[AArch64, ARM] Introduce "mrs" type attribute.
[official-gcc.git] / gcc / doc / invoke.texi
blob4995a5d664e67f165a47cec237437db5feccbf98
1 @c Copyright (C) 1988-2013 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-2013 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.  @samp{g++} accepts mostly the same options as @samp{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.
76 Other options are passed on to one stage of processing.  Some options
77 control the preprocessor and others the compiler itself.  Yet other
78 options control the assembler and linker; most of these are not
79 documented here, since you rarely need to use any of them.
81 @cindex C compilation options
82 Most of the command-line options that you can use with GCC are useful
83 for C programs; when an option is only useful with another language
84 (usually C++), the explanation says so explicitly.  If the description
85 for a particular option does not mention a source language, you can use
86 that option with all supported languages.
88 @cindex C++ compilation options
89 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90 options for compiling C++ programs.
92 @cindex grouping options
93 @cindex options, grouping
94 The @command{gcc} program accepts options and file names as operands.  Many
95 options have multi-letter names; therefore multiple single-letter options
96 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
97 -v}}.
99 @cindex order of options
100 @cindex options, order
101 You can mix options and other arguments.  For the most part, the order
102 you use doesn't matter.  Order does matter when you use several
103 options of the same kind; for example, if you specify @option{-L} more
104 than once, the directories are searched in the order specified.  Also,
105 the placement of the @option{-l} option is significant.
107 Many options have long names starting with @samp{-f} or with
108 @samp{-W}---for example,
109 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
110 these have both positive and negative forms; the negative form of
111 @option{-ffoo} is @option{-fno-foo}.  This manual documents
112 only one of these two forms, whichever one is not the default.
114 @c man end
116 @xref{Option Index}, for an index to GCC's options.
118 @menu
119 * Option Summary::      Brief list of all options, without explanations.
120 * Overall Options::     Controlling the kind of output:
121                         an executable, object files, assembler files,
122                         or preprocessed source.
123 * Invoking G++::        Compiling C++ programs.
124 * C Dialect Options::   Controlling the variant of C language compiled.
125 * C++ Dialect Options:: Variations on C++.
126 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
127                         and Objective-C++.
128 * Language Independent Options:: Controlling how diagnostics should be
129                         formatted.
130 * Warning Options::     How picky should the compiler be?
131 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
132 * Optimize Options::    How much optimization?
133 * Preprocessor Options:: Controlling header files and macro definitions.
134                          Also, getting dependency information for Make.
135 * Assembler Options::   Passing options to the assembler.
136 * Link Options::        Specifying libraries and so on.
137 * Directory Options::   Where to find header files and libraries.
138                         Where to find the compiler executable files.
139 * Spec Files::          How to pass switches to sub-processes.
140 * Target Options::      Running a cross-compiler, or an old version of GCC.
141 * Submodel Options::    Specifying minor hardware or convention variations,
142                         such as 68010 vs 68020.
143 * Code Gen Options::    Specifying conventions for function calls, data layout
144                         and register usage.
145 * Environment Variables:: Env vars that affect GCC.
146 * Precompiled Headers:: Compiling a header once, and using it many times.
147 @end menu
149 @c man begin OPTIONS
151 @node Option Summary
152 @section Option Summary
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
157 @table @emph
158 @item Overall Options
159 @xref{Overall Options,,Options Controlling the Kind of Output}.
160 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
161 -pipe  -pass-exit-codes  @gol
162 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
163 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
164 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{arg} -fdump-go-spec=@var{file}}
166 @item C Language Options
167 @xref{C Dialect Options,,Options Controlling C Dialect}.
168 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
169 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
170 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
171 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
172 -trigraphs  -traditional  -traditional-cpp @gol
173 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
174 -fsigned-bitfields  -fsigned-char @gol
175 -funsigned-bitfields  -funsigned-char}
177 @item C++ Language Options
178 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
179 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
180 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
181 -fno-elide-constructors @gol
182 -fno-enforce-eh-specs @gol
183 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
184 -fno-implicit-templates @gol
185 -fno-implicit-inline-templates @gol
186 -fno-implement-inlines  -fms-extensions @gol
187 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
188 -fno-optional-diags  -fpermissive @gol
189 -fno-pretty-templates @gol
190 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
191 -ftemplate-depth=@var{n} @gol
192 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
193 -fno-default-inline  -fvisibility-inlines-hidden @gol
194 -fvtable-verify=@var{std|preinit|none} @gol
195 -fvtv-counts -fvtv-debug @gol
196 -fvisibility-ms-compat @gol
197 -fext-numeric-literals @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
200 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
201 -Weffc++  -Wstrict-null-sentinel @gol
202 -Wno-non-template-friend  -Wold-style-cast @gol
203 -Woverloaded-virtual  -Wno-pmf-conversions @gol
204 -Wsign-promo}
206 @item Objective-C and Objective-C++ Language Options
207 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
208 Objective-C and Objective-C++ Dialects}.
209 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
210 -fgnu-runtime  -fnext-runtime @gol
211 -fno-nil-receivers @gol
212 -fobjc-abi-version=@var{n} @gol
213 -fobjc-call-cxx-cdtors @gol
214 -fobjc-direct-dispatch @gol
215 -fobjc-exceptions @gol
216 -fobjc-gc @gol
217 -fobjc-nilcheck @gol
218 -fobjc-std=objc1 @gol
219 -freplace-objc-classes @gol
220 -fzero-link @gol
221 -gen-decls @gol
222 -Wassign-intercept @gol
223 -Wno-protocol  -Wselector @gol
224 -Wstrict-selector-match @gol
225 -Wundeclared-selector}
227 @item Language Independent Options
228 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
229 @gccoptlist{-fmessage-length=@var{n}  @gol
230 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
231 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
232 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
234 @item Warning Options
235 @xref{Warning Options,,Options to Request or Suppress Warnings}.
236 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
237 -pedantic-errors @gol
238 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
239 -Waggressive-loop-optimizations -Warray-bounds @gol
240 -Wno-attributes -Wno-builtin-macro-redefined @gol
241 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
242 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
243 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
244 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
245 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
246 -Wno-endif-labels -Werror  -Werror=* @gol
247 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
248 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
249 -Wformat-security  -Wformat-y2k @gol
250 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
251 -Wignored-qualifiers @gol
252 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
253 -Winit-self  -Winline -Wmaybe-uninitialized @gol
254 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
255 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
256 -Wlogical-op -Wlong-long @gol
257 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
258 -Wmissing-include-dirs @gol
259 -Wno-mudflap @gol
260 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
261 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
262 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
263 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
264 -Wredundant-decls  -Wno-return-local-addr @gol
265 -Wreturn-type  -Wsequence-point  -Wshadow @gol
266 -Wsign-compare  -Wsign-conversion  -Wsizeof-pointer-memaccess @gol
267 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
268 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
269 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
270 -Wmissing-format-attribute @gol
271 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
272 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
273 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
274 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
275 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
276 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
277 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
278 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
279 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
281 @item C and Objective-C-only Warning Options
282 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
283 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
284 -Wold-style-declaration  -Wold-style-definition @gol
285 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
286 -Wdeclaration-after-statement -Wpointer-sign}
288 @item Debugging Options
289 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
290 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
291 -fsanitize=@var{style} @gol
292 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
293 -fdisable-ipa-@var{pass_name} @gol
294 -fdisable-rtl-@var{pass_name} @gol
295 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
296 -fdisable-tree-@var{pass_name} @gol
297 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
298 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
299 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
300 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
301 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
302 -fdump-passes @gol
303 -fdump-statistics @gol
304 -fdump-tree-all @gol
305 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
306 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-cfg -fdump-tree-alias @gol
308 -fdump-tree-ch @gol
309 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-nrv -fdump-tree-vect @gol
319 -fdump-tree-sink @gol
320 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
323 -fdump-tree-vtable-verify @gol
324 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
325 -ftree-vectorizer-verbose=@var{n} @gol
326 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
327 -fdump-final-insns=@var{file} @gol
328 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
329 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
330 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
331 -fenable-@var{kind}-@var{pass} @gol
332 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
333 -fdebug-types-section -fmem-report-wpa @gol
334 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
335 -fopt-info @gol
336 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
337 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
338 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
339 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
340 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
341 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
342 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
343 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
344 -gvms  -gxcoff  -gxcoff+ @gol
345 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
346 -fdebug-prefix-map=@var{old}=@var{new} @gol
347 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
348 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
349 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
350 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
351 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
352 -print-sysroot -print-sysroot-headers-suffix @gol
353 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
355 @item Optimization Options
356 @xref{Optimize Options,,Options that Control Optimization}.
357 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
358 -falign-jumps[=@var{n}] @gol
359 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
360 -fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
361 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
362 -fbtr-bb-exclusive -fcaller-saves @gol
363 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
364 -fcompare-elim -fcprop-registers -fcrossjumping @gol
365 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
366 -fcx-limited-range @gol
367 -fdata-sections -fdce -fdelayed-branch @gol
368 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively -fdse @gol
369 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
370 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
371 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
372 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
373 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
374 -fif-conversion2 -findirect-inlining @gol
375 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
376 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
377 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
378 -fira-algorithm=@var{algorithm} @gol
379 -fira-region=@var{region} -fira-hoist-pressure @gol
380 -fira-loop-pressure -fno-ira-share-save-slots @gol
381 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
382 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
383 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
384 -floop-parallelize-all -flto -flto-compression-level @gol
385 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
386 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
387 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
388 -fno-default-inline @gol
389 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
390 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
391 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
392 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
393 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
394 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
395 -fprefetch-loop-arrays -fprofile-report @gol
396 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
397 -fprofile-generate=@var{path} @gol
398 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
399 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
400 -freorder-blocks-and-partition -freorder-functions @gol
401 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
402 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
403 -fsched-spec-load -fsched-spec-load-dangerous @gol
404 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
405 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
406 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
407 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
408 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
409 -fselective-scheduling -fselective-scheduling2 @gol
410 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
411 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
412 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
413 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
414 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
415 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
416 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
417 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
418 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
419 -ftree-loop-if-convert-stores -ftree-loop-im @gol
420 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
421 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
422 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
423 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
424 -ftree-switch-conversion -ftree-tail-merge @gol
425 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
426 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
427 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
428 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
429 -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
430 --param @var{name}=@var{value}
431 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
433 @item Preprocessor Options
434 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
435 @gccoptlist{-A@var{question}=@var{answer} @gol
436 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
437 -C  -dD  -dI  -dM  -dN @gol
438 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
439 -idirafter @var{dir} @gol
440 -include @var{file}  -imacros @var{file} @gol
441 -iprefix @var{file}  -iwithprefix @var{dir} @gol
442 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
443 -imultilib @var{dir} -isysroot @var{dir} @gol
444 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
445 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
446 -remap -trigraphs  -undef  -U@var{macro}  @gol
447 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
449 @item Assembler Option
450 @xref{Assembler Options,,Passing Options to the Assembler}.
451 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
453 @item Linker Options
454 @xref{Link Options,,Options for Linking}.
455 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
456 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
457 -s  -static -static-libgcc -static-libstdc++ @gol
458 -static-libasan -static-libtsan -static-libubsan @gol
459 -shared -shared-libgcc  -symbolic @gol
460 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
461 -u @var{symbol}}
463 @item Directory Options
464 @xref{Directory Options,,Options for Directory Search}.
465 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
466 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
467 --sysroot=@var{dir} --no-sysroot-suffix}
469 @item Machine Dependent Options
470 @xref{Submodel Options,,Hardware Models and Configurations}.
471 @c This list is ordered alphanumerically by subsection name.
472 @c Try and put the significant identifier (CPU or system) first,
473 @c so users have a clue at guessing where the ones they want will be.
475 @emph{AArch64 Options}
476 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
477 -mgeneral-regs-only @gol
478 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
479 -mstrict-align @gol
480 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
481 -mtls-dialect=desc  -mtls-dialect=traditional @gol
482 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
484 @emph{Adapteva Epiphany Options}
485 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
486 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
487 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
488 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
489 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
490 -msplit-vecmove-early -m1reg-@var{reg}}
492 @emph{ARM Options}
493 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
494 -mabi=@var{name} @gol
495 -mapcs-stack-check  -mno-apcs-stack-check @gol
496 -mapcs-float  -mno-apcs-float @gol
497 -mapcs-reentrant  -mno-apcs-reentrant @gol
498 -msched-prolog  -mno-sched-prolog @gol
499 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
500 -mfloat-abi=@var{name} @gol
501 -mfp16-format=@var{name}
502 -mthumb-interwork  -mno-thumb-interwork @gol
503 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
504 -mstructure-size-boundary=@var{n} @gol
505 -mabort-on-noreturn @gol
506 -mlong-calls  -mno-long-calls @gol
507 -msingle-pic-base  -mno-single-pic-base @gol
508 -mpic-register=@var{reg} @gol
509 -mnop-fun-dllimport @gol
510 -mpoke-function-name @gol
511 -mthumb  -marm @gol
512 -mtpcs-frame  -mtpcs-leaf-frame @gol
513 -mcaller-super-interworking  -mcallee-super-interworking @gol
514 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
515 -mword-relocations @gol
516 -mfix-cortex-m3-ldrd @gol
517 -munaligned-access @gol
518 -mneon-for-64bits @gol
519 -mrestrict-it}
521 @emph{AVR Options}
522 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
523 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
524 -mstrict-X -mtiny-stack -Waddr-space-convert}
526 @emph{Blackfin Options}
527 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
528 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
529 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
530 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
531 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
532 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
533 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
534 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
535 -micplb}
537 @emph{C6X Options}
538 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
539 -msim -msdata=@var{sdata-type}}
541 @emph{CRIS Options}
542 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
543 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
544 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
545 -mstack-align  -mdata-align  -mconst-align @gol
546 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
547 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
548 -mmul-bug-workaround  -mno-mul-bug-workaround}
550 @emph{CR16 Options}
551 @gccoptlist{-mmac @gol
552 -mcr16cplus -mcr16c @gol
553 -msim -mint32 -mbit-ops
554 -mdata-model=@var{model}}
556 @emph{Darwin Options}
557 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
558 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
559 -client_name  -compatibility_version  -current_version @gol
560 -dead_strip @gol
561 -dependency-file  -dylib_file  -dylinker_install_name @gol
562 -dynamic  -dynamiclib  -exported_symbols_list @gol
563 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
564 -force_flat_namespace  -headerpad_max_install_names @gol
565 -iframework @gol
566 -image_base  -init  -install_name  -keep_private_externs @gol
567 -multi_module  -multiply_defined  -multiply_defined_unused @gol
568 -noall_load   -no_dead_strip_inits_and_terms @gol
569 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
570 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
571 -private_bundle  -read_only_relocs  -sectalign @gol
572 -sectobjectsymbols  -whyload  -seg1addr @gol
573 -sectcreate  -sectobjectsymbols  -sectorder @gol
574 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
575 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
576 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
577 -single_module  -static  -sub_library  -sub_umbrella @gol
578 -twolevel_namespace  -umbrella  -undefined @gol
579 -unexported_symbols_list  -weak_reference_mismatches @gol
580 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
581 -mkernel -mone-byte-bool}
583 @emph{DEC Alpha Options}
584 @gccoptlist{-mno-fp-regs  -msoft-float @gol
585 -mieee  -mieee-with-inexact  -mieee-conformant @gol
586 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
587 -mtrap-precision=@var{mode}  -mbuild-constants @gol
588 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
589 -mbwx  -mmax  -mfix  -mcix @gol
590 -mfloat-vax  -mfloat-ieee @gol
591 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
592 -msmall-text  -mlarge-text @gol
593 -mmemory-latency=@var{time}}
595 @emph{FR30 Options}
596 @gccoptlist{-msmall-model -mno-lsim}
598 @emph{FRV Options}
599 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
600 -mhard-float  -msoft-float @gol
601 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
602 -mdouble  -mno-double @gol
603 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
604 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
605 -mlinked-fp  -mlong-calls  -malign-labels @gol
606 -mlibrary-pic  -macc-4  -macc-8 @gol
607 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
608 -moptimize-membar -mno-optimize-membar @gol
609 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
610 -mvliw-branch  -mno-vliw-branch @gol
611 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
612 -mno-nested-cond-exec  -mtomcat-stats @gol
613 -mTLS -mtls @gol
614 -mcpu=@var{cpu}}
616 @emph{GNU/Linux Options}
617 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
618 -tno-android-cc -tno-android-ld}
620 @emph{H8/300 Options}
621 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
623 @emph{HPPA Options}
624 @gccoptlist{-march=@var{architecture-type} @gol
625 -mdisable-fpregs  -mdisable-indexing @gol
626 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
627 -mfixed-range=@var{register-range} @gol
628 -mjump-in-delay -mlinker-opt -mlong-calls @gol
629 -mlong-load-store  -mno-disable-fpregs @gol
630 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
631 -mno-jump-in-delay  -mno-long-load-store @gol
632 -mno-portable-runtime  -mno-soft-float @gol
633 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
634 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
635 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
636 -munix=@var{unix-std}  -nolibdld  -static  -threads}
638 @emph{i386 and x86-64 Options}
639 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
640 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
641 -mfpmath=@var{unit} @gol
642 -masm=@var{dialect}  -mno-fancy-math-387 @gol
643 -mno-fp-ret-in-387  -msoft-float @gol
644 -mno-wide-multiply  -mrtd  -malign-double @gol
645 -mpreferred-stack-boundary=@var{num} @gol
646 -mincoming-stack-boundary=@var{num} @gol
647 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
648 -mrecip -mrecip=@var{opt} @gol
649 -mvzeroupper -mprefer-avx128 @gol
650 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
651 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd @gol
652 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
653 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
654 -mbmi2 -mrtm -mlwp -mthreads @gol
655 -mno-align-stringops  -minline-all-stringops @gol
656 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
657 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} 
658 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
659 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
660 -mregparm=@var{num}  -msseregparm @gol
661 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
662 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
663 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
664 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
665 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
666 -msse2avx -mfentry -m8bit-idiv @gol
667 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
668 -mstack-protector-guard=@var{guard}}
670 @emph{i386 and x86-64 Windows Options}
671 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
672 -mnop-fun-dllimport -mthread @gol
673 -municode -mwin32 -mwindows -fno-set-stack-executable}
675 @emph{IA-64 Options}
676 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
677 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
678 -mconstant-gp  -mauto-pic  -mfused-madd @gol
679 -minline-float-divide-min-latency @gol
680 -minline-float-divide-max-throughput @gol
681 -mno-inline-float-divide @gol
682 -minline-int-divide-min-latency @gol
683 -minline-int-divide-max-throughput  @gol
684 -mno-inline-int-divide @gol
685 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
686 -mno-inline-sqrt @gol
687 -mdwarf2-asm -mearly-stop-bits @gol
688 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
689 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
690 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
691 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
692 -msched-spec-ldc -msched-spec-control-ldc @gol
693 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
694 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
695 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
696 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
698 @emph{LM32 Options}
699 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
700 -msign-extend-enabled -muser-enabled}
702 @emph{M32R/D Options}
703 @gccoptlist{-m32r2 -m32rx -m32r @gol
704 -mdebug @gol
705 -malign-loops -mno-align-loops @gol
706 -missue-rate=@var{number} @gol
707 -mbranch-cost=@var{number} @gol
708 -mmodel=@var{code-size-model-type} @gol
709 -msdata=@var{sdata-type} @gol
710 -mno-flush-func -mflush-func=@var{name} @gol
711 -mno-flush-trap -mflush-trap=@var{number} @gol
712 -G @var{num}}
714 @emph{M32C Options}
715 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
717 @emph{M680x0 Options}
718 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
719 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
720 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
721 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
722 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
723 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
724 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
725 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
726 -mxgot -mno-xgot}
728 @emph{MCore Options}
729 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
730 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
731 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
732 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
733 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
735 @emph{MeP Options}
736 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
737 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
738 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
739 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
740 -mtiny=@var{n}}
742 @emph{MicroBlaze Options}
743 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
744 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
745 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
746 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
747 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
749 @emph{MIPS Options}
750 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
751 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
752 -mips64  -mips64r2 @gol
753 -mips16  -mno-mips16  -mflip-mips16 @gol
754 -minterlink-compressed -mno-interlink-compressed @gol
755 -minterlink-mips16  -mno-interlink-mips16 @gol
756 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
757 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
758 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
759 -mno-float  -msingle-float  -mdouble-float @gol
760 -mabs=@var{mode}  -mnan=@var{encoding} @gol
761 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
762 -mmcu -mmno-mcu @gol
763 -meva -mno-eva @gol
764 -mmicromips -mno-micromips @gol
765 -mfpu=@var{fpu-type} @gol
766 -msmartmips  -mno-smartmips @gol
767 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
768 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
769 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
770 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
771 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
772 -membedded-data  -mno-embedded-data @gol
773 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
774 -mcode-readable=@var{setting} @gol
775 -msplit-addresses  -mno-split-addresses @gol
776 -mexplicit-relocs  -mno-explicit-relocs @gol
777 -mcheck-zero-division  -mno-check-zero-division @gol
778 -mdivide-traps  -mdivide-breaks @gol
779 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
780 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
781 -mfix-24k -mno-fix-24k @gol
782 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
783 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
784 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
785 -mflush-func=@var{func}  -mno-flush-func @gol
786 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
787 -mfp-exceptions -mno-fp-exceptions @gol
788 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
789 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
791 @emph{MMIX Options}
792 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
793 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
794 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
795 -mno-base-addresses  -msingle-exit  -mno-single-exit}
797 @emph{MN10300 Options}
798 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
799 -mno-am33 -mam33 -mam33-2 -mam34 @gol
800 -mtune=@var{cpu-type} @gol
801 -mreturn-pointer-on-d0 @gol
802 -mno-crt0  -mrelax -mliw -msetlb}
804 @emph{Moxie Options}
805 @gccoptlist{-meb -mel -mno-crt0}
807 @emph{PDP-11 Options}
808 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
809 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
810 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
811 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
812 -mbranch-expensive  -mbranch-cheap @gol
813 -munix-asm  -mdec-asm}
815 @emph{picoChip Options}
816 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
817 -msymbol-as-address -mno-inefficient-warnings}
819 @emph{PowerPC Options}
820 See RS/6000 and PowerPC Options.
822 @emph{RL78 Options}
823 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
825 @emph{RS/6000 and PowerPC Options}
826 @gccoptlist{-mcpu=@var{cpu-type} @gol
827 -mtune=@var{cpu-type} @gol
828 -mcmodel=@var{code-model} @gol
829 -mpowerpc64 @gol
830 -maltivec  -mno-altivec @gol
831 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
832 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
833 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
834 -mfprnd  -mno-fprnd @gol
835 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
836 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
837 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
838 -malign-power  -malign-natural @gol
839 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
840 -msingle-float -mdouble-float -msimple-fpu @gol
841 -mstring  -mno-string  -mupdate  -mno-update @gol
842 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
843 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
844 -mstrict-align  -mno-strict-align  -mrelocatable @gol
845 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
846 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
847 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
848 -mprioritize-restricted-insns=@var{priority} @gol
849 -msched-costly-dep=@var{dependence_type} @gol
850 -minsert-sched-nops=@var{scheme} @gol
851 -mcall-sysv  -mcall-netbsd @gol
852 -maix-struct-return  -msvr4-struct-return @gol
853 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
854 -mblock-move-inline-limit=@var{num} @gol
855 -misel -mno-isel @gol
856 -misel=yes  -misel=no @gol
857 -mspe -mno-spe @gol
858 -mspe=yes  -mspe=no @gol
859 -mpaired @gol
860 -mgen-cell-microcode -mwarn-cell-microcode @gol
861 -mvrsave -mno-vrsave @gol
862 -mmulhw -mno-mulhw @gol
863 -mdlmzb -mno-dlmzb @gol
864 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
865 -mprototype  -mno-prototype @gol
866 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
867 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
868 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
869 -mno-recip-precision @gol
870 -mveclibabi=@var{type} -mfriz -mno-friz @gol
871 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
872 -msave-toc-indirect -mno-save-toc-indirect @gol
873 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
874 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
875 -mquad-memory -mno-quad-memory @gol
876 -mcompat-align-parm -mno-compat-align-parm}
878 @emph{RX Options}
879 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
880 -mcpu=@gol
881 -mbig-endian-data -mlittle-endian-data @gol
882 -msmall-data @gol
883 -msim  -mno-sim@gol
884 -mas100-syntax -mno-as100-syntax@gol
885 -mrelax@gol
886 -mmax-constant-size=@gol
887 -mint-register=@gol
888 -mpid@gol
889 -mno-warn-multiple-fast-interrupts@gol
890 -msave-acc-in-interrupts}
892 @emph{S/390 and zSeries Options}
893 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
894 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
895 -mlong-double-64 -mlong-double-128 @gol
896 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
897 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
898 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
899 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
900 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
902 @emph{Score Options}
903 @gccoptlist{-meb -mel @gol
904 -mnhwloop @gol
905 -muls @gol
906 -mmac @gol
907 -mscore5 -mscore5u -mscore7 -mscore7d}
909 @emph{SH Options}
910 @gccoptlist{-m1  -m2  -m2e @gol
911 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
912 -m3  -m3e @gol
913 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
914 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
915 -m5-64media  -m5-64media-nofpu @gol
916 -m5-32media  -m5-32media-nofpu @gol
917 -m5-compact  -m5-compact-nofpu @gol
918 -mb  -ml  -mdalign  -mrelax @gol
919 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
920 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
921 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
922 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
923 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
924 -maccumulate-outgoing-args -minvalid-symbols @gol
925 -matomic-model=@var{atomic-model} @gol
926 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
927 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
928 -mpretend-cmove -mtas}
930 @emph{Solaris 2 Options}
931 @gccoptlist{-mimpure-text  -mno-impure-text @gol
932 -pthreads -pthread}
934 @emph{SPARC Options}
935 @gccoptlist{-mcpu=@var{cpu-type} @gol
936 -mtune=@var{cpu-type} @gol
937 -mcmodel=@var{code-model} @gol
938 -mmemory-model=@var{mem-model} @gol
939 -m32  -m64  -mapp-regs  -mno-app-regs @gol
940 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
941 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
942 -mhard-quad-float  -msoft-quad-float @gol
943 -mstack-bias  -mno-stack-bias @gol
944 -munaligned-doubles  -mno-unaligned-doubles @gol
945 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
946 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
947 -mcbcond -mno-cbcond @gol
948 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
949 -mfix-at697f -mfix-ut699}
951 @emph{SPU Options}
952 @gccoptlist{-mwarn-reloc -merror-reloc @gol
953 -msafe-dma -munsafe-dma @gol
954 -mbranch-hints @gol
955 -msmall-mem -mlarge-mem -mstdmain @gol
956 -mfixed-range=@var{register-range} @gol
957 -mea32 -mea64 @gol
958 -maddress-space-conversion -mno-address-space-conversion @gol
959 -mcache-size=@var{cache-size} @gol
960 -matomic-updates -mno-atomic-updates}
962 @emph{System V Options}
963 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
965 @emph{TILE-Gx Options}
966 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
968 @emph{TILEPro Options}
969 @gccoptlist{-mcpu=@var{cpu} -m32}
971 @emph{V850 Options}
972 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
973 -mprolog-function  -mno-prolog-function  -mspace @gol
974 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
975 -mapp-regs  -mno-app-regs @gol
976 -mdisable-callt  -mno-disable-callt @gol
977 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
978 -mv850e -mv850 -mv850e3v5 @gol
979 -mloop @gol
980 -mrelax @gol
981 -mlong-jumps @gol
982 -msoft-float @gol
983 -mhard-float @gol
984 -mgcc-abi @gol
985 -mrh850-abi @gol
986 -mbig-switch}
988 @emph{VAX Options}
989 @gccoptlist{-mg  -mgnu  -munix}
991 @emph{VMS Options}
992 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
993 -mpointer-size=@var{size}}
995 @emph{VxWorks Options}
996 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
997 -Xbind-lazy  -Xbind-now}
999 @emph{x86-64 Options}
1000 See i386 and x86-64 Options.
1002 @emph{Xstormy16 Options}
1003 @gccoptlist{-msim}
1005 @emph{Xtensa Options}
1006 @gccoptlist{-mconst16 -mno-const16 @gol
1007 -mfused-madd  -mno-fused-madd @gol
1008 -mforce-no-pic @gol
1009 -mserialize-volatile  -mno-serialize-volatile @gol
1010 -mtext-section-literals  -mno-text-section-literals @gol
1011 -mtarget-align  -mno-target-align @gol
1012 -mlongcalls  -mno-longcalls}
1014 @emph{zSeries Options}
1015 See S/390 and zSeries Options.
1017 @item Code Generation Options
1018 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1019 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1020 -ffixed-@var{reg}  -fexceptions @gol
1021 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1022 -fasynchronous-unwind-tables @gol
1023 -finhibit-size-directive  -finstrument-functions @gol
1024 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1025 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1026 -fno-common  -fno-ident @gol
1027 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1028 -fno-jump-tables @gol
1029 -frecord-gcc-switches @gol
1030 -freg-struct-return  -fshort-enums @gol
1031 -fshort-double  -fshort-wchar @gol
1032 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1033 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1034 -fno-stack-limit -fsplit-stack @gol
1035 -fleading-underscore  -ftls-model=@var{model} @gol
1036 -fstack-reuse=@var{reuse_level} @gol
1037 -ftrapv  -fwrapv  -fbounds-check @gol
1038 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1039 @end table
1041 @menu
1042 * Overall Options::     Controlling the kind of output:
1043                         an executable, object files, assembler files,
1044                         or preprocessed source.
1045 * C Dialect Options::   Controlling the variant of C language compiled.
1046 * C++ Dialect Options:: Variations on C++.
1047 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1048                         and Objective-C++.
1049 * Language Independent Options:: Controlling how diagnostics should be
1050                         formatted.
1051 * Warning Options::     How picky should the compiler be?
1052 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1053 * Optimize Options::    How much optimization?
1054 * Preprocessor Options:: Controlling header files and macro definitions.
1055                          Also, getting dependency information for Make.
1056 * Assembler Options::   Passing options to the assembler.
1057 * Link Options::        Specifying libraries and so on.
1058 * Directory Options::   Where to find header files and libraries.
1059                         Where to find the compiler executable files.
1060 * Spec Files::          How to pass switches to sub-processes.
1061 * Target Options::      Running a cross-compiler, or an old version of GCC.
1062 @end menu
1064 @node Overall Options
1065 @section Options Controlling the Kind of Output
1067 Compilation can involve up to four stages: preprocessing, compilation
1068 proper, assembly and linking, always in that order.  GCC is capable of
1069 preprocessing and compiling several files either into several
1070 assembler input files, or into one assembler input file; then each
1071 assembler input file produces an object file, and linking combines all
1072 the object files (those newly compiled, and those specified as input)
1073 into an executable file.
1075 @cindex file name suffix
1076 For any given input file, the file name suffix determines what kind of
1077 compilation is done:
1079 @table @gcctabopt
1080 @item @var{file}.c
1081 C source code that must be preprocessed.
1083 @item @var{file}.i
1084 C source code that should not be preprocessed.
1086 @item @var{file}.ii
1087 C++ source code that should not be preprocessed.
1089 @item @var{file}.m
1090 Objective-C source code.  Note that you must link with the @file{libobjc}
1091 library to make an Objective-C program work.
1093 @item @var{file}.mi
1094 Objective-C source code that should not be preprocessed.
1096 @item @var{file}.mm
1097 @itemx @var{file}.M
1098 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1099 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1100 to a literal capital M@.
1102 @item @var{file}.mii
1103 Objective-C++ source code that should not be preprocessed.
1105 @item @var{file}.h
1106 C, C++, Objective-C or Objective-C++ header file to be turned into a
1107 precompiled header (default), or C, C++ header file to be turned into an
1108 Ada spec (via the @option{-fdump-ada-spec} switch).
1110 @item @var{file}.cc
1111 @itemx @var{file}.cp
1112 @itemx @var{file}.cxx
1113 @itemx @var{file}.cpp
1114 @itemx @var{file}.CPP
1115 @itemx @var{file}.c++
1116 @itemx @var{file}.C
1117 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1118 the last two letters must both be literally @samp{x}.  Likewise,
1119 @samp{.C} refers to a literal capital C@.
1121 @item @var{file}.mm
1122 @itemx @var{file}.M
1123 Objective-C++ source code that must be preprocessed.
1125 @item @var{file}.mii
1126 Objective-C++ source code that should not be preprocessed.
1128 @item @var{file}.hh
1129 @itemx @var{file}.H
1130 @itemx @var{file}.hp
1131 @itemx @var{file}.hxx
1132 @itemx @var{file}.hpp
1133 @itemx @var{file}.HPP
1134 @itemx @var{file}.h++
1135 @itemx @var{file}.tcc
1136 C++ header file to be turned into a precompiled header or Ada spec.
1138 @item @var{file}.f
1139 @itemx @var{file}.for
1140 @itemx @var{file}.ftn
1141 Fixed form Fortran source code that should not be preprocessed.
1143 @item @var{file}.F
1144 @itemx @var{file}.FOR
1145 @itemx @var{file}.fpp
1146 @itemx @var{file}.FPP
1147 @itemx @var{file}.FTN
1148 Fixed form Fortran source code that must be preprocessed (with the traditional
1149 preprocessor).
1151 @item @var{file}.f90
1152 @itemx @var{file}.f95
1153 @itemx @var{file}.f03
1154 @itemx @var{file}.f08
1155 Free form Fortran source code that should not be preprocessed.
1157 @item @var{file}.F90
1158 @itemx @var{file}.F95
1159 @itemx @var{file}.F03
1160 @itemx @var{file}.F08
1161 Free form Fortran source code that must be preprocessed (with the
1162 traditional preprocessor).
1164 @item @var{file}.go
1165 Go source code.
1167 @c FIXME: Descriptions of Java file types.
1168 @c @var{file}.java
1169 @c @var{file}.class
1170 @c @var{file}.zip
1171 @c @var{file}.jar
1173 @item @var{file}.ads
1174 Ada source code file that contains a library unit declaration (a
1175 declaration of a package, subprogram, or generic, or a generic
1176 instantiation), or a library unit renaming declaration (a package,
1177 generic, or subprogram renaming declaration).  Such files are also
1178 called @dfn{specs}.
1180 @item @var{file}.adb
1181 Ada source code file containing a library unit body (a subprogram or
1182 package body).  Such files are also called @dfn{bodies}.
1184 @c GCC also knows about some suffixes for languages not yet included:
1185 @c Pascal:
1186 @c @var{file}.p
1187 @c @var{file}.pas
1188 @c Ratfor:
1189 @c @var{file}.r
1191 @item @var{file}.s
1192 Assembler code.
1194 @item @var{file}.S
1195 @itemx @var{file}.sx
1196 Assembler code that must be preprocessed.
1198 @item @var{other}
1199 An object file to be fed straight into linking.
1200 Any file name with no recognized suffix is treated this way.
1201 @end table
1203 @opindex x
1204 You can specify the input language explicitly with the @option{-x} option:
1206 @table @gcctabopt
1207 @item -x @var{language}
1208 Specify explicitly the @var{language} for the following input files
1209 (rather than letting the compiler choose a default based on the file
1210 name suffix).  This option applies to all following input files until
1211 the next @option{-x} option.  Possible values for @var{language} are:
1212 @smallexample
1213 c  c-header  cpp-output
1214 c++  c++-header  c++-cpp-output
1215 objective-c  objective-c-header  objective-c-cpp-output
1216 objective-c++ objective-c++-header objective-c++-cpp-output
1217 assembler  assembler-with-cpp
1219 f77  f77-cpp-input f95  f95-cpp-input
1221 java
1222 @end smallexample
1224 @item -x none
1225 Turn off any specification of a language, so that subsequent files are
1226 handled according to their file name suffixes (as they are if @option{-x}
1227 has not been used at all).
1229 @item -pass-exit-codes
1230 @opindex pass-exit-codes
1231 Normally the @command{gcc} program exits with the code of 1 if any
1232 phase of the compiler returns a non-success return code.  If you specify
1233 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1234 the numerically highest error produced by any phase returning an error
1235 indication.  The C, C++, and Fortran front ends return 4 if an internal
1236 compiler error is encountered.
1237 @end table
1239 If you only want some of the stages of compilation, you can use
1240 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1241 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1242 @command{gcc} is to stop.  Note that some combinations (for example,
1243 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1245 @table @gcctabopt
1246 @item -c
1247 @opindex c
1248 Compile or assemble the source files, but do not link.  The linking
1249 stage simply is not done.  The ultimate output is in the form of an
1250 object file for each source file.
1252 By default, the object file name for a source file is made by replacing
1253 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1255 Unrecognized input files, not requiring compilation or assembly, are
1256 ignored.
1258 @item -S
1259 @opindex S
1260 Stop after the stage of compilation proper; do not assemble.  The output
1261 is in the form of an assembler code file for each non-assembler input
1262 file specified.
1264 By default, the assembler file name for a source file is made by
1265 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1267 Input files that don't require compilation are ignored.
1269 @item -E
1270 @opindex E
1271 Stop after the preprocessing stage; do not run the compiler proper.  The
1272 output is in the form of preprocessed source code, which is sent to the
1273 standard output.
1275 Input files that don't require preprocessing are ignored.
1277 @cindex output file option
1278 @item -o @var{file}
1279 @opindex o
1280 Place output in file @var{file}.  This applies to whatever
1281 sort of output is being produced, whether it be an executable file,
1282 an object file, an assembler file or preprocessed C code.
1284 If @option{-o} is not specified, the default is to put an executable
1285 file in @file{a.out}, the object file for
1286 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1287 assembler file in @file{@var{source}.s}, a precompiled header file in
1288 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1289 standard output.
1291 @item -v
1292 @opindex v
1293 Print (on standard error output) the commands executed to run the stages
1294 of compilation.  Also print the version number of the compiler driver
1295 program and of the preprocessor and the compiler proper.
1297 @item -###
1298 @opindex ###
1299 Like @option{-v} except the commands are not executed and arguments
1300 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1301 This is useful for shell scripts to capture the driver-generated command lines.
1303 @item -pipe
1304 @opindex pipe
1305 Use pipes rather than temporary files for communication between the
1306 various stages of compilation.  This fails to work on some systems where
1307 the assembler is unable to read from a pipe; but the GNU assembler has
1308 no trouble.
1310 @item --help
1311 @opindex help
1312 Print (on the standard output) a description of the command-line options
1313 understood by @command{gcc}.  If the @option{-v} option is also specified
1314 then @option{--help} is also passed on to the various processes
1315 invoked by @command{gcc}, so that they can display the command-line options
1316 they accept.  If the @option{-Wextra} option has also been specified
1317 (prior to the @option{--help} option), then command-line options that
1318 have no documentation associated with them are also displayed.
1320 @item --target-help
1321 @opindex target-help
1322 Print (on the standard output) a description of target-specific command-line
1323 options for each tool.  For some targets extra target-specific
1324 information may also be printed.
1326 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1327 Print (on the standard output) a description of the command-line
1328 options understood by the compiler that fit into all specified classes
1329 and qualifiers.  These are the supported classes:
1331 @table @asis
1332 @item @samp{optimizers}
1333 Display all of the optimization options supported by the
1334 compiler.
1336 @item @samp{warnings}
1337 Display all of the options controlling warning messages
1338 produced by the compiler.
1340 @item @samp{target}
1341 Display target-specific options.  Unlike the
1342 @option{--target-help} option however, target-specific options of the
1343 linker and assembler are not displayed.  This is because those
1344 tools do not currently support the extended @option{--help=} syntax.
1346 @item @samp{params}
1347 Display the values recognized by the @option{--param}
1348 option.
1350 @item @var{language}
1351 Display the options supported for @var{language}, where
1352 @var{language} is the name of one of the languages supported in this
1353 version of GCC@.
1355 @item @samp{common}
1356 Display the options that are common to all languages.
1357 @end table
1359 These are the supported qualifiers:
1361 @table @asis
1362 @item @samp{undocumented}
1363 Display only those options that are undocumented.
1365 @item @samp{joined}
1366 Display options taking an argument that appears after an equal
1367 sign in the same continuous piece of text, such as:
1368 @samp{--help=target}.
1370 @item @samp{separate}
1371 Display options taking an argument that appears as a separate word
1372 following the original option, such as: @samp{-o output-file}.
1373 @end table
1375 Thus for example to display all the undocumented target-specific
1376 switches supported by the compiler, use:
1378 @smallexample
1379 --help=target,undocumented
1380 @end smallexample
1382 The sense of a qualifier can be inverted by prefixing it with the
1383 @samp{^} character, so for example to display all binary warning
1384 options (i.e., ones that are either on or off and that do not take an
1385 argument) that have a description, use:
1387 @smallexample
1388 --help=warnings,^joined,^undocumented
1389 @end smallexample
1391 The argument to @option{--help=} should not consist solely of inverted
1392 qualifiers.
1394 Combining several classes is possible, although this usually
1395 restricts the output so much that there is nothing to display.  One
1396 case where it does work, however, is when one of the classes is
1397 @var{target}.  For example, to display all the target-specific
1398 optimization options, use:
1400 @smallexample
1401 --help=target,optimizers
1402 @end smallexample
1404 The @option{--help=} option can be repeated on the command line.  Each
1405 successive use displays its requested class of options, skipping
1406 those that have already been displayed.
1408 If the @option{-Q} option appears on the command line before the
1409 @option{--help=} option, then the descriptive text displayed by
1410 @option{--help=} is changed.  Instead of describing the displayed
1411 options, an indication is given as to whether the option is enabled,
1412 disabled or set to a specific value (assuming that the compiler
1413 knows this at the point where the @option{--help=} option is used).
1415 Here is a truncated example from the ARM port of @command{gcc}:
1417 @smallexample
1418   % gcc -Q -mabi=2 --help=target -c
1419   The following options are target specific:
1420   -mabi=                                2
1421   -mabort-on-noreturn                   [disabled]
1422   -mapcs                                [disabled]
1423 @end smallexample
1425 The output is sensitive to the effects of previous command-line
1426 options, so for example it is possible to find out which optimizations
1427 are enabled at @option{-O2} by using:
1429 @smallexample
1430 -Q -O2 --help=optimizers
1431 @end smallexample
1433 Alternatively you can discover which binary optimizations are enabled
1434 by @option{-O3} by using:
1436 @smallexample
1437 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1438 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1439 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1440 @end smallexample
1442 @item -no-canonical-prefixes
1443 @opindex no-canonical-prefixes
1444 Do not expand any symbolic links, resolve references to @samp{/../}
1445 or @samp{/./}, or make the path absolute when generating a relative
1446 prefix.
1448 @item --version
1449 @opindex version
1450 Display the version number and copyrights of the invoked GCC@.
1452 @item -wrapper
1453 @opindex wrapper
1454 Invoke all subcommands under a wrapper program.  The name of the
1455 wrapper program and its parameters are passed as a comma separated
1456 list.
1458 @smallexample
1459 gcc -c t.c -wrapper gdb,--args
1460 @end smallexample
1462 @noindent
1463 This invokes all subprograms of @command{gcc} under
1464 @samp{gdb --args}, thus the invocation of @command{cc1} is
1465 @samp{gdb --args cc1 @dots{}}.
1467 @item -fplugin=@var{name}.so
1468 Load the plugin code in file @var{name}.so, assumed to be a
1469 shared object to be dlopen'd by the compiler.  The base name of
1470 the shared object file is used to identify the plugin for the
1471 purposes of argument parsing (See
1472 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1473 Each plugin should define the callback functions specified in the
1474 Plugins API.
1476 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1477 Define an argument called @var{key} with a value of @var{value}
1478 for the plugin called @var{name}.
1480 @item -fdump-ada-spec@r{[}-slim@r{]}
1481 For C and C++ source and include files, generate corresponding Ada
1482 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1483 GNAT User's Guide}, which provides detailed documentation on this feature.
1485 @item -fdump-go-spec=@var{file}
1486 For input files in any language, generate corresponding Go
1487 declarations in @var{file}.  This generates Go @code{const},
1488 @code{type}, @code{var}, and @code{func} declarations which may be a
1489 useful way to start writing a Go interface to code written in some
1490 other language.
1492 @include @value{srcdir}/../libiberty/at-file.texi
1493 @end table
1495 @node Invoking G++
1496 @section Compiling C++ Programs
1498 @cindex suffixes for C++ source
1499 @cindex C++ source file suffixes
1500 C++ source files conventionally use one of the suffixes @samp{.C},
1501 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1502 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1503 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1504 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1505 files with these names and compiles them as C++ programs even if you
1506 call the compiler the same way as for compiling C programs (usually
1507 with the name @command{gcc}).
1509 @findex g++
1510 @findex c++
1511 However, the use of @command{gcc} does not add the C++ library.
1512 @command{g++} is a program that calls GCC and automatically specifies linking
1513 against the C++ library.  It treats @samp{.c},
1514 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1515 files unless @option{-x} is used.  This program is also useful when
1516 precompiling a C header file with a @samp{.h} extension for use in C++
1517 compilations.  On many systems, @command{g++} is also installed with
1518 the name @command{c++}.
1520 @cindex invoking @command{g++}
1521 When you compile C++ programs, you may specify many of the same
1522 command-line options that you use for compiling programs in any
1523 language; or command-line options meaningful for C and related
1524 languages; or options that are meaningful only for C++ programs.
1525 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1526 explanations of options for languages related to C@.
1527 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1528 explanations of options that are meaningful only for C++ programs.
1530 @node C Dialect Options
1531 @section Options Controlling C Dialect
1532 @cindex dialect options
1533 @cindex language dialect options
1534 @cindex options, dialect
1536 The following options control the dialect of C (or languages derived
1537 from C, such as C++, Objective-C and Objective-C++) that the compiler
1538 accepts:
1540 @table @gcctabopt
1541 @cindex ANSI support
1542 @cindex ISO support
1543 @item -ansi
1544 @opindex ansi
1545 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1546 equivalent to @option{-std=c++98}.
1548 This turns off certain features of GCC that are incompatible with ISO
1549 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1550 such as the @code{asm} and @code{typeof} keywords, and
1551 predefined macros such as @code{unix} and @code{vax} that identify the
1552 type of system you are using.  It also enables the undesirable and
1553 rarely used ISO trigraph feature.  For the C compiler,
1554 it disables recognition of C++ style @samp{//} comments as well as
1555 the @code{inline} keyword.
1557 The alternate keywords @code{__asm__}, @code{__extension__},
1558 @code{__inline__} and @code{__typeof__} continue to work despite
1559 @option{-ansi}.  You would not want to use them in an ISO C program, of
1560 course, but it is useful to put them in header files that might be included
1561 in compilations done with @option{-ansi}.  Alternate predefined macros
1562 such as @code{__unix__} and @code{__vax__} are also available, with or
1563 without @option{-ansi}.
1565 The @option{-ansi} option does not cause non-ISO programs to be
1566 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1567 addition to @option{-ansi}.  @xref{Warning Options}.
1569 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1570 option is used.  Some header files may notice this macro and refrain
1571 from declaring certain functions or defining certain macros that the
1572 ISO standard doesn't call for; this is to avoid interfering with any
1573 programs that might use these names for other things.
1575 Functions that are normally built in but do not have semantics
1576 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1577 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1578 built-in functions provided by GCC}, for details of the functions
1579 affected.
1581 @item -std=
1582 @opindex std
1583 Determine the language standard. @xref{Standards,,Language Standards
1584 Supported by GCC}, for details of these standard versions.  This option
1585 is currently only supported when compiling C or C++.
1587 The compiler can accept several base standards, such as @samp{c90} or
1588 @samp{c++98}, and GNU dialects of those standards, such as
1589 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1590 compiler accepts all programs following that standard plus those
1591 using GNU extensions that do not contradict it.  For example,
1592 @option{-std=c90} turns off certain features of GCC that are
1593 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1594 keywords, but not other GNU extensions that do not have a meaning in
1595 ISO C90, such as omitting the middle term of a @code{?:}
1596 expression. On the other hand, when a GNU dialect of a standard is
1597 specified, all features supported by the compiler are enabled, even when
1598 those features change the meaning of the base standard.  As a result, some
1599 strict-conforming programs may be rejected.  The particular standard
1600 is used by @option{-Wpedantic} to identify which features are GNU
1601 extensions given that version of the standard. For example
1602 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1603 comments, while @option{-std=gnu99 -Wpedantic} does not.
1605 A value for this option must be provided; possible values are
1607 @table @samp
1608 @item c90
1609 @itemx c89
1610 @itemx iso9899:1990
1611 Support all ISO C90 programs (certain GNU extensions that conflict
1612 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1614 @item iso9899:199409
1615 ISO C90 as modified in amendment 1.
1617 @item c99
1618 @itemx c9x
1619 @itemx iso9899:1999
1620 @itemx iso9899:199x
1621 ISO C99.  Note that this standard is not yet fully supported; see
1622 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1623 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1625 @item c11
1626 @itemx c1x
1627 @itemx iso9899:2011
1628 ISO C11, the 2011 revision of the ISO C standard.
1629 Support is incomplete and experimental.  The name @samp{c1x} is
1630 deprecated.
1632 @item gnu90
1633 @itemx gnu89
1634 GNU dialect of ISO C90 (including some C99 features). This
1635 is the default for C code.
1637 @item gnu99
1638 @itemx gnu9x
1639 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1640 this will become the default.  The name @samp{gnu9x} is deprecated.
1642 @item gnu11
1643 @itemx gnu1x
1644 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1645 name @samp{gnu1x} is deprecated.
1647 @item c++98
1648 @itemx c++03
1649 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1650 additional defect reports. Same as @option{-ansi} for C++ code.
1652 @item gnu++98
1653 @itemx gnu++03
1654 GNU dialect of @option{-std=c++98}.  This is the default for
1655 C++ code.
1657 @item c++11
1658 @itemx c++0x
1659 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1660 experimental, and may change in incompatible ways in future releases.
1661 The name @samp{c++0x} is deprecated.
1663 @item gnu++11
1664 @itemx gnu++0x
1665 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1666 experimental, and may change in incompatible ways in future releases.
1667 The name @samp{gnu++0x} is deprecated.
1669 @item c++1y
1670 The next revision of the ISO C++ standard, tentatively planned for
1671 2014.  Support is highly experimental, and will almost certainly
1672 change in incompatible ways in future releases.
1674 @item gnu++1y
1675 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1676 and will almost certainly change in incompatible ways in future
1677 releases.
1678 @end table
1680 @item -fgnu89-inline
1681 @opindex fgnu89-inline
1682 The option @option{-fgnu89-inline} tells GCC to use the traditional
1683 GNU semantics for @code{inline} functions when in C99 mode.
1684 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1685 is accepted and ignored by GCC versions 4.1.3 up to but not including
1686 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1687 C99 mode.  Using this option is roughly equivalent to adding the
1688 @code{gnu_inline} function attribute to all inline functions
1689 (@pxref{Function Attributes}).
1691 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1692 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1693 specifies the default behavior).  This option was first supported in
1694 GCC 4.3.  This option is not supported in @option{-std=c90} or
1695 @option{-std=gnu90} mode.
1697 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1698 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1699 in effect for @code{inline} functions.  @xref{Common Predefined
1700 Macros,,,cpp,The C Preprocessor}.
1702 @item -aux-info @var{filename}
1703 @opindex aux-info
1704 Output to the given filename prototyped declarations for all functions
1705 declared and/or defined in a translation unit, including those in header
1706 files.  This option is silently ignored in any language other than C@.
1708 Besides declarations, the file indicates, in comments, the origin of
1709 each declaration (source file and line), whether the declaration was
1710 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1711 @samp{O} for old, respectively, in the first character after the line
1712 number and the colon), and whether it came from a declaration or a
1713 definition (@samp{C} or @samp{F}, respectively, in the following
1714 character).  In the case of function definitions, a K&R-style list of
1715 arguments followed by their declarations is also provided, inside
1716 comments, after the declaration.
1718 @item -fallow-parameterless-variadic-functions
1719 Accept variadic functions without named parameters.
1721 Although it is possible to define such a function, this is not very
1722 useful as it is not possible to read the arguments.  This is only
1723 supported for C as this construct is allowed by C++.
1725 @item -fno-asm
1726 @opindex fno-asm
1727 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1728 keyword, so that code can use these words as identifiers.  You can use
1729 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1730 instead.  @option{-ansi} implies @option{-fno-asm}.
1732 In C++, this switch only affects the @code{typeof} keyword, since
1733 @code{asm} and @code{inline} are standard keywords.  You may want to
1734 use the @option{-fno-gnu-keywords} flag instead, which has the same
1735 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1736 switch only affects the @code{asm} and @code{typeof} keywords, since
1737 @code{inline} is a standard keyword in ISO C99.
1739 @item -fno-builtin
1740 @itemx -fno-builtin-@var{function}
1741 @opindex fno-builtin
1742 @cindex built-in functions
1743 Don't recognize built-in functions that do not begin with
1744 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1745 functions provided by GCC}, for details of the functions affected,
1746 including those which are not built-in functions when @option{-ansi} or
1747 @option{-std} options for strict ISO C conformance are used because they
1748 do not have an ISO standard meaning.
1750 GCC normally generates special code to handle certain built-in functions
1751 more efficiently; for instance, calls to @code{alloca} may become single
1752 instructions which adjust the stack directly, and calls to @code{memcpy}
1753 may become inline copy loops.  The resulting code is often both smaller
1754 and faster, but since the function calls no longer appear as such, you
1755 cannot set a breakpoint on those calls, nor can you change the behavior
1756 of the functions by linking with a different library.  In addition,
1757 when a function is recognized as a built-in function, GCC may use
1758 information about that function to warn about problems with calls to
1759 that function, or to generate more efficient code, even if the
1760 resulting code still contains calls to that function.  For example,
1761 warnings are given with @option{-Wformat} for bad calls to
1762 @code{printf} when @code{printf} is built in and @code{strlen} is
1763 known not to modify global memory.
1765 With the @option{-fno-builtin-@var{function}} option
1766 only the built-in function @var{function} is
1767 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1768 function is named that is not built-in in this version of GCC, this
1769 option is ignored.  There is no corresponding
1770 @option{-fbuiltin-@var{function}} option; if you wish to enable
1771 built-in functions selectively when using @option{-fno-builtin} or
1772 @option{-ffreestanding}, you may define macros such as:
1774 @smallexample
1775 #define abs(n)          __builtin_abs ((n))
1776 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1777 @end smallexample
1779 @item -fhosted
1780 @opindex fhosted
1781 @cindex hosted environment
1783 Assert that compilation targets a hosted environment.  This implies
1784 @option{-fbuiltin}.  A hosted environment is one in which the
1785 entire standard library is available, and in which @code{main} has a return
1786 type of @code{int}.  Examples are nearly everything except a kernel.
1787 This is equivalent to @option{-fno-freestanding}.
1789 @item -ffreestanding
1790 @opindex ffreestanding
1791 @cindex hosted environment
1793 Assert that compilation targets a freestanding environment.  This
1794 implies @option{-fno-builtin}.  A freestanding environment
1795 is one in which the standard library may not exist, and program startup may
1796 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1797 This is equivalent to @option{-fno-hosted}.
1799 @xref{Standards,,Language Standards Supported by GCC}, for details of
1800 freestanding and hosted environments.
1802 @item -fopenmp
1803 @opindex fopenmp
1804 @cindex OpenMP parallel
1805 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1806 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1807 compiler generates parallel code according to the OpenMP Application
1808 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1809 implies @option{-pthread}, and thus is only supported on targets that
1810 have support for @option{-pthread}.
1812 @item -fcilkplus
1813 @opindex fcilkplus
1814 @cindex Enable Cilk Plus
1815 Enable the usage of Cilk Plus language extension features for C/C++.
1816 When the option @option{-fcilkplus} is specified, enable the usage of
1817 the Cilk Plus Language extension features for C/C++.  The present
1818 implementation follows ABI version 0.9.  This is an experimental
1819 feature that is only partially complete, and whose interface may
1820 change in future versions of GCC as the official specification
1821 changes.  Currently only the array notation feature of the language
1822 specification has been implemented.  More features will be implemented
1823 in subsequent release cycles.
1825 @item -fgnu-tm
1826 @opindex fgnu-tm
1827 When the option @option{-fgnu-tm} is specified, the compiler
1828 generates code for the Linux variant of Intel's current Transactional
1829 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1830 an experimental feature whose interface may change in future versions
1831 of GCC, as the official specification changes.  Please note that not
1832 all architectures are supported for this feature.
1834 For more information on GCC's support for transactional memory,
1835 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1836 Transactional Memory Library}.
1838 Note that the transactional memory feature is not supported with
1839 non-call exceptions (@option{-fnon-call-exceptions}).
1841 @item -fms-extensions
1842 @opindex fms-extensions
1843 Accept some non-standard constructs used in Microsoft header files.
1845 In C++ code, this allows member names in structures to be similar
1846 to previous types declarations.
1848 @smallexample
1849 typedef int UOW;
1850 struct ABC @{
1851   UOW UOW;
1853 @end smallexample
1855 Some cases of unnamed fields in structures and unions are only
1856 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1857 fields within structs/unions}, for details.
1859 @item -fplan9-extensions
1860 Accept some non-standard constructs used in Plan 9 code.
1862 This enables @option{-fms-extensions}, permits passing pointers to
1863 structures with anonymous fields to functions that expect pointers to
1864 elements of the type of the field, and permits referring to anonymous
1865 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1866 struct/union fields within structs/unions}, for details.  This is only
1867 supported for C, not C++.
1869 @item -trigraphs
1870 @opindex trigraphs
1871 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1872 options for strict ISO C conformance) implies @option{-trigraphs}.
1874 @cindex traditional C language
1875 @cindex C language, traditional
1876 @item -traditional
1877 @itemx -traditional-cpp
1878 @opindex traditional-cpp
1879 @opindex traditional
1880 Formerly, these options caused GCC to attempt to emulate a pre-standard
1881 C compiler.  They are now only supported with the @option{-E} switch.
1882 The preprocessor continues to support a pre-standard mode.  See the GNU
1883 CPP manual for details.
1885 @item -fcond-mismatch
1886 @opindex fcond-mismatch
1887 Allow conditional expressions with mismatched types in the second and
1888 third arguments.  The value of such an expression is void.  This option
1889 is not supported for C++.
1891 @item -flax-vector-conversions
1892 @opindex flax-vector-conversions
1893 Allow implicit conversions between vectors with differing numbers of
1894 elements and/or incompatible element types.  This option should not be
1895 used for new code.
1897 @item -funsigned-char
1898 @opindex funsigned-char
1899 Let the type @code{char} be unsigned, like @code{unsigned char}.
1901 Each kind of machine has a default for what @code{char} should
1902 be.  It is either like @code{unsigned char} by default or like
1903 @code{signed char} by default.
1905 Ideally, a portable program should always use @code{signed char} or
1906 @code{unsigned char} when it depends on the signedness of an object.
1907 But many programs have been written to use plain @code{char} and
1908 expect it to be signed, or expect it to be unsigned, depending on the
1909 machines they were written for.  This option, and its inverse, let you
1910 make such a program work with the opposite default.
1912 The type @code{char} is always a distinct type from each of
1913 @code{signed char} or @code{unsigned char}, even though its behavior
1914 is always just like one of those two.
1916 @item -fsigned-char
1917 @opindex fsigned-char
1918 Let the type @code{char} be signed, like @code{signed char}.
1920 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1921 the negative form of @option{-funsigned-char}.  Likewise, the option
1922 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1924 @item -fsigned-bitfields
1925 @itemx -funsigned-bitfields
1926 @itemx -fno-signed-bitfields
1927 @itemx -fno-unsigned-bitfields
1928 @opindex fsigned-bitfields
1929 @opindex funsigned-bitfields
1930 @opindex fno-signed-bitfields
1931 @opindex fno-unsigned-bitfields
1932 These options control whether a bit-field is signed or unsigned, when the
1933 declaration does not use either @code{signed} or @code{unsigned}.  By
1934 default, such a bit-field is signed, because this is consistent: the
1935 basic integer types such as @code{int} are signed types.
1936 @end table
1938 @node C++ Dialect Options
1939 @section Options Controlling C++ Dialect
1941 @cindex compiler options, C++
1942 @cindex C++ options, command-line
1943 @cindex options, C++
1944 This section describes the command-line options that are only meaningful
1945 for C++ programs.  You can also use most of the GNU compiler options
1946 regardless of what language your program is in.  For example, you
1947 might compile a file @code{firstClass.C} like this:
1949 @smallexample
1950 g++ -g -frepo -O -c firstClass.C
1951 @end smallexample
1953 @noindent
1954 In this example, only @option{-frepo} is an option meant
1955 only for C++ programs; you can use the other options with any
1956 language supported by GCC@.
1958 Here is a list of options that are @emph{only} for compiling C++ programs:
1960 @table @gcctabopt
1962 @item -fabi-version=@var{n}
1963 @opindex fabi-version
1964 Use version @var{n} of the C++ ABI@.  The default is version 2.
1966 Version 0 refers to the version conforming most closely to
1967 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1968 will change in different versions of G++ as ABI bugs are fixed.
1970 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1972 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1974 Version 3 corrects an error in mangling a constant address as a
1975 template argument.
1977 Version 4, which first appeared in G++ 4.5, implements a standard
1978 mangling for vector types.
1980 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1981 attribute const/volatile on function pointer types, decltype of a
1982 plain decl, and use of a function parameter in the declaration of
1983 another parameter.
1985 Version 6, which first appeared in G++ 4.7, corrects the promotion
1986 behavior of C++11 scoped enums and the mangling of template argument
1987 packs, const/static_cast, prefix ++ and --, and a class scope function
1988 used as a template argument.
1990 See also @option{-Wabi}.
1992 @item -fno-access-control
1993 @opindex fno-access-control
1994 Turn off all access checking.  This switch is mainly useful for working
1995 around bugs in the access control code.
1997 @item -fcheck-new
1998 @opindex fcheck-new
1999 Check that the pointer returned by @code{operator new} is non-null
2000 before attempting to modify the storage allocated.  This check is
2001 normally unnecessary because the C++ standard specifies that
2002 @code{operator new} only returns @code{0} if it is declared
2003 @samp{throw()}, in which case the compiler always checks the
2004 return value even without this option.  In all other cases, when
2005 @code{operator new} has a non-empty exception specification, memory
2006 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2007 @samp{new (nothrow)}.
2009 @item -fconstexpr-depth=@var{n}
2010 @opindex fconstexpr-depth
2011 Set the maximum nested evaluation depth for C++11 constexpr functions
2012 to @var{n}.  A limit is needed to detect endless recursion during
2013 constant expression evaluation.  The minimum specified by the standard
2014 is 512.
2016 @item -fdeduce-init-list
2017 @opindex fdeduce-init-list
2018 Enable deduction of a template type parameter as
2019 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2021 @smallexample
2022 template <class T> auto forward(T t) -> decltype (realfn (t))
2024   return realfn (t);
2027 void f()
2029   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2031 @end smallexample
2033 This deduction was implemented as a possible extension to the
2034 originally proposed semantics for the C++11 standard, but was not part
2035 of the final standard, so it is disabled by default.  This option is
2036 deprecated, and may be removed in a future version of G++.
2038 @item -ffriend-injection
2039 @opindex ffriend-injection
2040 Inject friend functions into the enclosing namespace, so that they are
2041 visible outside the scope of the class in which they are declared.
2042 Friend functions were documented to work this way in the old Annotated
2043 C++ Reference Manual, and versions of G++ before 4.1 always worked
2044 that way.  However, in ISO C++ a friend function that is not declared
2045 in an enclosing scope can only be found using argument dependent
2046 lookup.  This option causes friends to be injected as they were in
2047 earlier releases.
2049 This option is for compatibility, and may be removed in a future
2050 release of G++.
2052 @item -fno-elide-constructors
2053 @opindex fno-elide-constructors
2054 The C++ standard allows an implementation to omit creating a temporary
2055 that is only used to initialize another object of the same type.
2056 Specifying this option disables that optimization, and forces G++ to
2057 call the copy constructor in all cases.
2059 @item -fno-enforce-eh-specs
2060 @opindex fno-enforce-eh-specs
2061 Don't generate code to check for violation of exception specifications
2062 at run time.  This option violates the C++ standard, but may be useful
2063 for reducing code size in production builds, much like defining
2064 @samp{NDEBUG}.  This does not give user code permission to throw
2065 exceptions in violation of the exception specifications; the compiler
2066 still optimizes based on the specifications, so throwing an
2067 unexpected exception results in undefined behavior at run time.
2069 @item -fextern-tls-init
2070 @itemx -fno-extern-tls-init
2071 @opindex fextern-tls-init
2072 @opindex fno-extern-tls-init
2073 The C++11 and OpenMP standards allow @samp{thread_local} and
2074 @samp{threadprivate} variables to have dynamic (runtime)
2075 initialization.  To support this, any use of such a variable goes
2076 through a wrapper function that performs any necessary initialization.
2077 When the use and definition of the variable are in the same
2078 translation unit, this overhead can be optimized away, but when the
2079 use is in a different translation unit there is significant overhead
2080 even if the variable doesn't actually need dynamic initialization.  If
2081 the programmer can be sure that no use of the variable in a
2082 non-defining TU needs to trigger dynamic initialization (either
2083 because the variable is statically initialized, or a use of the
2084 variable in the defining TU will be executed before any uses in
2085 another TU), they can avoid this overhead with the
2086 @option{-fno-extern-tls-init} option.
2088 On targets that support symbol aliases, the default is
2089 @option{-fextern-tls-init}.  On targets that do not support symbol
2090 aliases, the default is @option{-fno-extern-tls-init}.
2092 @item -ffor-scope
2093 @itemx -fno-for-scope
2094 @opindex ffor-scope
2095 @opindex fno-for-scope
2096 If @option{-ffor-scope} is specified, the scope of variables declared in
2097 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2098 as specified by the C++ standard.
2099 If @option{-fno-for-scope} is specified, the scope of variables declared in
2100 a @i{for-init-statement} extends to the end of the enclosing scope,
2101 as was the case in old versions of G++, and other (traditional)
2102 implementations of C++.
2104 If neither flag is given, the default is to follow the standard,
2105 but to allow and give a warning for old-style code that would
2106 otherwise be invalid, or have different behavior.
2108 @item -fno-gnu-keywords
2109 @opindex fno-gnu-keywords
2110 Do not recognize @code{typeof} as a keyword, so that code can use this
2111 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2112 @option{-ansi} implies @option{-fno-gnu-keywords}.
2114 @item -fno-implicit-templates
2115 @opindex fno-implicit-templates
2116 Never emit code for non-inline templates that are instantiated
2117 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2118 @xref{Template Instantiation}, for more information.
2120 @item -fno-implicit-inline-templates
2121 @opindex fno-implicit-inline-templates
2122 Don't emit code for implicit instantiations of inline templates, either.
2123 The default is to handle inlines differently so that compiles with and
2124 without optimization need the same set of explicit instantiations.
2126 @item -fno-implement-inlines
2127 @opindex fno-implement-inlines
2128 To save space, do not emit out-of-line copies of inline functions
2129 controlled by @samp{#pragma implementation}.  This causes linker
2130 errors if these functions are not inlined everywhere they are called.
2132 @item -fms-extensions
2133 @opindex fms-extensions
2134 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2135 int and getting a pointer to member function via non-standard syntax.
2137 @item -fno-nonansi-builtins
2138 @opindex fno-nonansi-builtins
2139 Disable built-in declarations of functions that are not mandated by
2140 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2141 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2143 @item -fnothrow-opt
2144 @opindex fnothrow-opt
2145 Treat a @code{throw()} exception specification as if it were a
2146 @code{noexcept} specification to reduce or eliminate the text size
2147 overhead relative to a function with no exception specification.  If
2148 the function has local variables of types with non-trivial
2149 destructors, the exception specification actually makes the
2150 function smaller because the EH cleanups for those variables can be
2151 optimized away.  The semantic effect is that an exception thrown out of
2152 a function with such an exception specification results in a call
2153 to @code{terminate} rather than @code{unexpected}.
2155 @item -fno-operator-names
2156 @opindex fno-operator-names
2157 Do not treat the operator name keywords @code{and}, @code{bitand},
2158 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2159 synonyms as keywords.
2161 @item -fno-optional-diags
2162 @opindex fno-optional-diags
2163 Disable diagnostics that the standard says a compiler does not need to
2164 issue.  Currently, the only such diagnostic issued by G++ is the one for
2165 a name having multiple meanings within a class.
2167 @item -fpermissive
2168 @opindex fpermissive
2169 Downgrade some diagnostics about nonconformant code from errors to
2170 warnings.  Thus, using @option{-fpermissive} allows some
2171 nonconforming code to compile.
2173 @item -fno-pretty-templates
2174 @opindex fno-pretty-templates
2175 When an error message refers to a specialization of a function
2176 template, the compiler normally prints the signature of the
2177 template followed by the template arguments and any typedefs or
2178 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2179 rather than @code{void f(int)}) so that it's clear which template is
2180 involved.  When an error message refers to a specialization of a class
2181 template, the compiler omits any template arguments that match
2182 the default template arguments for that template.  If either of these
2183 behaviors make it harder to understand the error message rather than
2184 easier, you can use @option{-fno-pretty-templates} to disable them.
2186 @item -frepo
2187 @opindex frepo
2188 Enable automatic template instantiation at link time.  This option also
2189 implies @option{-fno-implicit-templates}.  @xref{Template
2190 Instantiation}, for more information.
2192 @item -fno-rtti
2193 @opindex fno-rtti
2194 Disable generation of information about every class with virtual
2195 functions for use by the C++ run-time type identification features
2196 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2197 of the language, you can save some space by using this flag.  Note that
2198 exception handling uses the same information, but G++ generates it as
2199 needed. The @samp{dynamic_cast} operator can still be used for casts that
2200 do not require run-time type information, i.e.@: casts to @code{void *} or to
2201 unambiguous base classes.
2203 @item -fstats
2204 @opindex fstats
2205 Emit statistics about front-end processing at the end of the compilation.
2206 This information is generally only useful to the G++ development team.
2208 @item -fstrict-enums
2209 @opindex fstrict-enums
2210 Allow the compiler to optimize using the assumption that a value of
2211 enumerated type can only be one of the values of the enumeration (as
2212 defined in the C++ standard; basically, a value that can be
2213 represented in the minimum number of bits needed to represent all the
2214 enumerators).  This assumption may not be valid if the program uses a
2215 cast to convert an arbitrary integer value to the enumerated type.
2217 @item -ftemplate-backtrace-limit=@var{n}
2218 @opindex ftemplate-backtrace-limit
2219 Set the maximum number of template instantiation notes for a single
2220 warning or error to @var{n}.  The default value is 10.
2222 @item -ftemplate-depth=@var{n}
2223 @opindex ftemplate-depth
2224 Set the maximum instantiation depth for template classes to @var{n}.
2225 A limit on the template instantiation depth is needed to detect
2226 endless recursions during template class instantiation.  ANSI/ISO C++
2227 conforming programs must not rely on a maximum depth greater than 17
2228 (changed to 1024 in C++11).  The default value is 900, as the compiler
2229 can run out of stack space before hitting 1024 in some situations.
2231 @item -fno-threadsafe-statics
2232 @opindex fno-threadsafe-statics
2233 Do not emit the extra code to use the routines specified in the C++
2234 ABI for thread-safe initialization of local statics.  You can use this
2235 option to reduce code size slightly in code that doesn't need to be
2236 thread-safe.
2238 @item -fuse-cxa-atexit
2239 @opindex fuse-cxa-atexit
2240 Register destructors for objects with static storage duration with the
2241 @code{__cxa_atexit} function rather than the @code{atexit} function.
2242 This option is required for fully standards-compliant handling of static
2243 destructors, but only works if your C library supports
2244 @code{__cxa_atexit}.
2246 @item -fno-use-cxa-get-exception-ptr
2247 @opindex fno-use-cxa-get-exception-ptr
2248 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2249 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2250 if the runtime routine is not available.
2252 @item -fvisibility-inlines-hidden
2253 @opindex fvisibility-inlines-hidden
2254 This switch declares that the user does not attempt to compare
2255 pointers to inline functions or methods where the addresses of the two functions
2256 are taken in different shared objects.
2258 The effect of this is that GCC may, effectively, mark inline methods with
2259 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2260 appear in the export table of a DSO and do not require a PLT indirection
2261 when used within the DSO@.  Enabling this option can have a dramatic effect
2262 on load and link times of a DSO as it massively reduces the size of the
2263 dynamic export table when the library makes heavy use of templates.
2265 The behavior of this switch is not quite the same as marking the
2266 methods as hidden directly, because it does not affect static variables
2267 local to the function or cause the compiler to deduce that
2268 the function is defined in only one shared object.
2270 You may mark a method as having a visibility explicitly to negate the
2271 effect of the switch for that method.  For example, if you do want to
2272 compare pointers to a particular inline method, you might mark it as
2273 having default visibility.  Marking the enclosing class with explicit
2274 visibility has no effect.
2276 Explicitly instantiated inline methods are unaffected by this option
2277 as their linkage might otherwise cross a shared library boundary.
2278 @xref{Template Instantiation}.
2280 @item -fvisibility-ms-compat
2281 @opindex fvisibility-ms-compat
2282 This flag attempts to use visibility settings to make GCC's C++
2283 linkage model compatible with that of Microsoft Visual Studio.
2285 The flag makes these changes to GCC's linkage model:
2287 @enumerate
2288 @item
2289 It sets the default visibility to @code{hidden}, like
2290 @option{-fvisibility=hidden}.
2292 @item
2293 Types, but not their members, are not hidden by default.
2295 @item
2296 The One Definition Rule is relaxed for types without explicit
2297 visibility specifications that are defined in more than one
2298 shared object: those declarations are permitted if they are
2299 permitted when this option is not used.
2300 @end enumerate
2302 In new code it is better to use @option{-fvisibility=hidden} and
2303 export those classes that are intended to be externally visible.
2304 Unfortunately it is possible for code to rely, perhaps accidentally,
2305 on the Visual Studio behavior.
2307 Among the consequences of these changes are that static data members
2308 of the same type with the same name but defined in different shared
2309 objects are different, so changing one does not change the other;
2310 and that pointers to function members defined in different shared
2311 objects may not compare equal.  When this flag is given, it is a
2312 violation of the ODR to define types with the same name differently.
2314 @item -fvtable-verify=@var{std|preinit|none}
2315 @opindex fvtable-verify
2316 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2317 feature that verifies at runtime, for every virtual call that is made, that
2318 the vtable pointer through which the call is made is valid for the type of
2319 the object, and has not been corrupted or overwritten.  If an invalid vtable
2320 pointer is detected (at runtime), an error is reported and execution of the
2321 program is immediately halted.
2323 This option causes runtime data structures to be built, at program start up,
2324 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2325 control the timing of when these data structures are built.  In both cases the
2326 data structures are built before execution reaches 'main'.  The
2327 @option{-fvtable-verify=std} causes these data structure to be built after the
2328 shared libraries have been loaded and initialized.
2329 @option{-fvtable-verify=preinit} causes them to be built before the shared
2330 libraries have been loaded and initialized.
2332 If this option appears multiple times in the compiler line, with different
2333 values specified, 'none' will take highest priority over both 'std' and
2334 'preinit'; 'preinit' will take priority over 'std'.
2336 @item -fvtv-debug
2337 @opindex (fvtv-debug)
2338 Causes debug versions of the runtime functions for the vtable verification 
2339 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2340 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2341 compiler to keep track of which vtable pointers it found for each class, and
2342 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2343 file directory on the user's machine.
2345 Note:  This feature APPENDS data to the log file. If you want a fresh log
2346 file, be sure to delete any existing one.
2348 @item -fvtv-counts
2349 @opindex (fvtv-counts)
2350 This is a debugging flag.  When used in conjunction with
2351 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2352 causes the compiler to keep track of the total number of virtual calls
2353 it encountered and the number of verifications it inserted.  It also
2354 counts the number of calls to certain runtime library functions
2355 that it inserts.  This information, for each compilation unit, is written
2356 to a file named ``vtv_count_data.log'', in the dump_file directory on
2357 the user's machine.   It also counts the size of the vtable pointer sets
2358 for each class, and writes this information to ``vtv_class_set_sizes.log''
2359 in the same directory.
2361 Note:  This feature APPENDS data to the log files.  To get a fresh log
2362 files, be sure to delete any existing ones.
2364 @item -fno-weak
2365 @opindex fno-weak
2366 Do not use weak symbol support, even if it is provided by the linker.
2367 By default, G++ uses weak symbols if they are available.  This
2368 option exists only for testing, and should not be used by end-users;
2369 it results in inferior code and has no benefits.  This option may
2370 be removed in a future release of G++.
2372 @item -nostdinc++
2373 @opindex nostdinc++
2374 Do not search for header files in the standard directories specific to
2375 C++, but do still search the other standard directories.  (This option
2376 is used when building the C++ library.)
2377 @end table
2379 In addition, these optimization, warning, and code generation options
2380 have meanings only for C++ programs:
2382 @table @gcctabopt
2383 @item -fno-default-inline
2384 @opindex fno-default-inline
2385 Do not assume @samp{inline} for functions defined inside a class scope.
2386 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2387 functions have linkage like inline functions; they just aren't
2388 inlined by default.
2390 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2391 @opindex Wabi
2392 @opindex Wno-abi
2393 Warn when G++ generates code that is probably not compatible with the
2394 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2395 all such cases, there are probably some cases that are not warned about,
2396 even though G++ is generating incompatible code.  There may also be
2397 cases where warnings are emitted even though the code that is generated
2398 is compatible.
2400 You should rewrite your code to avoid these warnings if you are
2401 concerned about the fact that code generated by G++ may not be binary
2402 compatible with code generated by other compilers.
2404 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2406 @itemize @bullet
2408 @item
2409 A template with a non-type template parameter of reference type is
2410 mangled incorrectly:
2411 @smallexample
2412 extern int N;
2413 template <int &> struct S @{@};
2414 void n (S<N>) @{2@}
2415 @end smallexample
2417 This is fixed in @option{-fabi-version=3}.
2419 @item
2420 SIMD vector types declared using @code{__attribute ((vector_size))} are
2421 mangled in a non-standard way that does not allow for overloading of
2422 functions taking vectors of different sizes.
2424 The mangling is changed in @option{-fabi-version=4}.
2425 @end itemize
2427 The known incompatibilities in @option{-fabi-version=1} include:
2429 @itemize @bullet
2431 @item
2432 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2433 pack data into the same byte as a base class.  For example:
2435 @smallexample
2436 struct A @{ virtual void f(); int f1 : 1; @};
2437 struct B : public A @{ int f2 : 1; @};
2438 @end smallexample
2440 @noindent
2441 In this case, G++ places @code{B::f2} into the same byte
2442 as @code{A::f1}; other compilers do not.  You can avoid this problem
2443 by explicitly padding @code{A} so that its size is a multiple of the
2444 byte size on your platform; that causes G++ and other compilers to
2445 lay out @code{B} identically.
2447 @item
2448 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2449 tail padding when laying out virtual bases.  For example:
2451 @smallexample
2452 struct A @{ virtual void f(); char c1; @};
2453 struct B @{ B(); char c2; @};
2454 struct C : public A, public virtual B @{@};
2455 @end smallexample
2457 @noindent
2458 In this case, G++ does not place @code{B} into the tail-padding for
2459 @code{A}; other compilers do.  You can avoid this problem by
2460 explicitly padding @code{A} so that its size is a multiple of its
2461 alignment (ignoring virtual base classes); that causes G++ and other
2462 compilers to lay out @code{C} identically.
2464 @item
2465 Incorrect handling of bit-fields with declared widths greater than that
2466 of their underlying types, when the bit-fields appear in a union.  For
2467 example:
2469 @smallexample
2470 union U @{ int i : 4096; @};
2471 @end smallexample
2473 @noindent
2474 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2475 union too small by the number of bits in an @code{int}.
2477 @item
2478 Empty classes can be placed at incorrect offsets.  For example:
2480 @smallexample
2481 struct A @{@};
2483 struct B @{
2484   A a;
2485   virtual void f ();
2488 struct C : public B, public A @{@};
2489 @end smallexample
2491 @noindent
2492 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2493 it should be placed at offset zero.  G++ mistakenly believes that the
2494 @code{A} data member of @code{B} is already at offset zero.
2496 @item
2497 Names of template functions whose types involve @code{typename} or
2498 template template parameters can be mangled incorrectly.
2500 @smallexample
2501 template <typename Q>
2502 void f(typename Q::X) @{@}
2504 template <template <typename> class Q>
2505 void f(typename Q<int>::X) @{@}
2506 @end smallexample
2508 @noindent
2509 Instantiations of these templates may be mangled incorrectly.
2511 @end itemize
2513 It also warns about psABI-related changes.  The known psABI changes at this
2514 point include:
2516 @itemize @bullet
2518 @item
2519 For SysV/x86-64, unions with @code{long double} members are 
2520 passed in memory as specified in psABI.  For example:
2522 @smallexample
2523 union U @{
2524   long double ld;
2525   int i;
2527 @end smallexample
2529 @noindent
2530 @code{union U} is always passed in memory.
2532 @end itemize
2534 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2535 @opindex Wctor-dtor-privacy
2536 @opindex Wno-ctor-dtor-privacy
2537 Warn when a class seems unusable because all the constructors or
2538 destructors in that class are private, and it has neither friends nor
2539 public static member functions.  Also warn if there are no non-private
2540 methods, and there's at least one private member function that isn't
2541 a constructor or destructor.
2543 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2544 @opindex Wdelete-non-virtual-dtor
2545 @opindex Wno-delete-non-virtual-dtor
2546 Warn when @samp{delete} is used to destroy an instance of a class that
2547 has virtual functions and non-virtual destructor. It is unsafe to delete
2548 an instance of a derived class through a pointer to a base class if the
2549 base class does not have a virtual destructor.  This warning is enabled
2550 by @option{-Wall}.
2552 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2553 @opindex Wliteral-suffix
2554 @opindex Wno-literal-suffix
2555 Warn when a string or character literal is followed by a ud-suffix which does
2556 not begin with an underscore.  As a conforming extension, GCC treats such
2557 suffixes as separate preprocessing tokens in order to maintain backwards
2558 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2559 For example:
2561 @smallexample
2562 #define __STDC_FORMAT_MACROS
2563 #include <inttypes.h>
2564 #include <stdio.h>
2566 int main() @{
2567   int64_t i64 = 123;
2568   printf("My int64: %"PRId64"\n", i64);
2570 @end smallexample
2572 In this case, @code{PRId64} is treated as a separate preprocessing token.
2574 This warning is enabled by default.
2576 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2577 @opindex Wnarrowing
2578 @opindex Wno-narrowing
2579 Warn when a narrowing conversion prohibited by C++11 occurs within
2580 @samp{@{ @}}, e.g.
2582 @smallexample
2583 int i = @{ 2.2 @}; // error: narrowing from double to int
2584 @end smallexample
2586 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2588 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2589 required by the standard.  Note that this does not affect the meaning
2590 of well-formed code; narrowing conversions are still considered
2591 ill-formed in SFINAE context.
2593 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2594 @opindex Wnoexcept
2595 @opindex Wno-noexcept
2596 Warn when a noexcept-expression evaluates to false because of a call
2597 to a function that does not have a non-throwing exception
2598 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2599 the compiler to never throw an exception.
2601 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2602 @opindex Wnon-virtual-dtor
2603 @opindex Wno-non-virtual-dtor
2604 Warn when a class has virtual functions and an accessible non-virtual
2605 destructor, in which case it is possible but unsafe to delete
2606 an instance of a derived class through a pointer to the base class.
2607 This warning is also enabled if @option{-Weffc++} is specified.
2609 @item -Wreorder @r{(C++ and Objective-C++ only)}
2610 @opindex Wreorder
2611 @opindex Wno-reorder
2612 @cindex reordering, warning
2613 @cindex warning for reordering of member initializers
2614 Warn when the order of member initializers given in the code does not
2615 match the order in which they must be executed.  For instance:
2617 @smallexample
2618 struct A @{
2619   int i;
2620   int j;
2621   A(): j (0), i (1) @{ @}
2623 @end smallexample
2625 @noindent
2626 The compiler rearranges the member initializers for @samp{i}
2627 and @samp{j} to match the declaration order of the members, emitting
2628 a warning to that effect.  This warning is enabled by @option{-Wall}.
2630 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2631 @opindex fext-numeric-literals
2632 @opindex fno-ext-numeric-literals
2633 Accept imaginary, fixed-point, or machine-defined
2634 literal number suffixes as GNU extensions.
2635 When this option is turned off these suffixes are treated
2636 as C++11 user-defined literal numeric suffixes.
2637 This is on by default for all pre-C++11 dialects and all GNU dialects:
2638 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2639 @option{-std=gnu++1y}.
2640 This option is off by default
2641 for ISO C++11 onwards (@option{-std=c++11}, ...).
2642 @end table
2644 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2646 @table @gcctabopt
2647 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2648 @opindex Weffc++
2649 @opindex Wno-effc++
2650 Warn about violations of the following style guidelines from Scott Meyers'
2651 @cite{Effective C++, Second Edition} book:
2653 @itemize @bullet
2654 @item
2655 Item 11:  Define a copy constructor and an assignment operator for classes
2656 with dynamically-allocated memory.
2658 @item
2659 Item 12:  Prefer initialization to assignment in constructors.
2661 @item
2662 Item 14:  Make destructors virtual in base classes.
2664 @item
2665 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2667 @item
2668 Item 23:  Don't try to return a reference when you must return an object.
2670 @end itemize
2672 Also warn about violations of the following style guidelines from
2673 Scott Meyers' @cite{More Effective C++} book:
2675 @itemize @bullet
2676 @item
2677 Item 6:  Distinguish between prefix and postfix forms of increment and
2678 decrement operators.
2680 @item
2681 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2683 @end itemize
2685 When selecting this option, be aware that the standard library
2686 headers do not obey all of these guidelines; use @samp{grep -v}
2687 to filter out those warnings.
2689 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2690 @opindex Wstrict-null-sentinel
2691 @opindex Wno-strict-null-sentinel
2692 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2693 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2694 to @code{__null}.  Although it is a null pointer constant rather than a
2695 null pointer, it is guaranteed to be of the same size as a pointer.
2696 But this use is not portable across different compilers.
2698 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2699 @opindex Wno-non-template-friend
2700 @opindex Wnon-template-friend
2701 Disable warnings when non-templatized friend functions are declared
2702 within a template.  Since the advent of explicit template specification
2703 support in G++, if the name of the friend is an unqualified-id (i.e.,
2704 @samp{friend foo(int)}), the C++ language specification demands that the
2705 friend declare or define an ordinary, nontemplate function.  (Section
2706 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2707 could be interpreted as a particular specialization of a templatized
2708 function.  Because this non-conforming behavior is no longer the default
2709 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2710 check existing code for potential trouble spots and is on by default.
2711 This new compiler behavior can be turned off with
2712 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2713 but disables the helpful warning.
2715 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2716 @opindex Wold-style-cast
2717 @opindex Wno-old-style-cast
2718 Warn if an old-style (C-style) cast to a non-void type is used within
2719 a C++ program.  The new-style casts (@samp{dynamic_cast},
2720 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2721 less vulnerable to unintended effects and much easier to search for.
2723 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2724 @opindex Woverloaded-virtual
2725 @opindex Wno-overloaded-virtual
2726 @cindex overloaded virtual function, warning
2727 @cindex warning for overloaded virtual function
2728 Warn when a function declaration hides virtual functions from a
2729 base class.  For example, in:
2731 @smallexample
2732 struct A @{
2733   virtual void f();
2736 struct B: public A @{
2737   void f(int);
2739 @end smallexample
2741 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2742 like:
2744 @smallexample
2745 B* b;
2746 b->f();
2747 @end smallexample
2749 @noindent
2750 fails to compile.
2752 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2753 @opindex Wno-pmf-conversions
2754 @opindex Wpmf-conversions
2755 Disable the diagnostic for converting a bound pointer to member function
2756 to a plain pointer.
2758 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2759 @opindex Wsign-promo
2760 @opindex Wno-sign-promo
2761 Warn when overload resolution chooses a promotion from unsigned or
2762 enumerated type to a signed type, over a conversion to an unsigned type of
2763 the same size.  Previous versions of G++ tried to preserve
2764 unsignedness, but the standard mandates the current behavior.
2765 @end table
2767 @node Objective-C and Objective-C++ Dialect Options
2768 @section Options Controlling Objective-C and Objective-C++ Dialects
2770 @cindex compiler options, Objective-C and Objective-C++
2771 @cindex Objective-C and Objective-C++ options, command-line
2772 @cindex options, Objective-C and Objective-C++
2773 (NOTE: This manual does not describe the Objective-C and Objective-C++
2774 languages themselves.  @xref{Standards,,Language Standards
2775 Supported by GCC}, for references.)
2777 This section describes the command-line options that are only meaningful
2778 for Objective-C and Objective-C++ programs.  You can also use most of
2779 the language-independent GNU compiler options.
2780 For example, you might compile a file @code{some_class.m} like this:
2782 @smallexample
2783 gcc -g -fgnu-runtime -O -c some_class.m
2784 @end smallexample
2786 @noindent
2787 In this example, @option{-fgnu-runtime} is an option meant only for
2788 Objective-C and Objective-C++ programs; you can use the other options with
2789 any language supported by GCC@.
2791 Note that since Objective-C is an extension of the C language, Objective-C
2792 compilations may also use options specific to the C front-end (e.g.,
2793 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2794 C++-specific options (e.g., @option{-Wabi}).
2796 Here is a list of options that are @emph{only} for compiling Objective-C
2797 and Objective-C++ programs:
2799 @table @gcctabopt
2800 @item -fconstant-string-class=@var{class-name}
2801 @opindex fconstant-string-class
2802 Use @var{class-name} as the name of the class to instantiate for each
2803 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2804 class name is @code{NXConstantString} if the GNU runtime is being used, and
2805 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2806 @option{-fconstant-cfstrings} option, if also present, overrides the
2807 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2808 to be laid out as constant CoreFoundation strings.
2810 @item -fgnu-runtime
2811 @opindex fgnu-runtime
2812 Generate object code compatible with the standard GNU Objective-C
2813 runtime.  This is the default for most types of systems.
2815 @item -fnext-runtime
2816 @opindex fnext-runtime
2817 Generate output compatible with the NeXT runtime.  This is the default
2818 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2819 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2820 used.
2822 @item -fno-nil-receivers
2823 @opindex fno-nil-receivers
2824 Assume that all Objective-C message dispatches (@code{[receiver
2825 message:arg]}) in this translation unit ensure that the receiver is
2826 not @code{nil}.  This allows for more efficient entry points in the
2827 runtime to be used.  This option is only available in conjunction with
2828 the NeXT runtime and ABI version 0 or 1.
2830 @item -fobjc-abi-version=@var{n}
2831 @opindex fobjc-abi-version
2832 Use version @var{n} of the Objective-C ABI for the selected runtime.
2833 This option is currently supported only for the NeXT runtime.  In that
2834 case, Version 0 is the traditional (32-bit) ABI without support for
2835 properties and other Objective-C 2.0 additions.  Version 1 is the
2836 traditional (32-bit) ABI with support for properties and other
2837 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2838 nothing is specified, the default is Version 0 on 32-bit target
2839 machines, and Version 2 on 64-bit target machines.
2841 @item -fobjc-call-cxx-cdtors
2842 @opindex fobjc-call-cxx-cdtors
2843 For each Objective-C class, check if any of its instance variables is a
2844 C++ object with a non-trivial default constructor.  If so, synthesize a
2845 special @code{- (id) .cxx_construct} instance method which runs
2846 non-trivial default constructors on any such instance variables, in order,
2847 and then return @code{self}.  Similarly, check if any instance variable
2848 is a C++ object with a non-trivial destructor, and if so, synthesize a
2849 special @code{- (void) .cxx_destruct} method which runs
2850 all such default destructors, in reverse order.
2852 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2853 methods thusly generated only operate on instance variables
2854 declared in the current Objective-C class, and not those inherited
2855 from superclasses.  It is the responsibility of the Objective-C
2856 runtime to invoke all such methods in an object's inheritance
2857 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2858 by the runtime immediately after a new object instance is allocated;
2859 the @code{- (void) .cxx_destruct} methods are invoked immediately
2860 before the runtime deallocates an object instance.
2862 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2863 support for invoking the @code{- (id) .cxx_construct} and
2864 @code{- (void) .cxx_destruct} methods.
2866 @item -fobjc-direct-dispatch
2867 @opindex fobjc-direct-dispatch
2868 Allow fast jumps to the message dispatcher.  On Darwin this is
2869 accomplished via the comm page.
2871 @item -fobjc-exceptions
2872 @opindex fobjc-exceptions
2873 Enable syntactic support for structured exception handling in
2874 Objective-C, similar to what is offered by C++ and Java.  This option
2875 is required to use the Objective-C keywords @code{@@try},
2876 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2877 @code{@@synchronized}.  This option is available with both the GNU
2878 runtime and the NeXT runtime (but not available in conjunction with
2879 the NeXT runtime on Mac OS X 10.2 and earlier).
2881 @item -fobjc-gc
2882 @opindex fobjc-gc
2883 Enable garbage collection (GC) in Objective-C and Objective-C++
2884 programs.  This option is only available with the NeXT runtime; the
2885 GNU runtime has a different garbage collection implementation that
2886 does not require special compiler flags.
2888 @item -fobjc-nilcheck
2889 @opindex fobjc-nilcheck
2890 For the NeXT runtime with version 2 of the ABI, check for a nil
2891 receiver in method invocations before doing the actual method call.
2892 This is the default and can be disabled using
2893 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2894 checked for nil in this way no matter what this flag is set to.
2895 Currently this flag does nothing when the GNU runtime, or an older
2896 version of the NeXT runtime ABI, is used.
2898 @item -fobjc-std=objc1
2899 @opindex fobjc-std
2900 Conform to the language syntax of Objective-C 1.0, the language
2901 recognized by GCC 4.0.  This only affects the Objective-C additions to
2902 the C/C++ language; it does not affect conformance to C/C++ standards,
2903 which is controlled by the separate C/C++ dialect option flags.  When
2904 this option is used with the Objective-C or Objective-C++ compiler,
2905 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2906 This is useful if you need to make sure that your Objective-C code can
2907 be compiled with older versions of GCC@.
2909 @item -freplace-objc-classes
2910 @opindex freplace-objc-classes
2911 Emit a special marker instructing @command{ld(1)} not to statically link in
2912 the resulting object file, and allow @command{dyld(1)} to load it in at
2913 run time instead.  This is used in conjunction with the Fix-and-Continue
2914 debugging mode, where the object file in question may be recompiled and
2915 dynamically reloaded in the course of program execution, without the need
2916 to restart the program itself.  Currently, Fix-and-Continue functionality
2917 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2918 and later.
2920 @item -fzero-link
2921 @opindex fzero-link
2922 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2923 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2924 compile time) with static class references that get initialized at load time,
2925 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2926 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2927 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2928 for individual class implementations to be modified during program execution.
2929 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2930 regardless of command-line options.
2932 @item -gen-decls
2933 @opindex gen-decls
2934 Dump interface declarations for all classes seen in the source file to a
2935 file named @file{@var{sourcename}.decl}.
2937 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2938 @opindex Wassign-intercept
2939 @opindex Wno-assign-intercept
2940 Warn whenever an Objective-C assignment is being intercepted by the
2941 garbage collector.
2943 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2944 @opindex Wno-protocol
2945 @opindex Wprotocol
2946 If a class is declared to implement a protocol, a warning is issued for
2947 every method in the protocol that is not implemented by the class.  The
2948 default behavior is to issue a warning for every method not explicitly
2949 implemented in the class, even if a method implementation is inherited
2950 from the superclass.  If you use the @option{-Wno-protocol} option, then
2951 methods inherited from the superclass are considered to be implemented,
2952 and no warning is issued for them.
2954 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2955 @opindex Wselector
2956 @opindex Wno-selector
2957 Warn if multiple methods of different types for the same selector are
2958 found during compilation.  The check is performed on the list of methods
2959 in the final stage of compilation.  Additionally, a check is performed
2960 for each selector appearing in a @code{@@selector(@dots{})}
2961 expression, and a corresponding method for that selector has been found
2962 during compilation.  Because these checks scan the method table only at
2963 the end of compilation, these warnings are not produced if the final
2964 stage of compilation is not reached, for example because an error is
2965 found during compilation, or because the @option{-fsyntax-only} option is
2966 being used.
2968 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2969 @opindex Wstrict-selector-match
2970 @opindex Wno-strict-selector-match
2971 Warn if multiple methods with differing argument and/or return types are
2972 found for a given selector when attempting to send a message using this
2973 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2974 is off (which is the default behavior), the compiler omits such warnings
2975 if any differences found are confined to types that share the same size
2976 and alignment.
2978 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2979 @opindex Wundeclared-selector
2980 @opindex Wno-undeclared-selector
2981 Warn if a @code{@@selector(@dots{})} expression referring to an
2982 undeclared selector is found.  A selector is considered undeclared if no
2983 method with that name has been declared before the
2984 @code{@@selector(@dots{})} expression, either explicitly in an
2985 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2986 an @code{@@implementation} section.  This option always performs its
2987 checks as soon as a @code{@@selector(@dots{})} expression is found,
2988 while @option{-Wselector} only performs its checks in the final stage of
2989 compilation.  This also enforces the coding style convention
2990 that methods and selectors must be declared before being used.
2992 @item -print-objc-runtime-info
2993 @opindex print-objc-runtime-info
2994 Generate C header describing the largest structure that is passed by
2995 value, if any.
2997 @end table
2999 @node Language Independent Options
3000 @section Options to Control Diagnostic Messages Formatting
3001 @cindex options to control diagnostics formatting
3002 @cindex diagnostic messages
3003 @cindex message formatting
3005 Traditionally, diagnostic messages have been formatted irrespective of
3006 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3007 options described below
3008 to control the formatting algorithm for diagnostic messages, 
3009 e.g.@: how many characters per line, how often source location
3010 information should be reported.  Note that some language front ends may not
3011 honor these options.
3013 @table @gcctabopt
3014 @item -fmessage-length=@var{n}
3015 @opindex fmessage-length
3016 Try to format error messages so that they fit on lines of about @var{n}
3017 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
3018 the front ends supported by GCC@.  If @var{n} is zero, then no
3019 line-wrapping is done; each error message appears on a single
3020 line.
3022 @item -fdiagnostics-show-location=once
3023 @opindex fdiagnostics-show-location
3024 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3025 reporter to emit source location information @emph{once}; that is, in
3026 case the message is too long to fit on a single physical line and has to
3027 be wrapped, the source location won't be emitted (as prefix) again,
3028 over and over, in subsequent continuation lines.  This is the default
3029 behavior.
3031 @item -fdiagnostics-show-location=every-line
3032 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3033 messages reporter to emit the same source location information (as
3034 prefix) for physical lines that result from the process of breaking
3035 a message which is too long to fit on a single line.
3037 @item -fdiagnostics-color[=@var{WHEN}]
3038 @itemx -fno-diagnostics-color
3039 @opindex fdiagnostics-color
3040 @cindex highlight, color, colour
3041 @vindex GCC_COLORS @r{environment variable}
3042 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3043 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3044 variable isn't present in the environment, and @samp{auto} otherwise.
3045 @samp{auto} means to use color only when the standard error is a terminal.
3046 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3047 aliases for @option{-fdiagnostics-color=always} and
3048 @option{-fdiagnostics-color=never}, respectively.
3050 The colors are defined by the environment variable @env{GCC_COLORS}.
3051 Its value is a colon-separated list of capabilities and Select Graphic
3052 Rendition (SGR) substrings. SGR commands are interpreted by the
3053 terminal or terminal emulator.  (See the section in the documentation
3054 of your text terminal for permitted values and their meanings as
3055 character attributes.)  These substring values are integers in decimal
3056 representation and can be concatenated with semicolons.
3057 Common values to concatenate include
3058 @samp{1} for bold,
3059 @samp{4} for underline,
3060 @samp{5} for blink,
3061 @samp{7} for inverse,
3062 @samp{39} for default foreground color,
3063 @samp{30} to @samp{37} for foreground colors,
3064 @samp{90} to @samp{97} for 16-color mode foreground colors,
3065 @samp{38;5;0} to @samp{38;5;255}
3066 for 88-color and 256-color modes foreground colors,
3067 @samp{49} for default background color,
3068 @samp{40} to @samp{47} for background colors,
3069 @samp{100} to @samp{107} for 16-color mode background colors,
3070 and @samp{48;5;0} to @samp{48;5;255}
3071 for 88-color and 256-color modes background colors.
3073 The default @env{GCC_COLORS} is
3074 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3075 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3076 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3077 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3078 string disables colors.
3079 Supported capabilities are as follows.
3081 @table @code
3082 @item error=
3083 @vindex error GCC_COLORS @r{capability}
3084 SGR substring for error: markers.
3086 @item warning=
3087 @vindex warning GCC_COLORS @r{capability}
3088 SGR substring for warning: markers.
3090 @item note=
3091 @vindex note GCC_COLORS @r{capability}
3092 SGR substring for note: markers.
3094 @item caret=
3095 @vindex caret GCC_COLORS @r{capability}
3096 SGR substring for caret line.
3098 @item locus=
3099 @vindex locus GCC_COLORS @r{capability}
3100 SGR substring for location information, @samp{file:line} or
3101 @samp{file:line:column} etc.
3103 @item quote=
3104 @vindex quote GCC_COLORS @r{capability}
3105 SGR substring for information printed within quotes.
3106 @end table
3108 @item -fno-diagnostics-show-option
3109 @opindex fno-diagnostics-show-option
3110 @opindex fdiagnostics-show-option
3111 By default, each diagnostic emitted includes text indicating the
3112 command-line option that directly controls the diagnostic (if such an
3113 option is known to the diagnostic machinery).  Specifying the
3114 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3116 @item -fno-diagnostics-show-caret
3117 @opindex fno-diagnostics-show-caret
3118 @opindex fdiagnostics-show-caret
3119 By default, each diagnostic emitted includes the original source line
3120 and a caret '^' indicating the column.  This option suppresses this
3121 information.
3123 @end table
3125 @node Warning Options
3126 @section Options to Request or Suppress Warnings
3127 @cindex options to control warnings
3128 @cindex warning messages
3129 @cindex messages, warning
3130 @cindex suppressing warnings
3132 Warnings are diagnostic messages that report constructions that
3133 are not inherently erroneous but that are risky or suggest there
3134 may have been an error.
3136 The following language-independent options do not enable specific
3137 warnings but control the kinds of diagnostics produced by GCC@.
3139 @table @gcctabopt
3140 @cindex syntax checking
3141 @item -fsyntax-only
3142 @opindex fsyntax-only
3143 Check the code for syntax errors, but don't do anything beyond that.
3145 @item -fmax-errors=@var{n}
3146 @opindex fmax-errors
3147 Limits the maximum number of error messages to @var{n}, at which point
3148 GCC bails out rather than attempting to continue processing the source
3149 code.  If @var{n} is 0 (the default), there is no limit on the number
3150 of error messages produced.  If @option{-Wfatal-errors} is also
3151 specified, then @option{-Wfatal-errors} takes precedence over this
3152 option.
3154 @item -w
3155 @opindex w
3156 Inhibit all warning messages.
3158 @item -Werror
3159 @opindex Werror
3160 @opindex Wno-error
3161 Make all warnings into errors.
3163 @item -Werror=
3164 @opindex Werror=
3165 @opindex Wno-error=
3166 Make the specified warning into an error.  The specifier for a warning
3167 is appended; for example @option{-Werror=switch} turns the warnings
3168 controlled by @option{-Wswitch} into errors.  This switch takes a
3169 negative form, to be used to negate @option{-Werror} for specific
3170 warnings; for example @option{-Wno-error=switch} makes
3171 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3172 is in effect.
3174 The warning message for each controllable warning includes the
3175 option that controls the warning.  That option can then be used with
3176 @option{-Werror=} and @option{-Wno-error=} as described above.
3177 (Printing of the option in the warning message can be disabled using the
3178 @option{-fno-diagnostics-show-option} flag.)
3180 Note that specifying @option{-Werror=}@var{foo} automatically implies
3181 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3182 imply anything.
3184 @item -Wfatal-errors
3185 @opindex Wfatal-errors
3186 @opindex Wno-fatal-errors
3187 This option causes the compiler to abort compilation on the first error
3188 occurred rather than trying to keep going and printing further error
3189 messages.
3191 @end table
3193 You can request many specific warnings with options beginning with
3194 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3195 implicit declarations.  Each of these specific warning options also
3196 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3197 example, @option{-Wno-implicit}.  This manual lists only one of the
3198 two forms, whichever is not the default.  For further
3199 language-specific options also refer to @ref{C++ Dialect Options} and
3200 @ref{Objective-C and Objective-C++ Dialect Options}.
3202 When an unrecognized warning option is requested (e.g.,
3203 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3204 that the option is not recognized.  However, if the @option{-Wno-} form
3205 is used, the behavior is slightly different: no diagnostic is
3206 produced for @option{-Wno-unknown-warning} unless other diagnostics
3207 are being produced.  This allows the use of new @option{-Wno-} options
3208 with old compilers, but if something goes wrong, the compiler
3209 warns that an unrecognized option is present.
3211 @table @gcctabopt
3212 @item -Wpedantic
3213 @itemx -pedantic
3214 @opindex pedantic
3215 @opindex Wpedantic
3216 Issue all the warnings demanded by strict ISO C and ISO C++;
3217 reject all programs that use forbidden extensions, and some other
3218 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3219 version of the ISO C standard specified by any @option{-std} option used.
3221 Valid ISO C and ISO C++ programs should compile properly with or without
3222 this option (though a rare few require @option{-ansi} or a
3223 @option{-std} option specifying the required version of ISO C)@.  However,
3224 without this option, certain GNU extensions and traditional C and C++
3225 features are supported as well.  With this option, they are rejected.
3227 @option{-Wpedantic} does not cause warning messages for use of the
3228 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3229 warnings are also disabled in the expression that follows
3230 @code{__extension__}.  However, only system header files should use
3231 these escape routes; application programs should avoid them.
3232 @xref{Alternate Keywords}.
3234 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3235 C conformance.  They soon find that it does not do quite what they want:
3236 it finds some non-ISO practices, but not all---only those for which
3237 ISO C @emph{requires} a diagnostic, and some others for which
3238 diagnostics have been added.
3240 A feature to report any failure to conform to ISO C might be useful in
3241 some instances, but would require considerable additional work and would
3242 be quite different from @option{-Wpedantic}.  We don't have plans to
3243 support such a feature in the near future.
3245 Where the standard specified with @option{-std} represents a GNU
3246 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3247 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3248 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3249 where they are required by the base standard.  (It does not make sense
3250 for such warnings to be given only for features not in the specified GNU
3251 C dialect, since by definition the GNU dialects of C include all
3252 features the compiler supports with the given option, and there would be
3253 nothing to warn about.)
3255 @item -pedantic-errors
3256 @opindex pedantic-errors
3257 Like @option{-Wpedantic}, except that errors are produced rather than
3258 warnings.
3260 @item -Wall
3261 @opindex Wall
3262 @opindex Wno-all
3263 This enables all the warnings about constructions that some users
3264 consider questionable, and that are easy to avoid (or modify to
3265 prevent the warning), even in conjunction with macros.  This also
3266 enables some language-specific warnings described in @ref{C++ Dialect
3267 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3269 @option{-Wall} turns on the following warning flags:
3271 @gccoptlist{-Waddress   @gol
3272 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3273 -Wc++11-compat  @gol
3274 -Wchar-subscripts  @gol
3275 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3276 -Wimplicit-int @r{(C and Objective-C only)} @gol
3277 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3278 -Wcomment  @gol
3279 -Wformat   @gol
3280 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3281 -Wmaybe-uninitialized @gol
3282 -Wmissing-braces @r{(only for C/ObjC)} @gol
3283 -Wnonnull  @gol
3284 -Wparentheses  @gol
3285 -Wpointer-sign  @gol
3286 -Wreorder   @gol
3287 -Wreturn-type  @gol
3288 -Wsequence-point  @gol
3289 -Wsign-compare @r{(only in C++)}  @gol
3290 -Wstrict-aliasing  @gol
3291 -Wstrict-overflow=1  @gol
3292 -Wswitch  @gol
3293 -Wtrigraphs  @gol
3294 -Wuninitialized  @gol
3295 -Wunknown-pragmas  @gol
3296 -Wunused-function  @gol
3297 -Wunused-label     @gol
3298 -Wunused-value     @gol
3299 -Wunused-variable  @gol
3300 -Wvolatile-register-var @gol
3303 Note that some warning flags are not implied by @option{-Wall}.  Some of
3304 them warn about constructions that users generally do not consider
3305 questionable, but which occasionally you might wish to check for;
3306 others warn about constructions that are necessary or hard to avoid in
3307 some cases, and there is no simple way to modify the code to suppress
3308 the warning. Some of them are enabled by @option{-Wextra} but many of
3309 them must be enabled individually.
3311 @item -Wextra
3312 @opindex W
3313 @opindex Wextra
3314 @opindex Wno-extra
3315 This enables some extra warning flags that are not enabled by
3316 @option{-Wall}. (This option used to be called @option{-W}.  The older
3317 name is still supported, but the newer name is more descriptive.)
3319 @gccoptlist{-Wclobbered  @gol
3320 -Wempty-body  @gol
3321 -Wignored-qualifiers @gol
3322 -Wmissing-field-initializers  @gol
3323 -Wmissing-parameter-type @r{(C only)}  @gol
3324 -Wold-style-declaration @r{(C only)}  @gol
3325 -Woverride-init  @gol
3326 -Wsign-compare  @gol
3327 -Wtype-limits  @gol
3328 -Wuninitialized  @gol
3329 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3330 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3333 The option @option{-Wextra} also prints warning messages for the
3334 following cases:
3336 @itemize @bullet
3338 @item
3339 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3340 @samp{>}, or @samp{>=}.
3342 @item
3343 (C++ only) An enumerator and a non-enumerator both appear in a
3344 conditional expression.
3346 @item
3347 (C++ only) Ambiguous virtual bases.
3349 @item
3350 (C++ only) Subscripting an array that has been declared @samp{register}.
3352 @item
3353 (C++ only) Taking the address of a variable that has been declared
3354 @samp{register}.
3356 @item
3357 (C++ only) A base class is not initialized in a derived class's copy
3358 constructor.
3360 @end itemize
3362 @item -Wchar-subscripts
3363 @opindex Wchar-subscripts
3364 @opindex Wno-char-subscripts
3365 Warn if an array subscript has type @code{char}.  This is a common cause
3366 of error, as programmers often forget that this type is signed on some
3367 machines.
3368 This warning is enabled by @option{-Wall}.
3370 @item -Wcomment
3371 @opindex Wcomment
3372 @opindex Wno-comment
3373 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3374 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3375 This warning is enabled by @option{-Wall}.
3377 @item -Wno-coverage-mismatch
3378 @opindex Wno-coverage-mismatch
3379 Warn if feedback profiles do not match when using the
3380 @option{-fprofile-use} option.
3381 If a source file is changed between compiling with @option{-fprofile-gen} and
3382 with @option{-fprofile-use}, the files with the profile feedback can fail
3383 to match the source file and GCC cannot use the profile feedback
3384 information.  By default, this warning is enabled and is treated as an
3385 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3386 warning or @option{-Wno-error=coverage-mismatch} can be used to
3387 disable the error.  Disabling the error for this warning can result in
3388 poorly optimized code and is useful only in the
3389 case of very minor changes such as bug fixes to an existing code-base.
3390 Completely disabling the warning is not recommended.
3392 @item -Wno-cpp
3393 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3395 Suppress warning messages emitted by @code{#warning} directives.
3397 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3398 @opindex Wdouble-promotion
3399 @opindex Wno-double-promotion
3400 Give a warning when a value of type @code{float} is implicitly
3401 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3402 floating-point unit implement @code{float} in hardware, but emulate
3403 @code{double} in software.  On such a machine, doing computations
3404 using @code{double} values is much more expensive because of the
3405 overhead required for software emulation.
3407 It is easy to accidentally do computations with @code{double} because
3408 floating-point literals are implicitly of type @code{double}.  For
3409 example, in:
3410 @smallexample
3411 @group
3412 float area(float radius)
3414    return 3.14159 * radius * radius;
3416 @end group
3417 @end smallexample
3418 the compiler performs the entire computation with @code{double}
3419 because the floating-point literal is a @code{double}.
3421 @item -Wformat
3422 @itemx -Wformat=@var{n}
3423 @opindex Wformat
3424 @opindex Wno-format
3425 @opindex ffreestanding
3426 @opindex fno-builtin
3427 @opindex Wformat=
3428 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3429 the arguments supplied have types appropriate to the format string
3430 specified, and that the conversions specified in the format string make
3431 sense.  This includes standard functions, and others specified by format
3432 attributes (@pxref{Function Attributes}), in the @code{printf},
3433 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3434 not in the C standard) families (or other target-specific families).
3435 Which functions are checked without format attributes having been
3436 specified depends on the standard version selected, and such checks of
3437 functions without the attribute specified are disabled by
3438 @option{-ffreestanding} or @option{-fno-builtin}.
3440 The formats are checked against the format features supported by GNU
3441 libc version 2.2.  These include all ISO C90 and C99 features, as well
3442 as features from the Single Unix Specification and some BSD and GNU
3443 extensions.  Other library implementations may not support all these
3444 features; GCC does not support warning about features that go beyond a
3445 particular library's limitations.  However, if @option{-Wpedantic} is used
3446 with @option{-Wformat}, warnings are given about format features not
3447 in the selected standard version (but not for @code{strfmon} formats,
3448 since those are not in any version of the C standard).  @xref{C Dialect
3449 Options,,Options Controlling C Dialect}.
3451 @table @gcctabopt
3452 @item -Wformat=1
3453 @itemx -Wformat
3454 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3455 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3456 @option{-Wformat} also checks for null format arguments for several
3457 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3458 aspects of this level of format checking can be disabled by the
3459 options: @option{-Wno-format-contains-nul},
3460 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3461 @option{-Wformat} is enabled by @option{-Wall}.
3463 @item -Wno-format-contains-nul
3464 @opindex Wno-format-contains-nul
3465 @opindex Wformat-contains-nul
3466 If @option{-Wformat} is specified, do not warn about format strings that
3467 contain NUL bytes.
3469 @item -Wno-format-extra-args
3470 @opindex Wno-format-extra-args
3471 @opindex Wformat-extra-args
3472 If @option{-Wformat} is specified, do not warn about excess arguments to a
3473 @code{printf} or @code{scanf} format function.  The C standard specifies
3474 that such arguments are ignored.
3476 Where the unused arguments lie between used arguments that are
3477 specified with @samp{$} operand number specifications, normally
3478 warnings are still given, since the implementation could not know what
3479 type to pass to @code{va_arg} to skip the unused arguments.  However,
3480 in the case of @code{scanf} formats, this option suppresses the
3481 warning if the unused arguments are all pointers, since the Single
3482 Unix Specification says that such unused arguments are allowed.
3484 @item -Wno-format-zero-length
3485 @opindex Wno-format-zero-length
3486 @opindex Wformat-zero-length
3487 If @option{-Wformat} is specified, do not warn about zero-length formats.
3488 The C standard specifies that zero-length formats are allowed.
3491 @item -Wformat=2
3492 Enable @option{-Wformat} plus additional format checks.  Currently
3493 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3494 -Wformat-y2k}.
3496 @item -Wformat-nonliteral
3497 @opindex Wformat-nonliteral
3498 @opindex Wno-format-nonliteral
3499 If @option{-Wformat} is specified, also warn if the format string is not a
3500 string literal and so cannot be checked, unless the format function
3501 takes its format arguments as a @code{va_list}.
3503 @item -Wformat-security
3504 @opindex Wformat-security
3505 @opindex Wno-format-security
3506 If @option{-Wformat} is specified, also warn about uses of format
3507 functions that represent possible security problems.  At present, this
3508 warns about calls to @code{printf} and @code{scanf} functions where the
3509 format string is not a string literal and there are no format arguments,
3510 as in @code{printf (foo);}.  This may be a security hole if the format
3511 string came from untrusted input and contains @samp{%n}.  (This is
3512 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3513 in future warnings may be added to @option{-Wformat-security} that are not
3514 included in @option{-Wformat-nonliteral}.)
3516 @item -Wformat-y2k
3517 @opindex Wformat-y2k
3518 @opindex Wno-format-y2k
3519 If @option{-Wformat} is specified, also warn about @code{strftime}
3520 formats that may yield only a two-digit year.
3521 @end table
3523 @item -Wnonnull
3524 @opindex Wnonnull
3525 @opindex Wno-nonnull
3526 Warn about passing a null pointer for arguments marked as
3527 requiring a non-null value by the @code{nonnull} function attribute.
3529 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3530 can be disabled with the @option{-Wno-nonnull} option.
3532 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3533 @opindex Winit-self
3534 @opindex Wno-init-self
3535 Warn about uninitialized variables that are initialized with themselves.
3536 Note this option can only be used with the @option{-Wuninitialized} option.
3538 For example, GCC warns about @code{i} being uninitialized in the
3539 following snippet only when @option{-Winit-self} has been specified:
3540 @smallexample
3541 @group
3542 int f()
3544   int i = i;
3545   return i;
3547 @end group
3548 @end smallexample
3550 This warning is enabled by @option{-Wall} in C++.
3552 @item -Wimplicit-int @r{(C and Objective-C only)}
3553 @opindex Wimplicit-int
3554 @opindex Wno-implicit-int
3555 Warn when a declaration does not specify a type.
3556 This warning is enabled by @option{-Wall}.
3558 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3559 @opindex Wimplicit-function-declaration
3560 @opindex Wno-implicit-function-declaration
3561 Give a warning whenever a function is used before being declared. In
3562 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3563 enabled by default and it is made into an error by
3564 @option{-pedantic-errors}. This warning is also enabled by
3565 @option{-Wall}.
3567 @item -Wimplicit @r{(C and Objective-C only)}
3568 @opindex Wimplicit
3569 @opindex Wno-implicit
3570 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3571 This warning is enabled by @option{-Wall}.
3573 @item -Wignored-qualifiers @r{(C and C++ only)}
3574 @opindex Wignored-qualifiers
3575 @opindex Wno-ignored-qualifiers
3576 Warn if the return type of a function has a type qualifier
3577 such as @code{const}.  For ISO C such a type qualifier has no effect,
3578 since the value returned by a function is not an lvalue.
3579 For C++, the warning is only emitted for scalar types or @code{void}.
3580 ISO C prohibits qualified @code{void} return types on function
3581 definitions, so such return types always receive a warning
3582 even without this option.
3584 This warning is also enabled by @option{-Wextra}.
3586 @item -Wmain
3587 @opindex Wmain
3588 @opindex Wno-main
3589 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3590 a function with external linkage, returning int, taking either zero
3591 arguments, two, or three arguments of appropriate types.  This warning
3592 is enabled by default in C++ and is enabled by either @option{-Wall}
3593 or @option{-Wpedantic}.
3595 @item -Wmissing-braces
3596 @opindex Wmissing-braces
3597 @opindex Wno-missing-braces
3598 Warn if an aggregate or union initializer is not fully bracketed.  In
3599 the following example, the initializer for @samp{a} is not fully
3600 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3601 enabled by @option{-Wall} in C.
3603 @smallexample
3604 int a[2][2] = @{ 0, 1, 2, 3 @};
3605 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3606 @end smallexample
3608 This warning is enabled by @option{-Wall}.
3610 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3611 @opindex Wmissing-include-dirs
3612 @opindex Wno-missing-include-dirs
3613 Warn if a user-supplied include directory does not exist.
3615 @item -Wparentheses
3616 @opindex Wparentheses
3617 @opindex Wno-parentheses
3618 Warn if parentheses are omitted in certain contexts, such
3619 as when there is an assignment in a context where a truth value
3620 is expected, or when operators are nested whose precedence people
3621 often get confused about.
3623 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3624 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3625 interpretation from that of ordinary mathematical notation.
3627 Also warn about constructions where there may be confusion to which
3628 @code{if} statement an @code{else} branch belongs.  Here is an example of
3629 such a case:
3631 @smallexample
3632 @group
3634   if (a)
3635     if (b)
3636       foo ();
3637   else
3638     bar ();
3640 @end group
3641 @end smallexample
3643 In C/C++, every @code{else} branch belongs to the innermost possible
3644 @code{if} statement, which in this example is @code{if (b)}.  This is
3645 often not what the programmer expected, as illustrated in the above
3646 example by indentation the programmer chose.  When there is the
3647 potential for this confusion, GCC issues a warning when this flag
3648 is specified.  To eliminate the warning, add explicit braces around
3649 the innermost @code{if} statement so there is no way the @code{else}
3650 can belong to the enclosing @code{if}.  The resulting code
3651 looks like this:
3653 @smallexample
3654 @group
3656   if (a)
3657     @{
3658       if (b)
3659         foo ();
3660       else
3661         bar ();
3662     @}
3664 @end group
3665 @end smallexample
3667 Also warn for dangerous uses of the GNU extension to
3668 @code{?:} with omitted middle operand. When the condition
3669 in the @code{?}: operator is a boolean expression, the omitted value is
3670 always 1.  Often programmers expect it to be a value computed
3671 inside the conditional expression instead.
3673 This warning is enabled by @option{-Wall}.
3675 @item -Wsequence-point
3676 @opindex Wsequence-point
3677 @opindex Wno-sequence-point
3678 Warn about code that may have undefined semantics because of violations
3679 of sequence point rules in the C and C++ standards.
3681 The C and C++ standards define the order in which expressions in a C/C++
3682 program are evaluated in terms of @dfn{sequence points}, which represent
3683 a partial ordering between the execution of parts of the program: those
3684 executed before the sequence point, and those executed after it.  These
3685 occur after the evaluation of a full expression (one which is not part
3686 of a larger expression), after the evaluation of the first operand of a
3687 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3688 function is called (but after the evaluation of its arguments and the
3689 expression denoting the called function), and in certain other places.
3690 Other than as expressed by the sequence point rules, the order of
3691 evaluation of subexpressions of an expression is not specified.  All
3692 these rules describe only a partial order rather than a total order,
3693 since, for example, if two functions are called within one expression
3694 with no sequence point between them, the order in which the functions
3695 are called is not specified.  However, the standards committee have
3696 ruled that function calls do not overlap.
3698 It is not specified when between sequence points modifications to the
3699 values of objects take effect.  Programs whose behavior depends on this
3700 have undefined behavior; the C and C++ standards specify that ``Between
3701 the previous and next sequence point an object shall have its stored
3702 value modified at most once by the evaluation of an expression.
3703 Furthermore, the prior value shall be read only to determine the value
3704 to be stored.''.  If a program breaks these rules, the results on any
3705 particular implementation are entirely unpredictable.
3707 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3708 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3709 diagnosed by this option, and it may give an occasional false positive
3710 result, but in general it has been found fairly effective at detecting
3711 this sort of problem in programs.
3713 The standard is worded confusingly, therefore there is some debate
3714 over the precise meaning of the sequence point rules in subtle cases.
3715 Links to discussions of the problem, including proposed formal
3716 definitions, may be found on the GCC readings page, at
3717 @uref{http://gcc.gnu.org/@/readings.html}.
3719 This warning is enabled by @option{-Wall} for C and C++.
3721 @item -Wno-return-local-addr
3722 @opindex Wno-return-local-addr
3723 @opindex Wreturn-local-addr
3724 Do not warn about returning a pointer (or in C++, a reference) to a
3725 variable that goes out of scope after the function returns.
3727 @item -Wreturn-type
3728 @opindex Wreturn-type
3729 @opindex Wno-return-type
3730 Warn whenever a function is defined with a return type that defaults
3731 to @code{int}.  Also warn about any @code{return} statement with no
3732 return value in a function whose return type is not @code{void}
3733 (falling off the end of the function body is considered returning
3734 without a value), and about a @code{return} statement with an
3735 expression in a function whose return type is @code{void}.
3737 For C++, a function without return type always produces a diagnostic
3738 message, even when @option{-Wno-return-type} is specified.  The only
3739 exceptions are @samp{main} and functions defined in system headers.
3741 This warning is enabled by @option{-Wall}.
3743 @item -Wswitch
3744 @opindex Wswitch
3745 @opindex Wno-switch
3746 Warn whenever a @code{switch} statement has an index of enumerated type
3747 and lacks a @code{case} for one or more of the named codes of that
3748 enumeration.  (The presence of a @code{default} label prevents this
3749 warning.)  @code{case} labels outside the enumeration range also
3750 provoke warnings when this option is used (even if there is a
3751 @code{default} label).
3752 This warning is enabled by @option{-Wall}.
3754 @item -Wswitch-default
3755 @opindex Wswitch-default
3756 @opindex Wno-switch-default
3757 Warn whenever a @code{switch} statement does not have a @code{default}
3758 case.
3760 @item -Wswitch-enum
3761 @opindex Wswitch-enum
3762 @opindex Wno-switch-enum
3763 Warn whenever a @code{switch} statement has an index of enumerated type
3764 and lacks a @code{case} for one or more of the named codes of that
3765 enumeration.  @code{case} labels outside the enumeration range also
3766 provoke warnings when this option is used.  The only difference
3767 between @option{-Wswitch} and this option is that this option gives a
3768 warning about an omitted enumeration code even if there is a
3769 @code{default} label.
3771 @item -Wsync-nand @r{(C and C++ only)}
3772 @opindex Wsync-nand
3773 @opindex Wno-sync-nand
3774 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3775 built-in functions are used.  These functions changed semantics in GCC 4.4.
3777 @item -Wtrigraphs
3778 @opindex Wtrigraphs
3779 @opindex Wno-trigraphs
3780 Warn if any trigraphs are encountered that might change the meaning of
3781 the program (trigraphs within comments are not warned about).
3782 This warning is enabled by @option{-Wall}.
3784 @item -Wunused-but-set-parameter
3785 @opindex Wunused-but-set-parameter
3786 @opindex Wno-unused-but-set-parameter
3787 Warn whenever a function parameter is assigned to, but otherwise unused
3788 (aside from its declaration).
3790 To suppress this warning use the @samp{unused} attribute
3791 (@pxref{Variable Attributes}).
3793 This warning is also enabled by @option{-Wunused} together with
3794 @option{-Wextra}.
3796 @item -Wunused-but-set-variable
3797 @opindex Wunused-but-set-variable
3798 @opindex Wno-unused-but-set-variable
3799 Warn whenever a local variable is assigned to, but otherwise unused
3800 (aside from its declaration).
3801 This warning is enabled by @option{-Wall}.
3803 To suppress this warning use the @samp{unused} attribute
3804 (@pxref{Variable Attributes}).
3806 This warning is also enabled by @option{-Wunused}, which is enabled
3807 by @option{-Wall}.
3809 @item -Wunused-function
3810 @opindex Wunused-function
3811 @opindex Wno-unused-function
3812 Warn whenever a static function is declared but not defined or a
3813 non-inline static function is unused.
3814 This warning is enabled by @option{-Wall}.
3816 @item -Wunused-label
3817 @opindex Wunused-label
3818 @opindex Wno-unused-label
3819 Warn whenever a label is declared but not used.
3820 This warning is enabled by @option{-Wall}.
3822 To suppress this warning use the @samp{unused} attribute
3823 (@pxref{Variable Attributes}).
3825 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3826 @opindex Wunused-local-typedefs
3827 Warn when a typedef locally defined in a function is not used.
3828 This warning is enabled by @option{-Wall}.
3830 @item -Wunused-parameter
3831 @opindex Wunused-parameter
3832 @opindex Wno-unused-parameter
3833 Warn whenever a function parameter is unused aside from its declaration.
3835 To suppress this warning use the @samp{unused} attribute
3836 (@pxref{Variable Attributes}).
3838 @item -Wno-unused-result
3839 @opindex Wunused-result
3840 @opindex Wno-unused-result
3841 Do not warn if a caller of a function marked with attribute
3842 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3843 its return value. The default is @option{-Wunused-result}.
3845 @item -Wunused-variable
3846 @opindex Wunused-variable
3847 @opindex Wno-unused-variable
3848 Warn whenever a local variable or non-constant static variable is unused
3849 aside from its declaration.
3850 This warning is enabled by @option{-Wall}.
3852 To suppress this warning use the @samp{unused} attribute
3853 (@pxref{Variable Attributes}).
3855 @item -Wunused-value
3856 @opindex Wunused-value
3857 @opindex Wno-unused-value
3858 Warn whenever a statement computes a result that is explicitly not
3859 used. To suppress this warning cast the unused expression to
3860 @samp{void}. This includes an expression-statement or the left-hand
3861 side of a comma expression that contains no side effects. For example,
3862 an expression such as @samp{x[i,j]} causes a warning, while
3863 @samp{x[(void)i,j]} does not.
3865 This warning is enabled by @option{-Wall}.
3867 @item -Wunused
3868 @opindex Wunused
3869 @opindex Wno-unused
3870 All the above @option{-Wunused} options combined.
3872 In order to get a warning about an unused function parameter, you must
3873 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3874 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3876 @item -Wuninitialized
3877 @opindex Wuninitialized
3878 @opindex Wno-uninitialized
3879 Warn if an automatic variable is used without first being initialized
3880 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3881 warn if a non-static reference or non-static @samp{const} member
3882 appears in a class without constructors.
3884 If you want to warn about code that uses the uninitialized value of the
3885 variable in its own initializer, use the @option{-Winit-self} option.
3887 These warnings occur for individual uninitialized or clobbered
3888 elements of structure, union or array variables as well as for
3889 variables that are uninitialized or clobbered as a whole.  They do
3890 not occur for variables or elements declared @code{volatile}.  Because
3891 these warnings depend on optimization, the exact variables or elements
3892 for which there are warnings depends on the precise optimization
3893 options and version of GCC used.
3895 Note that there may be no warning about a variable that is used only
3896 to compute a value that itself is never used, because such
3897 computations may be deleted by data flow analysis before the warnings
3898 are printed.
3900 @item -Wmaybe-uninitialized
3901 @opindex Wmaybe-uninitialized
3902 @opindex Wno-maybe-uninitialized
3903 For an automatic variable, if there exists a path from the function
3904 entry to a use of the variable that is initialized, but there exist
3905 some other paths for which the variable is not initialized, the compiler
3906 emits a warning if it cannot prove the uninitialized paths are not
3907 executed at run time. These warnings are made optional because GCC is
3908 not smart enough to see all the reasons why the code might be correct
3909 in spite of appearing to have an error.  Here is one example of how
3910 this can happen:
3912 @smallexample
3913 @group
3915   int x;
3916   switch (y)
3917     @{
3918     case 1: x = 1;
3919       break;
3920     case 2: x = 4;
3921       break;
3922     case 3: x = 5;
3923     @}
3924   foo (x);
3926 @end group
3927 @end smallexample
3929 @noindent
3930 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3931 always initialized, but GCC doesn't know this. To suppress the
3932 warning, you need to provide a default case with assert(0) or
3933 similar code.
3935 @cindex @code{longjmp} warnings
3936 This option also warns when a non-volatile automatic variable might be
3937 changed by a call to @code{longjmp}.  These warnings as well are possible
3938 only in optimizing compilation.
3940 The compiler sees only the calls to @code{setjmp}.  It cannot know
3941 where @code{longjmp} will be called; in fact, a signal handler could
3942 call it at any point in the code.  As a result, you may get a warning
3943 even when there is in fact no problem because @code{longjmp} cannot
3944 in fact be called at the place that would cause a problem.
3946 Some spurious warnings can be avoided if you declare all the functions
3947 you use that never return as @code{noreturn}.  @xref{Function
3948 Attributes}.
3950 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3952 @item -Wunknown-pragmas
3953 @opindex Wunknown-pragmas
3954 @opindex Wno-unknown-pragmas
3955 @cindex warning for unknown pragmas
3956 @cindex unknown pragmas, warning
3957 @cindex pragmas, warning of unknown
3958 Warn when a @code{#pragma} directive is encountered that is not understood by 
3959 GCC@.  If this command-line option is used, warnings are even issued
3960 for unknown pragmas in system header files.  This is not the case if
3961 the warnings are only enabled by the @option{-Wall} command-line option.
3963 @item -Wno-pragmas
3964 @opindex Wno-pragmas
3965 @opindex Wpragmas
3966 Do not warn about misuses of pragmas, such as incorrect parameters,
3967 invalid syntax, or conflicts between pragmas.  See also
3968 @option{-Wunknown-pragmas}.
3970 @item -Wstrict-aliasing
3971 @opindex Wstrict-aliasing
3972 @opindex Wno-strict-aliasing
3973 This option is only active when @option{-fstrict-aliasing} is active.
3974 It warns about code that might break the strict aliasing rules that the
3975 compiler is using for optimization.  The warning does not catch all
3976 cases, but does attempt to catch the more common pitfalls.  It is
3977 included in @option{-Wall}.
3978 It is equivalent to @option{-Wstrict-aliasing=3}
3980 @item -Wstrict-aliasing=n
3981 @opindex Wstrict-aliasing=n
3982 This option is only active when @option{-fstrict-aliasing} is active.
3983 It warns about code that might break the strict aliasing rules that the
3984 compiler is using for optimization.
3985 Higher levels correspond to higher accuracy (fewer false positives).
3986 Higher levels also correspond to more effort, similar to the way @option{-O} 
3987 works.
3988 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3990 Level 1: Most aggressive, quick, least accurate.
3991 Possibly useful when higher levels
3992 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3993 false negatives.  However, it has many false positives.
3994 Warns for all pointer conversions between possibly incompatible types,
3995 even if never dereferenced.  Runs in the front end only.
3997 Level 2: Aggressive, quick, not too precise.
3998 May still have many false positives (not as many as level 1 though),
3999 and few false negatives (but possibly more than level 1).
4000 Unlike level 1, it only warns when an address is taken.  Warns about
4001 incomplete types.  Runs in the front end only.
4003 Level 3 (default for @option{-Wstrict-aliasing}):
4004 Should have very few false positives and few false
4005 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4006 Takes care of the common pun+dereference pattern in the front end:
4007 @code{*(int*)&some_float}.
4008 If optimization is enabled, it also runs in the back end, where it deals
4009 with multiple statement cases using flow-sensitive points-to information.
4010 Only warns when the converted pointer is dereferenced.
4011 Does not warn about incomplete types.
4013 @item -Wstrict-overflow
4014 @itemx -Wstrict-overflow=@var{n}
4015 @opindex Wstrict-overflow
4016 @opindex Wno-strict-overflow
4017 This option is only active when @option{-fstrict-overflow} is active.
4018 It warns about cases where the compiler optimizes based on the
4019 assumption that signed overflow does not occur.  Note that it does not
4020 warn about all cases where the code might overflow: it only warns
4021 about cases where the compiler implements some optimization.  Thus
4022 this warning depends on the optimization level.
4024 An optimization that assumes that signed overflow does not occur is
4025 perfectly safe if the values of the variables involved are such that
4026 overflow never does, in fact, occur.  Therefore this warning can
4027 easily give a false positive: a warning about code that is not
4028 actually a problem.  To help focus on important issues, several
4029 warning levels are defined.  No warnings are issued for the use of
4030 undefined signed overflow when estimating how many iterations a loop
4031 requires, in particular when determining whether a loop will be
4032 executed at all.
4034 @table @gcctabopt
4035 @item -Wstrict-overflow=1
4036 Warn about cases that are both questionable and easy to avoid.  For
4037 example,  with @option{-fstrict-overflow}, the compiler simplifies
4038 @code{x + 1 > x} to @code{1}.  This level of
4039 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4040 are not, and must be explicitly requested.
4042 @item -Wstrict-overflow=2
4043 Also warn about other cases where a comparison is simplified to a
4044 constant.  For example: @code{abs (x) >= 0}.  This can only be
4045 simplified when @option{-fstrict-overflow} is in effect, because
4046 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4047 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4048 @option{-Wstrict-overflow=2}.
4050 @item -Wstrict-overflow=3
4051 Also warn about other cases where a comparison is simplified.  For
4052 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4054 @item -Wstrict-overflow=4
4055 Also warn about other simplifications not covered by the above cases.
4056 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4058 @item -Wstrict-overflow=5
4059 Also warn about cases where the compiler reduces the magnitude of a
4060 constant involved in a comparison.  For example: @code{x + 2 > y} is
4061 simplified to @code{x + 1 >= y}.  This is reported only at the
4062 highest warning level because this simplification applies to many
4063 comparisons, so this warning level gives a very large number of
4064 false positives.
4065 @end table
4067 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4068 @opindex Wsuggest-attribute=
4069 @opindex Wno-suggest-attribute=
4070 Warn for cases where adding an attribute may be beneficial. The
4071 attributes currently supported are listed below.
4073 @table @gcctabopt
4074 @item -Wsuggest-attribute=pure
4075 @itemx -Wsuggest-attribute=const
4076 @itemx -Wsuggest-attribute=noreturn
4077 @opindex Wsuggest-attribute=pure
4078 @opindex Wno-suggest-attribute=pure
4079 @opindex Wsuggest-attribute=const
4080 @opindex Wno-suggest-attribute=const
4081 @opindex Wsuggest-attribute=noreturn
4082 @opindex Wno-suggest-attribute=noreturn
4084 Warn about functions that might be candidates for attributes
4085 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4086 functions visible in other compilation units or (in the case of @code{pure} and
4087 @code{const}) if it cannot prove that the function returns normally. A function
4088 returns normally if it doesn't contain an infinite loop or return abnormally
4089 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4090 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4091 higher.  Higher optimization levels improve the accuracy of the analysis.
4093 @item -Wsuggest-attribute=format
4094 @itemx -Wmissing-format-attribute
4095 @opindex Wsuggest-attribute=format
4096 @opindex Wmissing-format-attribute
4097 @opindex Wno-suggest-attribute=format
4098 @opindex Wno-missing-format-attribute
4099 @opindex Wformat
4100 @opindex Wno-format
4102 Warn about function pointers that might be candidates for @code{format}
4103 attributes.  Note these are only possible candidates, not absolute ones.
4104 GCC guesses that function pointers with @code{format} attributes that
4105 are used in assignment, initialization, parameter passing or return
4106 statements should have a corresponding @code{format} attribute in the
4107 resulting type.  I.e.@: the left-hand side of the assignment or
4108 initialization, the type of the parameter variable, or the return type
4109 of the containing function respectively should also have a @code{format}
4110 attribute to avoid the warning.
4112 GCC also warns about function definitions that might be
4113 candidates for @code{format} attributes.  Again, these are only
4114 possible candidates.  GCC guesses that @code{format} attributes
4115 might be appropriate for any function that calls a function like
4116 @code{vprintf} or @code{vscanf}, but this might not always be the
4117 case, and some functions for which @code{format} attributes are
4118 appropriate may not be detected.
4119 @end table
4121 @item -Warray-bounds
4122 @opindex Wno-array-bounds
4123 @opindex Warray-bounds
4124 This option is only active when @option{-ftree-vrp} is active
4125 (default for @option{-O2} and above). It warns about subscripts to arrays
4126 that are always out of bounds. This warning is enabled by @option{-Wall}.
4128 @item -Wno-div-by-zero
4129 @opindex Wno-div-by-zero
4130 @opindex Wdiv-by-zero
4131 Do not warn about compile-time integer division by zero.  Floating-point
4132 division by zero is not warned about, as it can be a legitimate way of
4133 obtaining infinities and NaNs.
4135 @item -Wsystem-headers
4136 @opindex Wsystem-headers
4137 @opindex Wno-system-headers
4138 @cindex warnings from system headers
4139 @cindex system headers, warnings from
4140 Print warning messages for constructs found in system header files.
4141 Warnings from system headers are normally suppressed, on the assumption
4142 that they usually do not indicate real problems and would only make the
4143 compiler output harder to read.  Using this command-line option tells
4144 GCC to emit warnings from system headers as if they occurred in user
4145 code.  However, note that using @option{-Wall} in conjunction with this
4146 option does @emph{not} warn about unknown pragmas in system
4147 headers---for that, @option{-Wunknown-pragmas} must also be used.
4149 @item -Wtrampolines
4150 @opindex Wtrampolines
4151 @opindex Wno-trampolines
4152  Warn about trampolines generated for pointers to nested functions.
4154  A trampoline is a small piece of data or code that is created at run
4155  time on the stack when the address of a nested function is taken, and
4156  is used to call the nested function indirectly.  For some targets, it
4157  is made up of data only and thus requires no special treatment.  But,
4158  for most targets, it is made up of code and thus requires the stack
4159  to be made executable in order for the program to work properly.
4161 @item -Wfloat-equal
4162 @opindex Wfloat-equal
4163 @opindex Wno-float-equal
4164 Warn if floating-point values are used in equality comparisons.
4166 The idea behind this is that sometimes it is convenient (for the
4167 programmer) to consider floating-point values as approximations to
4168 infinitely precise real numbers.  If you are doing this, then you need
4169 to compute (by analyzing the code, or in some other way) the maximum or
4170 likely maximum error that the computation introduces, and allow for it
4171 when performing comparisons (and when producing output, but that's a
4172 different problem).  In particular, instead of testing for equality, you
4173 should check to see whether the two values have ranges that overlap; and
4174 this is done with the relational operators, so equality comparisons are
4175 probably mistaken.
4177 @item -Wtraditional @r{(C and Objective-C only)}
4178 @opindex Wtraditional
4179 @opindex Wno-traditional
4180 Warn about certain constructs that behave differently in traditional and
4181 ISO C@.  Also warn about ISO C constructs that have no traditional C
4182 equivalent, and/or problematic constructs that should be avoided.
4184 @itemize @bullet
4185 @item
4186 Macro parameters that appear within string literals in the macro body.
4187 In traditional C macro replacement takes place within string literals,
4188 but in ISO C it does not.
4190 @item
4191 In traditional C, some preprocessor directives did not exist.
4192 Traditional preprocessors only considered a line to be a directive
4193 if the @samp{#} appeared in column 1 on the line.  Therefore
4194 @option{-Wtraditional} warns about directives that traditional C
4195 understands but ignores because the @samp{#} does not appear as the
4196 first character on the line.  It also suggests you hide directives like
4197 @samp{#pragma} not understood by traditional C by indenting them.  Some
4198 traditional implementations do not recognize @samp{#elif}, so this option
4199 suggests avoiding it altogether.
4201 @item
4202 A function-like macro that appears without arguments.
4204 @item
4205 The unary plus operator.
4207 @item
4208 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4209 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4210 constants.)  Note, these suffixes appear in macros defined in the system
4211 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4212 Use of these macros in user code might normally lead to spurious
4213 warnings, however GCC's integrated preprocessor has enough context to
4214 avoid warning in these cases.
4216 @item
4217 A function declared external in one block and then used after the end of
4218 the block.
4220 @item
4221 A @code{switch} statement has an operand of type @code{long}.
4223 @item
4224 A non-@code{static} function declaration follows a @code{static} one.
4225 This construct is not accepted by some traditional C compilers.
4227 @item
4228 The ISO type of an integer constant has a different width or
4229 signedness from its traditional type.  This warning is only issued if
4230 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4231 typically represent bit patterns, are not warned about.
4233 @item
4234 Usage of ISO string concatenation is detected.
4236 @item
4237 Initialization of automatic aggregates.
4239 @item
4240 Identifier conflicts with labels.  Traditional C lacks a separate
4241 namespace for labels.
4243 @item
4244 Initialization of unions.  If the initializer is zero, the warning is
4245 omitted.  This is done under the assumption that the zero initializer in
4246 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4247 initializer warnings and relies on default initialization to zero in the
4248 traditional C case.
4250 @item
4251 Conversions by prototypes between fixed/floating-point values and vice
4252 versa.  The absence of these prototypes when compiling with traditional
4253 C causes serious problems.  This is a subset of the possible
4254 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4256 @item
4257 Use of ISO C style function definitions.  This warning intentionally is
4258 @emph{not} issued for prototype declarations or variadic functions
4259 because these ISO C features appear in your code when using
4260 libiberty's traditional C compatibility macros, @code{PARAMS} and
4261 @code{VPARAMS}.  This warning is also bypassed for nested functions
4262 because that feature is already a GCC extension and thus not relevant to
4263 traditional C compatibility.
4264 @end itemize
4266 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4267 @opindex Wtraditional-conversion
4268 @opindex Wno-traditional-conversion
4269 Warn if a prototype causes a type conversion that is different from what
4270 would happen to the same argument in the absence of a prototype.  This
4271 includes conversions of fixed point to floating and vice versa, and
4272 conversions changing the width or signedness of a fixed-point argument
4273 except when the same as the default promotion.
4275 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4276 @opindex Wdeclaration-after-statement
4277 @opindex Wno-declaration-after-statement
4278 Warn when a declaration is found after a statement in a block.  This
4279 construct, known from C++, was introduced with ISO C99 and is by default
4280 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4281 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4283 @item -Wundef
4284 @opindex Wundef
4285 @opindex Wno-undef
4286 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4288 @item -Wno-endif-labels
4289 @opindex Wno-endif-labels
4290 @opindex Wendif-labels
4291 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4293 @item -Wshadow
4294 @opindex Wshadow
4295 @opindex Wno-shadow
4296 Warn whenever a local variable or type declaration shadows another variable,
4297 parameter, type, or class member (in C++), or whenever a built-in function
4298 is shadowed. Note that in C++, the compiler warns if a local variable
4299 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4301 @item -Wlarger-than=@var{len}
4302 @opindex Wlarger-than=@var{len}
4303 @opindex Wlarger-than-@var{len}
4304 Warn whenever an object of larger than @var{len} bytes is defined.
4306 @item -Wframe-larger-than=@var{len}
4307 @opindex Wframe-larger-than
4308 Warn if the size of a function frame is larger than @var{len} bytes.
4309 The computation done to determine the stack frame size is approximate
4310 and not conservative.
4311 The actual requirements may be somewhat greater than @var{len}
4312 even if you do not get a warning.  In addition, any space allocated
4313 via @code{alloca}, variable-length arrays, or related constructs
4314 is not included by the compiler when determining
4315 whether or not to issue a warning.
4317 @item -Wno-free-nonheap-object
4318 @opindex Wno-free-nonheap-object
4319 @opindex Wfree-nonheap-object
4320 Do not warn when attempting to free an object that was not allocated
4321 on the heap.
4323 @item -Wstack-usage=@var{len}
4324 @opindex Wstack-usage
4325 Warn if the stack usage of a function might be larger than @var{len} bytes.
4326 The computation done to determine the stack usage is conservative.
4327 Any space allocated via @code{alloca}, variable-length arrays, or related
4328 constructs is included by the compiler when determining whether or not to
4329 issue a warning.
4331 The message is in keeping with the output of @option{-fstack-usage}.
4333 @itemize
4334 @item
4335 If the stack usage is fully static but exceeds the specified amount, it's:
4337 @smallexample
4338   warning: stack usage is 1120 bytes
4339 @end smallexample
4340 @item
4341 If the stack usage is (partly) dynamic but bounded, it's:
4343 @smallexample
4344   warning: stack usage might be 1648 bytes
4345 @end smallexample
4346 @item
4347 If the stack usage is (partly) dynamic and not bounded, it's:
4349 @smallexample
4350   warning: stack usage might be unbounded
4351 @end smallexample
4352 @end itemize
4354 @item -Wunsafe-loop-optimizations
4355 @opindex Wunsafe-loop-optimizations
4356 @opindex Wno-unsafe-loop-optimizations
4357 Warn if the loop cannot be optimized because the compiler cannot
4358 assume anything on the bounds of the loop indices.  With
4359 @option{-funsafe-loop-optimizations} warn if the compiler makes
4360 such assumptions.
4362 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4363 @opindex Wno-pedantic-ms-format
4364 @opindex Wpedantic-ms-format
4365 When used in combination with @option{-Wformat}
4366 and @option{-pedantic} without GNU extensions, this option
4367 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4368 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4369 which depend on the MS runtime.
4371 @item -Wpointer-arith
4372 @opindex Wpointer-arith
4373 @opindex Wno-pointer-arith
4374 Warn about anything that depends on the ``size of'' a function type or
4375 of @code{void}.  GNU C assigns these types a size of 1, for
4376 convenience in calculations with @code{void *} pointers and pointers
4377 to functions.  In C++, warn also when an arithmetic operation involves
4378 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4380 @item -Wtype-limits
4381 @opindex Wtype-limits
4382 @opindex Wno-type-limits
4383 Warn if a comparison is always true or always false due to the limited
4384 range of the data type, but do not warn for constant expressions.  For
4385 example, warn if an unsigned variable is compared against zero with
4386 @samp{<} or @samp{>=}.  This warning is also enabled by
4387 @option{-Wextra}.
4389 @item -Wbad-function-cast @r{(C and Objective-C only)}
4390 @opindex Wbad-function-cast
4391 @opindex Wno-bad-function-cast
4392 Warn whenever a function call is cast to a non-matching type.
4393 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4395 @item -Wc++-compat @r{(C and Objective-C only)}
4396 Warn about ISO C constructs that are outside of the common subset of
4397 ISO C and ISO C++, e.g.@: request for implicit conversion from
4398 @code{void *} to a pointer to non-@code{void} type.
4400 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4401 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4402 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4403 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4404 enabled by @option{-Wall}.
4406 @item -Wcast-qual
4407 @opindex Wcast-qual
4408 @opindex Wno-cast-qual
4409 Warn whenever a pointer is cast so as to remove a type qualifier from
4410 the target type.  For example, warn if a @code{const char *} is cast
4411 to an ordinary @code{char *}.
4413 Also warn when making a cast that introduces a type qualifier in an
4414 unsafe way.  For example, casting @code{char **} to @code{const char **}
4415 is unsafe, as in this example:
4417 @smallexample
4418   /* p is char ** value.  */
4419   const char **q = (const char **) p;
4420   /* Assignment of readonly string to const char * is OK.  */
4421   *q = "string";
4422   /* Now char** pointer points to read-only memory.  */
4423   **p = 'b';
4424 @end smallexample
4426 @item -Wcast-align
4427 @opindex Wcast-align
4428 @opindex Wno-cast-align
4429 Warn whenever a pointer is cast such that the required alignment of the
4430 target is increased.  For example, warn if a @code{char *} is cast to
4431 an @code{int *} on machines where integers can only be accessed at
4432 two- or four-byte boundaries.
4434 @item -Wwrite-strings
4435 @opindex Wwrite-strings
4436 @opindex Wno-write-strings
4437 When compiling C, give string constants the type @code{const
4438 char[@var{length}]} so that copying the address of one into a
4439 non-@code{const} @code{char *} pointer produces a warning.  These
4440 warnings help you find at compile time code that can try to write
4441 into a string constant, but only if you have been very careful about
4442 using @code{const} in declarations and prototypes.  Otherwise, it is
4443 just a nuisance. This is why we did not make @option{-Wall} request
4444 these warnings.
4446 When compiling C++, warn about the deprecated conversion from string
4447 literals to @code{char *}.  This warning is enabled by default for C++
4448 programs.
4450 @item -Wclobbered
4451 @opindex Wclobbered
4452 @opindex Wno-clobbered
4453 Warn for variables that might be changed by @samp{longjmp} or
4454 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4456 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4457 @opindex Wconditionally-supported
4458 @opindex Wno-conditionally-supported
4459 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4461 @item -Wconversion
4462 @opindex Wconversion
4463 @opindex Wno-conversion
4464 Warn for implicit conversions that may alter a value. This includes
4465 conversions between real and integer, like @code{abs (x)} when
4466 @code{x} is @code{double}; conversions between signed and unsigned,
4467 like @code{unsigned ui = -1}; and conversions to smaller types, like
4468 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4469 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4470 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4471 conversions between signed and unsigned integers can be disabled by
4472 using @option{-Wno-sign-conversion}.
4474 For C++, also warn for confusing overload resolution for user-defined
4475 conversions; and conversions that never use a type conversion
4476 operator: conversions to @code{void}, the same type, a base class or a
4477 reference to them. Warnings about conversions between signed and
4478 unsigned integers are disabled by default in C++ unless
4479 @option{-Wsign-conversion} is explicitly enabled.
4481 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4482 @opindex Wconversion-null
4483 @opindex Wno-conversion-null
4484 Do not warn for conversions between @code{NULL} and non-pointer
4485 types. @option{-Wconversion-null} is enabled by default.
4487 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4488 @opindex Wzero-as-null-pointer-constant
4489 @opindex Wno-zero-as-null-pointer-constant
4490 Warn when a literal '0' is used as null pointer constant.  This can
4491 be useful to facilitate the conversion to @code{nullptr} in C++11.
4493 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4494 @opindex Wuseless-cast
4495 @opindex Wno-useless-cast
4496 Warn when an expression is casted to its own type.
4498 @item -Wempty-body
4499 @opindex Wempty-body
4500 @opindex Wno-empty-body
4501 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4502 while} statement.  This warning is also enabled by @option{-Wextra}.
4504 @item -Wenum-compare
4505 @opindex Wenum-compare
4506 @opindex Wno-enum-compare
4507 Warn about a comparison between values of different enumerated types.
4508 In C++ enumeral mismatches in conditional expressions are also
4509 diagnosed and the warning is enabled by default.  In C this warning is 
4510 enabled by @option{-Wall}.
4512 @item -Wjump-misses-init @r{(C, Objective-C only)}
4513 @opindex Wjump-misses-init
4514 @opindex Wno-jump-misses-init
4515 Warn if a @code{goto} statement or a @code{switch} statement jumps
4516 forward across the initialization of a variable, or jumps backward to a
4517 label after the variable has been initialized.  This only warns about
4518 variables that are initialized when they are declared.  This warning is
4519 only supported for C and Objective-C; in C++ this sort of branch is an
4520 error in any case.
4522 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4523 can be disabled with the @option{-Wno-jump-misses-init} option.
4525 @item -Wsign-compare
4526 @opindex Wsign-compare
4527 @opindex Wno-sign-compare
4528 @cindex warning for comparison of signed and unsigned values
4529 @cindex comparison of signed and unsigned values, warning
4530 @cindex signed and unsigned values, comparison warning
4531 Warn when a comparison between signed and unsigned values could produce
4532 an incorrect result when the signed value is converted to unsigned.
4533 This warning is also enabled by @option{-Wextra}; to get the other warnings
4534 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4536 @item -Wsign-conversion
4537 @opindex Wsign-conversion
4538 @opindex Wno-sign-conversion
4539 Warn for implicit conversions that may change the sign of an integer
4540 value, like assigning a signed integer expression to an unsigned
4541 integer variable. An explicit cast silences the warning. In C, this
4542 option is enabled also by @option{-Wconversion}.
4544 @item -Wsizeof-pointer-memaccess
4545 @opindex Wsizeof-pointer-memaccess
4546 @opindex Wno-sizeof-pointer-memaccess
4547 Warn for suspicious length parameters to certain string and memory built-in
4548 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4549 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4550 but a pointer, and suggests a possible fix, or about
4551 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4552 @option{-Wall}.
4554 @item -Waddress
4555 @opindex Waddress
4556 @opindex Wno-address
4557 Warn about suspicious uses of memory addresses. These include using
4558 the address of a function in a conditional expression, such as
4559 @code{void func(void); if (func)}, and comparisons against the memory
4560 address of a string literal, such as @code{if (x == "abc")}.  Such
4561 uses typically indicate a programmer error: the address of a function
4562 always evaluates to true, so their use in a conditional usually
4563 indicate that the programmer forgot the parentheses in a function
4564 call; and comparisons against string literals result in unspecified
4565 behavior and are not portable in C, so they usually indicate that the
4566 programmer intended to use @code{strcmp}.  This warning is enabled by
4567 @option{-Wall}.
4569 @item -Wlogical-op
4570 @opindex Wlogical-op
4571 @opindex Wno-logical-op
4572 Warn about suspicious uses of logical operators in expressions.
4573 This includes using logical operators in contexts where a
4574 bit-wise operator is likely to be expected.
4576 @item -Waggregate-return
4577 @opindex Waggregate-return
4578 @opindex Wno-aggregate-return
4579 Warn if any functions that return structures or unions are defined or
4580 called.  (In languages where you can return an array, this also elicits
4581 a warning.)
4583 @item -Wno-aggressive-loop-optimizations
4584 @opindex Wno-aggressive-loop-optimizations
4585 @opindex Waggressive-loop-optimizations
4586 Warn if in a loop with constant number of iterations the compiler detects
4587 undefined behavior in some statement during one or more of the iterations.
4589 @item -Wno-attributes
4590 @opindex Wno-attributes
4591 @opindex Wattributes
4592 Do not warn if an unexpected @code{__attribute__} is used, such as
4593 unrecognized attributes, function attributes applied to variables,
4594 etc.  This does not stop errors for incorrect use of supported
4595 attributes.
4597 @item -Wno-builtin-macro-redefined
4598 @opindex Wno-builtin-macro-redefined
4599 @opindex Wbuiltin-macro-redefined
4600 Do not warn if certain built-in macros are redefined.  This suppresses
4601 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4602 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4604 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4605 @opindex Wstrict-prototypes
4606 @opindex Wno-strict-prototypes
4607 Warn if a function is declared or defined without specifying the
4608 argument types.  (An old-style function definition is permitted without
4609 a warning if preceded by a declaration that specifies the argument
4610 types.)
4612 @item -Wold-style-declaration @r{(C and Objective-C only)}
4613 @opindex Wold-style-declaration
4614 @opindex Wno-old-style-declaration
4615 Warn for obsolescent usages, according to the C Standard, in a
4616 declaration. For example, warn if storage-class specifiers like
4617 @code{static} are not the first things in a declaration.  This warning
4618 is also enabled by @option{-Wextra}.
4620 @item -Wold-style-definition @r{(C and Objective-C only)}
4621 @opindex Wold-style-definition
4622 @opindex Wno-old-style-definition
4623 Warn if an old-style function definition is used.  A warning is given
4624 even if there is a previous prototype.
4626 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4627 @opindex Wmissing-parameter-type
4628 @opindex Wno-missing-parameter-type
4629 A function parameter is declared without a type specifier in K&R-style
4630 functions:
4632 @smallexample
4633 void foo(bar) @{ @}
4634 @end smallexample
4636 This warning is also enabled by @option{-Wextra}.
4638 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4639 @opindex Wmissing-prototypes
4640 @opindex Wno-missing-prototypes
4641 Warn if a global function is defined without a previous prototype
4642 declaration.  This warning is issued even if the definition itself
4643 provides a prototype.  Use this option to detect global functions
4644 that do not have a matching prototype declaration in a header file.
4645 This option is not valid for C++ because all function declarations
4646 provide prototypes and a non-matching declaration will declare an
4647 overload rather than conflict with an earlier declaration.
4648 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4650 @item -Wmissing-declarations
4651 @opindex Wmissing-declarations
4652 @opindex Wno-missing-declarations
4653 Warn if a global function is defined without a previous declaration.
4654 Do so even if the definition itself provides a prototype.
4655 Use this option to detect global functions that are not declared in
4656 header files.  In C, no warnings are issued for functions with previous
4657 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4658 missing prototypes.  In C++, no warnings are issued for function templates,
4659 or for inline functions, or for functions in anonymous namespaces.
4661 @item -Wmissing-field-initializers
4662 @opindex Wmissing-field-initializers
4663 @opindex Wno-missing-field-initializers
4664 @opindex W
4665 @opindex Wextra
4666 @opindex Wno-extra
4667 Warn if a structure's initializer has some fields missing.  For
4668 example, the following code causes such a warning, because
4669 @code{x.h} is implicitly zero:
4671 @smallexample
4672 struct s @{ int f, g, h; @};
4673 struct s x = @{ 3, 4 @};
4674 @end smallexample
4676 This option does not warn about designated initializers, so the following
4677 modification does not trigger a warning:
4679 @smallexample
4680 struct s @{ int f, g, h; @};
4681 struct s x = @{ .f = 3, .g = 4 @};
4682 @end smallexample
4684 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4685 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4687 @item -Wno-multichar
4688 @opindex Wno-multichar
4689 @opindex Wmultichar
4690 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4691 Usually they indicate a typo in the user's code, as they have
4692 implementation-defined values, and should not be used in portable code.
4694 @item -Wnormalized=<none|id|nfc|nfkc>
4695 @opindex Wnormalized=
4696 @cindex NFC
4697 @cindex NFKC
4698 @cindex character set, input normalization
4699 In ISO C and ISO C++, two identifiers are different if they are
4700 different sequences of characters.  However, sometimes when characters
4701 outside the basic ASCII character set are used, you can have two
4702 different character sequences that look the same.  To avoid confusion,
4703 the ISO 10646 standard sets out some @dfn{normalization rules} which
4704 when applied ensure that two sequences that look the same are turned into
4705 the same sequence.  GCC can warn you if you are using identifiers that
4706 have not been normalized; this option controls that warning.
4708 There are four levels of warning supported by GCC@.  The default is
4709 @option{-Wnormalized=nfc}, which warns about any identifier that is
4710 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4711 recommended form for most uses.
4713 Unfortunately, there are some characters allowed in identifiers by
4714 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4715 identifiers.  That is, there's no way to use these symbols in portable
4716 ISO C or C++ and have all your identifiers in NFC@.
4717 @option{-Wnormalized=id} suppresses the warning for these characters.
4718 It is hoped that future versions of the standards involved will correct
4719 this, which is why this option is not the default.
4721 You can switch the warning off for all characters by writing
4722 @option{-Wnormalized=none}.  You should only do this if you
4723 are using some other normalization scheme (like ``D''), because
4724 otherwise you can easily create bugs that are literally impossible to see.
4726 Some characters in ISO 10646 have distinct meanings but look identical
4727 in some fonts or display methodologies, especially once formatting has
4728 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4729 LETTER N'', displays just like a regular @code{n} that has been
4730 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4731 normalization scheme to convert all these into a standard form as
4732 well, and GCC warns if your code is not in NFKC if you use
4733 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4734 about every identifier that contains the letter O because it might be
4735 confused with the digit 0, and so is not the default, but may be
4736 useful as a local coding convention if the programming environment 
4737 cannot be fixed to display these characters distinctly.
4739 @item -Wno-deprecated
4740 @opindex Wno-deprecated
4741 @opindex Wdeprecated
4742 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4744 @item -Wno-deprecated-declarations
4745 @opindex Wno-deprecated-declarations
4746 @opindex Wdeprecated-declarations
4747 Do not warn about uses of functions (@pxref{Function Attributes}),
4748 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4749 Attributes}) marked as deprecated by using the @code{deprecated}
4750 attribute.
4752 @item -Wno-overflow
4753 @opindex Wno-overflow
4754 @opindex Woverflow
4755 Do not warn about compile-time overflow in constant expressions.
4757 @item -Woverride-init @r{(C and Objective-C only)}
4758 @opindex Woverride-init
4759 @opindex Wno-override-init
4760 @opindex W
4761 @opindex Wextra
4762 @opindex Wno-extra
4763 Warn if an initialized field without side effects is overridden when
4764 using designated initializers (@pxref{Designated Inits, , Designated
4765 Initializers}).
4767 This warning is included in @option{-Wextra}.  To get other
4768 @option{-Wextra} warnings without this one, use @option{-Wextra
4769 -Wno-override-init}.
4771 @item -Wpacked
4772 @opindex Wpacked
4773 @opindex Wno-packed
4774 Warn if a structure is given the packed attribute, but the packed
4775 attribute has no effect on the layout or size of the structure.
4776 Such structures may be mis-aligned for little benefit.  For
4777 instance, in this code, the variable @code{f.x} in @code{struct bar}
4778 is misaligned even though @code{struct bar} does not itself
4779 have the packed attribute:
4781 @smallexample
4782 @group
4783 struct foo @{
4784   int x;
4785   char a, b, c, d;
4786 @} __attribute__((packed));
4787 struct bar @{
4788   char z;
4789   struct foo f;
4791 @end group
4792 @end smallexample
4794 @item -Wpacked-bitfield-compat
4795 @opindex Wpacked-bitfield-compat
4796 @opindex Wno-packed-bitfield-compat
4797 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4798 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4799 the change can lead to differences in the structure layout.  GCC
4800 informs you when the offset of such a field has changed in GCC 4.4.
4801 For example there is no longer a 4-bit padding between field @code{a}
4802 and @code{b} in this structure:
4804 @smallexample
4805 struct foo
4807   char a:4;
4808   char b:8;
4809 @} __attribute__ ((packed));
4810 @end smallexample
4812 This warning is enabled by default.  Use
4813 @option{-Wno-packed-bitfield-compat} to disable this warning.
4815 @item -Wpadded
4816 @opindex Wpadded
4817 @opindex Wno-padded
4818 Warn if padding is included in a structure, either to align an element
4819 of the structure or to align the whole structure.  Sometimes when this
4820 happens it is possible to rearrange the fields of the structure to
4821 reduce the padding and so make the structure smaller.
4823 @item -Wredundant-decls
4824 @opindex Wredundant-decls
4825 @opindex Wno-redundant-decls
4826 Warn if anything is declared more than once in the same scope, even in
4827 cases where multiple declaration is valid and changes nothing.
4829 @item -Wnested-externs @r{(C and Objective-C only)}
4830 @opindex Wnested-externs
4831 @opindex Wno-nested-externs
4832 Warn if an @code{extern} declaration is encountered within a function.
4834 @item -Wno-inherited-variadic-ctor
4835 @opindex Winherited-variadic-ctor
4836 @opindex Wno-inherited-variadic-ctor
4837 Suppress warnings about use of C++11 inheriting constructors when the
4838 base class inherited from has a C variadic constructor; the warning is
4839 on by default because the ellipsis is not inherited.
4841 @item -Winline
4842 @opindex Winline
4843 @opindex Wno-inline
4844 Warn if a function that is declared as inline cannot be inlined.
4845 Even with this option, the compiler does not warn about failures to
4846 inline functions declared in system headers.
4848 The compiler uses a variety of heuristics to determine whether or not
4849 to inline a function.  For example, the compiler takes into account
4850 the size of the function being inlined and the amount of inlining
4851 that has already been done in the current function.  Therefore,
4852 seemingly insignificant changes in the source program can cause the
4853 warnings produced by @option{-Winline} to appear or disappear.
4855 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4856 @opindex Wno-invalid-offsetof
4857 @opindex Winvalid-offsetof
4858 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4859 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4860 to a non-POD type is undefined.  In existing C++ implementations,
4861 however, @samp{offsetof} typically gives meaningful results even when
4862 applied to certain kinds of non-POD types (such as a simple
4863 @samp{struct} that fails to be a POD type only by virtue of having a
4864 constructor).  This flag is for users who are aware that they are
4865 writing nonportable code and who have deliberately chosen to ignore the
4866 warning about it.
4868 The restrictions on @samp{offsetof} may be relaxed in a future version
4869 of the C++ standard.
4871 @item -Wno-int-to-pointer-cast
4872 @opindex Wno-int-to-pointer-cast
4873 @opindex Wint-to-pointer-cast
4874 Suppress warnings from casts to pointer type of an integer of a
4875 different size. In C++, casting to a pointer type of smaller size is
4876 an error. @option{Wint-to-pointer-cast} is enabled by default.
4879 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4880 @opindex Wno-pointer-to-int-cast
4881 @opindex Wpointer-to-int-cast
4882 Suppress warnings from casts from a pointer to an integer type of a
4883 different size.
4885 @item -Winvalid-pch
4886 @opindex Winvalid-pch
4887 @opindex Wno-invalid-pch
4888 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4889 the search path but can't be used.
4891 @item -Wlong-long
4892 @opindex Wlong-long
4893 @opindex Wno-long-long
4894 Warn if @samp{long long} type is used.  This is enabled by either
4895 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4896 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4898 @item -Wvariadic-macros
4899 @opindex Wvariadic-macros
4900 @opindex Wno-variadic-macros
4901 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4902 alternate syntax when in pedantic ISO C99 mode.  This is default.
4903 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4905 @item -Wvarargs
4906 @opindex Wvarargs
4907 @opindex Wno-varargs
4908 Warn upon questionable usage of the macros used to handle variable
4909 arguments like @samp{va_start}.  This is default.  To inhibit the
4910 warning messages, use @option{-Wno-varargs}.
4912 @item -Wvector-operation-performance
4913 @opindex Wvector-operation-performance
4914 @opindex Wno-vector-operation-performance
4915 Warn if vector operation is not implemented via SIMD capabilities of the
4916 architecture.  Mainly useful for the performance tuning.
4917 Vector operation can be implemented @code{piecewise}, which means that the
4918 scalar operation is performed on every vector element; 
4919 @code{in parallel}, which means that the vector operation is implemented
4920 using scalars of wider type, which normally is more performance efficient;
4921 and @code{as a single scalar}, which means that vector fits into a
4922 scalar type.
4924 @item -Wno-virtual-move-assign
4925 @opindex Wvirtual-move-assign
4926 @opindex Wno-virtual-move-assign
4927 Suppress warnings about inheriting from a virtual base with a
4928 non-trivial C++11 move assignment operator.  This is dangerous because
4929 if the virtual base is reachable along more than one path, it will be
4930 moved multiple times, which can mean both objects end up in the
4931 moved-from state.  If the move assignment operator is written to avoid
4932 moving from a moved-from object, this warning can be disabled.
4934 @item -Wvla
4935 @opindex Wvla
4936 @opindex Wno-vla
4937 Warn if variable length array is used in the code.
4938 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4939 the variable length array.
4941 @item -Wvolatile-register-var
4942 @opindex Wvolatile-register-var
4943 @opindex Wno-volatile-register-var
4944 Warn if a register variable is declared volatile.  The volatile
4945 modifier does not inhibit all optimizations that may eliminate reads
4946 and/or writes to register variables.  This warning is enabled by
4947 @option{-Wall}.
4949 @item -Wdisabled-optimization
4950 @opindex Wdisabled-optimization
4951 @opindex Wno-disabled-optimization
4952 Warn if a requested optimization pass is disabled.  This warning does
4953 not generally indicate that there is anything wrong with your code; it
4954 merely indicates that GCC's optimizers are unable to handle the code
4955 effectively.  Often, the problem is that your code is too big or too
4956 complex; GCC refuses to optimize programs when the optimization
4957 itself is likely to take inordinate amounts of time.
4959 @item -Wpointer-sign @r{(C and Objective-C only)}
4960 @opindex Wpointer-sign
4961 @opindex Wno-pointer-sign
4962 Warn for pointer argument passing or assignment with different signedness.
4963 This option is only supported for C and Objective-C@.  It is implied by
4964 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4965 @option{-Wno-pointer-sign}.
4967 @item -Wstack-protector
4968 @opindex Wstack-protector
4969 @opindex Wno-stack-protector
4970 This option is only active when @option{-fstack-protector} is active.  It
4971 warns about functions that are not protected against stack smashing.
4973 @item -Wno-mudflap
4974 @opindex Wno-mudflap
4975 Suppress warnings about constructs that cannot be instrumented by
4976 @option{-fmudflap}.
4978 @item -Woverlength-strings
4979 @opindex Woverlength-strings
4980 @opindex Wno-overlength-strings
4981 Warn about string constants that are longer than the ``minimum
4982 maximum'' length specified in the C standard.  Modern compilers
4983 generally allow string constants that are much longer than the
4984 standard's minimum limit, but very portable programs should avoid
4985 using longer strings.
4987 The limit applies @emph{after} string constant concatenation, and does
4988 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4989 C99, it was raised to 4095.  C++98 does not specify a normative
4990 minimum maximum, so we do not diagnose overlength strings in C++@.
4992 This option is implied by @option{-Wpedantic}, and can be disabled with
4993 @option{-Wno-overlength-strings}.
4995 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4996 @opindex Wunsuffixed-float-constants
4998 Issue a warning for any floating constant that does not have
4999 a suffix.  When used together with @option{-Wsystem-headers} it
5000 warns about such constants in system header files.  This can be useful
5001 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5002 from the decimal floating-point extension to C99.
5003 @end table
5005 @node Debugging Options
5006 @section Options for Debugging Your Program or GCC
5007 @cindex options, debugging
5008 @cindex debugging information options
5010 GCC has various special options that are used for debugging
5011 either your program or GCC:
5013 @table @gcctabopt
5014 @item -g
5015 @opindex g
5016 Produce debugging information in the operating system's native format
5017 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5018 information.
5020 On most systems that use stabs format, @option{-g} enables use of extra
5021 debugging information that only GDB can use; this extra information
5022 makes debugging work better in GDB but probably makes other debuggers
5023 crash or
5024 refuse to read the program.  If you want to control for certain whether
5025 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5026 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5028 GCC allows you to use @option{-g} with
5029 @option{-O}.  The shortcuts taken by optimized code may occasionally
5030 produce surprising results: some variables you declared may not exist
5031 at all; flow of control may briefly move where you did not expect it;
5032 some statements may not be executed because they compute constant
5033 results or their values are already at hand; some statements may
5034 execute in different places because they have been moved out of loops.
5036 Nevertheless it proves possible to debug optimized output.  This makes
5037 it reasonable to use the optimizer for programs that might have bugs.
5039 The following options are useful when GCC is generated with the
5040 capability for more than one debugging format.
5042 @item -gsplit-dwarf
5043 @opindex gsplit-dwarf
5044 Separate as much dwarf debugging information as possible into a
5045 separate output file with the extension .dwo.  This option allows
5046 the build system to avoid linking files with debug information.  To
5047 be useful, this option requires a debugger capable of reading .dwo
5048 files.
5050 @item -ggdb
5051 @opindex ggdb
5052 Produce debugging information for use by GDB@.  This means to use the
5053 most expressive format available (DWARF 2, stabs, or the native format
5054 if neither of those are supported), including GDB extensions if at all
5055 possible.
5057 @item -gpubnames
5058 @opindex gpubnames
5059 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5061 @item -gstabs
5062 @opindex gstabs
5063 Produce debugging information in stabs format (if that is supported),
5064 without GDB extensions.  This is the format used by DBX on most BSD
5065 systems.  On MIPS, Alpha and System V Release 4 systems this option
5066 produces stabs debugging output that is not understood by DBX or SDB@.
5067 On System V Release 4 systems this option requires the GNU assembler.
5069 @item -feliminate-unused-debug-symbols
5070 @opindex feliminate-unused-debug-symbols
5071 Produce debugging information in stabs format (if that is supported),
5072 for only symbols that are actually used.
5074 @item -femit-class-debug-always
5075 Instead of emitting debugging information for a C++ class in only one
5076 object file, emit it in all object files using the class.  This option
5077 should be used only with debuggers that are unable to handle the way GCC
5078 normally emits debugging information for classes because using this
5079 option increases the size of debugging information by as much as a
5080 factor of two.
5082 @item -fdebug-types-section
5083 @opindex fdebug-types-section
5084 @opindex fno-debug-types-section
5085 When using DWARF Version 4 or higher, type DIEs can be put into
5086 their own @code{.debug_types} section instead of making them part of the
5087 @code{.debug_info} section.  It is more efficient to put them in a separate
5088 comdat sections since the linker can then remove duplicates.
5089 But not all DWARF consumers support @code{.debug_types} sections yet
5090 and on some objects @code{.debug_types} produces larger instead of smaller
5091 debugging information.
5093 @item -gstabs+
5094 @opindex gstabs+
5095 Produce debugging information in stabs format (if that is supported),
5096 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5097 use of these extensions is likely to make other debuggers crash or
5098 refuse to read the program.
5100 @item -gcoff
5101 @opindex gcoff
5102 Produce debugging information in COFF format (if that is supported).
5103 This is the format used by SDB on most System V systems prior to
5104 System V Release 4.
5106 @item -gxcoff
5107 @opindex gxcoff
5108 Produce debugging information in XCOFF format (if that is supported).
5109 This is the format used by the DBX debugger on IBM RS/6000 systems.
5111 @item -gxcoff+
5112 @opindex gxcoff+
5113 Produce debugging information in XCOFF format (if that is supported),
5114 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5115 use of these extensions is likely to make other debuggers crash or
5116 refuse to read the program, and may cause assemblers other than the GNU
5117 assembler (GAS) to fail with an error.
5119 @item -gdwarf-@var{version}
5120 @opindex gdwarf-@var{version}
5121 Produce debugging information in DWARF format (if that is supported).
5122 The value of @var{version} may be either 2, 3 or 4; the default version
5123 for most targets is 4.
5125 Note that with DWARF Version 2, some ports require and always
5126 use some non-conflicting DWARF 3 extensions in the unwind tables.
5128 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5129 for maximum benefit.
5131 @item -grecord-gcc-switches
5132 @opindex grecord-gcc-switches
5133 This switch causes the command-line options used to invoke the
5134 compiler that may affect code generation to be appended to the
5135 DW_AT_producer attribute in DWARF debugging information.  The options
5136 are concatenated with spaces separating them from each other and from
5137 the compiler version.  See also @option{-frecord-gcc-switches} for another
5138 way of storing compiler options into the object file.  This is the default.
5140 @item -gno-record-gcc-switches
5141 @opindex gno-record-gcc-switches
5142 Disallow appending command-line options to the DW_AT_producer attribute
5143 in DWARF debugging information.
5145 @item -gstrict-dwarf
5146 @opindex gstrict-dwarf
5147 Disallow using extensions of later DWARF standard version than selected
5148 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5149 DWARF extensions from later standard versions is allowed.
5151 @item -gno-strict-dwarf
5152 @opindex gno-strict-dwarf
5153 Allow using extensions of later DWARF standard version than selected with
5154 @option{-gdwarf-@var{version}}.
5156 @item -gvms
5157 @opindex gvms
5158 Produce debugging information in Alpha/VMS debug format (if that is
5159 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5161 @item -g@var{level}
5162 @itemx -ggdb@var{level}
5163 @itemx -gstabs@var{level}
5164 @itemx -gcoff@var{level}
5165 @itemx -gxcoff@var{level}
5166 @itemx -gvms@var{level}
5167 Request debugging information and also use @var{level} to specify how
5168 much information.  The default level is 2.
5170 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5171 @option{-g}.
5173 Level 1 produces minimal information, enough for making backtraces in
5174 parts of the program that you don't plan to debug.  This includes
5175 descriptions of functions and external variables, but no information
5176 about local variables and no line numbers.
5178 Level 3 includes extra information, such as all the macro definitions
5179 present in the program.  Some debuggers support macro expansion when
5180 you use @option{-g3}.
5182 @option{-gdwarf-2} does not accept a concatenated debug level, because
5183 GCC used to support an option @option{-gdwarf} that meant to generate
5184 debug information in version 1 of the DWARF format (which is very
5185 different from version 2), and it would have been too confusing.  That
5186 debug format is long obsolete, but the option cannot be changed now.
5187 Instead use an additional @option{-g@var{level}} option to change the
5188 debug level for DWARF.
5190 @item -gtoggle
5191 @opindex gtoggle
5192 Turn off generation of debug info, if leaving out this option
5193 generates it, or turn it on at level 2 otherwise.  The position of this
5194 argument in the command line does not matter; it takes effect after all
5195 other options are processed, and it does so only once, no matter how
5196 many times it is given.  This is mainly intended to be used with
5197 @option{-fcompare-debug}.
5199 @item -fsanitize=address
5200 Enable AddressSanitizer, a fast memory error detector.
5201 Memory access instructions will be instrumented to detect
5202 out-of-bounds and use-after-free bugs.
5203 See @uref{http://code.google.com/p/address-sanitizer/} for more details.
5205 @item -fsanitize=thread
5206 Enable ThreadSanitizer, a fast data race detector.
5207 Memory access instructions will be instrumented to detect
5208 data race bugs.
5209 See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for more details.
5211 @item -fsanitize=undefined
5212 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector
5213 Various computations will be instrumented to detect undefined behavior
5214 at runtime, e.g.@: division by zero or various overflows.
5215 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5216 @option{-fsanitize=undefined} gives a diagnostic message.
5217 This currently works only for the C family of languages.
5219 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5220 @opindex fdump-final-insns
5221 Dump the final internal representation (RTL) to @var{file}.  If the
5222 optional argument is omitted (or if @var{file} is @code{.}), the name
5223 of the dump file is determined by appending @code{.gkd} to the
5224 compilation output file name.
5226 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5227 @opindex fcompare-debug
5228 @opindex fno-compare-debug
5229 If no error occurs during compilation, run the compiler a second time,
5230 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5231 passed to the second compilation.  Dump the final internal
5232 representation in both compilations, and print an error if they differ.
5234 If the equal sign is omitted, the default @option{-gtoggle} is used.
5236 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5237 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5238 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5239 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5240 is used.
5242 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5243 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5244 of the final representation and the second compilation, preventing even
5245 @env{GCC_COMPARE_DEBUG} from taking effect.
5247 To verify full coverage during @option{-fcompare-debug} testing, set
5248 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5249 which GCC rejects as an invalid option in any actual compilation
5250 (rather than preprocessing, assembly or linking).  To get just a
5251 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5252 not overridden} will do.
5254 @item -fcompare-debug-second
5255 @opindex fcompare-debug-second
5256 This option is implicitly passed to the compiler for the second
5257 compilation requested by @option{-fcompare-debug}, along with options to
5258 silence warnings, and omitting other options that would cause
5259 side-effect compiler outputs to files or to the standard output.  Dump
5260 files and preserved temporary files are renamed so as to contain the
5261 @code{.gk} additional extension during the second compilation, to avoid
5262 overwriting those generated by the first.
5264 When this option is passed to the compiler driver, it causes the
5265 @emph{first} compilation to be skipped, which makes it useful for little
5266 other than debugging the compiler proper.
5268 @item -feliminate-dwarf2-dups
5269 @opindex feliminate-dwarf2-dups
5270 Compress DWARF 2 debugging information by eliminating duplicated
5271 information about each symbol.  This option only makes sense when
5272 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5274 @item -femit-struct-debug-baseonly
5275 Emit debug information for struct-like types
5276 only when the base name of the compilation source file
5277 matches the base name of file in which the struct is defined.
5279 This option substantially reduces the size of debugging information,
5280 but at significant potential loss in type information to the debugger.
5281 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5282 See @option{-femit-struct-debug-detailed} for more detailed control.
5284 This option works only with DWARF 2.
5286 @item -femit-struct-debug-reduced
5287 Emit debug information for struct-like types
5288 only when the base name of the compilation source file
5289 matches the base name of file in which the type is defined,
5290 unless the struct is a template or defined in a system header.
5292 This option significantly reduces the size of debugging information,
5293 with some potential loss in type information to the debugger.
5294 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5295 See @option{-femit-struct-debug-detailed} for more detailed control.
5297 This option works only with DWARF 2.
5299 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5300 Specify the struct-like types
5301 for which the compiler generates debug information.
5302 The intent is to reduce duplicate struct debug information
5303 between different object files within the same program.
5305 This option is a detailed version of
5306 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5307 which serves for most needs.
5309 A specification has the syntax@*
5310 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5312 The optional first word limits the specification to
5313 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5314 A struct type is used directly when it is the type of a variable, member.
5315 Indirect uses arise through pointers to structs.
5316 That is, when use of an incomplete struct is valid, the use is indirect.
5317 An example is
5318 @samp{struct one direct; struct two * indirect;}.
5320 The optional second word limits the specification to
5321 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5322 Generic structs are a bit complicated to explain.
5323 For C++, these are non-explicit specializations of template classes,
5324 or non-template classes within the above.
5325 Other programming languages have generics,
5326 but @option{-femit-struct-debug-detailed} does not yet implement them.
5328 The third word specifies the source files for those
5329 structs for which the compiler should emit debug information.
5330 The values @samp{none} and @samp{any} have the normal meaning.
5331 The value @samp{base} means that
5332 the base of name of the file in which the type declaration appears
5333 must match the base of the name of the main compilation file.
5334 In practice, this means that when compiling @file{foo.c}, debug information
5335 is generated for types declared in that file and @file{foo.h},
5336 but not other header files.
5337 The value @samp{sys} means those types satisfying @samp{base}
5338 or declared in system or compiler headers.
5340 You may need to experiment to determine the best settings for your application.
5342 The default is @option{-femit-struct-debug-detailed=all}.
5344 This option works only with DWARF 2.
5346 @item -fno-merge-debug-strings
5347 @opindex fmerge-debug-strings
5348 @opindex fno-merge-debug-strings
5349 Direct the linker to not merge together strings in the debugging
5350 information that are identical in different object files.  Merging is
5351 not supported by all assemblers or linkers.  Merging decreases the size
5352 of the debug information in the output file at the cost of increasing
5353 link processing time.  Merging is enabled by default.
5355 @item -fdebug-prefix-map=@var{old}=@var{new}
5356 @opindex fdebug-prefix-map
5357 When compiling files in directory @file{@var{old}}, record debugging
5358 information describing them as in @file{@var{new}} instead.
5360 @item -fno-dwarf2-cfi-asm
5361 @opindex fdwarf2-cfi-asm
5362 @opindex fno-dwarf2-cfi-asm
5363 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5364 instead of using GAS @code{.cfi_*} directives.
5366 @cindex @command{prof}
5367 @item -p
5368 @opindex p
5369 Generate extra code to write profile information suitable for the
5370 analysis program @command{prof}.  You must use this option when compiling
5371 the source files you want data about, and you must also use it when
5372 linking.
5374 @cindex @command{gprof}
5375 @item -pg
5376 @opindex pg
5377 Generate extra code to write profile information suitable for the
5378 analysis program @command{gprof}.  You must use this option when compiling
5379 the source files you want data about, and you must also use it when
5380 linking.
5382 @item -Q
5383 @opindex Q
5384 Makes the compiler print out each function name as it is compiled, and
5385 print some statistics about each pass when it finishes.
5387 @item -ftime-report
5388 @opindex ftime-report
5389 Makes the compiler print some statistics about the time consumed by each
5390 pass when it finishes.
5392 @item -fmem-report
5393 @opindex fmem-report
5394 Makes the compiler print some statistics about permanent memory
5395 allocation when it finishes.
5397 @item -fmem-report-wpa
5398 @opindex fmem-report-wpa
5399 Makes the compiler print some statistics about permanent memory
5400 allocation for the WPA phase only.
5402 @item -fpre-ipa-mem-report
5403 @opindex fpre-ipa-mem-report
5404 @item -fpost-ipa-mem-report
5405 @opindex fpost-ipa-mem-report
5406 Makes the compiler print some statistics about permanent memory
5407 allocation before or after interprocedural optimization.
5409 @item -fprofile-report
5410 @opindex fprofile-report
5411 Makes the compiler print some statistics about consistency of the
5412 (estimated) profile and effect of individual passes.
5414 @item -fstack-usage
5415 @opindex fstack-usage
5416 Makes the compiler output stack usage information for the program, on a
5417 per-function basis.  The filename for the dump is made by appending
5418 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5419 the output file, if explicitly specified and it is not an executable,
5420 otherwise it is the basename of the source file.  An entry is made up
5421 of three fields:
5423 @itemize
5424 @item
5425 The name of the function.
5426 @item
5427 A number of bytes.
5428 @item
5429 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5430 @end itemize
5432 The qualifier @code{static} means that the function manipulates the stack
5433 statically: a fixed number of bytes are allocated for the frame on function
5434 entry and released on function exit; no stack adjustments are otherwise made
5435 in the function.  The second field is this fixed number of bytes.
5437 The qualifier @code{dynamic} means that the function manipulates the stack
5438 dynamically: in addition to the static allocation described above, stack
5439 adjustments are made in the body of the function, for example to push/pop
5440 arguments around function calls.  If the qualifier @code{bounded} is also
5441 present, the amount of these adjustments is bounded at compile time and
5442 the second field is an upper bound of the total amount of stack used by
5443 the function.  If it is not present, the amount of these adjustments is
5444 not bounded at compile time and the second field only represents the
5445 bounded part.
5447 @item -fprofile-arcs
5448 @opindex fprofile-arcs
5449 Add code so that program flow @dfn{arcs} are instrumented.  During
5450 execution the program records how many times each branch and call is
5451 executed and how many times it is taken or returns.  When the compiled
5452 program exits it saves this data to a file called
5453 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5454 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5455 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5456 @var{auxname} is generated from the name of the output file, if
5457 explicitly specified and it is not the final executable, otherwise it is
5458 the basename of the source file.  In both cases any suffix is removed
5459 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5460 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5461 @xref{Cross-profiling}.
5463 @cindex @command{gcov}
5464 @item --coverage
5465 @opindex coverage
5467 This option is used to compile and link code instrumented for coverage
5468 analysis.  The option is a synonym for @option{-fprofile-arcs}
5469 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5470 linking).  See the documentation for those options for more details.
5472 @itemize
5474 @item
5475 Compile the source files with @option{-fprofile-arcs} plus optimization
5476 and code generation options.  For test coverage analysis, use the
5477 additional @option{-ftest-coverage} option.  You do not need to profile
5478 every source file in a program.
5480 @item
5481 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5482 (the latter implies the former).
5484 @item
5485 Run the program on a representative workload to generate the arc profile
5486 information.  This may be repeated any number of times.  You can run
5487 concurrent instances of your program, and provided that the file system
5488 supports locking, the data files will be correctly updated.  Also
5489 @code{fork} calls are detected and correctly handled (double counting
5490 will not happen).
5492 @item
5493 For profile-directed optimizations, compile the source files again with
5494 the same optimization and code generation options plus
5495 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5496 Control Optimization}).
5498 @item
5499 For test coverage analysis, use @command{gcov} to produce human readable
5500 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5501 @command{gcov} documentation for further information.
5503 @end itemize
5505 With @option{-fprofile-arcs}, for each function of your program GCC
5506 creates a program flow graph, then finds a spanning tree for the graph.
5507 Only arcs that are not on the spanning tree have to be instrumented: the
5508 compiler adds code to count the number of times that these arcs are
5509 executed.  When an arc is the only exit or only entrance to a block, the
5510 instrumentation code can be added to the block; otherwise, a new basic
5511 block must be created to hold the instrumentation code.
5513 @need 2000
5514 @item -ftest-coverage
5515 @opindex ftest-coverage
5516 Produce a notes file that the @command{gcov} code-coverage utility
5517 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5518 show program coverage.  Each source file's note file is called
5519 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5520 above for a description of @var{auxname} and instructions on how to
5521 generate test coverage data.  Coverage data matches the source files
5522 more closely if you do not optimize.
5524 @item -fdbg-cnt-list
5525 @opindex fdbg-cnt-list
5526 Print the name and the counter upper bound for all debug counters.
5529 @item -fdbg-cnt=@var{counter-value-list}
5530 @opindex fdbg-cnt
5531 Set the internal debug counter upper bound.  @var{counter-value-list}
5532 is a comma-separated list of @var{name}:@var{value} pairs
5533 which sets the upper bound of each debug counter @var{name} to @var{value}.
5534 All debug counters have the initial upper bound of @code{UINT_MAX};
5535 thus @code{dbg_cnt()} returns true always unless the upper bound
5536 is set by this option.
5537 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5538 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5540 @item -fenable-@var{kind}-@var{pass}
5541 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5542 @opindex fdisable-
5543 @opindex fenable-
5545 This is a set of options that are used to explicitly disable/enable
5546 optimization passes.  These options are intended for use for debugging GCC.
5547 Compiler users should use regular options for enabling/disabling
5548 passes instead.
5550 @table @gcctabopt
5552 @item -fdisable-ipa-@var{pass}
5553 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5554 statically invoked in the compiler multiple times, the pass name should be
5555 appended with a sequential number starting from 1.
5557 @item -fdisable-rtl-@var{pass}
5558 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5559 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5560 statically invoked in the compiler multiple times, the pass name should be
5561 appended with a sequential number starting from 1.  @var{range-list} is a 
5562 comma-separated list of function ranges or assembler names.  Each range is a number
5563 pair separated by a colon.  The range is inclusive in both ends.  If the range
5564 is trivial, the number pair can be simplified as a single number.  If the
5565 function's call graph node's @var{uid} falls within one of the specified ranges,
5566 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5567 function header of a dump file, and the pass names can be dumped by using
5568 option @option{-fdump-passes}.
5570 @item -fdisable-tree-@var{pass}
5571 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5572 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5573 option arguments.
5575 @item -fenable-ipa-@var{pass}
5576 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5577 statically invoked in the compiler multiple times, the pass name should be
5578 appended with a sequential number starting from 1.
5580 @item -fenable-rtl-@var{pass}
5581 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5582 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5583 description and examples.
5585 @item -fenable-tree-@var{pass}
5586 @itemx -fenable-tree-@var{pass}=@var{range-list}
5587 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5588 of option arguments.
5590 @end table
5592 Here are some examples showing uses of these options.
5594 @smallexample
5596 # disable ccp1 for all functions
5597    -fdisable-tree-ccp1
5598 # disable complete unroll for function whose cgraph node uid is 1
5599    -fenable-tree-cunroll=1
5600 # disable gcse2 for functions at the following ranges [1,1],
5601 # [300,400], and [400,1000]
5602 # disable gcse2 for functions foo and foo2
5603    -fdisable-rtl-gcse2=foo,foo2
5604 # disable early inlining
5605    -fdisable-tree-einline
5606 # disable ipa inlining
5607    -fdisable-ipa-inline
5608 # enable tree full unroll
5609    -fenable-tree-unroll
5611 @end smallexample
5613 @item -d@var{letters}
5614 @itemx -fdump-rtl-@var{pass}
5615 @itemx -fdump-rtl-@var{pass}=@var{filename}
5616 @opindex d
5617 Says to make debugging dumps during compilation at times specified by
5618 @var{letters}.  This is used for debugging the RTL-based passes of the
5619 compiler.  The file names for most of the dumps are made by appending
5620 a pass number and a word to the @var{dumpname}, and the files are
5621 created in the directory of the output file. In case of
5622 @option{=@var{filename}} option, the dump is output on the given file
5623 instead of the pass numbered dump files. Note that the pass number is
5624 computed statically as passes get registered into the pass manager.
5625 Thus the numbering is not related to the dynamic order of execution of
5626 passes.  In particular, a pass installed by a plugin could have a
5627 number over 200 even if it executed quite early.  @var{dumpname} is
5628 generated from the name of the output file, if explicitly specified
5629 and it is not an executable, otherwise it is the basename of the
5630 source file. These switches may have different effects when
5631 @option{-E} is used for preprocessing.
5633 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5634 @option{-d} option @var{letters}.  Here are the possible
5635 letters for use in @var{pass} and @var{letters}, and their meanings:
5637 @table @gcctabopt
5639 @item -fdump-rtl-alignments
5640 @opindex fdump-rtl-alignments
5641 Dump after branch alignments have been computed.
5643 @item -fdump-rtl-asmcons
5644 @opindex fdump-rtl-asmcons
5645 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5647 @item -fdump-rtl-auto_inc_dec
5648 @opindex fdump-rtl-auto_inc_dec
5649 Dump after auto-inc-dec discovery.  This pass is only run on
5650 architectures that have auto inc or auto dec instructions.
5652 @item -fdump-rtl-barriers
5653 @opindex fdump-rtl-barriers
5654 Dump after cleaning up the barrier instructions.
5656 @item -fdump-rtl-bbpart
5657 @opindex fdump-rtl-bbpart
5658 Dump after partitioning hot and cold basic blocks.
5660 @item -fdump-rtl-bbro
5661 @opindex fdump-rtl-bbro
5662 Dump after block reordering.
5664 @item -fdump-rtl-btl1
5665 @itemx -fdump-rtl-btl2
5666 @opindex fdump-rtl-btl2
5667 @opindex fdump-rtl-btl2
5668 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5669 after the two branch
5670 target load optimization passes.
5672 @item -fdump-rtl-bypass
5673 @opindex fdump-rtl-bypass
5674 Dump after jump bypassing and control flow optimizations.
5676 @item -fdump-rtl-combine
5677 @opindex fdump-rtl-combine
5678 Dump after the RTL instruction combination pass.
5680 @item -fdump-rtl-compgotos
5681 @opindex fdump-rtl-compgotos
5682 Dump after duplicating the computed gotos.
5684 @item -fdump-rtl-ce1
5685 @itemx -fdump-rtl-ce2
5686 @itemx -fdump-rtl-ce3
5687 @opindex fdump-rtl-ce1
5688 @opindex fdump-rtl-ce2
5689 @opindex fdump-rtl-ce3
5690 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5691 @option{-fdump-rtl-ce3} enable dumping after the three
5692 if conversion passes.
5694 @item -fdump-rtl-cprop_hardreg
5695 @opindex fdump-rtl-cprop_hardreg
5696 Dump after hard register copy propagation.
5698 @item -fdump-rtl-csa
5699 @opindex fdump-rtl-csa
5700 Dump after combining stack adjustments.
5702 @item -fdump-rtl-cse1
5703 @itemx -fdump-rtl-cse2
5704 @opindex fdump-rtl-cse1
5705 @opindex fdump-rtl-cse2
5706 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5707 the two common subexpression elimination passes.
5709 @item -fdump-rtl-dce
5710 @opindex fdump-rtl-dce
5711 Dump after the standalone dead code elimination passes.
5713 @item -fdump-rtl-dbr
5714 @opindex fdump-rtl-dbr
5715 Dump after delayed branch scheduling.
5717 @item -fdump-rtl-dce1
5718 @itemx -fdump-rtl-dce2
5719 @opindex fdump-rtl-dce1
5720 @opindex fdump-rtl-dce2
5721 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5722 the two dead store elimination passes.
5724 @item -fdump-rtl-eh
5725 @opindex fdump-rtl-eh
5726 Dump after finalization of EH handling code.
5728 @item -fdump-rtl-eh_ranges
5729 @opindex fdump-rtl-eh_ranges
5730 Dump after conversion of EH handling range regions.
5732 @item -fdump-rtl-expand
5733 @opindex fdump-rtl-expand
5734 Dump after RTL generation.
5736 @item -fdump-rtl-fwprop1
5737 @itemx -fdump-rtl-fwprop2
5738 @opindex fdump-rtl-fwprop1
5739 @opindex fdump-rtl-fwprop2
5740 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5741 dumping after the two forward propagation passes.
5743 @item -fdump-rtl-gcse1
5744 @itemx -fdump-rtl-gcse2
5745 @opindex fdump-rtl-gcse1
5746 @opindex fdump-rtl-gcse2
5747 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5748 after global common subexpression elimination.
5750 @item -fdump-rtl-init-regs
5751 @opindex fdump-rtl-init-regs
5752 Dump after the initialization of the registers.
5754 @item -fdump-rtl-initvals
5755 @opindex fdump-rtl-initvals
5756 Dump after the computation of the initial value sets.
5758 @item -fdump-rtl-into_cfglayout
5759 @opindex fdump-rtl-into_cfglayout
5760 Dump after converting to cfglayout mode.
5762 @item -fdump-rtl-ira
5763 @opindex fdump-rtl-ira
5764 Dump after iterated register allocation.
5766 @item -fdump-rtl-jump
5767 @opindex fdump-rtl-jump
5768 Dump after the second jump optimization.
5770 @item -fdump-rtl-loop2
5771 @opindex fdump-rtl-loop2
5772 @option{-fdump-rtl-loop2} enables dumping after the rtl
5773 loop optimization passes.
5775 @item -fdump-rtl-mach
5776 @opindex fdump-rtl-mach
5777 Dump after performing the machine dependent reorganization pass, if that
5778 pass exists.
5780 @item -fdump-rtl-mode_sw
5781 @opindex fdump-rtl-mode_sw
5782 Dump after removing redundant mode switches.
5784 @item -fdump-rtl-rnreg
5785 @opindex fdump-rtl-rnreg
5786 Dump after register renumbering.
5788 @item -fdump-rtl-outof_cfglayout
5789 @opindex fdump-rtl-outof_cfglayout
5790 Dump after converting from cfglayout mode.
5792 @item -fdump-rtl-peephole2
5793 @opindex fdump-rtl-peephole2
5794 Dump after the peephole pass.
5796 @item -fdump-rtl-postreload
5797 @opindex fdump-rtl-postreload
5798 Dump after post-reload optimizations.
5800 @item -fdump-rtl-pro_and_epilogue
5801 @opindex fdump-rtl-pro_and_epilogue
5802 Dump after generating the function prologues and epilogues.
5804 @item -fdump-rtl-regmove
5805 @opindex fdump-rtl-regmove
5806 Dump after the register move pass.
5808 @item -fdump-rtl-sched1
5809 @itemx -fdump-rtl-sched2
5810 @opindex fdump-rtl-sched1
5811 @opindex fdump-rtl-sched2
5812 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5813 after the basic block scheduling passes.
5815 @item -fdump-rtl-see
5816 @opindex fdump-rtl-see
5817 Dump after sign extension elimination.
5819 @item -fdump-rtl-seqabstr
5820 @opindex fdump-rtl-seqabstr
5821 Dump after common sequence discovery.
5823 @item -fdump-rtl-shorten
5824 @opindex fdump-rtl-shorten
5825 Dump after shortening branches.
5827 @item -fdump-rtl-sibling
5828 @opindex fdump-rtl-sibling
5829 Dump after sibling call optimizations.
5831 @item -fdump-rtl-split1
5832 @itemx -fdump-rtl-split2
5833 @itemx -fdump-rtl-split3
5834 @itemx -fdump-rtl-split4
5835 @itemx -fdump-rtl-split5
5836 @opindex fdump-rtl-split1
5837 @opindex fdump-rtl-split2
5838 @opindex fdump-rtl-split3
5839 @opindex fdump-rtl-split4
5840 @opindex fdump-rtl-split5
5841 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5842 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5843 @option{-fdump-rtl-split5} enable dumping after five rounds of
5844 instruction splitting.
5846 @item -fdump-rtl-sms
5847 @opindex fdump-rtl-sms
5848 Dump after modulo scheduling.  This pass is only run on some
5849 architectures.
5851 @item -fdump-rtl-stack
5852 @opindex fdump-rtl-stack
5853 Dump after conversion from GCC's ``flat register file'' registers to the
5854 x87's stack-like registers.  This pass is only run on x86 variants.
5856 @item -fdump-rtl-subreg1
5857 @itemx -fdump-rtl-subreg2
5858 @opindex fdump-rtl-subreg1
5859 @opindex fdump-rtl-subreg2
5860 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5861 the two subreg expansion passes.
5863 @item -fdump-rtl-unshare
5864 @opindex fdump-rtl-unshare
5865 Dump after all rtl has been unshared.
5867 @item -fdump-rtl-vartrack
5868 @opindex fdump-rtl-vartrack
5869 Dump after variable tracking.
5871 @item -fdump-rtl-vregs
5872 @opindex fdump-rtl-vregs
5873 Dump after converting virtual registers to hard registers.
5875 @item -fdump-rtl-web
5876 @opindex fdump-rtl-web
5877 Dump after live range splitting.
5879 @item -fdump-rtl-regclass
5880 @itemx -fdump-rtl-subregs_of_mode_init
5881 @itemx -fdump-rtl-subregs_of_mode_finish
5882 @itemx -fdump-rtl-dfinit
5883 @itemx -fdump-rtl-dfinish
5884 @opindex fdump-rtl-regclass
5885 @opindex fdump-rtl-subregs_of_mode_init
5886 @opindex fdump-rtl-subregs_of_mode_finish
5887 @opindex fdump-rtl-dfinit
5888 @opindex fdump-rtl-dfinish
5889 These dumps are defined but always produce empty files.
5891 @item -da
5892 @itemx -fdump-rtl-all
5893 @opindex da
5894 @opindex fdump-rtl-all
5895 Produce all the dumps listed above.
5897 @item -dA
5898 @opindex dA
5899 Annotate the assembler output with miscellaneous debugging information.
5901 @item -dD
5902 @opindex dD
5903 Dump all macro definitions, at the end of preprocessing, in addition to
5904 normal output.
5906 @item -dH
5907 @opindex dH
5908 Produce a core dump whenever an error occurs.
5910 @item -dp
5911 @opindex dp
5912 Annotate the assembler output with a comment indicating which
5913 pattern and alternative is used.  The length of each instruction is
5914 also printed.
5916 @item -dP
5917 @opindex dP
5918 Dump the RTL in the assembler output as a comment before each instruction.
5919 Also turns on @option{-dp} annotation.
5921 @item -dx
5922 @opindex dx
5923 Just generate RTL for a function instead of compiling it.  Usually used
5924 with @option{-fdump-rtl-expand}.
5925 @end table
5927 @item -fdump-noaddr
5928 @opindex fdump-noaddr
5929 When doing debugging dumps, suppress address output.  This makes it more
5930 feasible to use diff on debugging dumps for compiler invocations with
5931 different compiler binaries and/or different
5932 text / bss / data / heap / stack / dso start locations.
5934 @item -fdump-unnumbered
5935 @opindex fdump-unnumbered
5936 When doing debugging dumps, suppress instruction numbers and address output.
5937 This makes it more feasible to use diff on debugging dumps for compiler
5938 invocations with different options, in particular with and without
5939 @option{-g}.
5941 @item -fdump-unnumbered-links
5942 @opindex fdump-unnumbered-links
5943 When doing debugging dumps (see @option{-d} option above), suppress
5944 instruction numbers for the links to the previous and next instructions
5945 in a sequence.
5947 @item -fdump-translation-unit @r{(C++ only)}
5948 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5949 @opindex fdump-translation-unit
5950 Dump a representation of the tree structure for the entire translation
5951 unit to a file.  The file name is made by appending @file{.tu} to the
5952 source file name, and the file is created in the same directory as the
5953 output file.  If the @samp{-@var{options}} form is used, @var{options}
5954 controls the details of the dump as described for the
5955 @option{-fdump-tree} options.
5957 @item -fdump-class-hierarchy @r{(C++ only)}
5958 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5959 @opindex fdump-class-hierarchy
5960 Dump a representation of each class's hierarchy and virtual function
5961 table layout to a file.  The file name is made by appending
5962 @file{.class} to the source file name, and the file is created in the
5963 same directory as the output file.  If the @samp{-@var{options}} form
5964 is used, @var{options} controls the details of the dump as described
5965 for the @option{-fdump-tree} options.
5967 @item -fdump-ipa-@var{switch}
5968 @opindex fdump-ipa
5969 Control the dumping at various stages of inter-procedural analysis
5970 language tree to a file.  The file name is generated by appending a
5971 switch specific suffix to the source file name, and the file is created
5972 in the same directory as the output file.  The following dumps are
5973 possible:
5975 @table @samp
5976 @item all
5977 Enables all inter-procedural analysis dumps.
5979 @item cgraph
5980 Dumps information about call-graph optimization, unused function removal,
5981 and inlining decisions.
5983 @item inline
5984 Dump after function inlining.
5986 @end table
5988 @item -fdump-passes
5989 @opindex fdump-passes
5990 Dump the list of optimization passes that are turned on and off by
5991 the current command-line options.
5993 @item -fdump-statistics-@var{option}
5994 @opindex fdump-statistics
5995 Enable and control dumping of pass statistics in a separate file.  The
5996 file name is generated by appending a suffix ending in
5997 @samp{.statistics} to the source file name, and the file is created in
5998 the same directory as the output file.  If the @samp{-@var{option}}
5999 form is used, @samp{-stats} causes counters to be summed over the
6000 whole compilation unit while @samp{-details} dumps every event as
6001 the passes generate them.  The default with no option is to sum
6002 counters for each function compiled.
6004 @item -fdump-tree-@var{switch}
6005 @itemx -fdump-tree-@var{switch}-@var{options}
6006 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6007 @opindex fdump-tree
6008 Control the dumping at various stages of processing the intermediate
6009 language tree to a file.  The file name is generated by appending a
6010 switch-specific suffix to the source file name, and the file is
6011 created in the same directory as the output file. In case of
6012 @option{=@var{filename}} option, the dump is output on the given file
6013 instead of the auto named dump files.  If the @samp{-@var{options}}
6014 form is used, @var{options} is a list of @samp{-} separated options
6015 which control the details of the dump.  Not all options are applicable
6016 to all dumps; those that are not meaningful are ignored.  The
6017 following options are available
6019 @table @samp
6020 @item address
6021 Print the address of each node.  Usually this is not meaningful as it
6022 changes according to the environment and source file.  Its primary use
6023 is for tying up a dump file with a debug environment.
6024 @item asmname
6025 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6026 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6027 use working backward from mangled names in the assembly file.
6028 @item slim
6029 When dumping front-end intermediate representations, inhibit dumping
6030 of members of a scope or body of a function merely because that scope
6031 has been reached.  Only dump such items when they are directly reachable
6032 by some other path.
6034 When dumping pretty-printed trees, this option inhibits dumping the
6035 bodies of control structures.
6037 When dumping RTL, print the RTL in slim (condensed) form instead of
6038 the default LISP-like representation.
6039 @item raw
6040 Print a raw representation of the tree.  By default, trees are
6041 pretty-printed into a C-like representation.
6042 @item details
6043 Enable more detailed dumps (not honored by every dump option). Also
6044 include information from the optimization passes.
6045 @item stats
6046 Enable dumping various statistics about the pass (not honored by every dump
6047 option).
6048 @item blocks
6049 Enable showing basic block boundaries (disabled in raw dumps).
6050 @item graph
6051 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6052 dump a representation of the control flow graph suitable for viewing with
6053 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6054 the file is pretty-printed as a subgraph, so that GraphViz can render them
6055 all in a single plot.
6057 This option currently only works for RTL dumps, and the RTL is always
6058 dumped in slim form.
6059 @item vops
6060 Enable showing virtual operands for every statement.
6061 @item lineno
6062 Enable showing line numbers for statements.
6063 @item uid
6064 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6065 @item verbose
6066 Enable showing the tree dump for each statement.
6067 @item eh
6068 Enable showing the EH region number holding each statement.
6069 @item scev
6070 Enable showing scalar evolution analysis details.
6071 @item optimized
6072 Enable showing optimization information (only available in certain
6073 passes).
6074 @item missed
6075 Enable showing missed optimization information (only available in certain
6076 passes).
6077 @item notes
6078 Enable other detailed optimization information (only available in
6079 certain passes).
6080 @item =@var{filename}
6081 Instead of an auto named dump file, output into the given file
6082 name. The file names @file{stdout} and @file{stderr} are treated
6083 specially and are considered already open standard streams. For
6084 example,
6086 @smallexample
6087 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6088      -fdump-tree-pre=stderr file.c
6089 @end smallexample
6091 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6092 output on to @file{stderr}. If two conflicting dump filenames are
6093 given for the same pass, then the latter option overrides the earlier
6094 one.
6096 @item all
6097 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6098 and @option{lineno}.
6100 @item optall
6101 Turn on all optimization options, i.e., @option{optimized},
6102 @option{missed}, and @option{note}.
6103 @end table
6105 The following tree dumps are possible:
6106 @table @samp
6108 @item original
6109 @opindex fdump-tree-original
6110 Dump before any tree based optimization, to @file{@var{file}.original}.
6112 @item optimized
6113 @opindex fdump-tree-optimized
6114 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6116 @item gimple
6117 @opindex fdump-tree-gimple
6118 Dump each function before and after the gimplification pass to a file.  The
6119 file name is made by appending @file{.gimple} to the source file name.
6121 @item cfg
6122 @opindex fdump-tree-cfg
6123 Dump the control flow graph of each function to a file.  The file name is
6124 made by appending @file{.cfg} to the source file name.
6126 @item ch
6127 @opindex fdump-tree-ch
6128 Dump each function after copying loop headers.  The file name is made by
6129 appending @file{.ch} to the source file name.
6131 @item ssa
6132 @opindex fdump-tree-ssa
6133 Dump SSA related information to a file.  The file name is made by appending
6134 @file{.ssa} to the source file name.
6136 @item alias
6137 @opindex fdump-tree-alias
6138 Dump aliasing information for each function.  The file name is made by
6139 appending @file{.alias} to the source file name.
6141 @item ccp
6142 @opindex fdump-tree-ccp
6143 Dump each function after CCP@.  The file name is made by appending
6144 @file{.ccp} to the source file name.
6146 @item storeccp
6147 @opindex fdump-tree-storeccp
6148 Dump each function after STORE-CCP@.  The file name is made by appending
6149 @file{.storeccp} to the source file name.
6151 @item pre
6152 @opindex fdump-tree-pre
6153 Dump trees after partial redundancy elimination.  The file name is made
6154 by appending @file{.pre} to the source file name.
6156 @item fre
6157 @opindex fdump-tree-fre
6158 Dump trees after full redundancy elimination.  The file name is made
6159 by appending @file{.fre} to the source file name.
6161 @item copyprop
6162 @opindex fdump-tree-copyprop
6163 Dump trees after copy propagation.  The file name is made
6164 by appending @file{.copyprop} to the source file name.
6166 @item store_copyprop
6167 @opindex fdump-tree-store_copyprop
6168 Dump trees after store copy-propagation.  The file name is made
6169 by appending @file{.store_copyprop} to the source file name.
6171 @item dce
6172 @opindex fdump-tree-dce
6173 Dump each function after dead code elimination.  The file name is made by
6174 appending @file{.dce} to the source file name.
6176 @item mudflap
6177 @opindex fdump-tree-mudflap
6178 Dump each function after adding mudflap instrumentation.  The file name is
6179 made by appending @file{.mudflap} to the source file name.
6181 @item sra
6182 @opindex fdump-tree-sra
6183 Dump each function after performing scalar replacement of aggregates.  The
6184 file name is made by appending @file{.sra} to the source file name.
6186 @item sink
6187 @opindex fdump-tree-sink
6188 Dump each function after performing code sinking.  The file name is made
6189 by appending @file{.sink} to the source file name.
6191 @item dom
6192 @opindex fdump-tree-dom
6193 Dump each function after applying dominator tree optimizations.  The file
6194 name is made by appending @file{.dom} to the source file name.
6196 @item dse
6197 @opindex fdump-tree-dse
6198 Dump each function after applying dead store elimination.  The file
6199 name is made by appending @file{.dse} to the source file name.
6201 @item phiopt
6202 @opindex fdump-tree-phiopt
6203 Dump each function after optimizing PHI nodes into straightline code.  The file
6204 name is made by appending @file{.phiopt} to the source file name.
6206 @item forwprop
6207 @opindex fdump-tree-forwprop
6208 Dump each function after forward propagating single use variables.  The file
6209 name is made by appending @file{.forwprop} to the source file name.
6211 @item copyrename
6212 @opindex fdump-tree-copyrename
6213 Dump each function after applying the copy rename optimization.  The file
6214 name is made by appending @file{.copyrename} to the source file name.
6216 @item nrv
6217 @opindex fdump-tree-nrv
6218 Dump each function after applying the named return value optimization on
6219 generic trees.  The file name is made by appending @file{.nrv} to the source
6220 file name.
6222 @item vect
6223 @opindex fdump-tree-vect
6224 Dump each function after applying vectorization of loops.  The file name is
6225 made by appending @file{.vect} to the source file name.
6227 @item slp
6228 @opindex fdump-tree-slp
6229 Dump each function after applying vectorization of basic blocks.  The file name
6230 is made by appending @file{.slp} to the source file name.
6232 @item vrp
6233 @opindex fdump-tree-vrp
6234 Dump each function after Value Range Propagation (VRP).  The file name
6235 is made by appending @file{.vrp} to the source file name.
6237 @item all
6238 @opindex fdump-tree-all
6239 Enable all the available tree dumps with the flags provided in this option.
6240 @end table
6242 @item -fopt-info
6243 @itemx -fopt-info-@var{options}
6244 @itemx -fopt-info-@var{options}=@var{filename}
6245 @opindex fopt-info
6246 Controls optimization dumps from various optimization passes. If the
6247 @samp{-@var{options}} form is used, @var{options} is a list of
6248 @samp{-} separated options to select the dump details and
6249 optimizations.  If @var{options} is not specified, it defaults to
6250 @option{optimized} for details and @option{optall} for optimization
6251 groups. If the @var{filename} is not specified, it defaults to
6252 @file{stderr}. Note that the output @var{filename} will be overwritten
6253 in case of multiple translation units. If a combined output from
6254 multiple translation units is desired, @file{stderr} should be used
6255 instead.
6257 The options can be divided into two groups, 1) options describing the
6258 verbosity of the dump, and 2) options describing which optimizations
6259 should be included. The options from both the groups can be freely
6260 mixed as they are non-overlapping. However, in case of any conflicts,
6261 the latter options override the earlier options on the command
6262 line. Though multiple -fopt-info options are accepted, only one of
6263 them can have @option{=filename}. If other filenames are provided then
6264 all but the first one are ignored.
6266 The dump verbosity has the following options
6268 @table @samp
6269 @item optimized
6270 Print information when an optimization is successfully applied. It is
6271 up to a pass to decide which information is relevant. For example, the
6272 vectorizer passes print the source location of loops which got
6273 successfully vectorized.
6274 @item missed
6275 Print information about missed optimizations. Individual passes
6276 control which information to include in the output. For example,
6278 @smallexample
6279 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6280 @end smallexample
6282 will print information about missed optimization opportunities from
6283 vectorization passes on stderr.
6284 @item note
6285 Print verbose information about optimizations, such as certain
6286 transformations, more detailed messages about decisions etc.
6287 @item all
6288 Print detailed optimization information. This includes
6289 @var{optimized}, @var{missed}, and @var{note}.
6290 @end table
6292 The second set of options describes a group of optimizations and may
6293 include one or more of the following.
6295 @table @samp
6296 @item ipa
6297 Enable dumps from all interprocedural optimizations.
6298 @item loop
6299 Enable dumps from all loop optimizations.
6300 @item inline
6301 Enable dumps from all inlining optimizations.
6302 @item vec
6303 Enable dumps from all vectorization optimizations.
6304 @item optall
6305 Enable dumps from all optimizations. This is a superset of
6306 the optimization groups listed above.
6307 @end table
6309 For example,
6310 @smallexample
6311 gcc -O3 -fopt-info-missed=missed.all
6312 @end smallexample
6314 outputs missed optimization report from all the passes into
6315 @file{missed.all}.
6317 As another example,
6318 @smallexample
6319 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6320 @end smallexample
6322 will output information about missed optimizations as well as
6323 optimized locations from all the inlining passes into
6324 @file{inline.txt}.
6326 If the @var{filename} is provided, then the dumps from all the
6327 applicable optimizations are concatenated into the @file{filename}.
6328 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6329 omitted, it defaults to @option{all-optall}, which means dump all
6330 available optimization info from all the passes. In the following
6331 example, all optimization info is output on to @file{stderr}.
6333 @smallexample
6334 gcc -O3 -fopt-info
6335 @end smallexample
6337 Note that @option{-fopt-info-vec-missed} behaves the same as
6338 @option{-fopt-info-missed-vec}.
6340 As another example, consider
6342 @smallexample
6343 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6344 @end smallexample
6346 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6347 in conflict since only one output file is allowed. In this case, only
6348 the first option takes effect and the subsequent options are
6349 ignored. Thus only the @file{vec.miss} is produced which cotaints
6350 dumps from the vectorizer about missed opportunities.
6352 @item -ftree-vectorizer-verbose=@var{n}
6353 @opindex ftree-vectorizer-verbose
6354 This option is deprecated and is implemented in terms of
6355 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6356 instead, where @var{kind} is one of the valid opt-info options. It
6357 prints additional optimization information.  For @var{n}=0 no
6358 diagnostic information is reported.  If @var{n}=1 the vectorizer
6359 reports each loop that got vectorized, and the total number of loops
6360 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6361 which could not be vectorized and the reasons for those. For any
6362 higher verbosity levels all the analysis and transformation
6363 information from the vectorizer is reported.
6365 Note that the information output by @option{-ftree-vectorizer-verbose}
6366 option is sent to @file{stderr}. If the equivalent form
6367 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6368 output is sent into @var{filename} instead.
6370 @item -frandom-seed=@var{string}
6371 @opindex frandom-seed
6372 This option provides a seed that GCC uses in place of
6373 random numbers in generating certain symbol names
6374 that have to be different in every compiled file.  It is also used to
6375 place unique stamps in coverage data files and the object files that
6376 produce them.  You can use the @option{-frandom-seed} option to produce
6377 reproducibly identical object files.
6379 The @var{string} should be different for every file you compile.
6381 @item -fsched-verbose=@var{n}
6382 @opindex fsched-verbose
6383 On targets that use instruction scheduling, this option controls the
6384 amount of debugging output the scheduler prints.  This information is
6385 written to standard error, unless @option{-fdump-rtl-sched1} or
6386 @option{-fdump-rtl-sched2} is specified, in which case it is output
6387 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6388 respectively.  However for @var{n} greater than nine, the output is
6389 always printed to standard error.
6391 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6392 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6393 For @var{n} greater than one, it also output basic block probabilities,
6394 detailed ready list information and unit/insn info.  For @var{n} greater
6395 than two, it includes RTL at abort point, control-flow and regions info.
6396 And for @var{n} over four, @option{-fsched-verbose} also includes
6397 dependence info.
6399 @item -save-temps
6400 @itemx -save-temps=cwd
6401 @opindex save-temps
6402 Store the usual ``temporary'' intermediate files permanently; place them
6403 in the current directory and name them based on the source file.  Thus,
6404 compiling @file{foo.c} with @option{-c -save-temps} produces files
6405 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6406 preprocessed @file{foo.i} output file even though the compiler now
6407 normally uses an integrated preprocessor.
6409 When used in combination with the @option{-x} command-line option,
6410 @option{-save-temps} is sensible enough to avoid over writing an
6411 input source file with the same extension as an intermediate file.
6412 The corresponding intermediate file may be obtained by renaming the
6413 source file before using @option{-save-temps}.
6415 If you invoke GCC in parallel, compiling several different source
6416 files that share a common base name in different subdirectories or the
6417 same source file compiled for multiple output destinations, it is
6418 likely that the different parallel compilers will interfere with each
6419 other, and overwrite the temporary files.  For instance:
6421 @smallexample
6422 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6423 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6424 @end smallexample
6426 may result in @file{foo.i} and @file{foo.o} being written to
6427 simultaneously by both compilers.
6429 @item -save-temps=obj
6430 @opindex save-temps=obj
6431 Store the usual ``temporary'' intermediate files permanently.  If the
6432 @option{-o} option is used, the temporary files are based on the
6433 object file.  If the @option{-o} option is not used, the
6434 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6436 For example:
6438 @smallexample
6439 gcc -save-temps=obj -c foo.c
6440 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6441 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6442 @end smallexample
6444 @noindent
6445 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6446 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6447 @file{dir2/yfoobar.o}.
6449 @item -time@r{[}=@var{file}@r{]}
6450 @opindex time
6451 Report the CPU time taken by each subprocess in the compilation
6452 sequence.  For C source files, this is the compiler proper and assembler
6453 (plus the linker if linking is done).
6455 Without the specification of an output file, the output looks like this:
6457 @smallexample
6458 # cc1 0.12 0.01
6459 # as 0.00 0.01
6460 @end smallexample
6462 The first number on each line is the ``user time'', that is time spent
6463 executing the program itself.  The second number is ``system time'',
6464 time spent executing operating system routines on behalf of the program.
6465 Both numbers are in seconds.
6467 With the specification of an output file, the output is appended to the
6468 named file, and it looks like this:
6470 @smallexample
6471 0.12 0.01 cc1 @var{options}
6472 0.00 0.01 as @var{options}
6473 @end smallexample
6475 The ``user time'' and the ``system time'' are moved before the program
6476 name, and the options passed to the program are displayed, so that one
6477 can later tell what file was being compiled, and with which options.
6479 @item -fvar-tracking
6480 @opindex fvar-tracking
6481 Run variable tracking pass.  It computes where variables are stored at each
6482 position in code.  Better debugging information is then generated
6483 (if the debugging information format supports this information).
6485 It is enabled by default when compiling with optimization (@option{-Os},
6486 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6487 the debug info format supports it.
6489 @item -fvar-tracking-assignments
6490 @opindex fvar-tracking-assignments
6491 @opindex fno-var-tracking-assignments
6492 Annotate assignments to user variables early in the compilation and
6493 attempt to carry the annotations over throughout the compilation all the
6494 way to the end, in an attempt to improve debug information while
6495 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6497 It can be enabled even if var-tracking is disabled, in which case
6498 annotations are created and maintained, but discarded at the end.
6500 @item -fvar-tracking-assignments-toggle
6501 @opindex fvar-tracking-assignments-toggle
6502 @opindex fno-var-tracking-assignments-toggle
6503 Toggle @option{-fvar-tracking-assignments}, in the same way that
6504 @option{-gtoggle} toggles @option{-g}.
6506 @item -print-file-name=@var{library}
6507 @opindex print-file-name
6508 Print the full absolute name of the library file @var{library} that
6509 would be used when linking---and don't do anything else.  With this
6510 option, GCC does not compile or link anything; it just prints the
6511 file name.
6513 @item -print-multi-directory
6514 @opindex print-multi-directory
6515 Print the directory name corresponding to the multilib selected by any
6516 other switches present in the command line.  This directory is supposed
6517 to exist in @env{GCC_EXEC_PREFIX}.
6519 @item -print-multi-lib
6520 @opindex print-multi-lib
6521 Print the mapping from multilib directory names to compiler switches
6522 that enable them.  The directory name is separated from the switches by
6523 @samp{;}, and each switch starts with an @samp{@@} instead of the
6524 @samp{-}, without spaces between multiple switches.  This is supposed to
6525 ease shell processing.
6527 @item -print-multi-os-directory
6528 @opindex print-multi-os-directory
6529 Print the path to OS libraries for the selected
6530 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6531 present in the @file{lib} subdirectory and no multilibs are used, this is
6532 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6533 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6534 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6535 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6537 @item -print-multiarch
6538 @opindex print-multiarch
6539 Print the path to OS libraries for the selected multiarch,
6540 relative to some @file{lib} subdirectory.
6542 @item -print-prog-name=@var{program}
6543 @opindex print-prog-name
6544 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6546 @item -print-libgcc-file-name
6547 @opindex print-libgcc-file-name
6548 Same as @option{-print-file-name=libgcc.a}.
6550 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6551 but you do want to link with @file{libgcc.a}.  You can do:
6553 @smallexample
6554 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6555 @end smallexample
6557 @item -print-search-dirs
6558 @opindex print-search-dirs
6559 Print the name of the configured installation directory and a list of
6560 program and library directories @command{gcc} searches---and don't do anything else.
6562 This is useful when @command{gcc} prints the error message
6563 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6564 To resolve this you either need to put @file{cpp0} and the other compiler
6565 components where @command{gcc} expects to find them, or you can set the environment
6566 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6567 Don't forget the trailing @samp{/}.
6568 @xref{Environment Variables}.
6570 @item -print-sysroot
6571 @opindex print-sysroot
6572 Print the target sysroot directory that is used during
6573 compilation.  This is the target sysroot specified either at configure
6574 time or using the @option{--sysroot} option, possibly with an extra
6575 suffix that depends on compilation options.  If no target sysroot is
6576 specified, the option prints nothing.
6578 @item -print-sysroot-headers-suffix
6579 @opindex print-sysroot-headers-suffix
6580 Print the suffix added to the target sysroot when searching for
6581 headers, or give an error if the compiler is not configured with such
6582 a suffix---and don't do anything else.
6584 @item -dumpmachine
6585 @opindex dumpmachine
6586 Print the compiler's target machine (for example,
6587 @samp{i686-pc-linux-gnu})---and don't do anything else.
6589 @item -dumpversion
6590 @opindex dumpversion
6591 Print the compiler version (for example, @samp{3.0})---and don't do
6592 anything else.
6594 @item -dumpspecs
6595 @opindex dumpspecs
6596 Print the compiler's built-in specs---and don't do anything else.  (This
6597 is used when GCC itself is being built.)  @xref{Spec Files}.
6599 @item -fno-eliminate-unused-debug-types
6600 @opindex feliminate-unused-debug-types
6601 @opindex fno-eliminate-unused-debug-types
6602 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6603 output for types that are nowhere used in the source file being compiled.
6604 Sometimes it is useful to have GCC emit debugging
6605 information for all types declared in a compilation
6606 unit, regardless of whether or not they are actually used
6607 in that compilation unit, for example 
6608 if, in the debugger, you want to cast a value to a type that is
6609 not actually used in your program (but is declared).  More often,
6610 however, this results in a significant amount of wasted space.
6611 @end table
6613 @node Optimize Options
6614 @section Options That Control Optimization
6615 @cindex optimize options
6616 @cindex options, optimization
6618 These options control various sorts of optimizations.
6620 Without any optimization option, the compiler's goal is to reduce the
6621 cost of compilation and to make debugging produce the expected
6622 results.  Statements are independent: if you stop the program with a
6623 breakpoint between statements, you can then assign a new value to any
6624 variable or change the program counter to any other statement in the
6625 function and get exactly the results you expect from the source
6626 code.
6628 Turning on optimization flags makes the compiler attempt to improve
6629 the performance and/or code size at the expense of compilation time
6630 and possibly the ability to debug the program.
6632 The compiler performs optimization based on the knowledge it has of the
6633 program.  Compiling multiple files at once to a single output file mode allows
6634 the compiler to use information gained from all of the files when compiling
6635 each of them.
6637 Not all optimizations are controlled directly by a flag.  Only
6638 optimizations that have a flag are listed in this section.
6640 Most optimizations are only enabled if an @option{-O} level is set on
6641 the command line.  Otherwise they are disabled, even if individual
6642 optimization flags are specified.
6644 Depending on the target and how GCC was configured, a slightly different
6645 set of optimizations may be enabled at each @option{-O} level than
6646 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6647 to find out the exact set of optimizations that are enabled at each level.
6648 @xref{Overall Options}, for examples.
6650 @table @gcctabopt
6651 @item -O
6652 @itemx -O1
6653 @opindex O
6654 @opindex O1
6655 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6656 more memory for a large function.
6658 With @option{-O}, the compiler tries to reduce code size and execution
6659 time, without performing any optimizations that take a great deal of
6660 compilation time.
6662 @option{-O} turns on the following optimization flags:
6663 @gccoptlist{
6664 -fauto-inc-dec @gol
6665 -fcompare-elim @gol
6666 -fcprop-registers @gol
6667 -fdce @gol
6668 -fdefer-pop @gol
6669 -fdelayed-branch @gol
6670 -fdse @gol
6671 -fguess-branch-probability @gol
6672 -fif-conversion2 @gol
6673 -fif-conversion @gol
6674 -fipa-pure-const @gol
6675 -fipa-profile @gol
6676 -fipa-reference @gol
6677 -fmerge-constants
6678 -fsplit-wide-types @gol
6679 -ftree-bit-ccp @gol
6680 -ftree-builtin-call-dce @gol
6681 -ftree-ccp @gol
6682 -ftree-ch @gol
6683 -ftree-copyrename @gol
6684 -ftree-dce @gol
6685 -ftree-dominator-opts @gol
6686 -ftree-dse @gol
6687 -ftree-forwprop @gol
6688 -ftree-fre @gol
6689 -ftree-phiprop @gol
6690 -ftree-slsr @gol
6691 -ftree-sra @gol
6692 -ftree-pta @gol
6693 -ftree-ter @gol
6694 -funit-at-a-time}
6696 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6697 where doing so does not interfere with debugging.
6699 @item -O2
6700 @opindex O2
6701 Optimize even more.  GCC performs nearly all supported optimizations
6702 that do not involve a space-speed tradeoff.
6703 As compared to @option{-O}, this option increases both compilation time
6704 and the performance of the generated code.
6706 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6707 also turns on the following optimization flags:
6708 @gccoptlist{-fthread-jumps @gol
6709 -falign-functions  -falign-jumps @gol
6710 -falign-loops  -falign-labels @gol
6711 -fcaller-saves @gol
6712 -fcrossjumping @gol
6713 -fcse-follow-jumps  -fcse-skip-blocks @gol
6714 -fdelete-null-pointer-checks @gol
6715 -fdevirtualize -fdevirtualize-speculatively @gol
6716 -fexpensive-optimizations @gol
6717 -fgcse  -fgcse-lm  @gol
6718 -fhoist-adjacent-loads @gol
6719 -finline-small-functions @gol
6720 -findirect-inlining @gol
6721 -fipa-sra @gol
6722 -foptimize-sibling-calls @gol
6723 -fpartial-inlining @gol
6724 -fpeephole2 @gol
6725 -fregmove @gol
6726 -freorder-blocks  -freorder-functions @gol
6727 -frerun-cse-after-loop  @gol
6728 -fsched-interblock  -fsched-spec @gol
6729 -fschedule-insns  -fschedule-insns2 @gol
6730 -fstrict-aliasing -fstrict-overflow @gol
6731 -ftree-switch-conversion -ftree-tail-merge @gol
6732 -ftree-pre @gol
6733 -ftree-vrp}
6735 Please note the warning under @option{-fgcse} about
6736 invoking @option{-O2} on programs that use computed gotos.
6738 @item -O3
6739 @opindex O3
6740 Optimize yet more.  @option{-O3} turns on all optimizations specified
6741 by @option{-O2} and also turns on the @option{-finline-functions},
6742 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6743 @option{-fgcse-after-reload}, @option{-ftree-vectorize},
6744 @option{-fvect-cost-model},
6745 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6747 @item -O0
6748 @opindex O0
6749 Reduce compilation time and make debugging produce the expected
6750 results.  This is the default.
6752 @item -Os
6753 @opindex Os
6754 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6755 do not typically increase code size.  It also performs further
6756 optimizations designed to reduce code size.
6758 @option{-Os} disables the following optimization flags:
6759 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6760 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6761 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6763 @item -Ofast
6764 @opindex Ofast
6765 Disregard strict standards compliance.  @option{-Ofast} enables all
6766 @option{-O3} optimizations.  It also enables optimizations that are not
6767 valid for all standard-compliant programs.
6768 It turns on @option{-ffast-math} and the Fortran-specific
6769 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6771 @item -Og
6772 @opindex Og
6773 Optimize debugging experience.  @option{-Og} enables optimizations
6774 that do not interfere with debugging. It should be the optimization
6775 level of choice for the standard edit-compile-debug cycle, offering
6776 a reasonable level of optimization while maintaining fast compilation
6777 and a good debugging experience.
6779 If you use multiple @option{-O} options, with or without level numbers,
6780 the last such option is the one that is effective.
6781 @end table
6783 Options of the form @option{-f@var{flag}} specify machine-independent
6784 flags.  Most flags have both positive and negative forms; the negative
6785 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6786 below, only one of the forms is listed---the one you typically 
6787 use.  You can figure out the other form by either removing @samp{no-}
6788 or adding it.
6790 The following options control specific optimizations.  They are either
6791 activated by @option{-O} options or are related to ones that are.  You
6792 can use the following flags in the rare cases when ``fine-tuning'' of
6793 optimizations to be performed is desired.
6795 @table @gcctabopt
6796 @item -fno-default-inline
6797 @opindex fno-default-inline
6798 Do not make member functions inline by default merely because they are
6799 defined inside the class scope (C++ only).  Otherwise, when you specify
6800 @w{@option{-O}}, member functions defined inside class scope are compiled
6801 inline by default; i.e., you don't need to add @samp{inline} in front of
6802 the member function name.
6804 @item -fno-defer-pop
6805 @opindex fno-defer-pop
6806 Always pop the arguments to each function call as soon as that function
6807 returns.  For machines that must pop arguments after a function call,
6808 the compiler normally lets arguments accumulate on the stack for several
6809 function calls and pops them all at once.
6811 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6813 @item -fforward-propagate
6814 @opindex fforward-propagate
6815 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6816 instructions and checks if the result can be simplified.  If loop unrolling
6817 is active, two passes are performed and the second is scheduled after
6818 loop unrolling.
6820 This option is enabled by default at optimization levels @option{-O},
6821 @option{-O2}, @option{-O3}, @option{-Os}.
6823 @item -ffp-contract=@var{style}
6824 @opindex ffp-contract
6825 @option{-ffp-contract=off} disables floating-point expression contraction.
6826 @option{-ffp-contract=fast} enables floating-point expression contraction
6827 such as forming of fused multiply-add operations if the target has
6828 native support for them.
6829 @option{-ffp-contract=on} enables floating-point expression contraction
6830 if allowed by the language standard.  This is currently not implemented
6831 and treated equal to @option{-ffp-contract=off}.
6833 The default is @option{-ffp-contract=fast}.
6835 @item -fomit-frame-pointer
6836 @opindex fomit-frame-pointer
6837 Don't keep the frame pointer in a register for functions that
6838 don't need one.  This avoids the instructions to save, set up and
6839 restore frame pointers; it also makes an extra register available
6840 in many functions.  @strong{It also makes debugging impossible on
6841 some machines.}
6843 On some machines, such as the VAX, this flag has no effect, because
6844 the standard calling sequence automatically handles the frame pointer
6845 and nothing is saved by pretending it doesn't exist.  The
6846 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6847 whether a target machine supports this flag.  @xref{Registers,,Register
6848 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6850 Starting with GCC version 4.6, the default setting (when not optimizing for
6851 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6852 @option{-fomit-frame-pointer}.  The default can be reverted to
6853 @option{-fno-omit-frame-pointer} by configuring GCC with the
6854 @option{--enable-frame-pointer} configure option.
6856 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6858 @item -foptimize-sibling-calls
6859 @opindex foptimize-sibling-calls
6860 Optimize sibling and tail recursive calls.
6862 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6864 @item -fno-inline
6865 @opindex fno-inline
6866 Do not expand any functions inline apart from those marked with
6867 the @code{always_inline} attribute.  This is the default when not
6868 optimizing.
6870 Single functions can be exempted from inlining by marking them
6871 with the @code{noinline} attribute.
6873 @item -finline-small-functions
6874 @opindex finline-small-functions
6875 Integrate functions into their callers when their body is smaller than expected
6876 function call code (so overall size of program gets smaller).  The compiler
6877 heuristically decides which functions are simple enough to be worth integrating
6878 in this way.  This inlining applies to all functions, even those not declared
6879 inline.
6881 Enabled at level @option{-O2}.
6883 @item -findirect-inlining
6884 @opindex findirect-inlining
6885 Inline also indirect calls that are discovered to be known at compile
6886 time thanks to previous inlining.  This option has any effect only
6887 when inlining itself is turned on by the @option{-finline-functions}
6888 or @option{-finline-small-functions} options.
6890 Enabled at level @option{-O2}.
6892 @item -finline-functions
6893 @opindex finline-functions
6894 Consider all functions for inlining, even if they are not declared inline.
6895 The compiler heuristically decides which functions are worth integrating
6896 in this way.
6898 If all calls to a given function are integrated, and the function is
6899 declared @code{static}, then the function is normally not output as
6900 assembler code in its own right.
6902 Enabled at level @option{-O3}.
6904 @item -finline-functions-called-once
6905 @opindex finline-functions-called-once
6906 Consider all @code{static} functions called once for inlining into their
6907 caller even if they are not marked @code{inline}.  If a call to a given
6908 function is integrated, then the function is not output as assembler code
6909 in its own right.
6911 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6913 @item -fearly-inlining
6914 @opindex fearly-inlining
6915 Inline functions marked by @code{always_inline} and functions whose body seems
6916 smaller than the function call overhead early before doing
6917 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6918 makes profiling significantly cheaper and usually inlining faster on programs
6919 having large chains of nested wrapper functions.
6921 Enabled by default.
6923 @item -fipa-sra
6924 @opindex fipa-sra
6925 Perform interprocedural scalar replacement of aggregates, removal of
6926 unused parameters and replacement of parameters passed by reference
6927 by parameters passed by value.
6929 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6931 @item -finline-limit=@var{n}
6932 @opindex finline-limit
6933 By default, GCC limits the size of functions that can be inlined.  This flag
6934 allows coarse control of this limit.  @var{n} is the size of functions that
6935 can be inlined in number of pseudo instructions.
6937 Inlining is actually controlled by a number of parameters, which may be
6938 specified individually by using @option{--param @var{name}=@var{value}}.
6939 The @option{-finline-limit=@var{n}} option sets some of these parameters
6940 as follows:
6942 @table @gcctabopt
6943 @item max-inline-insns-single
6944 is set to @var{n}/2.
6945 @item max-inline-insns-auto
6946 is set to @var{n}/2.
6947 @end table
6949 See below for a documentation of the individual
6950 parameters controlling inlining and for the defaults of these parameters.
6952 @emph{Note:} there may be no value to @option{-finline-limit} that results
6953 in default behavior.
6955 @emph{Note:} pseudo instruction represents, in this particular context, an
6956 abstract measurement of function's size.  In no way does it represent a count
6957 of assembly instructions and as such its exact meaning might change from one
6958 release to an another.
6960 @item -fno-keep-inline-dllexport
6961 @opindex -fno-keep-inline-dllexport
6962 This is a more fine-grained version of @option{-fkeep-inline-functions},
6963 which applies only to functions that are declared using the @code{dllexport}
6964 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6965 Functions}.)
6967 @item -fkeep-inline-functions
6968 @opindex fkeep-inline-functions
6969 In C, emit @code{static} functions that are declared @code{inline}
6970 into the object file, even if the function has been inlined into all
6971 of its callers.  This switch does not affect functions using the
6972 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6973 inline functions into the object file.
6975 @item -fkeep-static-consts
6976 @opindex fkeep-static-consts
6977 Emit variables declared @code{static const} when optimization isn't turned
6978 on, even if the variables aren't referenced.
6980 GCC enables this option by default.  If you want to force the compiler to
6981 check if a variable is referenced, regardless of whether or not
6982 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6984 @item -fmerge-constants
6985 @opindex fmerge-constants
6986 Attempt to merge identical constants (string constants and floating-point
6987 constants) across compilation units.
6989 This option is the default for optimized compilation if the assembler and
6990 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6991 behavior.
6993 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6995 @item -fmerge-all-constants
6996 @opindex fmerge-all-constants
6997 Attempt to merge identical constants and identical variables.
6999 This option implies @option{-fmerge-constants}.  In addition to
7000 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7001 arrays or initialized constant variables with integral or floating-point
7002 types.  Languages like C or C++ require each variable, including multiple
7003 instances of the same variable in recursive calls, to have distinct locations,
7004 so using this option results in non-conforming
7005 behavior.
7007 @item -fmodulo-sched
7008 @opindex fmodulo-sched
7009 Perform swing modulo scheduling immediately before the first scheduling
7010 pass.  This pass looks at innermost loops and reorders their
7011 instructions by overlapping different iterations.
7013 @item -fmodulo-sched-allow-regmoves
7014 @opindex fmodulo-sched-allow-regmoves
7015 Perform more aggressive SMS-based modulo scheduling with register moves
7016 allowed.  By setting this flag certain anti-dependences edges are
7017 deleted, which triggers the generation of reg-moves based on the
7018 life-range analysis.  This option is effective only with
7019 @option{-fmodulo-sched} enabled.
7021 @item -fno-branch-count-reg
7022 @opindex fno-branch-count-reg
7023 Do not use ``decrement and branch'' instructions on a count register,
7024 but instead generate a sequence of instructions that decrement a
7025 register, compare it against zero, then branch based upon the result.
7026 This option is only meaningful on architectures that support such
7027 instructions, which include x86, PowerPC, IA-64 and S/390.
7029 The default is @option{-fbranch-count-reg}.
7031 @item -fno-function-cse
7032 @opindex fno-function-cse
7033 Do not put function addresses in registers; make each instruction that
7034 calls a constant function contain the function's address explicitly.
7036 This option results in less efficient code, but some strange hacks
7037 that alter the assembler output may be confused by the optimizations
7038 performed when this option is not used.
7040 The default is @option{-ffunction-cse}
7042 @item -fno-zero-initialized-in-bss
7043 @opindex fno-zero-initialized-in-bss
7044 If the target supports a BSS section, GCC by default puts variables that
7045 are initialized to zero into BSS@.  This can save space in the resulting
7046 code.
7048 This option turns off this behavior because some programs explicitly
7049 rely on variables going to the data section---e.g., so that the
7050 resulting executable can find the beginning of that section and/or make
7051 assumptions based on that.
7053 The default is @option{-fzero-initialized-in-bss}.
7055 @item -fmudflap -fmudflapth -fmudflapir
7056 @opindex fmudflap
7057 @opindex fmudflapth
7058 @opindex fmudflapir
7059 @cindex bounds checking
7060 @cindex mudflap
7061 For front-ends that support it (C and C++), instrument all risky
7062 pointer/array dereferencing operations, some standard library
7063 string/heap functions, and some other associated constructs with
7064 range/validity tests.  Modules so instrumented should be immune to
7065 buffer overflows, invalid heap use, and some other classes of C/C++
7066 programming errors.  The instrumentation relies on a separate runtime
7067 library (@file{libmudflap}), which is linked into a program if
7068 @option{-fmudflap} is given at link time.  Run-time behavior of the
7069 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
7070 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
7071 for its options.
7073 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
7074 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
7075 addition to @option{-fmudflap} or @option{-fmudflapth}, if
7076 instrumentation should ignore pointer reads.  This produces less
7077 instrumentation (and therefore faster execution) and still provides
7078 some protection against outright memory corrupting writes, but allows
7079 erroneously read data to propagate within a program.
7081 @item -fthread-jumps
7082 @opindex fthread-jumps
7083 Perform optimizations that check to see if a jump branches to a
7084 location where another comparison subsumed by the first is found.  If
7085 so, the first branch is redirected to either the destination of the
7086 second branch or a point immediately following it, depending on whether
7087 the condition is known to be true or false.
7089 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7091 @item -fsplit-wide-types
7092 @opindex fsplit-wide-types
7093 When using a type that occupies multiple registers, such as @code{long
7094 long} on a 32-bit system, split the registers apart and allocate them
7095 independently.  This normally generates better code for those types,
7096 but may make debugging more difficult.
7098 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7099 @option{-Os}.
7101 @item -fcse-follow-jumps
7102 @opindex fcse-follow-jumps
7103 In common subexpression elimination (CSE), scan through jump instructions
7104 when the target of the jump is not reached by any other path.  For
7105 example, when CSE encounters an @code{if} statement with an
7106 @code{else} clause, CSE follows the jump when the condition
7107 tested is false.
7109 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7111 @item -fcse-skip-blocks
7112 @opindex fcse-skip-blocks
7113 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7114 follow jumps that conditionally skip over blocks.  When CSE
7115 encounters a simple @code{if} statement with no else clause,
7116 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7117 body of the @code{if}.
7119 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7121 @item -frerun-cse-after-loop
7122 @opindex frerun-cse-after-loop
7123 Re-run common subexpression elimination after loop optimizations are
7124 performed.
7126 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7128 @item -fgcse
7129 @opindex fgcse
7130 Perform a global common subexpression elimination pass.
7131 This pass also performs global constant and copy propagation.
7133 @emph{Note:} When compiling a program using computed gotos, a GCC
7134 extension, you may get better run-time performance if you disable
7135 the global common subexpression elimination pass by adding
7136 @option{-fno-gcse} to the command line.
7138 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7140 @item -fgcse-lm
7141 @opindex fgcse-lm
7142 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7143 attempts to move loads that are only killed by stores into themselves.  This
7144 allows a loop containing a load/store sequence to be changed to a load outside
7145 the loop, and a copy/store within the loop.
7147 Enabled by default when @option{-fgcse} is enabled.
7149 @item -fgcse-sm
7150 @opindex fgcse-sm
7151 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7152 global common subexpression elimination.  This pass attempts to move
7153 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7154 loops containing a load/store sequence can be changed to a load before
7155 the loop and a store after the loop.
7157 Not enabled at any optimization level.
7159 @item -fgcse-las
7160 @opindex fgcse-las
7161 When @option{-fgcse-las} is enabled, the global common subexpression
7162 elimination pass eliminates redundant loads that come after stores to the
7163 same memory location (both partial and full redundancies).
7165 Not enabled at any optimization level.
7167 @item -fgcse-after-reload
7168 @opindex fgcse-after-reload
7169 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7170 pass is performed after reload.  The purpose of this pass is to clean up
7171 redundant spilling.
7173 @item -faggressive-loop-optimizations
7174 @opindex faggressive-loop-optimizations
7175 This option tells the loop optimizer to use language constraints to
7176 derive bounds for the number of iterations of a loop.  This assumes that
7177 loop code does not invoke undefined behavior by for example causing signed
7178 integer overflows or out-of-bound array accesses.  The bounds for the
7179 number of iterations of a loop are used to guide loop unrolling and peeling
7180 and loop exit test optimizations.
7181 This option is enabled by default.
7183 @item -funsafe-loop-optimizations
7184 @opindex funsafe-loop-optimizations
7185 This option tells the loop optimizer to assume that loop indices do not
7186 overflow, and that loops with nontrivial exit condition are not
7187 infinite.  This enables a wider range of loop optimizations even if
7188 the loop optimizer itself cannot prove that these assumptions are valid.
7189 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7190 if it finds this kind of loop.
7192 @item -fcrossjumping
7193 @opindex fcrossjumping
7194 Perform cross-jumping transformation.
7195 This transformation unifies equivalent code and saves code size.  The
7196 resulting code may or may not perform better than without cross-jumping.
7198 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7200 @item -fauto-inc-dec
7201 @opindex fauto-inc-dec
7202 Combine increments or decrements of addresses with memory accesses.
7203 This pass is always skipped on architectures that do not have
7204 instructions to support this.  Enabled by default at @option{-O} and
7205 higher on architectures that support this.
7207 @item -fdce
7208 @opindex fdce
7209 Perform dead code elimination (DCE) on RTL@.
7210 Enabled by default at @option{-O} and higher.
7212 @item -fdse
7213 @opindex fdse
7214 Perform dead store elimination (DSE) on RTL@.
7215 Enabled by default at @option{-O} and higher.
7217 @item -fif-conversion
7218 @opindex fif-conversion
7219 Attempt to transform conditional jumps into branch-less equivalents.  This
7220 includes use of conditional moves, min, max, set flags and abs instructions, and
7221 some tricks doable by standard arithmetics.  The use of conditional execution
7222 on chips where it is available is controlled by @code{if-conversion2}.
7224 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7226 @item -fif-conversion2
7227 @opindex fif-conversion2
7228 Use conditional execution (where available) to transform conditional jumps into
7229 branch-less equivalents.
7231 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7233 @item -fdelete-null-pointer-checks
7234 @opindex fdelete-null-pointer-checks
7235 Assume that programs cannot safely dereference null pointers, and that
7236 no code or data element resides there.  This enables simple constant
7237 folding optimizations at all optimization levels.  In addition, other
7238 optimization passes in GCC use this flag to control global dataflow
7239 analyses that eliminate useless checks for null pointers; these assume
7240 that if a pointer is checked after it has already been dereferenced,
7241 it cannot be null.
7243 Note however that in some environments this assumption is not true.
7244 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7245 for programs that depend on that behavior.
7247 Some targets, especially embedded ones, disable this option at all levels.
7248 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7249 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7250 are enabled independently at different optimization levels.
7252 @item -fdevirtualize
7253 @opindex fdevirtualize
7254 Attempt to convert calls to virtual functions to direct calls.  This
7255 is done both within a procedure and interprocedurally as part of
7256 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7257 propagation (@option{-fipa-cp}).
7258 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7260 @item -fdevirtualize-speculatively
7261 @opindex fdevirtualize-speculatively
7262 Attempt to convert calls to virtual functions to speculative direct calls.
7263 Based on the analysis of the type inheritance graph, determine for a given call
7264 the set of likely targets. If the set is small, preferably of size 1, change
7265 the call into an conditional deciding on direct and indirect call.  The
7266 speculative calls enable more optimizations, such as inlining.  When they seem
7267 useless after further optimization, they are converted back into original form.
7269 @item -fexpensive-optimizations
7270 @opindex fexpensive-optimizations
7271 Perform a number of minor optimizations that are relatively expensive.
7273 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7275 @item -free
7276 @opindex free
7277 Attempt to remove redundant extension instructions.  This is especially
7278 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7279 registers after writing to their lower 32-bit half.
7281 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7283 @item -foptimize-register-move
7284 @itemx -fregmove
7285 @opindex foptimize-register-move
7286 @opindex fregmove
7287 Attempt to reassign register numbers in move instructions and as
7288 operands of other simple instructions in order to maximize the amount of
7289 register tying.  This is especially helpful on machines with two-operand
7290 instructions.
7292 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7293 optimization.
7295 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7297 @item -fira-algorithm=@var{algorithm}
7298 Use the specified coloring algorithm for the integrated register
7299 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7300 specifies Chow's priority coloring, or @samp{CB}, which specifies
7301 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7302 for all architectures, but for those targets that do support it, it is
7303 the default because it generates better code.
7305 @item -fira-region=@var{region}
7306 Use specified regions for the integrated register allocator.  The
7307 @var{region} argument should be one of the following:
7309 @table @samp
7311 @item all
7312 Use all loops as register allocation regions.
7313 This can give the best results for machines with a small and/or
7314 irregular register set.
7316 @item mixed
7317 Use all loops except for loops with small register pressure 
7318 as the regions.  This value usually gives
7319 the best results in most cases and for most architectures,
7320 and is enabled by default when compiling with optimization for speed
7321 (@option{-O}, @option{-O2}, @dots{}).
7323 @item one
7324 Use all functions as a single region.  
7325 This typically results in the smallest code size, and is enabled by default for
7326 @option{-Os} or @option{-O0}.
7328 @end table
7330 @item -fira-hoist-pressure
7331 @opindex fira-hoist-pressure
7332 Use IRA to evaluate register pressure in the code hoisting pass for
7333 decisions to hoist expressions.  This option usually results in smaller
7334 code, but it can slow the compiler down.
7336 This option is enabled at level @option{-Os} for all targets.
7338 @item -fira-loop-pressure
7339 @opindex fira-loop-pressure
7340 Use IRA to evaluate register pressure in loops for decisions to move
7341 loop invariants.  This option usually results in generation
7342 of faster and smaller code on machines with large register files (>= 32
7343 registers), but it can slow the compiler down.
7345 This option is enabled at level @option{-O3} for some targets.
7347 @item -fno-ira-share-save-slots
7348 @opindex fno-ira-share-save-slots
7349 Disable sharing of stack slots used for saving call-used hard
7350 registers living through a call.  Each hard register gets a
7351 separate stack slot, and as a result function stack frames are
7352 larger.
7354 @item -fno-ira-share-spill-slots
7355 @opindex fno-ira-share-spill-slots
7356 Disable sharing of stack slots allocated for pseudo-registers.  Each
7357 pseudo-register that does not get a hard register gets a separate
7358 stack slot, and as a result function stack frames are larger.
7360 @item -fira-verbose=@var{n}
7361 @opindex fira-verbose
7362 Control the verbosity of the dump file for the integrated register allocator.
7363 The default value is 5.  If the value @var{n} is greater or equal to 10,
7364 the dump output is sent to stderr using the same format as @var{n} minus 10.
7366 @item -fdelayed-branch
7367 @opindex fdelayed-branch
7368 If supported for the target machine, attempt to reorder instructions
7369 to exploit instruction slots available after delayed branch
7370 instructions.
7372 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7374 @item -fschedule-insns
7375 @opindex fschedule-insns
7376 If supported for the target machine, attempt to reorder instructions to
7377 eliminate execution stalls due to required data being unavailable.  This
7378 helps machines that have slow floating point or memory load instructions
7379 by allowing other instructions to be issued until the result of the load
7380 or floating-point instruction is required.
7382 Enabled at levels @option{-O2}, @option{-O3}.
7384 @item -fschedule-insns2
7385 @opindex fschedule-insns2
7386 Similar to @option{-fschedule-insns}, but requests an additional pass of
7387 instruction scheduling after register allocation has been done.  This is
7388 especially useful on machines with a relatively small number of
7389 registers and where memory load instructions take more than one cycle.
7391 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7393 @item -fno-sched-interblock
7394 @opindex fno-sched-interblock
7395 Don't schedule instructions across basic blocks.  This is normally
7396 enabled by default when scheduling before register allocation, i.e.@:
7397 with @option{-fschedule-insns} or at @option{-O2} or higher.
7399 @item -fno-sched-spec
7400 @opindex fno-sched-spec
7401 Don't allow speculative motion of non-load instructions.  This is normally
7402 enabled by default when scheduling before register allocation, i.e.@:
7403 with @option{-fschedule-insns} or at @option{-O2} or higher.
7405 @item -fsched-pressure
7406 @opindex fsched-pressure
7407 Enable register pressure sensitive insn scheduling before register
7408 allocation.  This only makes sense when scheduling before register
7409 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7410 @option{-O2} or higher.  Usage of this option can improve the
7411 generated code and decrease its size by preventing register pressure
7412 increase above the number of available hard registers and subsequent
7413 spills in register allocation.
7415 @item -fsched-spec-load
7416 @opindex fsched-spec-load
7417 Allow speculative motion of some load instructions.  This only makes
7418 sense when scheduling before register allocation, i.e.@: with
7419 @option{-fschedule-insns} or at @option{-O2} or higher.
7421 @item -fsched-spec-load-dangerous
7422 @opindex fsched-spec-load-dangerous
7423 Allow speculative motion of more load instructions.  This only makes
7424 sense when scheduling before register allocation, i.e.@: with
7425 @option{-fschedule-insns} or at @option{-O2} or higher.
7427 @item -fsched-stalled-insns
7428 @itemx -fsched-stalled-insns=@var{n}
7429 @opindex fsched-stalled-insns
7430 Define how many insns (if any) can be moved prematurely from the queue
7431 of stalled insns into the ready list during the second scheduling pass.
7432 @option{-fno-sched-stalled-insns} means that no insns are moved
7433 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7434 on how many queued insns can be moved prematurely.
7435 @option{-fsched-stalled-insns} without a value is equivalent to
7436 @option{-fsched-stalled-insns=1}.
7438 @item -fsched-stalled-insns-dep
7439 @itemx -fsched-stalled-insns-dep=@var{n}
7440 @opindex fsched-stalled-insns-dep
7441 Define how many insn groups (cycles) are examined for a dependency
7442 on a stalled insn that is a candidate for premature removal from the queue
7443 of stalled insns.  This has an effect only during the second scheduling pass,
7444 and only if @option{-fsched-stalled-insns} is used.
7445 @option{-fno-sched-stalled-insns-dep} is equivalent to
7446 @option{-fsched-stalled-insns-dep=0}.
7447 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7448 @option{-fsched-stalled-insns-dep=1}.
7450 @item -fsched2-use-superblocks
7451 @opindex fsched2-use-superblocks
7452 When scheduling after register allocation, use superblock scheduling.
7453 This allows motion across basic block boundaries,
7454 resulting in faster schedules.  This option is experimental, as not all machine
7455 descriptions used by GCC model the CPU closely enough to avoid unreliable
7456 results from the algorithm.
7458 This only makes sense when scheduling after register allocation, i.e.@: with
7459 @option{-fschedule-insns2} or at @option{-O2} or higher.
7461 @item -fsched-group-heuristic
7462 @opindex fsched-group-heuristic
7463 Enable the group heuristic in the scheduler.  This heuristic favors
7464 the instruction that belongs to a schedule group.  This is enabled
7465 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7466 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7468 @item -fsched-critical-path-heuristic
7469 @opindex fsched-critical-path-heuristic
7470 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7471 instructions on the critical path.  This is enabled by default when
7472 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7473 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7475 @item -fsched-spec-insn-heuristic
7476 @opindex fsched-spec-insn-heuristic
7477 Enable the speculative instruction heuristic in the scheduler.  This
7478 heuristic favors speculative instructions with greater dependency weakness.
7479 This is enabled by default when scheduling is enabled, i.e.@:
7480 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7481 or at @option{-O2} or higher.
7483 @item -fsched-rank-heuristic
7484 @opindex fsched-rank-heuristic
7485 Enable the rank heuristic in the scheduler.  This heuristic favors
7486 the instruction belonging to a basic block with greater size or frequency.
7487 This is enabled by default when scheduling is enabled, i.e.@:
7488 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7489 at @option{-O2} or higher.
7491 @item -fsched-last-insn-heuristic
7492 @opindex fsched-last-insn-heuristic
7493 Enable the last-instruction heuristic in the scheduler.  This heuristic
7494 favors the instruction that is less dependent on the last instruction
7495 scheduled.  This is enabled by default when scheduling is enabled,
7496 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7497 at @option{-O2} or higher.
7499 @item -fsched-dep-count-heuristic
7500 @opindex fsched-dep-count-heuristic
7501 Enable the dependent-count heuristic in the scheduler.  This heuristic
7502 favors the instruction that has more instructions depending on it.
7503 This is enabled by default when scheduling is enabled, i.e.@:
7504 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7505 at @option{-O2} or higher.
7507 @item -freschedule-modulo-scheduled-loops
7508 @opindex freschedule-modulo-scheduled-loops
7509 Modulo scheduling is performed before traditional scheduling.  If a loop
7510 is modulo scheduled, later scheduling passes may change its schedule.  
7511 Use this option to control that behavior.
7513 @item -fselective-scheduling
7514 @opindex fselective-scheduling
7515 Schedule instructions using selective scheduling algorithm.  Selective
7516 scheduling runs instead of the first scheduler pass.
7518 @item -fselective-scheduling2
7519 @opindex fselective-scheduling2
7520 Schedule instructions using selective scheduling algorithm.  Selective
7521 scheduling runs instead of the second scheduler pass.
7523 @item -fsel-sched-pipelining
7524 @opindex fsel-sched-pipelining
7525 Enable software pipelining of innermost loops during selective scheduling.
7526 This option has no effect unless one of @option{-fselective-scheduling} or
7527 @option{-fselective-scheduling2} is turned on.
7529 @item -fsel-sched-pipelining-outer-loops
7530 @opindex fsel-sched-pipelining-outer-loops
7531 When pipelining loops during selective scheduling, also pipeline outer loops.
7532 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7534 @item -fshrink-wrap
7535 @opindex fshrink-wrap
7536 Emit function prologues only before parts of the function that need it,
7537 rather than at the top of the function.  This flag is enabled by default at
7538 @option{-O} and higher.
7540 @item -fcaller-saves
7541 @opindex fcaller-saves
7542 Enable allocation of values to registers that are clobbered by
7543 function calls, by emitting extra instructions to save and restore the
7544 registers around such calls.  Such allocation is done only when it
7545 seems to result in better code.
7547 This option is always enabled by default on certain machines, usually
7548 those which have no call-preserved registers to use instead.
7550 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7552 @item -fcombine-stack-adjustments
7553 @opindex fcombine-stack-adjustments
7554 Tracks stack adjustments (pushes and pops) and stack memory references
7555 and then tries to find ways to combine them.
7557 Enabled by default at @option{-O1} and higher.
7559 @item -fconserve-stack
7560 @opindex fconserve-stack
7561 Attempt to minimize stack usage.  The compiler attempts to use less
7562 stack space, even if that makes the program slower.  This option
7563 implies setting the @option{large-stack-frame} parameter to 100
7564 and the @option{large-stack-frame-growth} parameter to 400.
7566 @item -ftree-reassoc
7567 @opindex ftree-reassoc
7568 Perform reassociation on trees.  This flag is enabled by default
7569 at @option{-O} and higher.
7571 @item -ftree-pre
7572 @opindex ftree-pre
7573 Perform partial redundancy elimination (PRE) on trees.  This flag is
7574 enabled by default at @option{-O2} and @option{-O3}.
7576 @item -ftree-partial-pre
7577 @opindex ftree-partial-pre
7578 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7579 enabled by default at @option{-O3}.
7581 @item -ftree-forwprop
7582 @opindex ftree-forwprop
7583 Perform forward propagation on trees.  This flag is enabled by default
7584 at @option{-O} and higher.
7586 @item -ftree-fre
7587 @opindex ftree-fre
7588 Perform full redundancy elimination (FRE) on trees.  The difference
7589 between FRE and PRE is that FRE only considers expressions
7590 that are computed on all paths leading to the redundant computation.
7591 This analysis is faster than PRE, though it exposes fewer redundancies.
7592 This flag is enabled by default at @option{-O} and higher.
7594 @item -ftree-phiprop
7595 @opindex ftree-phiprop
7596 Perform hoisting of loads from conditional pointers on trees.  This
7597 pass is enabled by default at @option{-O} and higher.
7599 @item -fhoist-adjacent-loads
7600 @opindex hoist-adjacent-loads
7601 Speculatively hoist loads from both branches of an if-then-else if the
7602 loads are from adjacent locations in the same structure and the target
7603 architecture has a conditional move instruction.  This flag is enabled
7604 by default at @option{-O2} and higher.
7606 @item -ftree-copy-prop
7607 @opindex ftree-copy-prop
7608 Perform copy propagation on trees.  This pass eliminates unnecessary
7609 copy operations.  This flag is enabled by default at @option{-O} and
7610 higher.
7612 @item -fipa-pure-const
7613 @opindex fipa-pure-const
7614 Discover which functions are pure or constant.
7615 Enabled by default at @option{-O} and higher.
7617 @item -fipa-reference
7618 @opindex fipa-reference
7619 Discover which static variables do not escape the
7620 compilation unit.
7621 Enabled by default at @option{-O} and higher.
7623 @item -fipa-pta
7624 @opindex fipa-pta
7625 Perform interprocedural pointer analysis and interprocedural modification
7626 and reference analysis.  This option can cause excessive memory and
7627 compile-time usage on large compilation units.  It is not enabled by
7628 default at any optimization level.
7630 @item -fipa-profile
7631 @opindex fipa-profile
7632 Perform interprocedural profile propagation.  The functions called only from
7633 cold functions are marked as cold. Also functions executed once (such as
7634 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7635 functions and loop less parts of functions executed once are then optimized for
7636 size.
7637 Enabled by default at @option{-O} and higher.
7639 @item -fipa-cp
7640 @opindex fipa-cp
7641 Perform interprocedural constant propagation.
7642 This optimization analyzes the program to determine when values passed
7643 to functions are constants and then optimizes accordingly.
7644 This optimization can substantially increase performance
7645 if the application has constants passed to functions.
7646 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7648 @item -fipa-cp-clone
7649 @opindex fipa-cp-clone
7650 Perform function cloning to make interprocedural constant propagation stronger.
7651 When enabled, interprocedural constant propagation performs function cloning
7652 when externally visible function can be called with constant arguments.
7653 Because this optimization can create multiple copies of functions,
7654 it may significantly increase code size
7655 (see @option{--param ipcp-unit-growth=@var{value}}).
7656 This flag is enabled by default at @option{-O3}.
7658 @item -ftree-sink
7659 @opindex ftree-sink
7660 Perform forward store motion  on trees.  This flag is
7661 enabled by default at @option{-O} and higher.
7663 @item -ftree-bit-ccp
7664 @opindex ftree-bit-ccp
7665 Perform sparse conditional bit constant propagation on trees and propagate
7666 pointer alignment information.
7667 This pass only operates on local scalar variables and is enabled by default
7668 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7670 @item -ftree-ccp
7671 @opindex ftree-ccp
7672 Perform sparse conditional constant propagation (CCP) on trees.  This
7673 pass only operates on local scalar variables and is enabled by default
7674 at @option{-O} and higher.
7676 @item -ftree-switch-conversion
7677 Perform conversion of simple initializations in a switch to
7678 initializations from a scalar array.  This flag is enabled by default
7679 at @option{-O2} and higher.
7681 @item -ftree-tail-merge
7682 Look for identical code sequences.  When found, replace one with a jump to the
7683 other.  This optimization is known as tail merging or cross jumping.  This flag
7684 is enabled by default at @option{-O2} and higher.  The compilation time
7685 in this pass can
7686 be limited using @option{max-tail-merge-comparisons} parameter and
7687 @option{max-tail-merge-iterations} parameter.
7689 @item -ftree-dce
7690 @opindex ftree-dce
7691 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7692 default at @option{-O} and higher.
7694 @item -ftree-builtin-call-dce
7695 @opindex ftree-builtin-call-dce
7696 Perform conditional dead code elimination (DCE) for calls to built-in functions
7697 that may set @code{errno} but are otherwise side-effect free.  This flag is
7698 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7699 specified.
7701 @item -ftree-dominator-opts
7702 @opindex ftree-dominator-opts
7703 Perform a variety of simple scalar cleanups (constant/copy
7704 propagation, redundancy elimination, range propagation and expression
7705 simplification) based on a dominator tree traversal.  This also
7706 performs jump threading (to reduce jumps to jumps). This flag is
7707 enabled by default at @option{-O} and higher.
7709 @item -ftree-dse
7710 @opindex ftree-dse
7711 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7712 a memory location that is later overwritten by another store without
7713 any intervening loads.  In this case the earlier store can be deleted.  This
7714 flag is enabled by default at @option{-O} and higher.
7716 @item -ftree-ch
7717 @opindex ftree-ch
7718 Perform loop header copying on trees.  This is beneficial since it increases
7719 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7720 is enabled by default at @option{-O} and higher.  It is not enabled
7721 for @option{-Os}, since it usually increases code size.
7723 @item -ftree-loop-optimize
7724 @opindex ftree-loop-optimize
7725 Perform loop optimizations on trees.  This flag is enabled by default
7726 at @option{-O} and higher.
7728 @item -ftree-loop-linear
7729 @opindex ftree-loop-linear
7730 Perform loop interchange transformations on tree.  Same as
7731 @option{-floop-interchange}.  To use this code transformation, GCC has
7732 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7733 enable the Graphite loop transformation infrastructure.
7735 @item -floop-interchange
7736 @opindex floop-interchange
7737 Perform loop interchange transformations on loops.  Interchanging two
7738 nested loops switches the inner and outer loops.  For example, given a
7739 loop like:
7740 @smallexample
7741 DO J = 1, M
7742   DO I = 1, N
7743     A(J, I) = A(J, I) * C
7744   ENDDO
7745 ENDDO
7746 @end smallexample
7747 loop interchange transforms the loop as if it were written:
7748 @smallexample
7749 DO I = 1, N
7750   DO J = 1, M
7751     A(J, I) = A(J, I) * C
7752   ENDDO
7753 ENDDO
7754 @end smallexample
7755 which can be beneficial when @code{N} is larger than the caches,
7756 because in Fortran, the elements of an array are stored in memory
7757 contiguously by column, and the original loop iterates over rows,
7758 potentially creating at each access a cache miss.  This optimization
7759 applies to all the languages supported by GCC and is not limited to
7760 Fortran.  To use this code transformation, GCC has to be configured
7761 with @option{--with-ppl} and @option{--with-cloog} to enable the
7762 Graphite loop transformation infrastructure.
7764 @item -floop-strip-mine
7765 @opindex floop-strip-mine
7766 Perform loop strip mining transformations on loops.  Strip mining
7767 splits a loop into two nested loops.  The outer loop has strides
7768 equal to the strip size and the inner loop has strides of the
7769 original loop within a strip.  The strip length can be changed
7770 using the @option{loop-block-tile-size} parameter.  For example,
7771 given a loop like:
7772 @smallexample
7773 DO I = 1, N
7774   A(I) = A(I) + C
7775 ENDDO
7776 @end smallexample
7777 loop strip mining transforms the loop as if it were written:
7778 @smallexample
7779 DO II = 1, N, 51
7780   DO I = II, min (II + 50, N)
7781     A(I) = A(I) + C
7782   ENDDO
7783 ENDDO
7784 @end smallexample
7785 This optimization applies to all the languages supported by GCC and is
7786 not limited to Fortran.  To use this code transformation, GCC has to
7787 be configured with @option{--with-ppl} and @option{--with-cloog} to
7788 enable the Graphite loop transformation infrastructure.
7790 @item -floop-block
7791 @opindex floop-block
7792 Perform loop blocking transformations on loops.  Blocking strip mines
7793 each loop in the loop nest such that the memory accesses of the
7794 element loops fit inside caches.  The strip length can be changed
7795 using the @option{loop-block-tile-size} parameter.  For example, given
7796 a loop like:
7797 @smallexample
7798 DO I = 1, N
7799   DO J = 1, M
7800     A(J, I) = B(I) + C(J)
7801   ENDDO
7802 ENDDO
7803 @end smallexample
7804 loop blocking transforms the loop as if it were written:
7805 @smallexample
7806 DO II = 1, N, 51
7807   DO JJ = 1, M, 51
7808     DO I = II, min (II + 50, N)
7809       DO J = JJ, min (JJ + 50, M)
7810         A(J, I) = B(I) + C(J)
7811       ENDDO
7812     ENDDO
7813   ENDDO
7814 ENDDO
7815 @end smallexample
7816 which can be beneficial when @code{M} is larger than the caches,
7817 because the innermost loop iterates over a smaller amount of data
7818 which can be kept in the caches.  This optimization applies to all the
7819 languages supported by GCC and is not limited to Fortran.  To use this
7820 code transformation, GCC has to be configured with @option{--with-ppl}
7821 and @option{--with-cloog} to enable the Graphite loop transformation
7822 infrastructure.
7824 @item -fgraphite-identity
7825 @opindex fgraphite-identity
7826 Enable the identity transformation for graphite.  For every SCoP we generate
7827 the polyhedral representation and transform it back to gimple.  Using
7828 @option{-fgraphite-identity} we can check the costs or benefits of the
7829 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7830 are also performed by the code generator CLooG, like index splitting and
7831 dead code elimination in loops.
7833 @item -floop-nest-optimize
7834 @opindex floop-nest-optimize
7835 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7836 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7837 structure optimized for data-locality and parallelism.  This option
7838 is experimental.
7840 @item -floop-parallelize-all
7841 @opindex floop-parallelize-all
7842 Use the Graphite data dependence analysis to identify loops that can
7843 be parallelized.  Parallelize all the loops that can be analyzed to
7844 not contain loop carried dependences without checking that it is
7845 profitable to parallelize the loops.
7847 @item -fcheck-data-deps
7848 @opindex fcheck-data-deps
7849 Compare the results of several data dependence analyzers.  This option
7850 is used for debugging the data dependence analyzers.
7852 @item -ftree-loop-if-convert
7853 Attempt to transform conditional jumps in the innermost loops to
7854 branch-less equivalents.  The intent is to remove control-flow from
7855 the innermost loops in order to improve the ability of the
7856 vectorization pass to handle these loops.  This is enabled by default
7857 if vectorization is enabled.
7859 @item -ftree-loop-if-convert-stores
7860 Attempt to also if-convert conditional jumps containing memory writes.
7861 This transformation can be unsafe for multi-threaded programs as it
7862 transforms conditional memory writes into unconditional memory writes.
7863 For example,
7864 @smallexample
7865 for (i = 0; i < N; i++)
7866   if (cond)
7867     A[i] = expr;
7868 @end smallexample
7869 is transformed to
7870 @smallexample
7871 for (i = 0; i < N; i++)
7872   A[i] = cond ? expr : A[i];
7873 @end smallexample
7874 potentially producing data races.
7876 @item -ftree-loop-distribution
7877 Perform loop distribution.  This flag can improve cache performance on
7878 big loop bodies and allow further loop optimizations, like
7879 parallelization or vectorization, to take place.  For example, the loop
7880 @smallexample
7881 DO I = 1, N
7882   A(I) = B(I) + C
7883   D(I) = E(I) * F
7884 ENDDO
7885 @end smallexample
7886 is transformed to
7887 @smallexample
7888 DO I = 1, N
7889    A(I) = B(I) + C
7890 ENDDO
7891 DO I = 1, N
7892    D(I) = E(I) * F
7893 ENDDO
7894 @end smallexample
7896 @item -ftree-loop-distribute-patterns
7897 Perform loop distribution of patterns that can be code generated with
7898 calls to a library.  This flag is enabled by default at @option{-O3}.
7900 This pass distributes the initialization loops and generates a call to
7901 memset zero.  For example, the loop
7902 @smallexample
7903 DO I = 1, N
7904   A(I) = 0
7905   B(I) = A(I) + I
7906 ENDDO
7907 @end smallexample
7908 is transformed to
7909 @smallexample
7910 DO I = 1, N
7911    A(I) = 0
7912 ENDDO
7913 DO I = 1, N
7914    B(I) = A(I) + I
7915 ENDDO
7916 @end smallexample
7917 and the initialization loop is transformed into a call to memset zero.
7919 @item -ftree-loop-im
7920 @opindex ftree-loop-im
7921 Perform loop invariant motion on trees.  This pass moves only invariants that
7922 are hard to handle at RTL level (function calls, operations that expand to
7923 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7924 operands of conditions that are invariant out of the loop, so that we can use
7925 just trivial invariantness analysis in loop unswitching.  The pass also includes
7926 store motion.
7928 @item -ftree-loop-ivcanon
7929 @opindex ftree-loop-ivcanon
7930 Create a canonical counter for number of iterations in loops for which
7931 determining number of iterations requires complicated analysis.  Later
7932 optimizations then may determine the number easily.  Useful especially
7933 in connection with unrolling.
7935 @item -fivopts
7936 @opindex fivopts
7937 Perform induction variable optimizations (strength reduction, induction
7938 variable merging and induction variable elimination) on trees.
7940 @item -ftree-parallelize-loops=n
7941 @opindex ftree-parallelize-loops
7942 Parallelize loops, i.e., split their iteration space to run in n threads.
7943 This is only possible for loops whose iterations are independent
7944 and can be arbitrarily reordered.  The optimization is only
7945 profitable on multiprocessor machines, for loops that are CPU-intensive,
7946 rather than constrained e.g.@: by memory bandwidth.  This option
7947 implies @option{-pthread}, and thus is only supported on targets
7948 that have support for @option{-pthread}.
7950 @item -ftree-pta
7951 @opindex ftree-pta
7952 Perform function-local points-to analysis on trees.  This flag is
7953 enabled by default at @option{-O} and higher.
7955 @item -ftree-sra
7956 @opindex ftree-sra
7957 Perform scalar replacement of aggregates.  This pass replaces structure
7958 references with scalars to prevent committing structures to memory too
7959 early.  This flag is enabled by default at @option{-O} and higher.
7961 @item -ftree-copyrename
7962 @opindex ftree-copyrename
7963 Perform copy renaming on trees.  This pass attempts to rename compiler
7964 temporaries to other variables at copy locations, usually resulting in
7965 variable names which more closely resemble the original variables.  This flag
7966 is enabled by default at @option{-O} and higher.
7968 @item -ftree-coalesce-inlined-vars
7969 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7970 combine small user-defined variables too, but only if they were inlined
7971 from other functions.  It is a more limited form of
7972 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7973 inlined variables, but it will keep variables of the inlined-into
7974 function apart from each other, such that they are more likely to
7975 contain the expected values in a debugging session.  This was the
7976 default in GCC versions older than 4.7.
7978 @item -ftree-coalesce-vars
7979 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7980 combine small user-defined variables too, instead of just compiler
7981 temporaries.  This may severely limit the ability to debug an optimized
7982 program compiled with @option{-fno-var-tracking-assignments}.  In the
7983 negated form, this flag prevents SSA coalescing of user variables,
7984 including inlined ones.  This option is enabled by default.
7986 @item -ftree-ter
7987 @opindex ftree-ter
7988 Perform temporary expression replacement during the SSA->normal phase.  Single
7989 use/single def temporaries are replaced at their use location with their
7990 defining expression.  This results in non-GIMPLE code, but gives the expanders
7991 much more complex trees to work on resulting in better RTL generation.  This is
7992 enabled by default at @option{-O} and higher.
7994 @item -ftree-slsr
7995 @opindex ftree-slsr
7996 Perform straight-line strength reduction on trees.  This recognizes related
7997 expressions involving multiplications and replaces them by less expensive
7998 calculations when possible.  This is enabled by default at @option{-O} and
7999 higher.
8001 @item -ftree-vectorize
8002 @opindex ftree-vectorize
8003 Perform loop vectorization on trees. This flag is enabled by default at
8004 @option{-O3}.
8006 @item -ftree-slp-vectorize
8007 @opindex ftree-slp-vectorize
8008 Perform basic block vectorization on trees. This flag is enabled by default at
8009 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8011 @item -ftree-vect-loop-version
8012 @opindex ftree-vect-loop-version
8013 Perform loop versioning when doing loop vectorization on trees.  When a loop
8014 appears to be vectorizable except that data alignment or data dependence cannot
8015 be determined at compile time, then vectorized and non-vectorized versions of
8016 the loop are generated along with run-time checks for alignment or dependence
8017 to control which version is executed.  This option is enabled by default
8018 except at level @option{-Os} where it is disabled.
8020 @item -fvect-cost-model
8021 @opindex fvect-cost-model
8022 Enable cost model for vectorization.  This option is enabled by default at
8023 @option{-O3}.
8025 @item -ftree-vrp
8026 @opindex ftree-vrp
8027 Perform Value Range Propagation on trees.  This is similar to the
8028 constant propagation pass, but instead of values, ranges of values are
8029 propagated.  This allows the optimizers to remove unnecessary range
8030 checks like array bound checks and null pointer checks.  This is
8031 enabled by default at @option{-O2} and higher.  Null pointer check
8032 elimination is only done if @option{-fdelete-null-pointer-checks} is
8033 enabled.
8035 @item -ftracer
8036 @opindex ftracer
8037 Perform tail duplication to enlarge superblock size.  This transformation
8038 simplifies the control flow of the function allowing other optimizations to do
8039 a better job.
8041 @item -funroll-loops
8042 @opindex funroll-loops
8043 Unroll loops whose number of iterations can be determined at compile
8044 time or upon entry to the loop.  @option{-funroll-loops} implies
8045 @option{-frerun-cse-after-loop}.  This option makes code larger,
8046 and may or may not make it run faster.
8048 @item -funroll-all-loops
8049 @opindex funroll-all-loops
8050 Unroll all loops, even if their number of iterations is uncertain when
8051 the loop is entered.  This usually makes programs run more slowly.
8052 @option{-funroll-all-loops} implies the same options as
8053 @option{-funroll-loops},
8055 @item -fsplit-ivs-in-unroller
8056 @opindex fsplit-ivs-in-unroller
8057 Enables expression of values of induction variables in later iterations
8058 of the unrolled loop using the value in the first iteration.  This breaks
8059 long dependency chains, thus improving efficiency of the scheduling passes.
8061 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8062 same effect.  However, that is not reliable in cases where the loop body
8063 is more complicated than a single basic block.  It also does not work at all
8064 on some architectures due to restrictions in the CSE pass.
8066 This optimization is enabled by default.
8068 @item -fvariable-expansion-in-unroller
8069 @opindex fvariable-expansion-in-unroller
8070 With this option, the compiler creates multiple copies of some
8071 local variables when unrolling a loop, which can result in superior code.
8073 @item -fpartial-inlining
8074 @opindex fpartial-inlining
8075 Inline parts of functions.  This option has any effect only
8076 when inlining itself is turned on by the @option{-finline-functions}
8077 or @option{-finline-small-functions} options.
8079 Enabled at level @option{-O2}.
8081 @item -fpredictive-commoning
8082 @opindex fpredictive-commoning
8083 Perform predictive commoning optimization, i.e., reusing computations
8084 (especially memory loads and stores) performed in previous
8085 iterations of loops.
8087 This option is enabled at level @option{-O3}.
8089 @item -fprefetch-loop-arrays
8090 @opindex fprefetch-loop-arrays
8091 If supported by the target machine, generate instructions to prefetch
8092 memory to improve the performance of loops that access large arrays.
8094 This option may generate better or worse code; results are highly
8095 dependent on the structure of loops within the source code.
8097 Disabled at level @option{-Os}.
8099 @item -fno-peephole
8100 @itemx -fno-peephole2
8101 @opindex fno-peephole
8102 @opindex fno-peephole2
8103 Disable any machine-specific peephole optimizations.  The difference
8104 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8105 are implemented in the compiler; some targets use one, some use the
8106 other, a few use both.
8108 @option{-fpeephole} is enabled by default.
8109 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8111 @item -fno-guess-branch-probability
8112 @opindex fno-guess-branch-probability
8113 Do not guess branch probabilities using heuristics.
8115 GCC uses heuristics to guess branch probabilities if they are
8116 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8117 heuristics are based on the control flow graph.  If some branch probabilities
8118 are specified by @samp{__builtin_expect}, then the heuristics are
8119 used to guess branch probabilities for the rest of the control flow graph,
8120 taking the @samp{__builtin_expect} info into account.  The interactions
8121 between the heuristics and @samp{__builtin_expect} can be complex, and in
8122 some cases, it may be useful to disable the heuristics so that the effects
8123 of @samp{__builtin_expect} are easier to understand.
8125 The default is @option{-fguess-branch-probability} at levels
8126 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8128 @item -freorder-blocks
8129 @opindex freorder-blocks
8130 Reorder basic blocks in the compiled function in order to reduce number of
8131 taken branches and improve code locality.
8133 Enabled at levels @option{-O2}, @option{-O3}.
8135 @item -freorder-blocks-and-partition
8136 @opindex freorder-blocks-and-partition
8137 In addition to reordering basic blocks in the compiled function, in order
8138 to reduce number of taken branches, partitions hot and cold basic blocks
8139 into separate sections of the assembly and .o files, to improve
8140 paging and cache locality performance.
8142 This optimization is automatically turned off in the presence of
8143 exception handling, for linkonce sections, for functions with a user-defined
8144 section attribute and on any architecture that does not support named
8145 sections.
8147 @item -freorder-functions
8148 @opindex freorder-functions
8149 Reorder functions in the object file in order to
8150 improve code locality.  This is implemented by using special
8151 subsections @code{.text.hot} for most frequently executed functions and
8152 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8153 the linker so object file format must support named sections and linker must
8154 place them in a reasonable way.
8156 Also profile feedback must be available to make this option effective.  See
8157 @option{-fprofile-arcs} for details.
8159 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8161 @item -fstrict-aliasing
8162 @opindex fstrict-aliasing
8163 Allow the compiler to assume the strictest aliasing rules applicable to
8164 the language being compiled.  For C (and C++), this activates
8165 optimizations based on the type of expressions.  In particular, an
8166 object of one type is assumed never to reside at the same address as an
8167 object of a different type, unless the types are almost the same.  For
8168 example, an @code{unsigned int} can alias an @code{int}, but not a
8169 @code{void*} or a @code{double}.  A character type may alias any other
8170 type.
8172 @anchor{Type-punning}Pay special attention to code like this:
8173 @smallexample
8174 union a_union @{
8175   int i;
8176   double d;
8179 int f() @{
8180   union a_union t;
8181   t.d = 3.0;
8182   return t.i;
8184 @end smallexample
8185 The practice of reading from a different union member than the one most
8186 recently written to (called ``type-punning'') is common.  Even with
8187 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8188 is accessed through the union type.  So, the code above works as
8189 expected.  @xref{Structures unions enumerations and bit-fields
8190 implementation}.  However, this code might not:
8191 @smallexample
8192 int f() @{
8193   union a_union t;
8194   int* ip;
8195   t.d = 3.0;
8196   ip = &t.i;
8197   return *ip;
8199 @end smallexample
8201 Similarly, access by taking the address, casting the resulting pointer
8202 and dereferencing the result has undefined behavior, even if the cast
8203 uses a union type, e.g.:
8204 @smallexample
8205 int f() @{
8206   double d = 3.0;
8207   return ((union a_union *) &d)->i;
8209 @end smallexample
8211 The @option{-fstrict-aliasing} option is enabled at levels
8212 @option{-O2}, @option{-O3}, @option{-Os}.
8214 @item -fstrict-overflow
8215 @opindex fstrict-overflow
8216 Allow the compiler to assume strict signed overflow rules, depending
8217 on the language being compiled.  For C (and C++) this means that
8218 overflow when doing arithmetic with signed numbers is undefined, which
8219 means that the compiler may assume that it does not happen.  This
8220 permits various optimizations.  For example, the compiler assumes
8221 that an expression like @code{i + 10 > i} is always true for
8222 signed @code{i}.  This assumption is only valid if signed overflow is
8223 undefined, as the expression is false if @code{i + 10} overflows when
8224 using twos complement arithmetic.  When this option is in effect any
8225 attempt to determine whether an operation on signed numbers 
8226 overflows must be written carefully to not actually involve overflow.
8228 This option also allows the compiler to assume strict pointer
8229 semantics: given a pointer to an object, if adding an offset to that
8230 pointer does not produce a pointer to the same object, the addition is
8231 undefined.  This permits the compiler to conclude that @code{p + u >
8232 p} is always true for a pointer @code{p} and unsigned integer
8233 @code{u}.  This assumption is only valid because pointer wraparound is
8234 undefined, as the expression is false if @code{p + u} overflows using
8235 twos complement arithmetic.
8237 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8238 that integer signed overflow is fully defined: it wraps.  When
8239 @option{-fwrapv} is used, there is no difference between
8240 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8241 integers.  With @option{-fwrapv} certain types of overflow are
8242 permitted.  For example, if the compiler gets an overflow when doing
8243 arithmetic on constants, the overflowed value can still be used with
8244 @option{-fwrapv}, but not otherwise.
8246 The @option{-fstrict-overflow} option is enabled at levels
8247 @option{-O2}, @option{-O3}, @option{-Os}.
8249 @item -falign-functions
8250 @itemx -falign-functions=@var{n}
8251 @opindex falign-functions
8252 Align the start of functions to the next power-of-two greater than
8253 @var{n}, skipping up to @var{n} bytes.  For instance,
8254 @option{-falign-functions=32} aligns functions to the next 32-byte
8255 boundary, but @option{-falign-functions=24} aligns to the next
8256 32-byte boundary only if this can be done by skipping 23 bytes or less.
8258 @option{-fno-align-functions} and @option{-falign-functions=1} are
8259 equivalent and mean that functions are not aligned.
8261 Some assemblers only support this flag when @var{n} is a power of two;
8262 in that case, it is rounded up.
8264 If @var{n} is not specified or is zero, use a machine-dependent default.
8266 Enabled at levels @option{-O2}, @option{-O3}.
8268 @item -falign-labels
8269 @itemx -falign-labels=@var{n}
8270 @opindex falign-labels
8271 Align all branch targets to a power-of-two boundary, skipping up to
8272 @var{n} bytes like @option{-falign-functions}.  This option can easily
8273 make code slower, because it must insert dummy operations for when the
8274 branch target is reached in the usual flow of the code.
8276 @option{-fno-align-labels} and @option{-falign-labels=1} are
8277 equivalent and mean that labels are not aligned.
8279 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8280 are greater than this value, then their values are used instead.
8282 If @var{n} is not specified or is zero, use a machine-dependent default
8283 which is very likely to be @samp{1}, meaning no alignment.
8285 Enabled at levels @option{-O2}, @option{-O3}.
8287 @item -falign-loops
8288 @itemx -falign-loops=@var{n}
8289 @opindex falign-loops
8290 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8291 like @option{-falign-functions}.  If the loops are
8292 executed many times, this makes up for any execution of the dummy
8293 operations.
8295 @option{-fno-align-loops} and @option{-falign-loops=1} are
8296 equivalent and mean that loops are not aligned.
8298 If @var{n} is not specified or is zero, use a machine-dependent default.
8300 Enabled at levels @option{-O2}, @option{-O3}.
8302 @item -falign-jumps
8303 @itemx -falign-jumps=@var{n}
8304 @opindex falign-jumps
8305 Align branch targets to a power-of-two boundary, for branch targets
8306 where the targets can only be reached by jumping, skipping up to @var{n}
8307 bytes like @option{-falign-functions}.  In this case, no dummy operations
8308 need be executed.
8310 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8311 equivalent and mean that loops are not aligned.
8313 If @var{n} is not specified or is zero, use a machine-dependent default.
8315 Enabled at levels @option{-O2}, @option{-O3}.
8317 @item -funit-at-a-time
8318 @opindex funit-at-a-time
8319 This option is left for compatibility reasons. @option{-funit-at-a-time}
8320 has no effect, while @option{-fno-unit-at-a-time} implies
8321 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8323 Enabled by default.
8325 @item -fno-toplevel-reorder
8326 @opindex fno-toplevel-reorder
8327 Do not reorder top-level functions, variables, and @code{asm}
8328 statements.  Output them in the same order that they appear in the
8329 input file.  When this option is used, unreferenced static variables
8330 are not removed.  This option is intended to support existing code
8331 that relies on a particular ordering.  For new code, it is better to
8332 use attributes.
8334 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8335 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8336 targets.
8338 @item -fweb
8339 @opindex fweb
8340 Constructs webs as commonly used for register allocation purposes and assign
8341 each web individual pseudo register.  This allows the register allocation pass
8342 to operate on pseudos directly, but also strengthens several other optimization
8343 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8344 however, make debugging impossible, since variables no longer stay in a
8345 ``home register''.
8347 Enabled by default with @option{-funroll-loops}.
8349 @item -fwhole-program
8350 @opindex fwhole-program
8351 Assume that the current compilation unit represents the whole program being
8352 compiled.  All public functions and variables with the exception of @code{main}
8353 and those merged by attribute @code{externally_visible} become static functions
8354 and in effect are optimized more aggressively by interprocedural optimizers.
8356 This option should not be used in combination with @code{-flto}.
8357 Instead relying on a linker plugin should provide safer and more precise
8358 information.
8360 @item -flto[=@var{n}]
8361 @opindex flto
8362 This option runs the standard link-time optimizer.  When invoked
8363 with source code, it generates GIMPLE (one of GCC's internal
8364 representations) and writes it to special ELF sections in the object
8365 file.  When the object files are linked together, all the function
8366 bodies are read from these ELF sections and instantiated as if they
8367 had been part of the same translation unit.
8369 To use the link-time optimizer, @option{-flto} needs to be specified at
8370 compile time and during the final link.  For example:
8372 @smallexample
8373 gcc -c -O2 -flto foo.c
8374 gcc -c -O2 -flto bar.c
8375 gcc -o myprog -flto -O2 foo.o bar.o
8376 @end smallexample
8378 The first two invocations to GCC save a bytecode representation
8379 of GIMPLE into special ELF sections inside @file{foo.o} and
8380 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8381 @file{foo.o} and @file{bar.o}, merges the two files into a single
8382 internal image, and compiles the result as usual.  Since both
8383 @file{foo.o} and @file{bar.o} are merged into a single image, this
8384 causes all the interprocedural analyses and optimizations in GCC to
8385 work across the two files as if they were a single one.  This means,
8386 for example, that the inliner is able to inline functions in
8387 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8389 Another (simpler) way to enable link-time optimization is:
8391 @smallexample
8392 gcc -o myprog -flto -O2 foo.c bar.c
8393 @end smallexample
8395 The above generates bytecode for @file{foo.c} and @file{bar.c},
8396 merges them together into a single GIMPLE representation and optimizes
8397 them as usual to produce @file{myprog}.
8399 The only important thing to keep in mind is that to enable link-time
8400 optimizations the @option{-flto} flag needs to be passed to both the
8401 compile and the link commands.
8403 To make whole program optimization effective, it is necessary to make
8404 certain whole program assumptions.  The compiler needs to know
8405 what functions and variables can be accessed by libraries and runtime
8406 outside of the link-time optimized unit.  When supported by the linker,
8407 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8408 to the compiler about used and externally visible symbols.  When
8409 the linker plugin is not available, @option{-fwhole-program} should be
8410 used to allow the compiler to make these assumptions, which leads
8411 to more aggressive optimization decisions.
8413 Note that when a file is compiled with @option{-flto}, the generated
8414 object file is larger than a regular object file because it 
8415 contains GIMPLE bytecodes and the usual final code.  This means that
8416 object files with LTO information can be linked as normal object
8417 files; if @option{-flto} is not passed to the linker, no
8418 interprocedural optimizations are applied.
8420 Additionally, the optimization flags used to compile individual files
8421 are not necessarily related to those used at link time.  For instance,
8423 @smallexample
8424 gcc -c -O0 -flto foo.c
8425 gcc -c -O0 -flto bar.c
8426 gcc -o myprog -flto -O3 foo.o bar.o
8427 @end smallexample
8429 This produces individual object files with unoptimized assembler
8430 code, but the resulting binary @file{myprog} is optimized at
8431 @option{-O3}.  If, instead, the final binary is generated without
8432 @option{-flto}, then @file{myprog} is not optimized.
8434 When producing the final binary with @option{-flto}, GCC only
8435 applies link-time optimizations to those files that contain bytecode.
8436 Therefore, you can mix and match object files and libraries with
8437 GIMPLE bytecodes and final object code.  GCC automatically selects
8438 which files to optimize in LTO mode and which files to link without
8439 further processing.
8441 There are some code generation flags preserved by GCC when
8442 generating bytecodes, as they need to be used during the final link
8443 stage.  Currently, the following options are saved into the GIMPLE
8444 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8445 @option{-m} target flags.
8447 At link time, these options are read in and reapplied.  Note that the
8448 current implementation makes no attempt to recognize conflicting
8449 values for these options.  If different files have conflicting option
8450 values (e.g., one file is compiled with @option{-fPIC} and another
8451 isn't), the compiler simply uses the last value read from the
8452 bytecode files.  It is recommended, then, that you compile all the files
8453 participating in the same link with the same options.
8455 If LTO encounters objects with C linkage declared with incompatible
8456 types in separate translation units to be linked together (undefined
8457 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8458 issued.  The behavior is still undefined at run time.
8460 Another feature of LTO is that it is possible to apply interprocedural
8461 optimizations on files written in different languages.  This requires
8462 support in the language front end.  Currently, the C, C++ and
8463 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8464 something like this should work:
8466 @smallexample
8467 gcc -c -flto foo.c
8468 g++ -c -flto bar.cc
8469 gfortran -c -flto baz.f90
8470 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8471 @end smallexample
8473 Notice that the final link is done with @command{g++} to get the C++
8474 runtime libraries and @option{-lgfortran} is added to get the Fortran
8475 runtime libraries.  In general, when mixing languages in LTO mode, you
8476 should use the same link command options as when mixing languages in a
8477 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8478 all the compile and link commands.
8480 If object files containing GIMPLE bytecode are stored in a library archive, say
8481 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8482 are using a linker with plugin support.  To enable this feature, use
8483 the flag @option{-fuse-linker-plugin} at link time:
8485 @smallexample
8486 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8487 @end smallexample
8489 With the linker plugin enabled, the linker extracts the needed
8490 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8491 to make them part of the aggregated GIMPLE image to be optimized.
8493 If you are not using a linker with plugin support and/or do not
8494 enable the linker plugin, then the objects inside @file{libfoo.a}
8495 are extracted and linked as usual, but they do not participate
8496 in the LTO optimization process.
8498 Link-time optimizations do not require the presence of the whole program to
8499 operate.  If the program does not require any symbols to be exported, it is
8500 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8501 the interprocedural optimizers to use more aggressive assumptions which may
8502 lead to improved optimization opportunities.
8503 Use of @option{-fwhole-program} is not needed when linker plugin is
8504 active (see @option{-fuse-linker-plugin}).
8506 The current implementation of LTO makes no
8507 attempt to generate bytecode that is portable between different
8508 types of hosts.  The bytecode files are versioned and there is a
8509 strict version check, so bytecode files generated in one version of
8510 GCC will not work with an older/newer version of GCC@.
8512 Link-time optimization does not work well with generation of debugging
8513 information.  Combining @option{-flto} with
8514 @option{-g} is currently experimental and expected to produce wrong
8515 results.
8517 If you specify the optional @var{n}, the optimization and code
8518 generation done at link time is executed in parallel using @var{n}
8519 parallel jobs by utilizing an installed @command{make} program.  The
8520 environment variable @env{MAKE} may be used to override the program
8521 used.  The default value for @var{n} is 1.
8523 You can also specify @option{-flto=jobserver} to use GNU make's
8524 job server mode to determine the number of parallel jobs. This
8525 is useful when the Makefile calling GCC is already executing in parallel.
8526 You must prepend a @samp{+} to the command recipe in the parent Makefile
8527 for this to work.  This option likely only works if @env{MAKE} is
8528 GNU make.
8530 This option is disabled by default.
8532 @item -flto-partition=@var{alg}
8533 @opindex flto-partition
8534 Specify the partitioning algorithm used by the link-time optimizer.
8535 The value is either @code{1to1} to specify a partitioning mirroring
8536 the original source files or @code{balanced} to specify partitioning
8537 into equally sized chunks (whenever possible) or @code{max} to create
8538 new partition for every symbol where possible.  Specifying @code{none}
8539 as an algorithm disables partitioning and streaming completely. 
8540 The default value is @code{balanced}. While @code{1to1} can be used
8541 as an workaround for various code ordering issues, the @code{max}
8542 partitioning is intended for internal testing only.
8544 @item -flto-compression-level=@var{n}
8545 This option specifies the level of compression used for intermediate
8546 language written to LTO object files, and is only meaningful in
8547 conjunction with LTO mode (@option{-flto}).  Valid
8548 values are 0 (no compression) to 9 (maximum compression).  Values
8549 outside this range are clamped to either 0 or 9.  If the option is not
8550 given, a default balanced compression setting is used.
8552 @item -flto-report
8553 Prints a report with internal details on the workings of the link-time
8554 optimizer.  The contents of this report vary from version to version.
8555 It is meant to be useful to GCC developers when processing object
8556 files in LTO mode (via @option{-flto}).
8558 Disabled by default.
8560 @item -flto-report-wpa
8561 Like @option{-flto-report}, but only print for the WPA phase of Link
8562 Time Optimization.
8564 @item -fuse-linker-plugin
8565 Enables the use of a linker plugin during link-time optimization.  This
8566 option relies on plugin support in the linker, which is available in gold
8567 or in GNU ld 2.21 or newer.
8569 This option enables the extraction of object files with GIMPLE bytecode out
8570 of library archives. This improves the quality of optimization by exposing
8571 more code to the link-time optimizer.  This information specifies what
8572 symbols can be accessed externally (by non-LTO object or during dynamic
8573 linking).  Resulting code quality improvements on binaries (and shared
8574 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8575 See @option{-flto} for a description of the effect of this flag and how to
8576 use it.
8578 This option is enabled by default when LTO support in GCC is enabled
8579 and GCC was configured for use with
8580 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8582 @item -ffat-lto-objects
8583 @opindex ffat-lto-objects
8584 Fat LTO objects are object files that contain both the intermediate language
8585 and the object code. This makes them usable for both LTO linking and normal
8586 linking. This option is effective only when compiling with @option{-flto}
8587 and is ignored at link time.
8589 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8590 requires the complete toolchain to be aware of LTO. It requires a linker with
8591 linker plugin support for basic functionality.  Additionally,
8592 @command{nm}, @command{ar} and @command{ranlib}
8593 need to support linker plugins to allow a full-featured build environment
8594 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8595 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8596 to these tools. With non fat LTO makefiles need to be modified to use them.
8598 The default is @option{-ffat-lto-objects} but this default is intended to
8599 change in future releases when linker plugin enabled environments become more
8600 common.
8602 @item -fcompare-elim
8603 @opindex fcompare-elim
8604 After register allocation and post-register allocation instruction splitting,
8605 identify arithmetic instructions that compute processor flags similar to a
8606 comparison operation based on that arithmetic.  If possible, eliminate the
8607 explicit comparison operation.
8609 This pass only applies to certain targets that cannot explicitly represent
8610 the comparison operation before register allocation is complete.
8612 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8614 @item -fuse-ld=bfd
8615 Use the @command{bfd} linker instead of the default linker.
8617 @item -fuse-ld=gold
8618 Use the @command{gold} linker instead of the default linker.
8620 @item -fcprop-registers
8621 @opindex fcprop-registers
8622 After register allocation and post-register allocation instruction splitting,
8623 perform a copy-propagation pass to try to reduce scheduling dependencies
8624 and occasionally eliminate the copy.
8626 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8628 @item -fprofile-correction
8629 @opindex fprofile-correction
8630 Profiles collected using an instrumented binary for multi-threaded programs may
8631 be inconsistent due to missed counter updates. When this option is specified,
8632 GCC uses heuristics to correct or smooth out such inconsistencies. By
8633 default, GCC emits an error message when an inconsistent profile is detected.
8635 @item -fprofile-dir=@var{path}
8636 @opindex fprofile-dir
8638 Set the directory to search for the profile data files in to @var{path}.
8639 This option affects only the profile data generated by
8640 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8641 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8642 and its related options.  Both absolute and relative paths can be used.
8643 By default, GCC uses the current directory as @var{path}, thus the
8644 profile data file appears in the same directory as the object file.
8646 @item -fprofile-generate
8647 @itemx -fprofile-generate=@var{path}
8648 @opindex fprofile-generate
8650 Enable options usually used for instrumenting application to produce
8651 profile useful for later recompilation with profile feedback based
8652 optimization.  You must use @option{-fprofile-generate} both when
8653 compiling and when linking your program.
8655 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8657 If @var{path} is specified, GCC looks at the @var{path} to find
8658 the profile feedback data files. See @option{-fprofile-dir}.
8660 @item -fprofile-use
8661 @itemx -fprofile-use=@var{path}
8662 @opindex fprofile-use
8663 Enable profile feedback directed optimizations, and optimizations
8664 generally profitable only with profile feedback available.
8666 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8667 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8668 @code{ftree-loop-distribute-patterns}
8670 By default, GCC emits an error message if the feedback profiles do not
8671 match the source code.  This error can be turned into a warning by using
8672 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8673 code.
8675 If @var{path} is specified, GCC looks at the @var{path} to find
8676 the profile feedback data files. See @option{-fprofile-dir}.
8677 @end table
8679 The following options control compiler behavior regarding floating-point 
8680 arithmetic.  These options trade off between speed and
8681 correctness.  All must be specifically enabled.
8683 @table @gcctabopt
8684 @item -ffloat-store
8685 @opindex ffloat-store
8686 Do not store floating-point variables in registers, and inhibit other
8687 options that might change whether a floating-point value is taken from a
8688 register or memory.
8690 @cindex floating-point precision
8691 This option prevents undesirable excess precision on machines such as
8692 the 68000 where the floating registers (of the 68881) keep more
8693 precision than a @code{double} is supposed to have.  Similarly for the
8694 x86 architecture.  For most programs, the excess precision does only
8695 good, but a few programs rely on the precise definition of IEEE floating
8696 point.  Use @option{-ffloat-store} for such programs, after modifying
8697 them to store all pertinent intermediate computations into variables.
8699 @item -fexcess-precision=@var{style}
8700 @opindex fexcess-precision
8701 This option allows further control over excess precision on machines
8702 where floating-point registers have more precision than the IEEE
8703 @code{float} and @code{double} types and the processor does not
8704 support operations rounding to those types.  By default,
8705 @option{-fexcess-precision=fast} is in effect; this means that
8706 operations are carried out in the precision of the registers and that
8707 it is unpredictable when rounding to the types specified in the source
8708 code takes place.  When compiling C, if
8709 @option{-fexcess-precision=standard} is specified then excess
8710 precision follows the rules specified in ISO C99; in particular,
8711 both casts and assignments cause values to be rounded to their
8712 semantic types (whereas @option{-ffloat-store} only affects
8713 assignments).  This option is enabled by default for C if a strict
8714 conformance option such as @option{-std=c99} is used.
8716 @opindex mfpmath
8717 @option{-fexcess-precision=standard} is not implemented for languages
8718 other than C, and has no effect if
8719 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8720 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8721 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8722 semantics apply without excess precision, and in the latter, rounding
8723 is unpredictable.
8725 @item -ffast-math
8726 @opindex ffast-math
8727 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8728 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8729 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8731 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8733 This option is not turned on by any @option{-O} option besides
8734 @option{-Ofast} since it can result in incorrect output for programs
8735 that depend on an exact implementation of IEEE or ISO rules/specifications
8736 for math functions. It may, however, yield faster code for programs
8737 that do not require the guarantees of these specifications.
8739 @item -fno-math-errno
8740 @opindex fno-math-errno
8741 Do not set @code{errno} after calling math functions that are executed
8742 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8743 IEEE exceptions for math error handling may want to use this flag
8744 for speed while maintaining IEEE arithmetic compatibility.
8746 This option is not turned on by any @option{-O} option since
8747 it can result in incorrect output for programs that depend on
8748 an exact implementation of IEEE or ISO rules/specifications for
8749 math functions. It may, however, yield faster code for programs
8750 that do not require the guarantees of these specifications.
8752 The default is @option{-fmath-errno}.
8754 On Darwin systems, the math library never sets @code{errno}.  There is
8755 therefore no reason for the compiler to consider the possibility that
8756 it might, and @option{-fno-math-errno} is the default.
8758 @item -funsafe-math-optimizations
8759 @opindex funsafe-math-optimizations
8761 Allow optimizations for floating-point arithmetic that (a) assume
8762 that arguments and results are valid and (b) may violate IEEE or
8763 ANSI standards.  When used at link-time, it may include libraries
8764 or startup files that change the default FPU control word or other
8765 similar optimizations.
8767 This option is not turned on by any @option{-O} option since
8768 it can result in incorrect output for programs that depend on
8769 an exact implementation of IEEE or ISO rules/specifications for
8770 math functions. It may, however, yield faster code for programs
8771 that do not require the guarantees of these specifications.
8772 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8773 @option{-fassociative-math} and @option{-freciprocal-math}.
8775 The default is @option{-fno-unsafe-math-optimizations}.
8777 @item -fassociative-math
8778 @opindex fassociative-math
8780 Allow re-association of operands in series of floating-point operations.
8781 This violates the ISO C and C++ language standard by possibly changing
8782 computation result.  NOTE: re-ordering may change the sign of zero as
8783 well as ignore NaNs and inhibit or create underflow or overflow (and
8784 thus cannot be used on code that relies on rounding behavior like
8785 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8786 and thus may not be used when ordered comparisons are required.
8787 This option requires that both @option{-fno-signed-zeros} and
8788 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8789 much sense with @option{-frounding-math}. For Fortran the option
8790 is automatically enabled when both @option{-fno-signed-zeros} and
8791 @option{-fno-trapping-math} are in effect.
8793 The default is @option{-fno-associative-math}.
8795 @item -freciprocal-math
8796 @opindex freciprocal-math
8798 Allow the reciprocal of a value to be used instead of dividing by
8799 the value if this enables optimizations.  For example @code{x / y}
8800 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8801 is subject to common subexpression elimination.  Note that this loses
8802 precision and increases the number of flops operating on the value.
8804 The default is @option{-fno-reciprocal-math}.
8806 @item -ffinite-math-only
8807 @opindex ffinite-math-only
8808 Allow optimizations for floating-point arithmetic that assume
8809 that arguments and results are not NaNs or +-Infs.
8811 This option is not turned on by any @option{-O} option since
8812 it can result in incorrect output for programs that depend on
8813 an exact implementation of IEEE or ISO rules/specifications for
8814 math functions. It may, however, yield faster code for programs
8815 that do not require the guarantees of these specifications.
8817 The default is @option{-fno-finite-math-only}.
8819 @item -fno-signed-zeros
8820 @opindex fno-signed-zeros
8821 Allow optimizations for floating-point arithmetic that ignore the
8822 signedness of zero.  IEEE arithmetic specifies the behavior of
8823 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8824 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8825 This option implies that the sign of a zero result isn't significant.
8827 The default is @option{-fsigned-zeros}.
8829 @item -fno-trapping-math
8830 @opindex fno-trapping-math
8831 Compile code assuming that floating-point operations cannot generate
8832 user-visible traps.  These traps include division by zero, overflow,
8833 underflow, inexact result and invalid operation.  This option requires
8834 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8835 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8837 This option should never be turned on by any @option{-O} option since
8838 it can result in incorrect output for programs that depend on
8839 an exact implementation of IEEE or ISO rules/specifications for
8840 math functions.
8842 The default is @option{-ftrapping-math}.
8844 @item -frounding-math
8845 @opindex frounding-math
8846 Disable transformations and optimizations that assume default floating-point
8847 rounding behavior.  This is round-to-zero for all floating point
8848 to integer conversions, and round-to-nearest for all other arithmetic
8849 truncations.  This option should be specified for programs that change
8850 the FP rounding mode dynamically, or that may be executed with a
8851 non-default rounding mode.  This option disables constant folding of
8852 floating-point expressions at compile time (which may be affected by
8853 rounding mode) and arithmetic transformations that are unsafe in the
8854 presence of sign-dependent rounding modes.
8856 The default is @option{-fno-rounding-math}.
8858 This option is experimental and does not currently guarantee to
8859 disable all GCC optimizations that are affected by rounding mode.
8860 Future versions of GCC may provide finer control of this setting
8861 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8862 will be used to specify the default state for @code{FENV_ACCESS}.
8864 @item -fsignaling-nans
8865 @opindex fsignaling-nans
8866 Compile code assuming that IEEE signaling NaNs may generate user-visible
8867 traps during floating-point operations.  Setting this option disables
8868 optimizations that may change the number of exceptions visible with
8869 signaling NaNs.  This option implies @option{-ftrapping-math}.
8871 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8872 be defined.
8874 The default is @option{-fno-signaling-nans}.
8876 This option is experimental and does not currently guarantee to
8877 disable all GCC optimizations that affect signaling NaN behavior.
8879 @item -fsingle-precision-constant
8880 @opindex fsingle-precision-constant
8881 Treat floating-point constants as single precision instead of
8882 implicitly converting them to double-precision constants.
8884 @item -fcx-limited-range
8885 @opindex fcx-limited-range
8886 When enabled, this option states that a range reduction step is not
8887 needed when performing complex division.  Also, there is no checking
8888 whether the result of a complex multiplication or division is @code{NaN
8889 + I*NaN}, with an attempt to rescue the situation in that case.  The
8890 default is @option{-fno-cx-limited-range}, but is enabled by
8891 @option{-ffast-math}.
8893 This option controls the default setting of the ISO C99
8894 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8895 all languages.
8897 @item -fcx-fortran-rules
8898 @opindex fcx-fortran-rules
8899 Complex multiplication and division follow Fortran rules.  Range
8900 reduction is done as part of complex division, but there is no checking
8901 whether the result of a complex multiplication or division is @code{NaN
8902 + I*NaN}, with an attempt to rescue the situation in that case.
8904 The default is @option{-fno-cx-fortran-rules}.
8906 @end table
8908 The following options control optimizations that may improve
8909 performance, but are not enabled by any @option{-O} options.  This
8910 section includes experimental options that may produce broken code.
8912 @table @gcctabopt
8913 @item -fbranch-probabilities
8914 @opindex fbranch-probabilities
8915 After running a program compiled with @option{-fprofile-arcs}
8916 (@pxref{Debugging Options,, Options for Debugging Your Program or
8917 @command{gcc}}), you can compile it a second time using
8918 @option{-fbranch-probabilities}, to improve optimizations based on
8919 the number of times each branch was taken.  When a program
8920 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8921 counts to a file called @file{@var{sourcename}.gcda} for each source
8922 file.  The information in this data file is very dependent on the
8923 structure of the generated code, so you must use the same source code
8924 and the same optimization options for both compilations.
8926 With @option{-fbranch-probabilities}, GCC puts a
8927 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8928 These can be used to improve optimization.  Currently, they are only
8929 used in one place: in @file{reorg.c}, instead of guessing which path a
8930 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8931 exactly determine which path is taken more often.
8933 @item -fprofile-values
8934 @opindex fprofile-values
8935 If combined with @option{-fprofile-arcs}, it adds code so that some
8936 data about values of expressions in the program is gathered.
8938 With @option{-fbranch-probabilities}, it reads back the data gathered
8939 from profiling values of expressions for usage in optimizations.
8941 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8943 @item -fvpt
8944 @opindex fvpt
8945 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8946 to add code to gather information about values of expressions.
8948 With @option{-fbranch-probabilities}, it reads back the data gathered
8949 and actually performs the optimizations based on them.
8950 Currently the optimizations include specialization of division operations
8951 using the knowledge about the value of the denominator.
8953 @item -frename-registers
8954 @opindex frename-registers
8955 Attempt to avoid false dependencies in scheduled code by making use
8956 of registers left over after register allocation.  This optimization
8957 most benefits processors with lots of registers.  Depending on the
8958 debug information format adopted by the target, however, it can
8959 make debugging impossible, since variables no longer stay in
8960 a ``home register''.
8962 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8964 @item -ftracer
8965 @opindex ftracer
8966 Perform tail duplication to enlarge superblock size.  This transformation
8967 simplifies the control flow of the function allowing other optimizations to do
8968 a better job.
8970 Enabled with @option{-fprofile-use}.
8972 @item -funroll-loops
8973 @opindex funroll-loops
8974 Unroll loops whose number of iterations can be determined at compile time or
8975 upon entry to the loop.  @option{-funroll-loops} implies
8976 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8977 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8978 a small constant number of iterations).  This option makes code larger, and may
8979 or may not make it run faster.
8981 Enabled with @option{-fprofile-use}.
8983 @item -funroll-all-loops
8984 @opindex funroll-all-loops
8985 Unroll all loops, even if their number of iterations is uncertain when
8986 the loop is entered.  This usually makes programs run more slowly.
8987 @option{-funroll-all-loops} implies the same options as
8988 @option{-funroll-loops}.
8990 @item -fpeel-loops
8991 @opindex fpeel-loops
8992 Peels loops for which there is enough information that they do not
8993 roll much (from profile feedback).  It also turns on complete loop peeling
8994 (i.e.@: complete removal of loops with small constant number of iterations).
8996 Enabled with @option{-fprofile-use}.
8998 @item -fmove-loop-invariants
8999 @opindex fmove-loop-invariants
9000 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9001 at level @option{-O1}
9003 @item -funswitch-loops
9004 @opindex funswitch-loops
9005 Move branches with loop invariant conditions out of the loop, with duplicates
9006 of the loop on both branches (modified according to result of the condition).
9008 @item -ffunction-sections
9009 @itemx -fdata-sections
9010 @opindex ffunction-sections
9011 @opindex fdata-sections
9012 Place each function or data item into its own section in the output
9013 file if the target supports arbitrary sections.  The name of the
9014 function or the name of the data item determines the section's name
9015 in the output file.
9017 Use these options on systems where the linker can perform optimizations
9018 to improve locality of reference in the instruction space.  Most systems
9019 using the ELF object format and SPARC processors running Solaris 2 have
9020 linkers with such optimizations.  AIX may have these optimizations in
9021 the future.
9023 Only use these options when there are significant benefits from doing
9024 so.  When you specify these options, the assembler and linker
9025 create larger object and executable files and are also slower.
9026 You cannot use @code{gprof} on all systems if you
9027 specify this option, and you may have problems with debugging if
9028 you specify both this option and @option{-g}.
9030 @item -fbranch-target-load-optimize
9031 @opindex fbranch-target-load-optimize
9032 Perform branch target register load optimization before prologue / epilogue
9033 threading.
9034 The use of target registers can typically be exposed only during reload,
9035 thus hoisting loads out of loops and doing inter-block scheduling needs
9036 a separate optimization pass.
9038 @item -fbranch-target-load-optimize2
9039 @opindex fbranch-target-load-optimize2
9040 Perform branch target register load optimization after prologue / epilogue
9041 threading.
9043 @item -fbtr-bb-exclusive
9044 @opindex fbtr-bb-exclusive
9045 When performing branch target register load optimization, don't reuse
9046 branch target registers within any basic block.
9048 @item -fstack-protector
9049 @opindex fstack-protector
9050 Emit extra code to check for buffer overflows, such as stack smashing
9051 attacks.  This is done by adding a guard variable to functions with
9052 vulnerable objects.  This includes functions that call @code{alloca}, and
9053 functions with buffers larger than 8 bytes.  The guards are initialized
9054 when a function is entered and then checked when the function exits.
9055 If a guard check fails, an error message is printed and the program exits.
9057 @item -fstack-protector-all
9058 @opindex fstack-protector-all
9059 Like @option{-fstack-protector} except that all functions are protected.
9061 @item -fstack-protector-strong
9062 @opindex fstack-protector-strong
9063 Like @option{-fstack-protector} but includes additional functions to
9064 be protected --- those that have local array definitions, or have
9065 references to local frame addresses.
9067 @item -fsection-anchors
9068 @opindex fsection-anchors
9069 Try to reduce the number of symbolic address calculations by using
9070 shared ``anchor'' symbols to address nearby objects.  This transformation
9071 can help to reduce the number of GOT entries and GOT accesses on some
9072 targets.
9074 For example, the implementation of the following function @code{foo}:
9076 @smallexample
9077 static int a, b, c;
9078 int foo (void) @{ return a + b + c; @}
9079 @end smallexample
9081 @noindent
9082 usually calculates the addresses of all three variables, but if you
9083 compile it with @option{-fsection-anchors}, it accesses the variables
9084 from a common anchor point instead.  The effect is similar to the
9085 following pseudocode (which isn't valid C):
9087 @smallexample
9088 int foo (void)
9090   register int *xr = &x;
9091   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9093 @end smallexample
9095 Not all targets support this option.
9097 @item --param @var{name}=@var{value}
9098 @opindex param
9099 In some places, GCC uses various constants to control the amount of
9100 optimization that is done.  For example, GCC does not inline functions
9101 that contain more than a certain number of instructions.  You can
9102 control some of these constants on the command line using the
9103 @option{--param} option.
9105 The names of specific parameters, and the meaning of the values, are
9106 tied to the internals of the compiler, and are subject to change
9107 without notice in future releases.
9109 In each case, the @var{value} is an integer.  The allowable choices for
9110 @var{name} are:
9112 @table @gcctabopt
9113 @item predictable-branch-outcome
9114 When branch is predicted to be taken with probability lower than this threshold
9115 (in percent), then it is considered well predictable. The default is 10.
9117 @item max-crossjump-edges
9118 The maximum number of incoming edges to consider for cross-jumping.
9119 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9120 the number of edges incoming to each block.  Increasing values mean
9121 more aggressive optimization, making the compilation time increase with
9122 probably small improvement in executable size.
9124 @item min-crossjump-insns
9125 The minimum number of instructions that must be matched at the end
9126 of two blocks before cross-jumping is performed on them.  This
9127 value is ignored in the case where all instructions in the block being
9128 cross-jumped from are matched.  The default value is 5.
9130 @item max-grow-copy-bb-insns
9131 The maximum code size expansion factor when copying basic blocks
9132 instead of jumping.  The expansion is relative to a jump instruction.
9133 The default value is 8.
9135 @item max-goto-duplication-insns
9136 The maximum number of instructions to duplicate to a block that jumps
9137 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9138 passes, GCC factors computed gotos early in the compilation process,
9139 and unfactors them as late as possible.  Only computed jumps at the
9140 end of a basic blocks with no more than max-goto-duplication-insns are
9141 unfactored.  The default value is 8.
9143 @item max-delay-slot-insn-search
9144 The maximum number of instructions to consider when looking for an
9145 instruction to fill a delay slot.  If more than this arbitrary number of
9146 instructions are searched, the time savings from filling the delay slot
9147 are minimal, so stop searching.  Increasing values mean more
9148 aggressive optimization, making the compilation time increase with probably
9149 small improvement in execution time.
9151 @item max-delay-slot-live-search
9152 When trying to fill delay slots, the maximum number of instructions to
9153 consider when searching for a block with valid live register
9154 information.  Increasing this arbitrarily chosen value means more
9155 aggressive optimization, increasing the compilation time.  This parameter
9156 should be removed when the delay slot code is rewritten to maintain the
9157 control-flow graph.
9159 @item max-gcse-memory
9160 The approximate maximum amount of memory that can be allocated in
9161 order to perform the global common subexpression elimination
9162 optimization.  If more memory than specified is required, the
9163 optimization is not done.
9165 @item max-gcse-insertion-ratio
9166 If the ratio of expression insertions to deletions is larger than this value
9167 for any expression, then RTL PRE inserts or removes the expression and thus
9168 leaves partially redundant computations in the instruction stream.  The default value is 20.
9170 @item max-pending-list-length
9171 The maximum number of pending dependencies scheduling allows
9172 before flushing the current state and starting over.  Large functions
9173 with few branches or calls can create excessively large lists which
9174 needlessly consume memory and resources.
9176 @item max-modulo-backtrack-attempts
9177 The maximum number of backtrack attempts the scheduler should make
9178 when modulo scheduling a loop.  Larger values can exponentially increase
9179 compilation time.
9181 @item max-inline-insns-single
9182 Several parameters control the tree inliner used in GCC@.
9183 This number sets the maximum number of instructions (counted in GCC's
9184 internal representation) in a single function that the tree inliner
9185 considers for inlining.  This only affects functions declared
9186 inline and methods implemented in a class declaration (C++).
9187 The default value is 400.
9189 @item max-inline-insns-auto
9190 When you use @option{-finline-functions} (included in @option{-O3}),
9191 a lot of functions that would otherwise not be considered for inlining
9192 by the compiler are investigated.  To those functions, a different
9193 (more restrictive) limit compared to functions declared inline can
9194 be applied.
9195 The default value is 40.
9197 @item inline-min-speedup
9198 When estimated performance improvement of caller + callee runtime exceeds this
9199 threshold (in precent), the function can be inlined regardless the limit on
9200 @option{--param max-inline-insns-single} and @option{--param
9201 max-inline-insns-auto}.
9203 @item large-function-insns
9204 The limit specifying really large functions.  For functions larger than this
9205 limit after inlining, inlining is constrained by
9206 @option{--param large-function-growth}.  This parameter is useful primarily
9207 to avoid extreme compilation time caused by non-linear algorithms used by the
9208 back end.
9209 The default value is 2700.
9211 @item large-function-growth
9212 Specifies maximal growth of large function caused by inlining in percents.
9213 The default value is 100 which limits large function growth to 2.0 times
9214 the original size.
9216 @item large-unit-insns
9217 The limit specifying large translation unit.  Growth caused by inlining of
9218 units larger than this limit is limited by @option{--param inline-unit-growth}.
9219 For small units this might be too tight.
9220 For example, consider a unit consisting of function A
9221 that is inline and B that just calls A three times.  If B is small relative to
9222 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9223 large units consisting of small inlineable functions, however, the overall unit
9224 growth limit is needed to avoid exponential explosion of code size.  Thus for
9225 smaller units, the size is increased to @option{--param large-unit-insns}
9226 before applying @option{--param inline-unit-growth}.  The default is 10000.
9228 @item inline-unit-growth
9229 Specifies maximal overall growth of the compilation unit caused by inlining.
9230 The default value is 30 which limits unit growth to 1.3 times the original
9231 size.
9233 @item ipcp-unit-growth
9234 Specifies maximal overall growth of the compilation unit caused by
9235 interprocedural constant propagation.  The default value is 10 which limits
9236 unit growth to 1.1 times the original size.
9238 @item large-stack-frame
9239 The limit specifying large stack frames.  While inlining the algorithm is trying
9240 to not grow past this limit too much.  The default value is 256 bytes.
9242 @item large-stack-frame-growth
9243 Specifies maximal growth of large stack frames caused by inlining in percents.
9244 The default value is 1000 which limits large stack frame growth to 11 times
9245 the original size.
9247 @item max-inline-insns-recursive
9248 @itemx max-inline-insns-recursive-auto
9249 Specifies the maximum number of instructions an out-of-line copy of a
9250 self-recursive inline
9251 function can grow into by performing recursive inlining.
9253 For functions declared inline, @option{--param max-inline-insns-recursive} is
9254 taken into account.  For functions not declared inline, recursive inlining
9255 happens only when @option{-finline-functions} (included in @option{-O3}) is
9256 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9257 default value is 450.
9259 @item max-inline-recursive-depth
9260 @itemx max-inline-recursive-depth-auto
9261 Specifies the maximum recursion depth used for recursive inlining.
9263 For functions declared inline, @option{--param max-inline-recursive-depth} is
9264 taken into account.  For functions not declared inline, recursive inlining
9265 happens only when @option{-finline-functions} (included in @option{-O3}) is
9266 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9267 default value is 8.
9269 @item min-inline-recursive-probability
9270 Recursive inlining is profitable only for function having deep recursion
9271 in average and can hurt for function having little recursion depth by
9272 increasing the prologue size or complexity of function body to other
9273 optimizers.
9275 When profile feedback is available (see @option{-fprofile-generate}) the actual
9276 recursion depth can be guessed from probability that function recurses via a
9277 given call expression.  This parameter limits inlining only to call expressions
9278 whose probability exceeds the given threshold (in percents).
9279 The default value is 10.
9281 @item early-inlining-insns
9282 Specify growth that the early inliner can make.  In effect it increases
9283 the amount of inlining for code having a large abstraction penalty.
9284 The default value is 10.
9286 @item max-early-inliner-iterations
9287 @itemx max-early-inliner-iterations
9288 Limit of iterations of the early inliner.  This basically bounds
9289 the number of nested indirect calls the early inliner can resolve.
9290 Deeper chains are still handled by late inlining.
9292 @item comdat-sharing-probability
9293 @itemx comdat-sharing-probability
9294 Probability (in percent) that C++ inline function with comdat visibility
9295 are shared across multiple compilation units.  The default value is 20.
9297 @item min-vect-loop-bound
9298 The minimum number of iterations under which loops are not vectorized
9299 when @option{-ftree-vectorize} is used.  The number of iterations after
9300 vectorization needs to be greater than the value specified by this option
9301 to allow vectorization.  The default value is 0.
9303 @item gcse-cost-distance-ratio
9304 Scaling factor in calculation of maximum distance an expression
9305 can be moved by GCSE optimizations.  This is currently supported only in the
9306 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9307 is with simple expressions, i.e., the expressions that have cost
9308 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9309 hoisting of simple expressions.  The default value is 10.
9311 @item gcse-unrestricted-cost
9312 Cost, roughly measured as the cost of a single typical machine
9313 instruction, at which GCSE optimizations do not constrain
9314 the distance an expression can travel.  This is currently
9315 supported only in the code hoisting pass.  The lesser the cost,
9316 the more aggressive code hoisting is.  Specifying 0 
9317 allows all expressions to travel unrestricted distances.
9318 The default value is 3.
9320 @item max-hoist-depth
9321 The depth of search in the dominator tree for expressions to hoist.
9322 This is used to avoid quadratic behavior in hoisting algorithm.
9323 The value of 0 does not limit on the search, but may slow down compilation
9324 of huge functions.  The default value is 30.
9326 @item max-tail-merge-comparisons
9327 The maximum amount of similar bbs to compare a bb with.  This is used to
9328 avoid quadratic behavior in tree tail merging.  The default value is 10.
9330 @item max-tail-merge-iterations
9331 The maximum amount of iterations of the pass over the function.  This is used to
9332 limit compilation time in tree tail merging.  The default value is 2.
9334 @item max-unrolled-insns
9335 The maximum number of instructions that a loop may have to be unrolled.
9336 If a loop is unrolled, this parameter also determines how many times
9337 the loop code is unrolled.
9339 @item max-average-unrolled-insns
9340 The maximum number of instructions biased by probabilities of their execution
9341 that a loop may have to be unrolled.  If a loop is unrolled,
9342 this parameter also determines how many times the loop code is unrolled.
9344 @item max-unroll-times
9345 The maximum number of unrollings of a single loop.
9347 @item max-peeled-insns
9348 The maximum number of instructions that a loop may have to be peeled.
9349 If a loop is peeled, this parameter also determines how many times
9350 the loop code is peeled.
9352 @item max-peel-times
9353 The maximum number of peelings of a single loop.
9355 @item max-peel-branches
9356 The maximum number of branches on the hot path through the peeled sequence.
9358 @item max-completely-peeled-insns
9359 The maximum number of insns of a completely peeled loop.
9361 @item max-completely-peel-times
9362 The maximum number of iterations of a loop to be suitable for complete peeling.
9364 @item max-completely-peel-loop-nest-depth
9365 The maximum depth of a loop nest suitable for complete peeling.
9367 @item max-unswitch-insns
9368 The maximum number of insns of an unswitched loop.
9370 @item max-unswitch-level
9371 The maximum number of branches unswitched in a single loop.
9373 @item lim-expensive
9374 The minimum cost of an expensive expression in the loop invariant motion.
9376 @item iv-consider-all-candidates-bound
9377 Bound on number of candidates for induction variables, below which
9378 all candidates are considered for each use in induction variable
9379 optimizations.  If there are more candidates than this,
9380 only the most relevant ones are considered to avoid quadratic time complexity.
9382 @item iv-max-considered-uses
9383 The induction variable optimizations give up on loops that contain more
9384 induction variable uses.
9386 @item iv-always-prune-cand-set-bound
9387 If the number of candidates in the set is smaller than this value,
9388 always try to remove unnecessary ivs from the set
9389 when adding a new one.
9391 @item scev-max-expr-size
9392 Bound on size of expressions used in the scalar evolutions analyzer.
9393 Large expressions slow the analyzer.
9395 @item scev-max-expr-complexity
9396 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9397 Complex expressions slow the analyzer.
9399 @item omega-max-vars
9400 The maximum number of variables in an Omega constraint system.
9401 The default value is 128.
9403 @item omega-max-geqs
9404 The maximum number of inequalities in an Omega constraint system.
9405 The default value is 256.
9407 @item omega-max-eqs
9408 The maximum number of equalities in an Omega constraint system.
9409 The default value is 128.
9411 @item omega-max-wild-cards
9412 The maximum number of wildcard variables that the Omega solver is
9413 able to insert.  The default value is 18.
9415 @item omega-hash-table-size
9416 The size of the hash table in the Omega solver.  The default value is
9417 550.
9419 @item omega-max-keys
9420 The maximal number of keys used by the Omega solver.  The default
9421 value is 500.
9423 @item omega-eliminate-redundant-constraints
9424 When set to 1, use expensive methods to eliminate all redundant
9425 constraints.  The default value is 0.
9427 @item vect-max-version-for-alignment-checks
9428 The maximum number of run-time checks that can be performed when
9429 doing loop versioning for alignment in the vectorizer.  See option
9430 @option{-ftree-vect-loop-version} for more information.
9432 @item vect-max-version-for-alias-checks
9433 The maximum number of run-time checks that can be performed when
9434 doing loop versioning for alias in the vectorizer.  See option
9435 @option{-ftree-vect-loop-version} for more information.
9437 @item max-iterations-to-track
9438 The maximum number of iterations of a loop the brute-force algorithm
9439 for analysis of the number of iterations of the loop tries to evaluate.
9441 @item hot-bb-count-ws-permille
9442 A basic block profile count is considered hot if it contributes to 
9443 the given permillage (i.e. 0...1000) of the entire profiled execution.
9445 @item hot-bb-frequency-fraction
9446 Select fraction of the entry block frequency of executions of basic block in
9447 function given basic block needs to have to be considered hot.
9449 @item max-predicted-iterations
9450 The maximum number of loop iterations we predict statically.  This is useful
9451 in cases where a function contains a single loop with known bound and
9452 another loop with unknown bound.
9453 The known number of iterations is predicted correctly, while
9454 the unknown number of iterations average to roughly 10.  This means that the
9455 loop without bounds appears artificially cold relative to the other one.
9457 @item align-threshold
9459 Select fraction of the maximal frequency of executions of a basic block in
9460 a function to align the basic block.
9462 @item align-loop-iterations
9464 A loop expected to iterate at least the selected number of iterations is
9465 aligned.
9467 @item tracer-dynamic-coverage
9468 @itemx tracer-dynamic-coverage-feedback
9470 This value is used to limit superblock formation once the given percentage of
9471 executed instructions is covered.  This limits unnecessary code size
9472 expansion.
9474 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9475 feedback is available.  The real profiles (as opposed to statically estimated
9476 ones) are much less balanced allowing the threshold to be larger value.
9478 @item tracer-max-code-growth
9479 Stop tail duplication once code growth has reached given percentage.  This is
9480 a rather artificial limit, as most of the duplicates are eliminated later in
9481 cross jumping, so it may be set to much higher values than is the desired code
9482 growth.
9484 @item tracer-min-branch-ratio
9486 Stop reverse growth when the reverse probability of best edge is less than this
9487 threshold (in percent).
9489 @item tracer-min-branch-ratio
9490 @itemx tracer-min-branch-ratio-feedback
9492 Stop forward growth if the best edge has probability lower than this
9493 threshold.
9495 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9496 compilation for profile feedback and one for compilation without.  The value
9497 for compilation with profile feedback needs to be more conservative (higher) in
9498 order to make tracer effective.
9500 @item max-cse-path-length
9502 The maximum number of basic blocks on path that CSE considers.
9503 The default is 10.
9505 @item max-cse-insns
9506 The maximum number of instructions CSE processes before flushing.
9507 The default is 1000.
9509 @item ggc-min-expand
9511 GCC uses a garbage collector to manage its own memory allocation.  This
9512 parameter specifies the minimum percentage by which the garbage
9513 collector's heap should be allowed to expand between collections.
9514 Tuning this may improve compilation speed; it has no effect on code
9515 generation.
9517 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9518 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9519 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9520 GCC is not able to calculate RAM on a particular platform, the lower
9521 bound of 30% is used.  Setting this parameter and
9522 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9523 every opportunity.  This is extremely slow, but can be useful for
9524 debugging.
9526 @item ggc-min-heapsize
9528 Minimum size of the garbage collector's heap before it begins bothering
9529 to collect garbage.  The first collection occurs after the heap expands
9530 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9531 tuning this may improve compilation speed, and has no effect on code
9532 generation.
9534 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9535 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9536 with a lower bound of 4096 (four megabytes) and an upper bound of
9537 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9538 particular platform, the lower bound is used.  Setting this parameter
9539 very large effectively disables garbage collection.  Setting this
9540 parameter and @option{ggc-min-expand} to zero causes a full collection
9541 to occur at every opportunity.
9543 @item max-reload-search-insns
9544 The maximum number of instruction reload should look backward for equivalent
9545 register.  Increasing values mean more aggressive optimization, making the
9546 compilation time increase with probably slightly better performance.
9547 The default value is 100.
9549 @item max-cselib-memory-locations
9550 The maximum number of memory locations cselib should take into account.
9551 Increasing values mean more aggressive optimization, making the compilation time
9552 increase with probably slightly better performance.  The default value is 500.
9554 @item reorder-blocks-duplicate
9555 @itemx reorder-blocks-duplicate-feedback
9557 Used by the basic block reordering pass to decide whether to use unconditional
9558 branch or duplicate the code on its destination.  Code is duplicated when its
9559 estimated size is smaller than this value multiplied by the estimated size of
9560 unconditional jump in the hot spots of the program.
9562 The @option{reorder-block-duplicate-feedback} is used only when profile
9563 feedback is available.  It may be set to higher values than
9564 @option{reorder-block-duplicate} since information about the hot spots is more
9565 accurate.
9567 @item max-sched-ready-insns
9568 The maximum number of instructions ready to be issued the scheduler should
9569 consider at any given time during the first scheduling pass.  Increasing
9570 values mean more thorough searches, making the compilation time increase
9571 with probably little benefit.  The default value is 100.
9573 @item max-sched-region-blocks
9574 The maximum number of blocks in a region to be considered for
9575 interblock scheduling.  The default value is 10.
9577 @item max-pipeline-region-blocks
9578 The maximum number of blocks in a region to be considered for
9579 pipelining in the selective scheduler.  The default value is 15.
9581 @item max-sched-region-insns
9582 The maximum number of insns in a region to be considered for
9583 interblock scheduling.  The default value is 100.
9585 @item max-pipeline-region-insns
9586 The maximum number of insns in a region to be considered for
9587 pipelining in the selective scheduler.  The default value is 200.
9589 @item min-spec-prob
9590 The minimum probability (in percents) of reaching a source block
9591 for interblock speculative scheduling.  The default value is 40.
9593 @item max-sched-extend-regions-iters
9594 The maximum number of iterations through CFG to extend regions.
9595 A value of 0 (the default) disables region extensions.
9597 @item max-sched-insn-conflict-delay
9598 The maximum conflict delay for an insn to be considered for speculative motion.
9599 The default value is 3.
9601 @item sched-spec-prob-cutoff
9602 The minimal probability of speculation success (in percents), so that
9603 speculative insns are scheduled.
9604 The default value is 40.
9606 @item sched-spec-state-edge-prob-cutoff
9607 The minimum probability an edge must have for the scheduler to save its
9608 state across it.
9609 The default value is 10.
9611 @item sched-mem-true-dep-cost
9612 Minimal distance (in CPU cycles) between store and load targeting same
9613 memory locations.  The default value is 1.
9615 @item selsched-max-lookahead
9616 The maximum size of the lookahead window of selective scheduling.  It is a
9617 depth of search for available instructions.
9618 The default value is 50.
9620 @item selsched-max-sched-times
9621 The maximum number of times that an instruction is scheduled during
9622 selective scheduling.  This is the limit on the number of iterations
9623 through which the instruction may be pipelined.  The default value is 2.
9625 @item selsched-max-insns-to-rename
9626 The maximum number of best instructions in the ready list that are considered
9627 for renaming in the selective scheduler.  The default value is 2.
9629 @item sms-min-sc
9630 The minimum value of stage count that swing modulo scheduler
9631 generates.  The default value is 2.
9633 @item max-last-value-rtl
9634 The maximum size measured as number of RTLs that can be recorded in an expression
9635 in combiner for a pseudo register as last known value of that register.  The default
9636 is 10000.
9638 @item integer-share-limit
9639 Small integer constants can use a shared data structure, reducing the
9640 compiler's memory usage and increasing its speed.  This sets the maximum
9641 value of a shared integer constant.  The default value is 256.
9643 @item ssp-buffer-size
9644 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9645 protection when @option{-fstack-protection} is used.
9647 @item max-jump-thread-duplication-stmts
9648 Maximum number of statements allowed in a block that needs to be
9649 duplicated when threading jumps.
9651 @item max-fields-for-field-sensitive
9652 Maximum number of fields in a structure treated in
9653 a field sensitive manner during pointer analysis.  The default is zero
9654 for @option{-O0} and @option{-O1},
9655 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9657 @item prefetch-latency
9658 Estimate on average number of instructions that are executed before
9659 prefetch finishes.  The distance prefetched ahead is proportional
9660 to this constant.  Increasing this number may also lead to less
9661 streams being prefetched (see @option{simultaneous-prefetches}).
9663 @item simultaneous-prefetches
9664 Maximum number of prefetches that can run at the same time.
9666 @item l1-cache-line-size
9667 The size of cache line in L1 cache, in bytes.
9669 @item l1-cache-size
9670 The size of L1 cache, in kilobytes.
9672 @item l2-cache-size
9673 The size of L2 cache, in kilobytes.
9675 @item min-insn-to-prefetch-ratio
9676 The minimum ratio between the number of instructions and the
9677 number of prefetches to enable prefetching in a loop.
9679 @item prefetch-min-insn-to-mem-ratio
9680 The minimum ratio between the number of instructions and the
9681 number of memory references to enable prefetching in a loop.
9683 @item use-canonical-types
9684 Whether the compiler should use the ``canonical'' type system.  By
9685 default, this should always be 1, which uses a more efficient internal
9686 mechanism for comparing types in C++ and Objective-C++.  However, if
9687 bugs in the canonical type system are causing compilation failures,
9688 set this value to 0 to disable canonical types.
9690 @item switch-conversion-max-branch-ratio
9691 Switch initialization conversion refuses to create arrays that are
9692 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9693 branches in the switch.
9695 @item max-partial-antic-length
9696 Maximum length of the partial antic set computed during the tree
9697 partial redundancy elimination optimization (@option{-ftree-pre}) when
9698 optimizing at @option{-O3} and above.  For some sorts of source code
9699 the enhanced partial redundancy elimination optimization can run away,
9700 consuming all of the memory available on the host machine.  This
9701 parameter sets a limit on the length of the sets that are computed,
9702 which prevents the runaway behavior.  Setting a value of 0 for
9703 this parameter allows an unlimited set length.
9705 @item sccvn-max-scc-size
9706 Maximum size of a strongly connected component (SCC) during SCCVN
9707 processing.  If this limit is hit, SCCVN processing for the whole
9708 function is not done and optimizations depending on it are
9709 disabled.  The default maximum SCC size is 10000.
9711 @item sccvn-max-alias-queries-per-access
9712 Maximum number of alias-oracle queries we perform when looking for
9713 redundancies for loads and stores.  If this limit is hit the search
9714 is aborted and the load or store is not considered redundant.  The
9715 number of queries is algorithmically limited to the number of
9716 stores on all paths from the load to the function entry.
9717 The default maxmimum number of queries is 1000.
9719 @item ira-max-loops-num
9720 IRA uses regional register allocation by default.  If a function
9721 contains more loops than the number given by this parameter, only at most
9722 the given number of the most frequently-executed loops form regions
9723 for regional register allocation.  The default value of the
9724 parameter is 100.
9726 @item ira-max-conflict-table-size 
9727 Although IRA uses a sophisticated algorithm to compress the conflict
9728 table, the table can still require excessive amounts of memory for
9729 huge functions.  If the conflict table for a function could be more
9730 than the size in MB given by this parameter, the register allocator
9731 instead uses a faster, simpler, and lower-quality
9732 algorithm that does not require building a pseudo-register conflict table.  
9733 The default value of the parameter is 2000.
9735 @item ira-loop-reserved-regs
9736 IRA can be used to evaluate more accurate register pressure in loops
9737 for decisions to move loop invariants (see @option{-O3}).  The number
9738 of available registers reserved for some other purposes is given
9739 by this parameter.  The default value of the parameter is 2, which is
9740 the minimal number of registers needed by typical instructions.
9741 This value is the best found from numerous experiments.
9743 @item loop-invariant-max-bbs-in-loop
9744 Loop invariant motion can be very expensive, both in compilation time and
9745 in amount of needed compile-time memory, with very large loops.  Loops
9746 with more basic blocks than this parameter won't have loop invariant
9747 motion optimization performed on them.  The default value of the
9748 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9750 @item loop-max-datarefs-for-datadeps
9751 Building data dapendencies is expensive for very large loops.  This
9752 parameter limits the number of data references in loops that are
9753 considered for data dependence analysis.  These large loops are no
9754 handled by the optimizations using loop data dependencies.
9755 The default value is 1000.
9757 @item max-vartrack-size
9758 Sets a maximum number of hash table slots to use during variable
9759 tracking dataflow analysis of any function.  If this limit is exceeded
9760 with variable tracking at assignments enabled, analysis for that
9761 function is retried without it, after removing all debug insns from
9762 the function.  If the limit is exceeded even without debug insns, var
9763 tracking analysis is completely disabled for the function.  Setting
9764 the parameter to zero makes it unlimited.
9766 @item max-vartrack-expr-depth
9767 Sets a maximum number of recursion levels when attempting to map
9768 variable names or debug temporaries to value expressions.  This trades
9769 compilation time for more complete debug information.  If this is set too
9770 low, value expressions that are available and could be represented in
9771 debug information may end up not being used; setting this higher may
9772 enable the compiler to find more complex debug expressions, but compile
9773 time and memory use may grow.  The default is 12.
9775 @item min-nondebug-insn-uid
9776 Use uids starting at this parameter for nondebug insns.  The range below
9777 the parameter is reserved exclusively for debug insns created by
9778 @option{-fvar-tracking-assignments}, but debug insns may get
9779 (non-overlapping) uids above it if the reserved range is exhausted.
9781 @item ipa-sra-ptr-growth-factor
9782 IPA-SRA replaces a pointer to an aggregate with one or more new
9783 parameters only when their cumulative size is less or equal to
9784 @option{ipa-sra-ptr-growth-factor} times the size of the original
9785 pointer parameter.
9787 @item tm-max-aggregate-size
9788 When making copies of thread-local variables in a transaction, this
9789 parameter specifies the size in bytes after which variables are
9790 saved with the logging functions as opposed to save/restore code
9791 sequence pairs.  This option only applies when using
9792 @option{-fgnu-tm}.
9794 @item graphite-max-nb-scop-params
9795 To avoid exponential effects in the Graphite loop transforms, the
9796 number of parameters in a Static Control Part (SCoP) is bounded.  The
9797 default value is 10 parameters.  A variable whose value is unknown at
9798 compilation time and defined outside a SCoP is a parameter of the SCoP.
9800 @item graphite-max-bbs-per-function
9801 To avoid exponential effects in the detection of SCoPs, the size of
9802 the functions analyzed by Graphite is bounded.  The default value is
9803 100 basic blocks.
9805 @item loop-block-tile-size
9806 Loop blocking or strip mining transforms, enabled with
9807 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9808 loop in the loop nest by a given number of iterations.  The strip
9809 length can be changed using the @option{loop-block-tile-size}
9810 parameter.  The default value is 51 iterations.
9812 @item ipa-cp-value-list-size
9813 IPA-CP attempts to track all possible values and types passed to a function's
9814 parameter in order to propagate them and perform devirtualization.
9815 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9816 stores per one formal parameter of a function.
9818 @item lto-partitions
9819 Specify desired number of partitions produced during WHOPR compilation.
9820 The number of partitions should exceed the number of CPUs used for compilation.
9821 The default value is 32.
9823 @item lto-minpartition
9824 Size of minimal partition for WHOPR (in estimated instructions).
9825 This prevents expenses of splitting very small programs into too many
9826 partitions.
9828 @item cxx-max-namespaces-for-diagnostic-help
9829 The maximum number of namespaces to consult for suggestions when C++
9830 name lookup fails for an identifier.  The default is 1000.
9832 @item sink-frequency-threshold
9833 The maximum relative execution frequency (in percents) of the target block
9834 relative to a statement's original block to allow statement sinking of a
9835 statement.  Larger numbers result in more aggressive statement sinking.
9836 The default value is 75.  A small positive adjustment is applied for
9837 statements with memory operands as those are even more profitable so sink.
9839 @item max-stores-to-sink
9840 The maximum number of conditional stores paires that can be sunk.  Set to 0
9841 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9842 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9844 @item allow-load-data-races
9845 Allow optimizers to introduce new data races on loads.
9846 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9847 unless implicitly set by the @option{-fmemory-model=} option.
9849 @item allow-store-data-races
9850 Allow optimizers to introduce new data races on stores.
9851 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9852 unless implicitly set by the @option{-fmemory-model=} option.
9854 @item allow-packed-load-data-races
9855 Allow optimizers to introduce new data races on packed data loads.
9856 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9857 unless implicitly set by the @option{-fmemory-model=} option.
9859 @item allow-packed-store-data-races
9860 Allow optimizers to introduce new data races on packed data stores.
9861 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9862 unless implicitly set by the @option{-fmemory-model=} option.
9864 @item case-values-threshold
9865 The smallest number of different values for which it is best to use a
9866 jump-table instead of a tree of conditional branches.  If the value is
9867 0, use the default for the machine.  The default is 0.
9869 @item tree-reassoc-width
9870 Set the maximum number of instructions executed in parallel in
9871 reassociated tree. This parameter overrides target dependent
9872 heuristics used by default if has non zero value.
9874 @item sched-pressure-algorithm
9875 Choose between the two available implementations of
9876 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9877 and is the more likely to prevent instructions from being reordered.
9878 Algorithm 2 was designed to be a compromise between the relatively
9879 conservative approach taken by algorithm 1 and the rather aggressive
9880 approach taken by the default scheduler.  It relies more heavily on
9881 having a regular register file and accurate register pressure classes.
9882 See @file{haifa-sched.c} in the GCC sources for more details.
9884 The default choice depends on the target.
9886 @item max-slsr-cand-scan
9887 Set the maximum number of existing candidates that will be considered when
9888 seeking a basis for a new straight-line strength reduction candidate.
9890 @end table
9891 @end table
9893 @node Preprocessor Options
9894 @section Options Controlling the Preprocessor
9895 @cindex preprocessor options
9896 @cindex options, preprocessor
9898 These options control the C preprocessor, which is run on each C source
9899 file before actual compilation.
9901 If you use the @option{-E} option, nothing is done except preprocessing.
9902 Some of these options make sense only together with @option{-E} because
9903 they cause the preprocessor output to be unsuitable for actual
9904 compilation.
9906 @table @gcctabopt
9907 @item -Wp,@var{option}
9908 @opindex Wp
9909 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9910 and pass @var{option} directly through to the preprocessor.  If
9911 @var{option} contains commas, it is split into multiple options at the
9912 commas.  However, many options are modified, translated or interpreted
9913 by the compiler driver before being passed to the preprocessor, and
9914 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9915 interface is undocumented and subject to change, so whenever possible
9916 you should avoid using @option{-Wp} and let the driver handle the
9917 options instead.
9919 @item -Xpreprocessor @var{option}
9920 @opindex Xpreprocessor
9921 Pass @var{option} as an option to the preprocessor.  You can use this to
9922 supply system-specific preprocessor options that GCC does not 
9923 recognize.
9925 If you want to pass an option that takes an argument, you must use
9926 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9928 @item -no-integrated-cpp
9929 @opindex no-integrated-cpp
9930 Perform preprocessing as a separate pass before compilation.
9931 By default, GCC performs preprocessing as an integrated part of
9932 input tokenization and parsing.
9933 If this option is provided, the appropriate language front end
9934 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9935 and Objective-C, respectively) is instead invoked twice,
9936 once for preprocessing only and once for actual compilation
9937 of the preprocessed input.
9938 This option may be useful in conjunction with the @option{-B} or
9939 @option{-wrapper} options to specify an alternate preprocessor or
9940 perform additional processing of the program source between
9941 normal preprocessing and compilation.
9942 @end table
9944 @include cppopts.texi
9946 @node Assembler Options
9947 @section Passing Options to the Assembler
9949 @c prevent bad page break with this line
9950 You can pass options to the assembler.
9952 @table @gcctabopt
9953 @item -Wa,@var{option}
9954 @opindex Wa
9955 Pass @var{option} as an option to the assembler.  If @var{option}
9956 contains commas, it is split into multiple options at the commas.
9958 @item -Xassembler @var{option}
9959 @opindex Xassembler
9960 Pass @var{option} as an option to the assembler.  You can use this to
9961 supply system-specific assembler options that GCC does not
9962 recognize.
9964 If you want to pass an option that takes an argument, you must use
9965 @option{-Xassembler} twice, once for the option and once for the argument.
9967 @end table
9969 @node Link Options
9970 @section Options for Linking
9971 @cindex link options
9972 @cindex options, linking
9974 These options come into play when the compiler links object files into
9975 an executable output file.  They are meaningless if the compiler is
9976 not doing a link step.
9978 @table @gcctabopt
9979 @cindex file names
9980 @item @var{object-file-name}
9981 A file name that does not end in a special recognized suffix is
9982 considered to name an object file or library.  (Object files are
9983 distinguished from libraries by the linker according to the file
9984 contents.)  If linking is done, these object files are used as input
9985 to the linker.
9987 @item -c
9988 @itemx -S
9989 @itemx -E
9990 @opindex c
9991 @opindex S
9992 @opindex E
9993 If any of these options is used, then the linker is not run, and
9994 object file names should not be used as arguments.  @xref{Overall
9995 Options}.
9997 @cindex Libraries
9998 @item -l@var{library}
9999 @itemx -l @var{library}
10000 @opindex l
10001 Search the library named @var{library} when linking.  (The second
10002 alternative with the library as a separate argument is only for
10003 POSIX compliance and is not recommended.)
10005 It makes a difference where in the command you write this option; the
10006 linker searches and processes libraries and object files in the order they
10007 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10008 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10009 to functions in @samp{z}, those functions may not be loaded.
10011 The linker searches a standard list of directories for the library,
10012 which is actually a file named @file{lib@var{library}.a}.  The linker
10013 then uses this file as if it had been specified precisely by name.
10015 The directories searched include several standard system directories
10016 plus any that you specify with @option{-L}.
10018 Normally the files found this way are library files---archive files
10019 whose members are object files.  The linker handles an archive file by
10020 scanning through it for members which define symbols that have so far
10021 been referenced but not defined.  But if the file that is found is an
10022 ordinary object file, it is linked in the usual fashion.  The only
10023 difference between using an @option{-l} option and specifying a file name
10024 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10025 and searches several directories.
10027 @item -lobjc
10028 @opindex lobjc
10029 You need this special case of the @option{-l} option in order to
10030 link an Objective-C or Objective-C++ program.
10032 @item -nostartfiles
10033 @opindex nostartfiles
10034 Do not use the standard system startup files when linking.
10035 The standard system libraries are used normally, unless @option{-nostdlib}
10036 or @option{-nodefaultlibs} is used.
10038 @item -nodefaultlibs
10039 @opindex nodefaultlibs
10040 Do not use the standard system libraries when linking.
10041 Only the libraries you specify are passed to the linker, and options
10042 specifying linkage of the system libraries, such as @code{-static-libgcc}
10043 or @code{-shared-libgcc}, are ignored.  
10044 The standard startup files are used normally, unless @option{-nostartfiles}
10045 is used.  
10047 The compiler may generate calls to @code{memcmp},
10048 @code{memset}, @code{memcpy} and @code{memmove}.
10049 These entries are usually resolved by entries in
10050 libc.  These entry points should be supplied through some other
10051 mechanism when this option is specified.
10053 @item -nostdlib
10054 @opindex nostdlib
10055 Do not use the standard system startup files or libraries when linking.
10056 No startup files and only the libraries you specify are passed to
10057 the linker, and options specifying linkage of the system libraries, such as
10058 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10060 The compiler may generate calls to @code{memcmp}, @code{memset},
10061 @code{memcpy} and @code{memmove}.
10062 These entries are usually resolved by entries in
10063 libc.  These entry points should be supplied through some other
10064 mechanism when this option is specified.
10066 @cindex @option{-lgcc}, use with @option{-nostdlib}
10067 @cindex @option{-nostdlib} and unresolved references
10068 @cindex unresolved references and @option{-nostdlib}
10069 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10070 @cindex @option{-nodefaultlibs} and unresolved references
10071 @cindex unresolved references and @option{-nodefaultlibs}
10072 One of the standard libraries bypassed by @option{-nostdlib} and
10073 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10074 which GCC uses to overcome shortcomings of particular machines, or special
10075 needs for some languages.
10076 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10077 Collection (GCC) Internals},
10078 for more discussion of @file{libgcc.a}.)
10079 In most cases, you need @file{libgcc.a} even when you want to avoid
10080 other standard libraries.  In other words, when you specify @option{-nostdlib}
10081 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10082 This ensures that you have no unresolved references to internal GCC
10083 library subroutines.
10084 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10085 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10086 GNU Compiler Collection (GCC) Internals}.)
10088 @item -pie
10089 @opindex pie
10090 Produce a position independent executable on targets that support it.
10091 For predictable results, you must also specify the same set of options
10092 used for compilation (@option{-fpie}, @option{-fPIE},
10093 or model suboptions) when you specify this linker option.
10095 @item -rdynamic
10096 @opindex rdynamic
10097 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10098 that support it. This instructs the linker to add all symbols, not
10099 only used ones, to the dynamic symbol table. This option is needed
10100 for some uses of @code{dlopen} or to allow obtaining backtraces
10101 from within a program.
10103 @item -s
10104 @opindex s
10105 Remove all symbol table and relocation information from the executable.
10107 @item -static
10108 @opindex static
10109 On systems that support dynamic linking, this prevents linking with the shared
10110 libraries.  On other systems, this option has no effect.
10112 @item -shared
10113 @opindex shared
10114 Produce a shared object which can then be linked with other objects to
10115 form an executable.  Not all systems support this option.  For predictable
10116 results, you must also specify the same set of options used for compilation
10117 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10118 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10119 needs to build supplementary stub code for constructors to work.  On
10120 multi-libbed systems, @samp{gcc -shared} must select the correct support
10121 libraries to link against.  Failing to supply the correct flags may lead
10122 to subtle defects.  Supplying them in cases where they are not necessary
10123 is innocuous.}
10125 @item -shared-libgcc
10126 @itemx -static-libgcc
10127 @opindex shared-libgcc
10128 @opindex static-libgcc
10129 On systems that provide @file{libgcc} as a shared library, these options
10130 force the use of either the shared or static version, respectively.
10131 If no shared version of @file{libgcc} was built when the compiler was
10132 configured, these options have no effect.
10134 There are several situations in which an application should use the
10135 shared @file{libgcc} instead of the static version.  The most common
10136 of these is when the application wishes to throw and catch exceptions
10137 across different shared libraries.  In that case, each of the libraries
10138 as well as the application itself should use the shared @file{libgcc}.
10140 Therefore, the G++ and GCJ drivers automatically add
10141 @option{-shared-libgcc} whenever you build a shared library or a main
10142 executable, because C++ and Java programs typically use exceptions, so
10143 this is the right thing to do.
10145 If, instead, you use the GCC driver to create shared libraries, you may
10146 find that they are not always linked with the shared @file{libgcc}.
10147 If GCC finds, at its configuration time, that you have a non-GNU linker
10148 or a GNU linker that does not support option @option{--eh-frame-hdr},
10149 it links the shared version of @file{libgcc} into shared libraries
10150 by default.  Otherwise, it takes advantage of the linker and optimizes
10151 away the linking with the shared version of @file{libgcc}, linking with
10152 the static version of libgcc by default.  This allows exceptions to
10153 propagate through such shared libraries, without incurring relocation
10154 costs at library load time.
10156 However, if a library or main executable is supposed to throw or catch
10157 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10158 for the languages used in the program, or using the option
10159 @option{-shared-libgcc}, such that it is linked with the shared
10160 @file{libgcc}.
10162 @item -static-libasan
10163 When the @option{-fsanitize=address} option is used to link a program,
10164 the GCC driver automatically links against @option{libasan}.  If
10165 @file{libasan} is available as a shared library, and the @option{-static}
10166 option is not used, then this links against the shared version of
10167 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10168 driver to link @file{libasan} statically, without necessarily linking
10169 other libraries statically.
10171 @item -static-libtsan
10172 When the @option{-fsanitize=thread} option is used to link a program,
10173 the GCC driver automatically links against @option{libtsan}.  If
10174 @file{libtsan} is available as a shared library, and the @option{-static}
10175 option is not used, then this links against the shared version of
10176 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10177 driver to link @file{libtsan} statically, without necessarily linking
10178 other libraries statically.
10180 @item -static-libubsan
10181 When the @option{-fsanitize=undefined} option is used to link a program,
10182 the GCC driver automatically links against @option{libubsan}.  If
10183 @file{libubsan} is available as a shared library, and the @option{-static}
10184 option is not used, then this links against the shared version of
10185 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10186 driver to link @file{libubsan} statically, without necessarily linking
10187 other libraries statically.
10189 @item -static-libstdc++
10190 When the @command{g++} program is used to link a C++ program, it
10191 normally automatically links against @option{libstdc++}.  If
10192 @file{libstdc++} is available as a shared library, and the
10193 @option{-static} option is not used, then this links against the
10194 shared version of @file{libstdc++}.  That is normally fine.  However, it
10195 is sometimes useful to freeze the version of @file{libstdc++} used by
10196 the program without going all the way to a fully static link.  The
10197 @option{-static-libstdc++} option directs the @command{g++} driver to
10198 link @file{libstdc++} statically, without necessarily linking other
10199 libraries statically.
10201 @item -symbolic
10202 @opindex symbolic
10203 Bind references to global symbols when building a shared object.  Warn
10204 about any unresolved references (unless overridden by the link editor
10205 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10206 this option.
10208 @item -T @var{script}
10209 @opindex T
10210 @cindex linker script
10211 Use @var{script} as the linker script.  This option is supported by most
10212 systems using the GNU linker.  On some targets, such as bare-board
10213 targets without an operating system, the @option{-T} option may be required
10214 when linking to avoid references to undefined symbols.
10216 @item -Xlinker @var{option}
10217 @opindex Xlinker
10218 Pass @var{option} as an option to the linker.  You can use this to
10219 supply system-specific linker options that GCC does not recognize.
10221 If you want to pass an option that takes a separate argument, you must use
10222 @option{-Xlinker} twice, once for the option and once for the argument.
10223 For example, to pass @option{-assert definitions}, you must write
10224 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10225 @option{-Xlinker "-assert definitions"}, because this passes the entire
10226 string as a single argument, which is not what the linker expects.
10228 When using the GNU linker, it is usually more convenient to pass
10229 arguments to linker options using the @option{@var{option}=@var{value}}
10230 syntax than as separate arguments.  For example, you can specify
10231 @option{-Xlinker -Map=output.map} rather than
10232 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10233 this syntax for command-line options.
10235 @item -Wl,@var{option}
10236 @opindex Wl
10237 Pass @var{option} as an option to the linker.  If @var{option} contains
10238 commas, it is split into multiple options at the commas.  You can use this
10239 syntax to pass an argument to the option.
10240 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10241 linker.  When using the GNU linker, you can also get the same effect with
10242 @option{-Wl,-Map=output.map}.
10244 @item -u @var{symbol}
10245 @opindex u
10246 Pretend the symbol @var{symbol} is undefined, to force linking of
10247 library modules to define it.  You can use @option{-u} multiple times with
10248 different symbols to force loading of additional library modules.
10249 @end table
10251 @node Directory Options
10252 @section Options for Directory Search
10253 @cindex directory options
10254 @cindex options, directory search
10255 @cindex search path
10257 These options specify directories to search for header files, for
10258 libraries and for parts of the compiler:
10260 @table @gcctabopt
10261 @item -I@var{dir}
10262 @opindex I
10263 Add the directory @var{dir} to the head of the list of directories to be
10264 searched for header files.  This can be used to override a system header
10265 file, substituting your own version, since these directories are
10266 searched before the system header file directories.  However, you should
10267 not use this option to add directories that contain vendor-supplied
10268 system header files (use @option{-isystem} for that).  If you use more than
10269 one @option{-I} option, the directories are scanned in left-to-right
10270 order; the standard system directories come after.
10272 If a standard system include directory, or a directory specified with
10273 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10274 option is ignored.  The directory is still searched but as a
10275 system directory at its normal position in the system include chain.
10276 This is to ensure that GCC's procedure to fix buggy system headers and
10277 the ordering for the @code{include_next} directive are not inadvertently changed.
10278 If you really need to change the search order for system directories,
10279 use the @option{-nostdinc} and/or @option{-isystem} options.
10281 @item -iplugindir=@var{dir}
10282 Set the directory to search for plugins that are passed
10283 by @option{-fplugin=@var{name}} instead of
10284 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10285 to be used by the user, but only passed by the driver.
10287 @item -iquote@var{dir}
10288 @opindex iquote
10289 Add the directory @var{dir} to the head of the list of directories to
10290 be searched for header files only for the case of @samp{#include
10291 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10292 otherwise just like @option{-I}.
10294 @item -L@var{dir}
10295 @opindex L
10296 Add directory @var{dir} to the list of directories to be searched
10297 for @option{-l}.
10299 @item -B@var{prefix}
10300 @opindex B
10301 This option specifies where to find the executables, libraries,
10302 include files, and data files of the compiler itself.
10304 The compiler driver program runs one or more of the subprograms
10305 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10306 @var{prefix} as a prefix for each program it tries to run, both with and
10307 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10309 For each subprogram to be run, the compiler driver first tries the
10310 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10311 is not specified, the driver tries two standard prefixes, 
10312 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10313 those results in a file name that is found, the unmodified program
10314 name is searched for using the directories specified in your
10315 @env{PATH} environment variable.
10317 The compiler checks to see if the path provided by the @option{-B}
10318 refers to a directory, and if necessary it adds a directory
10319 separator character at the end of the path.
10321 @option{-B} prefixes that effectively specify directory names also apply
10322 to libraries in the linker, because the compiler translates these
10323 options into @option{-L} options for the linker.  They also apply to
10324 includes files in the preprocessor, because the compiler translates these
10325 options into @option{-isystem} options for the preprocessor.  In this case,
10326 the compiler appends @samp{include} to the prefix.
10328 The runtime support file @file{libgcc.a} can also be searched for using
10329 the @option{-B} prefix, if needed.  If it is not found there, the two
10330 standard prefixes above are tried, and that is all.  The file is left
10331 out of the link if it is not found by those means.
10333 Another way to specify a prefix much like the @option{-B} prefix is to use
10334 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10335 Variables}.
10337 As a special kludge, if the path provided by @option{-B} is
10338 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10339 9, then it is replaced by @file{[dir/]include}.  This is to help
10340 with boot-strapping the compiler.
10342 @item -specs=@var{file}
10343 @opindex specs
10344 Process @var{file} after the compiler reads in the standard @file{specs}
10345 file, in order to override the defaults which the @command{gcc} driver
10346 program uses when determining what switches to pass to @command{cc1},
10347 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10348 @option{-specs=@var{file}} can be specified on the command line, and they
10349 are processed in order, from left to right.
10351 @item --sysroot=@var{dir}
10352 @opindex sysroot
10353 Use @var{dir} as the logical root directory for headers and libraries.
10354 For example, if the compiler normally searches for headers in
10355 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10356 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10358 If you use both this option and the @option{-isysroot} option, then
10359 the @option{--sysroot} option applies to libraries, but the
10360 @option{-isysroot} option applies to header files.
10362 The GNU linker (beginning with version 2.16) has the necessary support
10363 for this option.  If your linker does not support this option, the
10364 header file aspect of @option{--sysroot} still works, but the
10365 library aspect does not.
10367 @item --no-sysroot-suffix
10368 @opindex no-sysroot-suffix
10369 For some targets, a suffix is added to the root directory specified
10370 with @option{--sysroot}, depending on the other options used, so that
10371 headers may for example be found in
10372 @file{@var{dir}/@var{suffix}/usr/include} instead of
10373 @file{@var{dir}/usr/include}.  This option disables the addition of
10374 such a suffix.
10376 @item -I-
10377 @opindex I-
10378 This option has been deprecated.  Please use @option{-iquote} instead for
10379 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10380 Any directories you specify with @option{-I} options before the @option{-I-}
10381 option are searched only for the case of @samp{#include "@var{file}"};
10382 they are not searched for @samp{#include <@var{file}>}.
10384 If additional directories are specified with @option{-I} options after
10385 the @option{-I-}, these directories are searched for all @samp{#include}
10386 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10387 this way.)
10389 In addition, the @option{-I-} option inhibits the use of the current
10390 directory (where the current input file came from) as the first search
10391 directory for @samp{#include "@var{file}"}.  There is no way to
10392 override this effect of @option{-I-}.  With @option{-I.} you can specify
10393 searching the directory that is current when the compiler is
10394 invoked.  That is not exactly the same as what the preprocessor does
10395 by default, but it is often satisfactory.
10397 @option{-I-} does not inhibit the use of the standard system directories
10398 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10399 independent.
10400 @end table
10402 @c man end
10404 @node Spec Files
10405 @section Specifying subprocesses and the switches to pass to them
10406 @cindex Spec Files
10408 @command{gcc} is a driver program.  It performs its job by invoking a
10409 sequence of other programs to do the work of compiling, assembling and
10410 linking.  GCC interprets its command-line parameters and uses these to
10411 deduce which programs it should invoke, and which command-line options
10412 it ought to place on their command lines.  This behavior is controlled
10413 by @dfn{spec strings}.  In most cases there is one spec string for each
10414 program that GCC can invoke, but a few programs have multiple spec
10415 strings to control their behavior.  The spec strings built into GCC can
10416 be overridden by using the @option{-specs=} command-line switch to specify
10417 a spec file.
10419 @dfn{Spec files} are plaintext files that are used to construct spec
10420 strings.  They consist of a sequence of directives separated by blank
10421 lines.  The type of directive is determined by the first non-whitespace
10422 character on the line, which can be one of the following:
10424 @table @code
10425 @item %@var{command}
10426 Issues a @var{command} to the spec file processor.  The commands that can
10427 appear here are:
10429 @table @code
10430 @item %include <@var{file}>
10431 @cindex @code{%include}
10432 Search for @var{file} and insert its text at the current point in the
10433 specs file.
10435 @item %include_noerr <@var{file}>
10436 @cindex @code{%include_noerr}
10437 Just like @samp{%include}, but do not generate an error message if the include
10438 file cannot be found.
10440 @item %rename @var{old_name} @var{new_name}
10441 @cindex @code{%rename}
10442 Rename the spec string @var{old_name} to @var{new_name}.
10444 @end table
10446 @item *[@var{spec_name}]:
10447 This tells the compiler to create, override or delete the named spec
10448 string.  All lines after this directive up to the next directive or
10449 blank line are considered to be the text for the spec string.  If this
10450 results in an empty string then the spec is deleted.  (Or, if the
10451 spec did not exist, then nothing happens.)  Otherwise, if the spec
10452 does not currently exist a new spec is created.  If the spec does
10453 exist then its contents are overridden by the text of this
10454 directive, unless the first character of that text is the @samp{+}
10455 character, in which case the text is appended to the spec.
10457 @item [@var{suffix}]:
10458 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10459 and up to the next directive or blank line are considered to make up the
10460 spec string for the indicated suffix.  When the compiler encounters an
10461 input file with the named suffix, it processes the spec string in
10462 order to work out how to compile that file.  For example:
10464 @smallexample
10465 .ZZ:
10466 z-compile -input %i
10467 @end smallexample
10469 This says that any input file whose name ends in @samp{.ZZ} should be
10470 passed to the program @samp{z-compile}, which should be invoked with the
10471 command-line switch @option{-input} and with the result of performing the
10472 @samp{%i} substitution.  (See below.)
10474 As an alternative to providing a spec string, the text following a
10475 suffix directive can be one of the following:
10477 @table @code
10478 @item @@@var{language}
10479 This says that the suffix is an alias for a known @var{language}.  This is
10480 similar to using the @option{-x} command-line switch to GCC to specify a
10481 language explicitly.  For example:
10483 @smallexample
10484 .ZZ:
10485 @@c++
10486 @end smallexample
10488 Says that .ZZ files are, in fact, C++ source files.
10490 @item #@var{name}
10491 This causes an error messages saying:
10493 @smallexample
10494 @var{name} compiler not installed on this system.
10495 @end smallexample
10496 @end table
10498 GCC already has an extensive list of suffixes built into it.
10499 This directive adds an entry to the end of the list of suffixes, but
10500 since the list is searched from the end backwards, it is effectively
10501 possible to override earlier entries using this technique.
10503 @end table
10505 GCC has the following spec strings built into it.  Spec files can
10506 override these strings or create their own.  Note that individual
10507 targets can also add their own spec strings to this list.
10509 @smallexample
10510 asm          Options to pass to the assembler
10511 asm_final    Options to pass to the assembler post-processor
10512 cpp          Options to pass to the C preprocessor
10513 cc1          Options to pass to the C compiler
10514 cc1plus      Options to pass to the C++ compiler
10515 endfile      Object files to include at the end of the link
10516 link         Options to pass to the linker
10517 lib          Libraries to include on the command line to the linker
10518 libgcc       Decides which GCC support library to pass to the linker
10519 linker       Sets the name of the linker
10520 predefines   Defines to be passed to the C preprocessor
10521 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10522              by default
10523 startfile    Object files to include at the start of the link
10524 @end smallexample
10526 Here is a small example of a spec file:
10528 @smallexample
10529 %rename lib                 old_lib
10531 *lib:
10532 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10533 @end smallexample
10535 This example renames the spec called @samp{lib} to @samp{old_lib} and
10536 then overrides the previous definition of @samp{lib} with a new one.
10537 The new definition adds in some extra command-line options before
10538 including the text of the old definition.
10540 @dfn{Spec strings} are a list of command-line options to be passed to their
10541 corresponding program.  In addition, the spec strings can contain
10542 @samp{%}-prefixed sequences to substitute variable text or to
10543 conditionally insert text into the command line.  Using these constructs
10544 it is possible to generate quite complex command lines.
10546 Here is a table of all defined @samp{%}-sequences for spec
10547 strings.  Note that spaces are not generated automatically around the
10548 results of expanding these sequences.  Therefore you can concatenate them
10549 together or combine them with constant text in a single argument.
10551 @table @code
10552 @item %%
10553 Substitute one @samp{%} into the program name or argument.
10555 @item %i
10556 Substitute the name of the input file being processed.
10558 @item %b
10559 Substitute the basename of the input file being processed.
10560 This is the substring up to (and not including) the last period
10561 and not including the directory.
10563 @item %B
10564 This is the same as @samp{%b}, but include the file suffix (text after
10565 the last period).
10567 @item %d
10568 Marks the argument containing or following the @samp{%d} as a
10569 temporary file name, so that that file is deleted if GCC exits
10570 successfully.  Unlike @samp{%g}, this contributes no text to the
10571 argument.
10573 @item %g@var{suffix}
10574 Substitute a file name that has suffix @var{suffix} and is chosen
10575 once per compilation, and mark the argument in the same way as
10576 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10577 name is now chosen in a way that is hard to predict even when previously
10578 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10579 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10580 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10581 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10582 was simply substituted with a file name chosen once per compilation,
10583 without regard to any appended suffix (which was therefore treated
10584 just like ordinary text), making such attacks more likely to succeed.
10586 @item %u@var{suffix}
10587 Like @samp{%g}, but generates a new temporary file name
10588 each time it appears instead of once per compilation.
10590 @item %U@var{suffix}
10591 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10592 new one if there is no such last file name.  In the absence of any
10593 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10594 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10595 involves the generation of two distinct file names, one
10596 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10597 simply substituted with a file name chosen for the previous @samp{%u},
10598 without regard to any appended suffix.
10600 @item %j@var{suffix}
10601 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10602 writable, and if @option{-save-temps} is not used; 
10603 otherwise, substitute the name
10604 of a temporary file, just like @samp{%u}.  This temporary file is not
10605 meant for communication between processes, but rather as a junk
10606 disposal mechanism.
10608 @item %|@var{suffix}
10609 @itemx %m@var{suffix}
10610 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10611 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10612 all.  These are the two most common ways to instruct a program that it
10613 should read from standard input or write to standard output.  If you
10614 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10615 construct: see for example @file{f/lang-specs.h}.
10617 @item %.@var{SUFFIX}
10618 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10619 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10620 terminated by the next space or %.
10622 @item %w
10623 Marks the argument containing or following the @samp{%w} as the
10624 designated output file of this compilation.  This puts the argument
10625 into the sequence of arguments that @samp{%o} substitutes.
10627 @item %o
10628 Substitutes the names of all the output files, with spaces
10629 automatically placed around them.  You should write spaces
10630 around the @samp{%o} as well or the results are undefined.
10631 @samp{%o} is for use in the specs for running the linker.
10632 Input files whose names have no recognized suffix are not compiled
10633 at all, but they are included among the output files, so they are
10634 linked.
10636 @item %O
10637 Substitutes the suffix for object files.  Note that this is
10638 handled specially when it immediately follows @samp{%g, %u, or %U},
10639 because of the need for those to form complete file names.  The
10640 handling is such that @samp{%O} is treated exactly as if it had already
10641 been substituted, except that @samp{%g, %u, and %U} do not currently
10642 support additional @var{suffix} characters following @samp{%O} as they do
10643 following, for example, @samp{.o}.
10645 @item %p
10646 Substitutes the standard macro predefinitions for the
10647 current target machine.  Use this when running @code{cpp}.
10649 @item %P
10650 Like @samp{%p}, but puts @samp{__} before and after the name of each
10651 predefined macro, except for macros that start with @samp{__} or with
10652 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10655 @item %I
10656 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10657 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10658 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10659 and @option{-imultilib} as necessary.
10661 @item %s
10662 Current argument is the name of a library or startup file of some sort.
10663 Search for that file in a standard list of directories and substitute
10664 the full name found.  The current working directory is included in the
10665 list of directories scanned.
10667 @item %T
10668 Current argument is the name of a linker script.  Search for that file
10669 in the current list of directories to scan for libraries. If the file
10670 is located insert a @option{--script} option into the command line
10671 followed by the full path name found.  If the file is not found then
10672 generate an error message.  Note: the current working directory is not
10673 searched.
10675 @item %e@var{str}
10676 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10677 Use this when inconsistent options are detected.
10679 @item %(@var{name})
10680 Substitute the contents of spec string @var{name} at this point.
10682 @item %x@{@var{option}@}
10683 Accumulate an option for @samp{%X}.
10685 @item %X
10686 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10687 spec string.
10689 @item %Y
10690 Output the accumulated assembler options specified by @option{-Wa}.
10692 @item %Z
10693 Output the accumulated preprocessor options specified by @option{-Wp}.
10695 @item %a
10696 Process the @code{asm} spec.  This is used to compute the
10697 switches to be passed to the assembler.
10699 @item %A
10700 Process the @code{asm_final} spec.  This is a spec string for
10701 passing switches to an assembler post-processor, if such a program is
10702 needed.
10704 @item %l
10705 Process the @code{link} spec.  This is the spec for computing the
10706 command line passed to the linker.  Typically it makes use of the
10707 @samp{%L %G %S %D and %E} sequences.
10709 @item %D
10710 Dump out a @option{-L} option for each directory that GCC believes might
10711 contain startup files.  If the target supports multilibs then the
10712 current multilib directory is prepended to each of these paths.
10714 @item %L
10715 Process the @code{lib} spec.  This is a spec string for deciding which
10716 libraries are included on the command line to the linker.
10718 @item %G
10719 Process the @code{libgcc} spec.  This is a spec string for deciding
10720 which GCC support library is included on the command line to the linker.
10722 @item %S
10723 Process the @code{startfile} spec.  This is a spec for deciding which
10724 object files are the first ones passed to the linker.  Typically
10725 this might be a file named @file{crt0.o}.
10727 @item %E
10728 Process the @code{endfile} spec.  This is a spec string that specifies
10729 the last object files that are passed to the linker.
10731 @item %C
10732 Process the @code{cpp} spec.  This is used to construct the arguments
10733 to be passed to the C preprocessor.
10735 @item %1
10736 Process the @code{cc1} spec.  This is used to construct the options to be
10737 passed to the actual C compiler (@samp{cc1}).
10739 @item %2
10740 Process the @code{cc1plus} spec.  This is used to construct the options to be
10741 passed to the actual C++ compiler (@samp{cc1plus}).
10743 @item %*
10744 Substitute the variable part of a matched option.  See below.
10745 Note that each comma in the substituted string is replaced by
10746 a single space.
10748 @item %<@code{S}
10749 Remove all occurrences of @code{-S} from the command line.  Note---this
10750 command is position dependent.  @samp{%} commands in the spec string
10751 before this one see @code{-S}, @samp{%} commands in the spec string
10752 after this one do not.
10754 @item %:@var{function}(@var{args})
10755 Call the named function @var{function}, passing it @var{args}.
10756 @var{args} is first processed as a nested spec string, then split
10757 into an argument vector in the usual fashion.  The function returns
10758 a string which is processed as if it had appeared literally as part
10759 of the current spec.
10761 The following built-in spec functions are provided:
10763 @table @code
10764 @item @code{getenv}
10765 The @code{getenv} spec function takes two arguments: an environment
10766 variable name and a string.  If the environment variable is not
10767 defined, a fatal error is issued.  Otherwise, the return value is the
10768 value of the environment variable concatenated with the string.  For
10769 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10771 @smallexample
10772 %:getenv(TOPDIR /include)
10773 @end smallexample
10775 expands to @file{/path/to/top/include}.
10777 @item @code{if-exists}
10778 The @code{if-exists} spec function takes one argument, an absolute
10779 pathname to a file.  If the file exists, @code{if-exists} returns the
10780 pathname.  Here is a small example of its usage:
10782 @smallexample
10783 *startfile:
10784 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10785 @end smallexample
10787 @item @code{if-exists-else}
10788 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10789 spec function, except that it takes two arguments.  The first argument is
10790 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10791 returns the pathname.  If it does not exist, it returns the second argument.
10792 This way, @code{if-exists-else} can be used to select one file or another,
10793 based on the existence of the first.  Here is a small example of its usage:
10795 @smallexample
10796 *startfile:
10797 crt0%O%s %:if-exists(crti%O%s) \
10798 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10799 @end smallexample
10801 @item @code{replace-outfile}
10802 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10803 first argument in the outfiles array and replaces it with the second argument.  Here
10804 is a small example of its usage:
10806 @smallexample
10807 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10808 @end smallexample
10810 @item @code{remove-outfile}
10811 The @code{remove-outfile} spec function takes one argument.  It looks for the
10812 first argument in the outfiles array and removes it.  Here is a small example
10813 its usage:
10815 @smallexample
10816 %:remove-outfile(-lm)
10817 @end smallexample
10819 @item @code{pass-through-libs}
10820 The @code{pass-through-libs} spec function takes any number of arguments.  It
10821 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10822 assumes are the names of linker input library archive files) and returns a
10823 result containing all the found arguments each prepended by
10824 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10825 intended to be passed to the LTO linker plugin.
10827 @smallexample
10828 %:pass-through-libs(%G %L %G)
10829 @end smallexample
10831 @item @code{print-asm-header}
10832 The @code{print-asm-header} function takes no arguments and simply
10833 prints a banner like:
10835 @smallexample
10836 Assembler options
10837 =================
10839 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10840 @end smallexample
10842 It is used to separate compiler options from assembler options
10843 in the @option{--target-help} output.
10844 @end table
10846 @item %@{@code{S}@}
10847 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10848 If that switch is not specified, this substitutes nothing.  Note that
10849 the leading dash is omitted when specifying this option, and it is
10850 automatically inserted if the substitution is performed.  Thus the spec
10851 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10852 and outputs the command-line option @option{-foo}.
10854 @item %W@{@code{S}@}
10855 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10856 deleted on failure.
10858 @item %@{@code{S}*@}
10859 Substitutes all the switches specified to GCC whose names start
10860 with @code{-S}, but which also take an argument.  This is used for
10861 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10862 GCC considers @option{-o foo} as being
10863 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10864 text, including the space.  Thus two arguments are generated.
10866 @item %@{@code{S}*&@code{T}*@}
10867 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10868 (the order of @code{S} and @code{T} in the spec is not significant).
10869 There can be any number of ampersand-separated variables; for each the
10870 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10872 @item %@{@code{S}:@code{X}@}
10873 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10875 @item %@{!@code{S}:@code{X}@}
10876 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10878 @item %@{@code{S}*:@code{X}@}
10879 Substitutes @code{X} if one or more switches whose names start with
10880 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10881 once, no matter how many such switches appeared.  However, if @code{%*}
10882 appears somewhere in @code{X}, then @code{X} is substituted once
10883 for each matching switch, with the @code{%*} replaced by the part of
10884 that switch matching the @code{*}.
10886 @item %@{.@code{S}:@code{X}@}
10887 Substitutes @code{X}, if processing a file with suffix @code{S}.
10889 @item %@{!.@code{S}:@code{X}@}
10890 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10892 @item %@{,@code{S}:@code{X}@}
10893 Substitutes @code{X}, if processing a file for language @code{S}.
10895 @item %@{!,@code{S}:@code{X}@}
10896 Substitutes @code{X}, if not processing a file for language @code{S}.
10898 @item %@{@code{S}|@code{P}:@code{X}@}
10899 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10900 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10901 @code{*} sequences as well, although they have a stronger binding than
10902 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10903 alternatives must be starred, and only the first matching alternative
10904 is substituted.
10906 For example, a spec string like this:
10908 @smallexample
10909 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10910 @end smallexample
10912 @noindent
10913 outputs the following command-line options from the following input
10914 command-line options:
10916 @smallexample
10917 fred.c        -foo -baz
10918 jim.d         -bar -boggle
10919 -d fred.c     -foo -baz -boggle
10920 -d jim.d      -bar -baz -boggle
10921 @end smallexample
10923 @item %@{S:X; T:Y; :D@}
10925 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10926 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10927 be as many clauses as you need.  This may be combined with @code{.},
10928 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10931 @end table
10933 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10934 construct may contain other nested @samp{%} constructs or spaces, or
10935 even newlines.  They are processed as usual, as described above.
10936 Trailing white space in @code{X} is ignored.  White space may also
10937 appear anywhere on the left side of the colon in these constructs,
10938 except between @code{.} or @code{*} and the corresponding word.
10940 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10941 handled specifically in these constructs.  If another value of
10942 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10943 @option{-W} switch is found later in the command line, the earlier
10944 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10945 just one letter, which passes all matching options.
10947 The character @samp{|} at the beginning of the predicate text is used to
10948 indicate that a command should be piped to the following command, but
10949 only if @option{-pipe} is specified.
10951 It is built into GCC which switches take arguments and which do not.
10952 (You might think it would be useful to generalize this to allow each
10953 compiler's spec to say which switches take arguments.  But this cannot
10954 be done in a consistent fashion.  GCC cannot even decide which input
10955 files have been specified without knowing which switches take arguments,
10956 and it must know which input files to compile in order to tell which
10957 compilers to run).
10959 GCC also knows implicitly that arguments starting in @option{-l} are to be
10960 treated as compiler output files, and passed to the linker in their
10961 proper position among the other output files.
10963 @c man begin OPTIONS
10965 @node Target Options
10966 @section Specifying Target Machine and Compiler Version
10967 @cindex target options
10968 @cindex cross compiling
10969 @cindex specifying machine version
10970 @cindex specifying compiler version and target machine
10971 @cindex compiler version, specifying
10972 @cindex target machine, specifying
10974 The usual way to run GCC is to run the executable called @command{gcc}, or
10975 @command{@var{machine}-gcc} when cross-compiling, or
10976 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10977 one that was installed last.
10979 @node Submodel Options
10980 @section Hardware Models and Configurations
10981 @cindex submodel options
10982 @cindex specifying hardware config
10983 @cindex hardware models and configurations, specifying
10984 @cindex machine dependent options
10986 Each target machine types can have its own
10987 special options, starting with @samp{-m}, to choose among various
10988 hardware models or configurations---for example, 68010 vs 68020,
10989 floating coprocessor or none.  A single installed version of the
10990 compiler can compile for any model or configuration, according to the
10991 options specified.
10993 Some configurations of the compiler also support additional special
10994 options, usually for compatibility with other compilers on the same
10995 platform.
10997 @c This list is ordered alphanumerically by subsection name.
10998 @c It should be the same order and spelling as these options are listed
10999 @c in Machine Dependent Options
11001 @menu
11002 * AArch64 Options::
11003 * Adapteva Epiphany Options::
11004 * ARM Options::
11005 * AVR Options::
11006 * Blackfin Options::
11007 * C6X Options::
11008 * CRIS Options::
11009 * CR16 Options::
11010 * Darwin Options::
11011 * DEC Alpha Options::
11012 * FR30 Options::
11013 * FRV Options::
11014 * GNU/Linux Options::
11015 * H8/300 Options::
11016 * HPPA Options::
11017 * i386 and x86-64 Options::
11018 * i386 and x86-64 Windows Options::
11019 * IA-64 Options::
11020 * LM32 Options::
11021 * M32C Options::
11022 * M32R/D Options::
11023 * M680x0 Options::
11024 * MCore Options::
11025 * MeP Options::
11026 * MicroBlaze Options::
11027 * MIPS Options::
11028 * MMIX Options::
11029 * MN10300 Options::
11030 * Moxie Options::
11031 * PDP-11 Options::
11032 * picoChip Options::
11033 * PowerPC Options::
11034 * RL78 Options::
11035 * RS/6000 and PowerPC Options::
11036 * RX Options::
11037 * S/390 and zSeries Options::
11038 * Score Options::
11039 * SH Options::
11040 * Solaris 2 Options::
11041 * SPARC Options::
11042 * SPU Options::
11043 * System V Options::
11044 * TILE-Gx Options::
11045 * TILEPro Options::
11046 * V850 Options::
11047 * VAX Options::
11048 * VMS Options::
11049 * VxWorks Options::
11050 * x86-64 Options::
11051 * Xstormy16 Options::
11052 * Xtensa Options::
11053 * zSeries Options::
11054 @end menu
11056 @node AArch64 Options
11057 @subsection AArch64 Options
11058 @cindex AArch64 Options
11060 These options are defined for AArch64 implementations:
11062 @table @gcctabopt
11064 @item -mabi=@var{name}
11065 @opindex mabi
11066 Generate code for the specified data model.  Permissible values
11067 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11068 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11069 but long int and pointer are 64-bit.
11071 The default depends on the specific target configuration.  Note that
11072 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11073 entire program with the same ABI, and link with a compatible set of libraries.
11075 @item -mbig-endian
11076 @opindex mbig-endian
11077 Generate big-endian code.  This is the default when GCC is configured for an
11078 @samp{aarch64_be-*-*} target.
11080 @item -mgeneral-regs-only
11081 @opindex mgeneral-regs-only
11082 Generate code which uses only the general registers.
11084 @item -mlittle-endian
11085 @opindex mlittle-endian
11086 Generate little-endian code.  This is the default when GCC is configured for an
11087 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11089 @item -mcmodel=tiny
11090 @opindex mcmodel=tiny
11091 Generate code for the tiny code model.  The program and its statically defined
11092 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11093 be statically or dynamically linked.  This model is not fully implemented and
11094 mostly treated as @samp{small}.
11096 @item -mcmodel=small
11097 @opindex mcmodel=small
11098 Generate code for the small code model.  The program and its statically defined
11099 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11100 be statically or dynamically linked.  This is the default code model.
11102 @item -mcmodel=large
11103 @opindex mcmodel=large
11104 Generate code for the large code model.  This makes no assumptions about
11105 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11106 statically linked only.
11108 @item -mstrict-align
11109 @opindex mstrict-align
11110 Do not assume that unaligned memory references will be handled by the system.
11112 @item -momit-leaf-frame-pointer
11113 @itemx -mno-omit-leaf-frame-pointer
11114 @opindex momit-leaf-frame-pointer
11115 @opindex mno-omit-leaf-frame-pointer
11116 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11117 default.
11119 @item -mtls-dialect=desc
11120 @opindex mtls-dialect=desc
11121 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11122 of TLS variables.  This is the default.
11124 @item -mtls-dialect=traditional
11125 @opindex mtls-dialect=traditional
11126 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11127 of TLS variables.
11129 @item -march=@var{name}
11130 @opindex march
11131 Specify the name of the target architecture, optionally suffixed by one or
11132 more feature modifiers.  This option has the form
11133 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11134 only value for @var{arch} is @samp{armv8-a}.  The possible values for
11135 @var{feature} are documented in the sub-section below.
11137 Where conflicting feature modifiers are specified, the right-most feature is
11138 used.
11140 GCC uses this name to determine what kind of instructions it can emit when
11141 generating assembly code.  This option can be used in conjunction with or
11142 instead of the @option{-mcpu=} option.
11144 @item -mcpu=@var{name}
11145 @opindex mcpu
11146 Specify the name of the target processor, optionally suffixed by one or more
11147 feature modifiers.  This option has the form
11148 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11149 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
11150 possible values for @var{feature} are documented in the sub-section
11151 below.
11153 Where conflicting feature modifiers are specified, the right-most feature is
11154 used.
11156 GCC uses this name to determine what kind of instructions it can emit when
11157 generating assembly code.
11159 @item -mtune=@var{name}
11160 @opindex mtune
11161 Specify the name of the processor to tune the performance for.  The code will
11162 be tuned as if the target processor were of the type specified in this option,
11163 but still using instructions compatible with the target processor specified
11164 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
11165 modifiers.
11167 @end table
11169 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11170 @cindex @option{-march} feature modifiers
11171 @cindex @option{-mcpu} feature modifiers
11172 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11173 the following:
11175 @table @samp
11176 @item crc
11177 Enable CRC extension.
11178 @item crypto
11179 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11180 @item fp
11181 Enable floating-point instructions.
11182 @item simd
11183 Enable Advanced SIMD instructions.  This implies floating-point instructions
11184 are enabled.  This is the default for all current possible values for options
11185 @option{-march} and @option{-mcpu=}.
11186 @end table
11188 @node Adapteva Epiphany Options
11189 @subsection Adapteva Epiphany Options
11191 These @samp{-m} options are defined for Adapteva Epiphany:
11193 @table @gcctabopt
11194 @item -mhalf-reg-file
11195 @opindex mhalf-reg-file
11196 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11197 That allows code to run on hardware variants that lack these registers.
11199 @item -mprefer-short-insn-regs
11200 @opindex mprefer-short-insn-regs
11201 Preferrentially allocate registers that allow short instruction generation.
11202 This can result in increased instruction count, so this may either reduce or
11203 increase overall code size.
11205 @item -mbranch-cost=@var{num}
11206 @opindex mbranch-cost
11207 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11208 This cost is only a heuristic and is not guaranteed to produce
11209 consistent results across releases.
11211 @item -mcmove
11212 @opindex mcmove
11213 Enable the generation of conditional moves.
11215 @item -mnops=@var{num}
11216 @opindex mnops
11217 Emit @var{num} NOPs before every other generated instruction.
11219 @item -mno-soft-cmpsf
11220 @opindex mno-soft-cmpsf
11221 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11222 and test the flags.  This is faster than a software comparison, but can
11223 get incorrect results in the presence of NaNs, or when two different small
11224 numbers are compared such that their difference is calculated as zero.
11225 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11226 software comparisons.
11228 @item -mstack-offset=@var{num}
11229 @opindex mstack-offset
11230 Set the offset between the top of the stack and the stack pointer.
11231 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11232 can be used by leaf functions without stack allocation.
11233 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11234 Note also that this option changes the ABI; compiling a program with a
11235 different stack offset than the libraries have been compiled with
11236 generally does not work.
11237 This option can be useful if you want to evaluate if a different stack
11238 offset would give you better code, but to actually use a different stack
11239 offset to build working programs, it is recommended to configure the
11240 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11242 @item -mno-round-nearest
11243 @opindex mno-round-nearest
11244 Make the scheduler assume that the rounding mode has been set to
11245 truncating.  The default is @option{-mround-nearest}.
11247 @item -mlong-calls
11248 @opindex mlong-calls
11249 If not otherwise specified by an attribute, assume all calls might be beyond
11250 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11251 function address into a register before performing a (otherwise direct) call.
11252 This is the default.
11254 @item -mshort-calls
11255 @opindex short-calls
11256 If not otherwise specified by an attribute, assume all direct calls are
11257 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11258 for direct calls.  The default is @option{-mlong-calls}.
11260 @item -msmall16
11261 @opindex msmall16
11262 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11263 apply to function addresses for which @option{-mlong-calls} semantics
11264 are in effect.
11266 @item -mfp-mode=@var{mode}
11267 @opindex mfp-mode
11268 Set the prevailing mode of the floating-point unit.
11269 This determines the floating-point mode that is provided and expected
11270 at function call and return time.  Making this mode match the mode you
11271 predominantly need at function start can make your programs smaller and
11272 faster by avoiding unnecessary mode switches.
11274 @var{mode} can be set to one the following values:
11276 @table @samp
11277 @item caller
11278 Any mode at function entry is valid, and retained or restored when
11279 the function returns, and when it calls other functions.
11280 This mode is useful for compiling libraries or other compilation units
11281 you might want to incorporate into different programs with different
11282 prevailing FPU modes, and the convenience of being able to use a single
11283 object file outweighs the size and speed overhead for any extra
11284 mode switching that might be needed, compared with what would be needed
11285 with a more specific choice of prevailing FPU mode.
11287 @item truncate
11288 This is the mode used for floating-point calculations with
11289 truncating (i.e.@: round towards zero) rounding mode.  That includes
11290 conversion from floating point to integer.
11292 @item round-nearest
11293 This is the mode used for floating-point calculations with
11294 round-to-nearest-or-even rounding mode.
11296 @item int
11297 This is the mode used to perform integer calculations in the FPU, e.g.@:
11298 integer multiply, or integer multiply-and-accumulate.
11299 @end table
11301 The default is @option{-mfp-mode=caller}
11303 @item -mnosplit-lohi
11304 @itemx -mno-postinc
11305 @itemx -mno-postmodify
11306 @opindex mnosplit-lohi
11307 @opindex mno-postinc
11308 @opindex mno-postmodify
11309 Code generation tweaks that disable, respectively, splitting of 32-bit
11310 loads, generation of post-increment addresses, and generation of
11311 post-modify addresses.  The defaults are @option{msplit-lohi},
11312 @option{-mpost-inc}, and @option{-mpost-modify}.
11314 @item -mnovect-double
11315 @opindex mno-vect-double
11316 Change the preferred SIMD mode to SImode.  The default is
11317 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11319 @item -max-vect-align=@var{num}
11320 @opindex max-vect-align
11321 The maximum alignment for SIMD vector mode types.
11322 @var{num} may be 4 or 8.  The default is 8.
11323 Note that this is an ABI change, even though many library function
11324 interfaces are unaffected if they don't use SIMD vector modes
11325 in places that affect size and/or alignment of relevant types.
11327 @item -msplit-vecmove-early
11328 @opindex msplit-vecmove-early
11329 Split vector moves into single word moves before reload.  In theory this
11330 can give better register allocation, but so far the reverse seems to be
11331 generally the case.
11333 @item -m1reg-@var{reg}
11334 @opindex m1reg-
11335 Specify a register to hold the constant @minus{}1, which makes loading small negative
11336 constants and certain bitmasks faster.
11337 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11338 which specify use of that register as a fixed register,
11339 and @samp{none}, which means that no register is used for this
11340 purpose.  The default is @option{-m1reg-none}.
11342 @end table
11344 @node ARM Options
11345 @subsection ARM Options
11346 @cindex ARM options
11348 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11349 architectures:
11351 @table @gcctabopt
11352 @item -mabi=@var{name}
11353 @opindex mabi
11354 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11355 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11357 @item -mapcs-frame
11358 @opindex mapcs-frame
11359 Generate a stack frame that is compliant with the ARM Procedure Call
11360 Standard for all functions, even if this is not strictly necessary for
11361 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11362 with this option causes the stack frames not to be generated for
11363 leaf functions.  The default is @option{-mno-apcs-frame}.
11365 @item -mapcs
11366 @opindex mapcs
11367 This is a synonym for @option{-mapcs-frame}.
11369 @ignore
11370 @c not currently implemented
11371 @item -mapcs-stack-check
11372 @opindex mapcs-stack-check
11373 Generate code to check the amount of stack space available upon entry to
11374 every function (that actually uses some stack space).  If there is
11375 insufficient space available then either the function
11376 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11377 called, depending upon the amount of stack space required.  The runtime
11378 system is required to provide these functions.  The default is
11379 @option{-mno-apcs-stack-check}, since this produces smaller code.
11381 @c not currently implemented
11382 @item -mapcs-float
11383 @opindex mapcs-float
11384 Pass floating-point arguments using the floating-point registers.  This is
11385 one of the variants of the APCS@.  This option is recommended if the
11386 target hardware has a floating-point unit or if a lot of floating-point
11387 arithmetic is going to be performed by the code.  The default is
11388 @option{-mno-apcs-float}, since the size of integer-only code is 
11389 slightly increased if @option{-mapcs-float} is used.
11391 @c not currently implemented
11392 @item -mapcs-reentrant
11393 @opindex mapcs-reentrant
11394 Generate reentrant, position-independent code.  The default is
11395 @option{-mno-apcs-reentrant}.
11396 @end ignore
11398 @item -mthumb-interwork
11399 @opindex mthumb-interwork
11400 Generate code that supports calling between the ARM and Thumb
11401 instruction sets.  Without this option, on pre-v5 architectures, the
11402 two instruction sets cannot be reliably used inside one program.  The
11403 default is @option{-mno-thumb-interwork}, since slightly larger code
11404 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11405 configurations this option is meaningless.
11407 @item -mno-sched-prolog
11408 @opindex mno-sched-prolog
11409 Prevent the reordering of instructions in the function prologue, or the
11410 merging of those instruction with the instructions in the function's
11411 body.  This means that all functions start with a recognizable set
11412 of instructions (or in fact one of a choice from a small set of
11413 different function prologues), and this information can be used to
11414 locate the start of functions inside an executable piece of code.  The
11415 default is @option{-msched-prolog}.
11417 @item -mfloat-abi=@var{name}
11418 @opindex mfloat-abi
11419 Specifies which floating-point ABI to use.  Permissible values
11420 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11422 Specifying @samp{soft} causes GCC to generate output containing
11423 library calls for floating-point operations.
11424 @samp{softfp} allows the generation of code using hardware floating-point
11425 instructions, but still uses the soft-float calling conventions.
11426 @samp{hard} allows generation of floating-point instructions
11427 and uses FPU-specific calling conventions.
11429 The default depends on the specific target configuration.  Note that
11430 the hard-float and soft-float ABIs are not link-compatible; you must
11431 compile your entire program with the same ABI, and link with a
11432 compatible set of libraries.
11434 @item -mlittle-endian
11435 @opindex mlittle-endian
11436 Generate code for a processor running in little-endian mode.  This is
11437 the default for all standard configurations.
11439 @item -mbig-endian
11440 @opindex mbig-endian
11441 Generate code for a processor running in big-endian mode; the default is
11442 to compile code for a little-endian processor.
11444 @item -mwords-little-endian
11445 @opindex mwords-little-endian
11446 This option only applies when generating code for big-endian processors.
11447 Generate code for a little-endian word order but a big-endian byte
11448 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11449 option should only be used if you require compatibility with code for
11450 big-endian ARM processors generated by versions of the compiler prior to
11451 2.8.  This option is now deprecated.
11453 @item -mcpu=@var{name}
11454 @opindex mcpu
11455 This specifies the name of the target ARM processor.  GCC uses this name
11456 to determine what kind of instructions it can emit when generating
11457 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
11458 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
11459 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
11460 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
11461 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
11462 @samp{arm720},
11463 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
11464 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
11465 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
11466 @samp{strongarm1110},
11467 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
11468 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
11469 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
11470 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
11471 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
11472 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
11473 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
11474 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
11475 @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-r4}, @samp{cortex-r4f},
11476 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
11477 @samp{cortex-m1},
11478 @samp{cortex-m0},
11479 @samp{cortex-m0plus},
11480 @samp{marvell-pj4},
11481 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
11482 @samp{fa526}, @samp{fa626},
11483 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
11486 @option{-mcpu=generic-@var{arch}} is also permissible, and is
11487 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
11488 See @option{-mtune} for more information.
11490 @option{-mcpu=native} causes the compiler to auto-detect the CPU
11491 of the build computer.  At present, this feature is only supported on
11492 Linux, and not all architectures are recognized.  If the auto-detect is
11493 unsuccessful the option has no effect.
11495 @item -mtune=@var{name}
11496 @opindex mtune
11497 This option is very similar to the @option{-mcpu=} option, except that
11498 instead of specifying the actual target processor type, and hence
11499 restricting which instructions can be used, it specifies that GCC should
11500 tune the performance of the code as if the target were of the type
11501 specified in this option, but still choosing the instructions it
11502 generates based on the CPU specified by a @option{-mcpu=} option.
11503 For some ARM implementations better performance can be obtained by using
11504 this option.
11506 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
11507 performance for a blend of processors within architecture @var{arch}.
11508 The aim is to generate code that run well on the current most popular
11509 processors, balancing between optimizations that benefit some CPUs in the
11510 range, and avoiding performance pitfalls of other CPUs.  The effects of
11511 this option may change in future GCC versions as CPU models come and go.
11513 @option{-mtune=native} causes the compiler to auto-detect the CPU
11514 of the build computer.  At present, this feature is only supported on
11515 Linux, and not all architectures are recognized.  If the auto-detect is
11516 unsuccessful the option has no effect.
11518 @item -march=@var{name}
11519 @opindex march
11520 This specifies the name of the target ARM architecture.  GCC uses this
11521 name to determine what kind of instructions it can emit when generating
11522 assembly code.  This option can be used in conjunction with or instead
11523 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
11524 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
11525 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
11526 @samp{armv6}, @samp{armv6j},
11527 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
11528 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
11529 @samp{armv8-a},
11530 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
11532 @option{-march=native} causes the compiler to auto-detect the architecture
11533 of the build computer.  At present, this feature is only supported on
11534 Linux, and not all architectures are recognized.  If the auto-detect is
11535 unsuccessful the option has no effect.
11537 @item -mfpu=@var{name}
11538 @opindex mfpu
11539 This specifies what floating-point hardware (or hardware emulation) is
11540 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
11541 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
11542 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
11543 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
11544 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
11546 If @option{-msoft-float} is specified this specifies the format of
11547 floating-point values.
11549 If the selected floating-point hardware includes the NEON extension
11550 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
11551 operations are not generated by GCC's auto-vectorization pass unless
11552 @option{-funsafe-math-optimizations} is also specified.  This is
11553 because NEON hardware does not fully implement the IEEE 754 standard for
11554 floating-point arithmetic (in particular denormal values are treated as
11555 zero), so the use of NEON instructions may lead to a loss of precision.
11557 @item -mfp16-format=@var{name}
11558 @opindex mfp16-format
11559 Specify the format of the @code{__fp16} half-precision floating-point type.
11560 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
11561 the default is @samp{none}, in which case the @code{__fp16} type is not
11562 defined.  @xref{Half-Precision}, for more information.
11564 @item -mstructure-size-boundary=@var{n}
11565 @opindex mstructure-size-boundary
11566 The sizes of all structures and unions are rounded up to a multiple
11567 of the number of bits set by this option.  Permissible values are 8, 32
11568 and 64.  The default value varies for different toolchains.  For the COFF
11569 targeted toolchain the default value is 8.  A value of 64 is only allowed
11570 if the underlying ABI supports it.
11572 Specifying a larger number can produce faster, more efficient code, but
11573 can also increase the size of the program.  Different values are potentially
11574 incompatible.  Code compiled with one value cannot necessarily expect to
11575 work with code or libraries compiled with another value, if they exchange
11576 information using structures or unions.
11578 @item -mabort-on-noreturn
11579 @opindex mabort-on-noreturn
11580 Generate a call to the function @code{abort} at the end of a
11581 @code{noreturn} function.  It is executed if the function tries to
11582 return.
11584 @item -mlong-calls
11585 @itemx -mno-long-calls
11586 @opindex mlong-calls
11587 @opindex mno-long-calls
11588 Tells the compiler to perform function calls by first loading the
11589 address of the function into a register and then performing a subroutine
11590 call on this register.  This switch is needed if the target function
11591 lies outside of the 64-megabyte addressing range of the offset-based
11592 version of subroutine call instruction.
11594 Even if this switch is enabled, not all function calls are turned
11595 into long calls.  The heuristic is that static functions, functions
11596 that have the @samp{short-call} attribute, functions that are inside
11597 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
11598 definitions have already been compiled within the current compilation
11599 unit are not turned into long calls.  The exceptions to this rule are
11600 that weak function definitions, functions with the @samp{long-call}
11601 attribute or the @samp{section} attribute, and functions that are within
11602 the scope of a @samp{#pragma long_calls} directive are always
11603 turned into long calls.
11605 This feature is not enabled by default.  Specifying
11606 @option{-mno-long-calls} restores the default behavior, as does
11607 placing the function calls within the scope of a @samp{#pragma
11608 long_calls_off} directive.  Note these switches have no effect on how
11609 the compiler generates code to handle function calls via function
11610 pointers.
11612 @item -msingle-pic-base
11613 @opindex msingle-pic-base
11614 Treat the register used for PIC addressing as read-only, rather than
11615 loading it in the prologue for each function.  The runtime system is
11616 responsible for initializing this register with an appropriate value
11617 before execution begins.
11619 @item -mpic-register=@var{reg}
11620 @opindex mpic-register
11621 Specify the register to be used for PIC addressing.  The default is R10
11622 unless stack-checking is enabled, when R9 is used.
11624 @item -mpoke-function-name
11625 @opindex mpoke-function-name
11626 Write the name of each function into the text section, directly
11627 preceding the function prologue.  The generated code is similar to this:
11629 @smallexample
11630      t0
11631          .ascii "arm_poke_function_name", 0
11632          .align
11633      t1
11634          .word 0xff000000 + (t1 - t0)
11635      arm_poke_function_name
11636          mov     ip, sp
11637          stmfd   sp!, @{fp, ip, lr, pc@}
11638          sub     fp, ip, #4
11639 @end smallexample
11641 When performing a stack backtrace, code can inspect the value of
11642 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11643 location @code{pc - 12} and the top 8 bits are set, then we know that
11644 there is a function name embedded immediately preceding this location
11645 and has length @code{((pc[-3]) & 0xff000000)}.
11647 @item -mthumb
11648 @itemx -marm
11649 @opindex marm
11650 @opindex mthumb
11652 Select between generating code that executes in ARM and Thumb
11653 states.  The default for most configurations is to generate code
11654 that executes in ARM state, but the default can be changed by
11655 configuring GCC with the @option{--with-mode=}@var{state}
11656 configure option.
11658 @item -mtpcs-frame
11659 @opindex mtpcs-frame
11660 Generate a stack frame that is compliant with the Thumb Procedure Call
11661 Standard for all non-leaf functions.  (A leaf function is one that does
11662 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11664 @item -mtpcs-leaf-frame
11665 @opindex mtpcs-leaf-frame
11666 Generate a stack frame that is compliant with the Thumb Procedure Call
11667 Standard for all leaf functions.  (A leaf function is one that does
11668 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11670 @item -mcallee-super-interworking
11671 @opindex mcallee-super-interworking
11672 Gives all externally visible functions in the file being compiled an ARM
11673 instruction set header which switches to Thumb mode before executing the
11674 rest of the function.  This allows these functions to be called from
11675 non-interworking code.  This option is not valid in AAPCS configurations
11676 because interworking is enabled by default.
11678 @item -mcaller-super-interworking
11679 @opindex mcaller-super-interworking
11680 Allows calls via function pointers (including virtual functions) to
11681 execute correctly regardless of whether the target code has been
11682 compiled for interworking or not.  There is a small overhead in the cost
11683 of executing a function pointer if this option is enabled.  This option
11684 is not valid in AAPCS configurations because interworking is enabled
11685 by default.
11687 @item -mtp=@var{name}
11688 @opindex mtp
11689 Specify the access model for the thread local storage pointer.  The valid
11690 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11691 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11692 (supported in the arm6k architecture), and @option{auto}, which uses the
11693 best available method for the selected processor.  The default setting is
11694 @option{auto}.
11696 @item -mtls-dialect=@var{dialect}
11697 @opindex mtls-dialect
11698 Specify the dialect to use for accessing thread local storage.  Two
11699 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11700 @samp{gnu} dialect selects the original GNU scheme for supporting
11701 local and global dynamic TLS models.  The @samp{gnu2} dialect
11702 selects the GNU descriptor scheme, which provides better performance
11703 for shared libraries.  The GNU descriptor scheme is compatible with
11704 the original scheme, but does require new assembler, linker and
11705 library support.  Initial and local exec TLS models are unaffected by
11706 this option and always use the original scheme.
11708 @item -mword-relocations
11709 @opindex mword-relocations
11710 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11711 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11712 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11713 is specified.
11715 @item -mfix-cortex-m3-ldrd
11716 @opindex mfix-cortex-m3-ldrd
11717 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11718 with overlapping destination and base registers are used.  This option avoids
11719 generating these instructions.  This option is enabled by default when
11720 @option{-mcpu=cortex-m3} is specified.
11722 @item -munaligned-access
11723 @itemx -mno-unaligned-access
11724 @opindex munaligned-access
11725 @opindex mno-unaligned-access
11726 Enables (or disables) reading and writing of 16- and 32- bit values
11727 from addresses that are not 16- or 32- bit aligned.  By default
11728 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11729 architectures, and enabled for all other architectures.  If unaligned
11730 access is not enabled then words in packed data structures will be
11731 accessed a byte at a time.
11733 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11734 generated object file to either true or false, depending upon the
11735 setting of this option.  If unaligned access is enabled then the
11736 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11737 defined.
11739 @item -mneon-for-64bits
11740 @opindex mneon-for-64bits
11741 Enables using Neon to handle scalar 64-bits operations. This is
11742 disabled by default since the cost of moving data from core registers
11743 to Neon is high.
11745 @item -mrestrict-it
11746 @opindex mrestrict-it
11747 Restricts generation of IT blocks to conform to the rules of ARMv8.
11748 IT blocks can only contain a single 16-bit instruction from a select
11749 set of instructions. This option is on by default for ARMv8 Thumb mode.
11750 @end table
11752 @node AVR Options
11753 @subsection AVR Options
11754 @cindex AVR Options
11756 These options are defined for AVR implementations:
11758 @table @gcctabopt
11759 @item -mmcu=@var{mcu}
11760 @opindex mmcu
11761 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11763 The default for this option is@tie{}@code{avr2}.
11765 GCC supports the following AVR devices and ISAs:
11767 @include avr-mmcu.texi
11769 @item -maccumulate-args
11770 @opindex maccumulate-args
11771 Accumulate outgoing function arguments and acquire/release the needed
11772 stack space for outgoing function arguments once in function
11773 prologue/epilogue.  Without this option, outgoing arguments are pushed
11774 before calling a function and popped afterwards.
11776 Popping the arguments after the function call can be expensive on
11777 AVR so that accumulating the stack space might lead to smaller
11778 executables because arguments need not to be removed from the
11779 stack after such a function call.
11781 This option can lead to reduced code size for functions that perform
11782 several calls to functions that get their arguments on the stack like
11783 calls to printf-like functions.
11785 @item -mbranch-cost=@var{cost}
11786 @opindex mbranch-cost
11787 Set the branch costs for conditional branch instructions to
11788 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11789 integers. The default branch cost is 0.
11791 @item -mcall-prologues
11792 @opindex mcall-prologues
11793 Functions prologues/epilogues are expanded as calls to appropriate
11794 subroutines.  Code size is smaller.
11796 @item -mint8
11797 @opindex mint8
11798 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11799 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11800 and @code{long long} is 4 bytes.  Please note that this option does not
11801 conform to the C standards, but it results in smaller code
11802 size.
11804 @item -mno-interrupts
11805 @opindex mno-interrupts
11806 Generated code is not compatible with hardware interrupts.
11807 Code size is smaller.
11809 @item -mrelax
11810 @opindex mrelax
11811 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11812 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11813 Setting @code{-mrelax} just adds the @code{--relax} option to the
11814 linker command line when the linker is called.
11816 Jump relaxing is performed by the linker because jump offsets are not
11817 known before code is located. Therefore, the assembler code generated by the
11818 compiler is the same, but the instructions in the executable may
11819 differ from instructions in the assembler code.
11821 Relaxing must be turned on if linker stubs are needed, see the
11822 section on @code{EIND} and linker stubs below.
11824 @item -msp8
11825 @opindex msp8
11826 Treat the stack pointer register as an 8-bit register,
11827 i.e.@: assume the high byte of the stack pointer is zero.
11828 In general, you don't need to set this option by hand.
11830 This option is used internally by the compiler to select and
11831 build multilibs for architectures @code{avr2} and @code{avr25}.
11832 These architectures mix devices with and without @code{SPH}.
11833 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11834 the compiler driver will add or remove this option from the compiler
11835 proper's command line, because the compiler then knows if the device
11836 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11837 register or not.
11839 @item -mstrict-X
11840 @opindex mstrict-X
11841 Use address register @code{X} in a way proposed by the hardware.  This means
11842 that @code{X} is only used in indirect, post-increment or
11843 pre-decrement addressing.
11845 Without this option, the @code{X} register may be used in the same way
11846 as @code{Y} or @code{Z} which then is emulated by additional
11847 instructions.  
11848 For example, loading a value with @code{X+const} addressing with a
11849 small non-negative @code{const < 64} to a register @var{Rn} is
11850 performed as
11852 @example
11853 adiw r26, const   ; X += const
11854 ld   @var{Rn}, X        ; @var{Rn} = *X
11855 sbiw r26, const   ; X -= const
11856 @end example
11858 @item -mtiny-stack
11859 @opindex mtiny-stack
11860 Only change the lower 8@tie{}bits of the stack pointer.
11862 @item -Waddr-space-convert
11863 @opindex Waddr-space-convert
11864 Warn about conversions between address spaces in the case where the
11865 resulting address space is not contained in the incoming address space.
11866 @end table
11868 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11869 @cindex @code{EIND}
11870 Pointers in the implementation are 16@tie{}bits wide.
11871 The address of a function or label is represented as word address so
11872 that indirect jumps and calls can target any code address in the
11873 range of 64@tie{}Ki words.
11875 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11876 bytes of program memory space, there is a special function register called
11877 @code{EIND} that serves as most significant part of the target address
11878 when @code{EICALL} or @code{EIJMP} instructions are used.
11880 Indirect jumps and calls on these devices are handled as follows by
11881 the compiler and are subject to some limitations:
11883 @itemize @bullet
11885 @item
11886 The compiler never sets @code{EIND}.
11888 @item
11889 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11890 instructions or might read @code{EIND} directly in order to emulate an
11891 indirect call/jump by means of a @code{RET} instruction.
11893 @item
11894 The compiler assumes that @code{EIND} never changes during the startup
11895 code or during the application. In particular, @code{EIND} is not
11896 saved/restored in function or interrupt service routine
11897 prologue/epilogue.
11899 @item
11900 For indirect calls to functions and computed goto, the linker
11901 generates @emph{stubs}. Stubs are jump pads sometimes also called
11902 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11903 The stub contains a direct jump to the desired address.
11905 @item
11906 Linker relaxation must be turned on so that the linker will generate
11907 the stubs correctly an all situaltion. See the compiler option
11908 @code{-mrelax} and the linler option @code{--relax}.
11909 There are corner cases where the linker is supposed to generate stubs
11910 but aborts without relaxation and without a helpful error message.
11912 @item
11913 The default linker script is arranged for code with @code{EIND = 0}.
11914 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11915 linker script has to be used in order to place the sections whose
11916 name start with @code{.trampolines} into the segment where @code{EIND}
11917 points to.
11919 @item
11920 The startup code from libgcc never sets @code{EIND}.
11921 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11922 For the impact of AVR-LibC on @code{EIND}, see the
11923 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
11925 @item
11926 It is legitimate for user-specific startup code to set up @code{EIND}
11927 early, for example by means of initialization code located in
11928 section @code{.init3}. Such code runs prior to general startup code
11929 that initializes RAM and calls constructors, but after the bit
11930 of startup code from AVR-LibC that sets @code{EIND} to the segment
11931 where the vector table is located.
11932 @example
11933 #include <avr/io.h>
11935 static void
11936 __attribute__((section(".init3"),naked,used,no_instrument_function))
11937 init3_set_eind (void)
11939   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11940                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11942 @end example
11944 @noindent
11945 The @code{__trampolines_start} symbol is defined in the linker script.
11947 @item
11948 Stubs are generated automatically by the linker if
11949 the following two conditions are met:
11950 @itemize @minus
11952 @item The address of a label is taken by means of the @code{gs} modifier
11953 (short for @emph{generate stubs}) like so:
11954 @example
11955 LDI r24, lo8(gs(@var{func}))
11956 LDI r25, hi8(gs(@var{func}))
11957 @end example
11958 @item The final location of that label is in a code segment
11959 @emph{outside} the segment where the stubs are located.
11960 @end itemize
11962 @item
11963 The compiler emits such @code{gs} modifiers for code labels in the
11964 following situations:
11965 @itemize @minus
11966 @item Taking address of a function or code label.
11967 @item Computed goto.
11968 @item If prologue-save function is used, see @option{-mcall-prologues}
11969 command-line option.
11970 @item Switch/case dispatch tables. If you do not want such dispatch
11971 tables you can specify the @option{-fno-jump-tables} command-line option.
11972 @item C and C++ constructors/destructors called during startup/shutdown.
11973 @item If the tools hit a @code{gs()} modifier explained above.
11974 @end itemize
11976 @item
11977 Jumping to non-symbolic addresses like so is @emph{not} supported:
11979 @example
11980 int main (void)
11982     /* Call function at word address 0x2 */
11983     return ((int(*)(void)) 0x2)();
11985 @end example
11987 Instead, a stub has to be set up, i.e.@: the function has to be called
11988 through a symbol (@code{func_4} in the example):
11990 @example
11991 int main (void)
11993     extern int func_4 (void);
11995     /* Call function at byte address 0x4 */
11996     return func_4();
11998 @end example
12000 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
12001 Alternatively, @code{func_4} can be defined in the linker script.
12002 @end itemize
12004 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
12005 @cindex @code{RAMPD}
12006 @cindex @code{RAMPX}
12007 @cindex @code{RAMPY}
12008 @cindex @code{RAMPZ}
12009 Some AVR devices support memories larger than the 64@tie{}KiB range
12010 that can be accessed with 16-bit pointers.  To access memory locations
12011 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
12012 register is used as high part of the address:
12013 The @code{X}, @code{Y}, @code{Z} address register is concatenated
12014 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
12015 register, respectively, to get a wide address. Similarly,
12016 @code{RAMPD} is used together with direct addressing.
12018 @itemize
12019 @item
12020 The startup code initializes the @code{RAMP} special function
12021 registers with zero.
12023 @item
12024 If a @ref{AVR Named Address Spaces,named address space} other than
12025 generic or @code{__flash} is used, then @code{RAMPZ} is set
12026 as needed before the operation.
12028 @item
12029 If the device supports RAM larger than 64@tie{KiB} and the compiler
12030 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
12031 is reset to zero after the operation.
12033 @item
12034 If the device comes with a specific @code{RAMP} register, the ISR
12035 prologue/epilogue saves/restores that SFR and initializes it with
12036 zero in case the ISR code might (implicitly) use it.
12038 @item
12039 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
12040 If you use inline assembler to read from locations outside the
12041 16-bit address range and change one of the @code{RAMP} registers,
12042 you must reset it to zero after the access.
12044 @end itemize
12046 @subsubsection AVR Built-in Macros
12048 GCC defines several built-in macros so that the user code can test
12049 for the presence or absence of features.  Almost any of the following
12050 built-in macros are deduced from device capabilities and thus
12051 triggered by the @code{-mmcu=} command-line option.
12053 For even more AVR-specific built-in macros see
12054 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
12056 @table @code
12058 @item __AVR_ARCH__
12059 Build-in macro that resolves to a decimal number that identifies the
12060 architecture and depends on the @code{-mmcu=@var{mcu}} option.
12061 Possible values are:
12063 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
12064 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
12065 @code{105}, @code{106}, @code{107}
12067 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
12068 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
12069 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
12070 @code{avrxmega6}, @code{avrxmega7}, respectively.
12071 If @var{mcu} specifies a device, this built-in macro is set
12072 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
12073 defined to @code{4}.
12075 @item __AVR_@var{Device}__
12076 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
12077 the device's name. For example, @code{-mmcu=atmega8} defines the
12078 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
12079 @code{__AVR_ATtiny261A__}, etc.
12081 The built-in macros' names follow
12082 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
12083 the device name as from the AVR user manual. The difference between
12084 @var{Device} in the built-in macro and @var{device} in
12085 @code{-mmcu=@var{device}} is that the latter is always lowercase.
12087 If @var{device} is not a device but only a core architecture like
12088 @code{avr51}, this macro will not be defined.
12090 @item __AVR_XMEGA__
12091 The device / architecture belongs to the XMEGA family of devices.
12093 @item __AVR_HAVE_ELPM__
12094 The device has the the @code{ELPM} instruction.
12096 @item __AVR_HAVE_ELPMX__
12097 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
12098 R@var{n},Z+} instructions.
12100 @item __AVR_HAVE_MOVW__
12101 The device has the @code{MOVW} instruction to perform 16-bit
12102 register-register moves.
12104 @item __AVR_HAVE_LPMX__
12105 The device has the @code{LPM R@var{n},Z} and
12106 @code{LPM R@var{n},Z+} instructions.
12108 @item __AVR_HAVE_MUL__
12109 The device has a hardware multiplier. 
12111 @item __AVR_HAVE_JMP_CALL__
12112 The device has the @code{JMP} and @code{CALL} instructions.
12113 This is the case for devices with at least 16@tie{}KiB of program
12114 memory.
12116 @item __AVR_HAVE_EIJMP_EICALL__
12117 @itemx __AVR_3_BYTE_PC__
12118 The device has the @code{EIJMP} and @code{EICALL} instructions.
12119 This is the case for devices with more than 128@tie{}KiB of program memory.
12120 This also means that the program counter
12121 (PC) is 3@tie{}bytes wide.
12123 @item __AVR_2_BYTE_PC__
12124 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
12125 with up to 128@tie{}KiB of program memory.
12127 @item __AVR_HAVE_8BIT_SP__
12128 @itemx __AVR_HAVE_16BIT_SP__
12129 The stack pointer (SP) register is treated as 8-bit respectively
12130 16-bit register by the compiler.
12131 The definition of these macros is affected by @code{-mtiny-stack}.
12133 @item __AVR_HAVE_SPH__
12134 @itemx __AVR_SP8__
12135 The device has the SPH (high part of stack pointer) special function
12136 register or has an 8-bit stack pointer, respectively.
12137 The definition of these macros is affected by @code{-mmcu=} and
12138 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
12139 by @code{-msp8}.
12141 @item __AVR_HAVE_RAMPD__
12142 @itemx __AVR_HAVE_RAMPX__
12143 @itemx __AVR_HAVE_RAMPY__
12144 @itemx __AVR_HAVE_RAMPZ__
12145 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
12146 @code{RAMPZ} special function register, respectively.
12148 @item __NO_INTERRUPTS__
12149 This macro reflects the @code{-mno-interrupts} command line option.
12151 @item __AVR_ERRATA_SKIP__
12152 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
12153 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
12154 instructions because of a hardware erratum.  Skip instructions are
12155 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
12156 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
12157 set.
12159 @item __AVR_SFR_OFFSET__=@var{offset}
12160 Instructions that can address I/O special function registers directly
12161 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
12162 address as if addressed by an instruction to access RAM like @code{LD}
12163 or @code{STS}. This offset depends on the device architecture and has
12164 to be subtracted from the RAM address in order to get the
12165 respective I/O@tie{}address.
12167 @item __WITH_AVRLIBC__
12168 The compiler is configured to be used together with AVR-Libc.
12169 See the @code{--with-avrlibc} configure option.
12171 @end table
12173 @node Blackfin Options
12174 @subsection Blackfin Options
12175 @cindex Blackfin Options
12177 @table @gcctabopt
12178 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
12179 @opindex mcpu=
12180 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
12181 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
12182 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
12183 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
12184 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
12185 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
12186 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
12187 @samp{bf561}, @samp{bf592}.
12189 The optional @var{sirevision} specifies the silicon revision of the target
12190 Blackfin processor.  Any workarounds available for the targeted silicon revision
12191 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
12192 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
12193 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
12194 hexadecimal digits representing the major and minor numbers in the silicon
12195 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
12196 is not defined.  If @var{sirevision} is @samp{any}, the
12197 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
12198 If this optional @var{sirevision} is not used, GCC assumes the latest known
12199 silicon revision of the targeted Blackfin processor.
12201 GCC defines a preprocessor macro for the specified @var{cpu}.
12202 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
12203 provided by libgloss to be linked in if @option{-msim} is not given.
12205 Without this option, @samp{bf532} is used as the processor by default.
12207 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
12208 only the preprocessor macro is defined.
12210 @item -msim
12211 @opindex msim
12212 Specifies that the program will be run on the simulator.  This causes
12213 the simulator BSP provided by libgloss to be linked in.  This option
12214 has effect only for @samp{bfin-elf} toolchain.
12215 Certain other options, such as @option{-mid-shared-library} and
12216 @option{-mfdpic}, imply @option{-msim}.
12218 @item -momit-leaf-frame-pointer
12219 @opindex momit-leaf-frame-pointer
12220 Don't keep the frame pointer in a register for leaf functions.  This
12221 avoids the instructions to save, set up and restore frame pointers and
12222 makes an extra register available in leaf functions.  The option
12223 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
12224 which might make debugging harder.
12226 @item -mspecld-anomaly
12227 @opindex mspecld-anomaly
12228 When enabled, the compiler ensures that the generated code does not
12229 contain speculative loads after jump instructions. If this option is used,
12230 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
12232 @item -mno-specld-anomaly
12233 @opindex mno-specld-anomaly
12234 Don't generate extra code to prevent speculative loads from occurring.
12236 @item -mcsync-anomaly
12237 @opindex mcsync-anomaly
12238 When enabled, the compiler ensures that the generated code does not
12239 contain CSYNC or SSYNC instructions too soon after conditional branches.
12240 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
12242 @item -mno-csync-anomaly
12243 @opindex mno-csync-anomaly
12244 Don't generate extra code to prevent CSYNC or SSYNC instructions from
12245 occurring too soon after a conditional branch.
12247 @item -mlow-64k
12248 @opindex mlow-64k
12249 When enabled, the compiler is free to take advantage of the knowledge that
12250 the entire program fits into the low 64k of memory.
12252 @item -mno-low-64k
12253 @opindex mno-low-64k
12254 Assume that the program is arbitrarily large.  This is the default.
12256 @item -mstack-check-l1
12257 @opindex mstack-check-l1
12258 Do stack checking using information placed into L1 scratchpad memory by the
12259 uClinux kernel.
12261 @item -mid-shared-library
12262 @opindex mid-shared-library
12263 Generate code that supports shared libraries via the library ID method.
12264 This allows for execute in place and shared libraries in an environment
12265 without virtual memory management.  This option implies @option{-fPIC}.
12266 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12268 @item -mno-id-shared-library
12269 @opindex mno-id-shared-library
12270 Generate code that doesn't assume ID-based shared libraries are being used.
12271 This is the default.
12273 @item -mleaf-id-shared-library
12274 @opindex mleaf-id-shared-library
12275 Generate code that supports shared libraries via the library ID method,
12276 but assumes that this library or executable won't link against any other
12277 ID shared libraries.  That allows the compiler to use faster code for jumps
12278 and calls.
12280 @item -mno-leaf-id-shared-library
12281 @opindex mno-leaf-id-shared-library
12282 Do not assume that the code being compiled won't link against any ID shared
12283 libraries.  Slower code is generated for jump and call insns.
12285 @item -mshared-library-id=n
12286 @opindex mshared-library-id
12287 Specifies the identification number of the ID-based shared library being
12288 compiled.  Specifying a value of 0 generates more compact code; specifying
12289 other values forces the allocation of that number to the current
12290 library but is no more space- or time-efficient than omitting this option.
12292 @item -msep-data
12293 @opindex msep-data
12294 Generate code that allows the data segment to be located in a different
12295 area of memory from the text segment.  This allows for execute in place in
12296 an environment without virtual memory management by eliminating relocations
12297 against the text section.
12299 @item -mno-sep-data
12300 @opindex mno-sep-data
12301 Generate code that assumes that the data segment follows the text segment.
12302 This is the default.
12304 @item -mlong-calls
12305 @itemx -mno-long-calls
12306 @opindex mlong-calls
12307 @opindex mno-long-calls
12308 Tells the compiler to perform function calls by first loading the
12309 address of the function into a register and then performing a subroutine
12310 call on this register.  This switch is needed if the target function
12311 lies outside of the 24-bit addressing range of the offset-based
12312 version of subroutine call instruction.
12314 This feature is not enabled by default.  Specifying
12315 @option{-mno-long-calls} restores the default behavior.  Note these
12316 switches have no effect on how the compiler generates code to handle
12317 function calls via function pointers.
12319 @item -mfast-fp
12320 @opindex mfast-fp
12321 Link with the fast floating-point library. This library relaxes some of
12322 the IEEE floating-point standard's rules for checking inputs against
12323 Not-a-Number (NAN), in the interest of performance.
12325 @item -minline-plt
12326 @opindex minline-plt
12327 Enable inlining of PLT entries in function calls to functions that are
12328 not known to bind locally.  It has no effect without @option{-mfdpic}.
12330 @item -mmulticore
12331 @opindex mmulticore
12332 Build a standalone application for multicore Blackfin processors. 
12333 This option causes proper start files and link scripts supporting 
12334 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12335 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12337 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12338 selects the one-application-per-core programming model.  Without
12339 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12340 programming model is used. In this model, the main function of Core B
12341 should be named as @code{coreb_main}.
12343 If this option is not used, the single-core application programming
12344 model is used.
12346 @item -mcorea
12347 @opindex mcorea
12348 Build a standalone application for Core A of BF561 when using
12349 the one-application-per-core programming model. Proper start files
12350 and link scripts are used to support Core A, and the macro
12351 @code{__BFIN_COREA} is defined.
12352 This option can only be used in conjunction with @option{-mmulticore}.
12354 @item -mcoreb
12355 @opindex mcoreb
12356 Build a standalone application for Core B of BF561 when using
12357 the one-application-per-core programming model. Proper start files
12358 and link scripts are used to support Core B, and the macro
12359 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12360 should be used instead of @code{main}. 
12361 This option can only be used in conjunction with @option{-mmulticore}.
12363 @item -msdram
12364 @opindex msdram
12365 Build a standalone application for SDRAM. Proper start files and
12366 link scripts are used to put the application into SDRAM, and the macro
12367 @code{__BFIN_SDRAM} is defined.
12368 The loader should initialize SDRAM before loading the application.
12370 @item -micplb
12371 @opindex micplb
12372 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12373 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12374 are enabled; for standalone applications the default is off.
12375 @end table
12377 @node C6X Options
12378 @subsection C6X Options
12379 @cindex C6X Options
12381 @table @gcctabopt
12382 @item -march=@var{name}
12383 @opindex march
12384 This specifies the name of the target architecture.  GCC uses this
12385 name to determine what kind of instructions it can emit when generating
12386 assembly code.  Permissible names are: @samp{c62x},
12387 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12389 @item -mbig-endian
12390 @opindex mbig-endian
12391 Generate code for a big-endian target.
12393 @item -mlittle-endian
12394 @opindex mlittle-endian
12395 Generate code for a little-endian target.  This is the default.
12397 @item -msim
12398 @opindex msim
12399 Choose startup files and linker script suitable for the simulator.
12401 @item -msdata=default
12402 @opindex msdata=default
12403 Put small global and static data in the @samp{.neardata} section,
12404 which is pointed to by register @code{B14}.  Put small uninitialized
12405 global and static data in the @samp{.bss} section, which is adjacent
12406 to the @samp{.neardata} section.  Put small read-only data into the
12407 @samp{.rodata} section.  The corresponding sections used for large
12408 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12410 @item -msdata=all
12411 @opindex msdata=all
12412 Put all data, not just small objects, into the sections reserved for
12413 small data, and use addressing relative to the @code{B14} register to
12414 access them.
12416 @item -msdata=none
12417 @opindex msdata=none
12418 Make no use of the sections reserved for small data, and use absolute
12419 addresses to access all data.  Put all initialized global and static
12420 data in the @samp{.fardata} section, and all uninitialized data in the
12421 @samp{.far} section.  Put all constant data into the @samp{.const}
12422 section.
12423 @end table
12425 @node CRIS Options
12426 @subsection CRIS Options
12427 @cindex CRIS Options
12429 These options are defined specifically for the CRIS ports.
12431 @table @gcctabopt
12432 @item -march=@var{architecture-type}
12433 @itemx -mcpu=@var{architecture-type}
12434 @opindex march
12435 @opindex mcpu
12436 Generate code for the specified architecture.  The choices for
12437 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12438 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12439 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12440 @samp{v10}.
12442 @item -mtune=@var{architecture-type}
12443 @opindex mtune
12444 Tune to @var{architecture-type} everything applicable about the generated
12445 code, except for the ABI and the set of available instructions.  The
12446 choices for @var{architecture-type} are the same as for
12447 @option{-march=@var{architecture-type}}.
12449 @item -mmax-stack-frame=@var{n}
12450 @opindex mmax-stack-frame
12451 Warn when the stack frame of a function exceeds @var{n} bytes.
12453 @item -metrax4
12454 @itemx -metrax100
12455 @opindex metrax4
12456 @opindex metrax100
12457 The options @option{-metrax4} and @option{-metrax100} are synonyms for
12458 @option{-march=v3} and @option{-march=v8} respectively.
12460 @item -mmul-bug-workaround
12461 @itemx -mno-mul-bug-workaround
12462 @opindex mmul-bug-workaround
12463 @opindex mno-mul-bug-workaround
12464 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
12465 models where it applies.  This option is active by default.
12467 @item -mpdebug
12468 @opindex mpdebug
12469 Enable CRIS-specific verbose debug-related information in the assembly
12470 code.  This option also has the effect of turning off the @samp{#NO_APP}
12471 formatted-code indicator to the assembler at the beginning of the
12472 assembly file.
12474 @item -mcc-init
12475 @opindex mcc-init
12476 Do not use condition-code results from previous instruction; always emit
12477 compare and test instructions before use of condition codes.
12479 @item -mno-side-effects
12480 @opindex mno-side-effects
12481 Do not emit instructions with side effects in addressing modes other than
12482 post-increment.
12484 @item -mstack-align
12485 @itemx -mno-stack-align
12486 @itemx -mdata-align
12487 @itemx -mno-data-align
12488 @itemx -mconst-align
12489 @itemx -mno-const-align
12490 @opindex mstack-align
12491 @opindex mno-stack-align
12492 @opindex mdata-align
12493 @opindex mno-data-align
12494 @opindex mconst-align
12495 @opindex mno-const-align
12496 These options (@samp{no-} options) arrange (eliminate arrangements) for the
12497 stack frame, individual data and constants to be aligned for the maximum
12498 single data access size for the chosen CPU model.  The default is to
12499 arrange for 32-bit alignment.  ABI details such as structure layout are
12500 not affected by these options.
12502 @item -m32-bit
12503 @itemx -m16-bit
12504 @itemx -m8-bit
12505 @opindex m32-bit
12506 @opindex m16-bit
12507 @opindex m8-bit
12508 Similar to the stack- data- and const-align options above, these options
12509 arrange for stack frame, writable data and constants to all be 32-bit,
12510 16-bit or 8-bit aligned.  The default is 32-bit alignment.
12512 @item -mno-prologue-epilogue
12513 @itemx -mprologue-epilogue
12514 @opindex mno-prologue-epilogue
12515 @opindex mprologue-epilogue
12516 With @option{-mno-prologue-epilogue}, the normal function prologue and
12517 epilogue which set up the stack frame are omitted and no return
12518 instructions or return sequences are generated in the code.  Use this
12519 option only together with visual inspection of the compiled code: no
12520 warnings or errors are generated when call-saved registers must be saved,
12521 or storage for local variables needs to be allocated.
12523 @item -mno-gotplt
12524 @itemx -mgotplt
12525 @opindex mno-gotplt
12526 @opindex mgotplt
12527 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
12528 instruction sequences that load addresses for functions from the PLT part
12529 of the GOT rather than (traditional on other architectures) calls to the
12530 PLT@.  The default is @option{-mgotplt}.
12532 @item -melf
12533 @opindex melf
12534 Legacy no-op option only recognized with the cris-axis-elf and
12535 cris-axis-linux-gnu targets.
12537 @item -mlinux
12538 @opindex mlinux
12539 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
12541 @item -sim
12542 @opindex sim
12543 This option, recognized for the cris-axis-elf, arranges
12544 to link with input-output functions from a simulator library.  Code,
12545 initialized data and zero-initialized data are allocated consecutively.
12547 @item -sim2
12548 @opindex sim2
12549 Like @option{-sim}, but pass linker options to locate initialized data at
12550 0x40000000 and zero-initialized data at 0x80000000.
12551 @end table
12553 @node CR16 Options
12554 @subsection CR16 Options
12555 @cindex CR16 Options
12557 These options are defined specifically for the CR16 ports.
12559 @table @gcctabopt
12561 @item -mmac
12562 @opindex mmac
12563 Enable the use of multiply-accumulate instructions. Disabled by default.
12565 @item -mcr16cplus
12566 @itemx -mcr16c
12567 @opindex mcr16cplus
12568 @opindex mcr16c
12569 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
12570 is default.
12572 @item -msim
12573 @opindex msim
12574 Links the library libsim.a which is in compatible with simulator. Applicable
12575 to ELF compiler only.
12577 @item -mint32
12578 @opindex mint32
12579 Choose integer type as 32-bit wide.
12581 @item -mbit-ops
12582 @opindex mbit-ops
12583 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
12585 @item -mdata-model=@var{model}
12586 @opindex mdata-model
12587 Choose a data model. The choices for @var{model} are @samp{near},
12588 @samp{far} or @samp{medium}. @samp{medium} is default.
12589 However, @samp{far} is not valid with @option{-mcr16c}, as the
12590 CR16C architecture does not support the far data model.
12591 @end table
12593 @node Darwin Options
12594 @subsection Darwin Options
12595 @cindex Darwin options
12597 These options are defined for all architectures running the Darwin operating
12598 system.
12600 FSF GCC on Darwin does not create ``fat'' object files; it creates
12601 an object file for the single architecture that GCC was built to
12602 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
12603 @option{-arch} options are used; it does so by running the compiler or
12604 linker multiple times and joining the results together with
12605 @file{lipo}.
12607 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
12608 @samp{i686}) is determined by the flags that specify the ISA
12609 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
12610 @option{-force_cpusubtype_ALL} option can be used to override this.
12612 The Darwin tools vary in their behavior when presented with an ISA
12613 mismatch.  The assembler, @file{as}, only permits instructions to
12614 be used that are valid for the subtype of the file it is generating,
12615 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
12616 The linker for shared libraries, @file{/usr/bin/libtool}, fails
12617 and prints an error if asked to create a shared library with a less
12618 restrictive subtype than its input files (for instance, trying to put
12619 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
12620 for executables, @command{ld}, quietly gives the executable the most
12621 restrictive subtype of any of its input files.
12623 @table @gcctabopt
12624 @item -F@var{dir}
12625 @opindex F
12626 Add the framework directory @var{dir} to the head of the list of
12627 directories to be searched for header files.  These directories are
12628 interleaved with those specified by @option{-I} options and are
12629 scanned in a left-to-right order.
12631 A framework directory is a directory with frameworks in it.  A
12632 framework is a directory with a @file{Headers} and/or
12633 @file{PrivateHeaders} directory contained directly in it that ends
12634 in @file{.framework}.  The name of a framework is the name of this
12635 directory excluding the @file{.framework}.  Headers associated with
12636 the framework are found in one of those two directories, with
12637 @file{Headers} being searched first.  A subframework is a framework
12638 directory that is in a framework's @file{Frameworks} directory.
12639 Includes of subframework headers can only appear in a header of a
12640 framework that contains the subframework, or in a sibling subframework
12641 header.  Two subframeworks are siblings if they occur in the same
12642 framework.  A subframework should not have the same name as a
12643 framework; a warning is issued if this is violated.  Currently a
12644 subframework cannot have subframeworks; in the future, the mechanism
12645 may be extended to support this.  The standard frameworks can be found
12646 in @file{/System/Library/Frameworks} and
12647 @file{/Library/Frameworks}.  An example include looks like
12648 @code{#include <Framework/header.h>}, where @file{Framework} denotes
12649 the name of the framework and @file{header.h} is found in the
12650 @file{PrivateHeaders} or @file{Headers} directory.
12652 @item -iframework@var{dir}
12653 @opindex iframework
12654 Like @option{-F} except the directory is a treated as a system
12655 directory.  The main difference between this @option{-iframework} and
12656 @option{-F} is that with @option{-iframework} the compiler does not
12657 warn about constructs contained within header files found via
12658 @var{dir}.  This option is valid only for the C family of languages.
12660 @item -gused
12661 @opindex gused
12662 Emit debugging information for symbols that are used.  For stabs
12663 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12664 This is by default ON@.
12666 @item -gfull
12667 @opindex gfull
12668 Emit debugging information for all symbols and types.
12670 @item -mmacosx-version-min=@var{version}
12671 The earliest version of MacOS X that this executable will run on
12672 is @var{version}.  Typical values of @var{version} include @code{10.1},
12673 @code{10.2}, and @code{10.3.9}.
12675 If the compiler was built to use the system's headers by default,
12676 then the default for this option is the system version on which the
12677 compiler is running, otherwise the default is to make choices that
12678 are compatible with as many systems and code bases as possible.
12680 @item -mkernel
12681 @opindex mkernel
12682 Enable kernel development mode.  The @option{-mkernel} option sets
12683 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12684 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12685 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12686 applicable.  This mode also sets @option{-mno-altivec},
12687 @option{-msoft-float}, @option{-fno-builtin} and
12688 @option{-mlong-branch} for PowerPC targets.
12690 @item -mone-byte-bool
12691 @opindex mone-byte-bool
12692 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12693 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12694 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12695 option has no effect on x86.
12697 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12698 to generate code that is not binary compatible with code generated
12699 without that switch.  Using this switch may require recompiling all
12700 other modules in a program, including system libraries.  Use this
12701 switch to conform to a non-default data model.
12703 @item -mfix-and-continue
12704 @itemx -ffix-and-continue
12705 @itemx -findirect-data
12706 @opindex mfix-and-continue
12707 @opindex ffix-and-continue
12708 @opindex findirect-data
12709 Generate code suitable for fast turnaround development, such as to
12710 allow GDB to dynamically load @code{.o} files into already-running
12711 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12712 are provided for backwards compatibility.
12714 @item -all_load
12715 @opindex all_load
12716 Loads all members of static archive libraries.
12717 See man ld(1) for more information.
12719 @item -arch_errors_fatal
12720 @opindex arch_errors_fatal
12721 Cause the errors having to do with files that have the wrong architecture
12722 to be fatal.
12724 @item -bind_at_load
12725 @opindex bind_at_load
12726 Causes the output file to be marked such that the dynamic linker will
12727 bind all undefined references when the file is loaded or launched.
12729 @item -bundle
12730 @opindex bundle
12731 Produce a Mach-o bundle format file.
12732 See man ld(1) for more information.
12734 @item -bundle_loader @var{executable}
12735 @opindex bundle_loader
12736 This option specifies the @var{executable} that will load the build
12737 output file being linked.  See man ld(1) for more information.
12739 @item -dynamiclib
12740 @opindex dynamiclib
12741 When passed this option, GCC produces a dynamic library instead of
12742 an executable when linking, using the Darwin @file{libtool} command.
12744 @item -force_cpusubtype_ALL
12745 @opindex force_cpusubtype_ALL
12746 This causes GCC's output file to have the @var{ALL} subtype, instead of
12747 one controlled by the @option{-mcpu} or @option{-march} option.
12749 @item -allowable_client  @var{client_name}
12750 @itemx -client_name
12751 @itemx -compatibility_version
12752 @itemx -current_version
12753 @itemx -dead_strip
12754 @itemx -dependency-file
12755 @itemx -dylib_file
12756 @itemx -dylinker_install_name
12757 @itemx -dynamic
12758 @itemx -exported_symbols_list
12759 @itemx -filelist
12760 @need 800
12761 @itemx -flat_namespace
12762 @itemx -force_flat_namespace
12763 @itemx -headerpad_max_install_names
12764 @itemx -image_base
12765 @itemx -init
12766 @itemx -install_name
12767 @itemx -keep_private_externs
12768 @itemx -multi_module
12769 @itemx -multiply_defined
12770 @itemx -multiply_defined_unused
12771 @need 800
12772 @itemx -noall_load
12773 @itemx -no_dead_strip_inits_and_terms
12774 @itemx -nofixprebinding
12775 @itemx -nomultidefs
12776 @itemx -noprebind
12777 @itemx -noseglinkedit
12778 @itemx -pagezero_size
12779 @itemx -prebind
12780 @itemx -prebind_all_twolevel_modules
12781 @itemx -private_bundle
12782 @need 800
12783 @itemx -read_only_relocs
12784 @itemx -sectalign
12785 @itemx -sectobjectsymbols
12786 @itemx -whyload
12787 @itemx -seg1addr
12788 @itemx -sectcreate
12789 @itemx -sectobjectsymbols
12790 @itemx -sectorder
12791 @itemx -segaddr
12792 @itemx -segs_read_only_addr
12793 @need 800
12794 @itemx -segs_read_write_addr
12795 @itemx -seg_addr_table
12796 @itemx -seg_addr_table_filename
12797 @itemx -seglinkedit
12798 @itemx -segprot
12799 @itemx -segs_read_only_addr
12800 @itemx -segs_read_write_addr
12801 @itemx -single_module
12802 @itemx -static
12803 @itemx -sub_library
12804 @need 800
12805 @itemx -sub_umbrella
12806 @itemx -twolevel_namespace
12807 @itemx -umbrella
12808 @itemx -undefined
12809 @itemx -unexported_symbols_list
12810 @itemx -weak_reference_mismatches
12811 @itemx -whatsloaded
12812 @opindex allowable_client
12813 @opindex client_name
12814 @opindex compatibility_version
12815 @opindex current_version
12816 @opindex dead_strip
12817 @opindex dependency-file
12818 @opindex dylib_file
12819 @opindex dylinker_install_name
12820 @opindex dynamic
12821 @opindex exported_symbols_list
12822 @opindex filelist
12823 @opindex flat_namespace
12824 @opindex force_flat_namespace
12825 @opindex headerpad_max_install_names
12826 @opindex image_base
12827 @opindex init
12828 @opindex install_name
12829 @opindex keep_private_externs
12830 @opindex multi_module
12831 @opindex multiply_defined
12832 @opindex multiply_defined_unused
12833 @opindex noall_load
12834 @opindex no_dead_strip_inits_and_terms
12835 @opindex nofixprebinding
12836 @opindex nomultidefs
12837 @opindex noprebind
12838 @opindex noseglinkedit
12839 @opindex pagezero_size
12840 @opindex prebind
12841 @opindex prebind_all_twolevel_modules
12842 @opindex private_bundle
12843 @opindex read_only_relocs
12844 @opindex sectalign
12845 @opindex sectobjectsymbols
12846 @opindex whyload
12847 @opindex seg1addr
12848 @opindex sectcreate
12849 @opindex sectobjectsymbols
12850 @opindex sectorder
12851 @opindex segaddr
12852 @opindex segs_read_only_addr
12853 @opindex segs_read_write_addr
12854 @opindex seg_addr_table
12855 @opindex seg_addr_table_filename
12856 @opindex seglinkedit
12857 @opindex segprot
12858 @opindex segs_read_only_addr
12859 @opindex segs_read_write_addr
12860 @opindex single_module
12861 @opindex static
12862 @opindex sub_library
12863 @opindex sub_umbrella
12864 @opindex twolevel_namespace
12865 @opindex umbrella
12866 @opindex undefined
12867 @opindex unexported_symbols_list
12868 @opindex weak_reference_mismatches
12869 @opindex whatsloaded
12870 These options are passed to the Darwin linker.  The Darwin linker man page
12871 describes them in detail.
12872 @end table
12874 @node DEC Alpha Options
12875 @subsection DEC Alpha Options
12877 These @samp{-m} options are defined for the DEC Alpha implementations:
12879 @table @gcctabopt
12880 @item -mno-soft-float
12881 @itemx -msoft-float
12882 @opindex mno-soft-float
12883 @opindex msoft-float
12884 Use (do not use) the hardware floating-point instructions for
12885 floating-point operations.  When @option{-msoft-float} is specified,
12886 functions in @file{libgcc.a} are used to perform floating-point
12887 operations.  Unless they are replaced by routines that emulate the
12888 floating-point operations, or compiled in such a way as to call such
12889 emulations routines, these routines issue floating-point
12890 operations.   If you are compiling for an Alpha without floating-point
12891 operations, you must ensure that the library is built so as not to call
12892 them.
12894 Note that Alpha implementations without floating-point operations are
12895 required to have floating-point registers.
12897 @item -mfp-reg
12898 @itemx -mno-fp-regs
12899 @opindex mfp-reg
12900 @opindex mno-fp-regs
12901 Generate code that uses (does not use) the floating-point register set.
12902 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12903 register set is not used, floating-point operands are passed in integer
12904 registers as if they were integers and floating-point results are passed
12905 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12906 so any function with a floating-point argument or return value called by code
12907 compiled with @option{-mno-fp-regs} must also be compiled with that
12908 option.
12910 A typical use of this option is building a kernel that does not use,
12911 and hence need not save and restore, any floating-point registers.
12913 @item -mieee
12914 @opindex mieee
12915 The Alpha architecture implements floating-point hardware optimized for
12916 maximum performance.  It is mostly compliant with the IEEE floating-point
12917 standard.  However, for full compliance, software assistance is
12918 required.  This option generates code fully IEEE-compliant code
12919 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12920 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12921 defined during compilation.  The resulting code is less efficient but is
12922 able to correctly support denormalized numbers and exceptional IEEE
12923 values such as not-a-number and plus/minus infinity.  Other Alpha
12924 compilers call this option @option{-ieee_with_no_inexact}.
12926 @item -mieee-with-inexact
12927 @opindex mieee-with-inexact
12928 This is like @option{-mieee} except the generated code also maintains
12929 the IEEE @var{inexact-flag}.  Turning on this option causes the
12930 generated code to implement fully-compliant IEEE math.  In addition to
12931 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12932 macro.  On some Alpha implementations the resulting code may execute
12933 significantly slower than the code generated by default.  Since there is
12934 very little code that depends on the @var{inexact-flag}, you should
12935 normally not specify this option.  Other Alpha compilers call this
12936 option @option{-ieee_with_inexact}.
12938 @item -mfp-trap-mode=@var{trap-mode}
12939 @opindex mfp-trap-mode
12940 This option controls what floating-point related traps are enabled.
12941 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12942 The trap mode can be set to one of four values:
12944 @table @samp
12945 @item n
12946 This is the default (normal) setting.  The only traps that are enabled
12947 are the ones that cannot be disabled in software (e.g., division by zero
12948 trap).
12950 @item u
12951 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12952 as well.
12954 @item su
12955 Like @samp{u}, but the instructions are marked to be safe for software
12956 completion (see Alpha architecture manual for details).
12958 @item sui
12959 Like @samp{su}, but inexact traps are enabled as well.
12960 @end table
12962 @item -mfp-rounding-mode=@var{rounding-mode}
12963 @opindex mfp-rounding-mode
12964 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12965 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12968 @table @samp
12969 @item n
12970 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12971 the nearest machine number or towards the even machine number in case
12972 of a tie.
12974 @item m
12975 Round towards minus infinity.
12977 @item c
12978 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12980 @item d
12981 Dynamic rounding mode.  A field in the floating-point control register
12982 (@var{fpcr}, see Alpha architecture reference manual) controls the
12983 rounding mode in effect.  The C library initializes this register for
12984 rounding towards plus infinity.  Thus, unless your program modifies the
12985 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12986 @end table
12988 @item -mtrap-precision=@var{trap-precision}
12989 @opindex mtrap-precision
12990 In the Alpha architecture, floating-point traps are imprecise.  This
12991 means without software assistance it is impossible to recover from a
12992 floating trap and program execution normally needs to be terminated.
12993 GCC can generate code that can assist operating system trap handlers
12994 in determining the exact location that caused a floating-point trap.
12995 Depending on the requirements of an application, different levels of
12996 precisions can be selected:
12998 @table @samp
12999 @item p
13000 Program precision.  This option is the default and means a trap handler
13001 can only identify which program caused a floating-point exception.
13003 @item f
13004 Function precision.  The trap handler can determine the function that
13005 caused a floating-point exception.
13007 @item i
13008 Instruction precision.  The trap handler can determine the exact
13009 instruction that caused a floating-point exception.
13010 @end table
13012 Other Alpha compilers provide the equivalent options called
13013 @option{-scope_safe} and @option{-resumption_safe}.
13015 @item -mieee-conformant
13016 @opindex mieee-conformant
13017 This option marks the generated code as IEEE conformant.  You must not
13018 use this option unless you also specify @option{-mtrap-precision=i} and either
13019 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
13020 is to emit the line @samp{.eflag 48} in the function prologue of the
13021 generated assembly file.
13023 @item -mbuild-constants
13024 @opindex mbuild-constants
13025 Normally GCC examines a 32- or 64-bit integer constant to
13026 see if it can construct it from smaller constants in two or three
13027 instructions.  If it cannot, it outputs the constant as a literal and
13028 generates code to load it from the data segment at run time.
13030 Use this option to require GCC to construct @emph{all} integer constants
13031 using code, even if it takes more instructions (the maximum is six).
13033 You typically use this option to build a shared library dynamic
13034 loader.  Itself a shared library, it must relocate itself in memory
13035 before it can find the variables and constants in its own data segment.
13037 @item -mbwx
13038 @itemx -mno-bwx
13039 @itemx -mcix
13040 @itemx -mno-cix
13041 @itemx -mfix
13042 @itemx -mno-fix
13043 @itemx -mmax
13044 @itemx -mno-max
13045 @opindex mbwx
13046 @opindex mno-bwx
13047 @opindex mcix
13048 @opindex mno-cix
13049 @opindex mfix
13050 @opindex mno-fix
13051 @opindex mmax
13052 @opindex mno-max
13053 Indicate whether GCC should generate code to use the optional BWX,
13054 CIX, FIX and MAX instruction sets.  The default is to use the instruction
13055 sets supported by the CPU type specified via @option{-mcpu=} option or that
13056 of the CPU on which GCC was built if none is specified.
13058 @item -mfloat-vax
13059 @itemx -mfloat-ieee
13060 @opindex mfloat-vax
13061 @opindex mfloat-ieee
13062 Generate code that uses (does not use) VAX F and G floating-point
13063 arithmetic instead of IEEE single and double precision.
13065 @item -mexplicit-relocs
13066 @itemx -mno-explicit-relocs
13067 @opindex mexplicit-relocs
13068 @opindex mno-explicit-relocs
13069 Older Alpha assemblers provided no way to generate symbol relocations
13070 except via assembler macros.  Use of these macros does not allow
13071 optimal instruction scheduling.  GNU binutils as of version 2.12
13072 supports a new syntax that allows the compiler to explicitly mark
13073 which relocations should apply to which instructions.  This option
13074 is mostly useful for debugging, as GCC detects the capabilities of
13075 the assembler when it is built and sets the default accordingly.
13077 @item -msmall-data
13078 @itemx -mlarge-data
13079 @opindex msmall-data
13080 @opindex mlarge-data
13081 When @option{-mexplicit-relocs} is in effect, static data is
13082 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
13083 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
13084 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
13085 16-bit relocations off of the @code{$gp} register.  This limits the
13086 size of the small data area to 64KB, but allows the variables to be
13087 directly accessed via a single instruction.
13089 The default is @option{-mlarge-data}.  With this option the data area
13090 is limited to just below 2GB@.  Programs that require more than 2GB of
13091 data must use @code{malloc} or @code{mmap} to allocate the data in the
13092 heap instead of in the program's data segment.
13094 When generating code for shared libraries, @option{-fpic} implies
13095 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
13097 @item -msmall-text
13098 @itemx -mlarge-text
13099 @opindex msmall-text
13100 @opindex mlarge-text
13101 When @option{-msmall-text} is used, the compiler assumes that the
13102 code of the entire program (or shared library) fits in 4MB, and is
13103 thus reachable with a branch instruction.  When @option{-msmall-data}
13104 is used, the compiler can assume that all local symbols share the
13105 same @code{$gp} value, and thus reduce the number of instructions
13106 required for a function call from 4 to 1.
13108 The default is @option{-mlarge-text}.
13110 @item -mcpu=@var{cpu_type}
13111 @opindex mcpu
13112 Set the instruction set and instruction scheduling parameters for
13113 machine type @var{cpu_type}.  You can specify either the @samp{EV}
13114 style name or the corresponding chip number.  GCC supports scheduling
13115 parameters for the EV4, EV5 and EV6 family of processors and
13116 chooses the default values for the instruction set from the processor
13117 you specify.  If you do not specify a processor type, GCC defaults
13118 to the processor on which the compiler was built.
13120 Supported values for @var{cpu_type} are
13122 @table @samp
13123 @item ev4
13124 @itemx ev45
13125 @itemx 21064
13126 Schedules as an EV4 and has no instruction set extensions.
13128 @item ev5
13129 @itemx 21164
13130 Schedules as an EV5 and has no instruction set extensions.
13132 @item ev56
13133 @itemx 21164a
13134 Schedules as an EV5 and supports the BWX extension.
13136 @item pca56
13137 @itemx 21164pc
13138 @itemx 21164PC
13139 Schedules as an EV5 and supports the BWX and MAX extensions.
13141 @item ev6
13142 @itemx 21264
13143 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
13145 @item ev67
13146 @itemx 21264a
13147 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
13148 @end table
13150 Native toolchains also support the value @samp{native},
13151 which selects the best architecture option for the host processor.
13152 @option{-mcpu=native} has no effect if GCC does not recognize
13153 the processor.
13155 @item -mtune=@var{cpu_type}
13156 @opindex mtune
13157 Set only the instruction scheduling parameters for machine type
13158 @var{cpu_type}.  The instruction set is not changed.
13160 Native toolchains also support the value @samp{native},
13161 which selects the best architecture option for the host processor.
13162 @option{-mtune=native} has no effect if GCC does not recognize
13163 the processor.
13165 @item -mmemory-latency=@var{time}
13166 @opindex mmemory-latency
13167 Sets the latency the scheduler should assume for typical memory
13168 references as seen by the application.  This number is highly
13169 dependent on the memory access patterns used by the application
13170 and the size of the external cache on the machine.
13172 Valid options for @var{time} are
13174 @table @samp
13175 @item @var{number}
13176 A decimal number representing clock cycles.
13178 @item L1
13179 @itemx L2
13180 @itemx L3
13181 @itemx main
13182 The compiler contains estimates of the number of clock cycles for
13183 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
13184 (also called Dcache, Scache, and Bcache), as well as to main memory.
13185 Note that L3 is only valid for EV5.
13187 @end table
13188 @end table
13190 @node FR30 Options
13191 @subsection FR30 Options
13192 @cindex FR30 Options
13194 These options are defined specifically for the FR30 port.
13196 @table @gcctabopt
13198 @item -msmall-model
13199 @opindex msmall-model
13200 Use the small address space model.  This can produce smaller code, but
13201 it does assume that all symbolic values and addresses fit into a
13202 20-bit range.
13204 @item -mno-lsim
13205 @opindex mno-lsim
13206 Assume that runtime support has been provided and so there is no need
13207 to include the simulator library (@file{libsim.a}) on the linker
13208 command line.
13210 @end table
13212 @node FRV Options
13213 @subsection FRV Options
13214 @cindex FRV Options
13216 @table @gcctabopt
13217 @item -mgpr-32
13218 @opindex mgpr-32
13220 Only use the first 32 general-purpose registers.
13222 @item -mgpr-64
13223 @opindex mgpr-64
13225 Use all 64 general-purpose registers.
13227 @item -mfpr-32
13228 @opindex mfpr-32
13230 Use only the first 32 floating-point registers.
13232 @item -mfpr-64
13233 @opindex mfpr-64
13235 Use all 64 floating-point registers.
13237 @item -mhard-float
13238 @opindex mhard-float
13240 Use hardware instructions for floating-point operations.
13242 @item -msoft-float
13243 @opindex msoft-float
13245 Use library routines for floating-point operations.
13247 @item -malloc-cc
13248 @opindex malloc-cc
13250 Dynamically allocate condition code registers.
13252 @item -mfixed-cc
13253 @opindex mfixed-cc
13255 Do not try to dynamically allocate condition code registers, only
13256 use @code{icc0} and @code{fcc0}.
13258 @item -mdword
13259 @opindex mdword
13261 Change ABI to use double word insns.
13263 @item -mno-dword
13264 @opindex mno-dword
13266 Do not use double word instructions.
13268 @item -mdouble
13269 @opindex mdouble
13271 Use floating-point double instructions.
13273 @item -mno-double
13274 @opindex mno-double
13276 Do not use floating-point double instructions.
13278 @item -mmedia
13279 @opindex mmedia
13281 Use media instructions.
13283 @item -mno-media
13284 @opindex mno-media
13286 Do not use media instructions.
13288 @item -mmuladd
13289 @opindex mmuladd
13291 Use multiply and add/subtract instructions.
13293 @item -mno-muladd
13294 @opindex mno-muladd
13296 Do not use multiply and add/subtract instructions.
13298 @item -mfdpic
13299 @opindex mfdpic
13301 Select the FDPIC ABI, which uses function descriptors to represent
13302 pointers to functions.  Without any PIC/PIE-related options, it
13303 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
13304 assumes GOT entries and small data are within a 12-bit range from the
13305 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
13306 are computed with 32 bits.
13307 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13309 @item -minline-plt
13310 @opindex minline-plt
13312 Enable inlining of PLT entries in function calls to functions that are
13313 not known to bind locally.  It has no effect without @option{-mfdpic}.
13314 It's enabled by default if optimizing for speed and compiling for
13315 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13316 optimization option such as @option{-O3} or above is present in the
13317 command line.
13319 @item -mTLS
13320 @opindex mTLS
13322 Assume a large TLS segment when generating thread-local code.
13324 @item -mtls
13325 @opindex mtls
13327 Do not assume a large TLS segment when generating thread-local code.
13329 @item -mgprel-ro
13330 @opindex mgprel-ro
13332 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13333 that is known to be in read-only sections.  It's enabled by default,
13334 except for @option{-fpic} or @option{-fpie}: even though it may help
13335 make the global offset table smaller, it trades 1 instruction for 4.
13336 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13337 one of which may be shared by multiple symbols, and it avoids the need
13338 for a GOT entry for the referenced symbol, so it's more likely to be a
13339 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13341 @item -multilib-library-pic
13342 @opindex multilib-library-pic
13344 Link with the (library, not FD) pic libraries.  It's implied by
13345 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13346 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13347 it explicitly.
13349 @item -mlinked-fp
13350 @opindex mlinked-fp
13352 Follow the EABI requirement of always creating a frame pointer whenever
13353 a stack frame is allocated.  This option is enabled by default and can
13354 be disabled with @option{-mno-linked-fp}.
13356 @item -mlong-calls
13357 @opindex mlong-calls
13359 Use indirect addressing to call functions outside the current
13360 compilation unit.  This allows the functions to be placed anywhere
13361 within the 32-bit address space.
13363 @item -malign-labels
13364 @opindex malign-labels
13366 Try to align labels to an 8-byte boundary by inserting NOPs into the
13367 previous packet.  This option only has an effect when VLIW packing
13368 is enabled.  It doesn't create new packets; it merely adds NOPs to
13369 existing ones.
13371 @item -mlibrary-pic
13372 @opindex mlibrary-pic
13374 Generate position-independent EABI code.
13376 @item -macc-4
13377 @opindex macc-4
13379 Use only the first four media accumulator registers.
13381 @item -macc-8
13382 @opindex macc-8
13384 Use all eight media accumulator registers.
13386 @item -mpack
13387 @opindex mpack
13389 Pack VLIW instructions.
13391 @item -mno-pack
13392 @opindex mno-pack
13394 Do not pack VLIW instructions.
13396 @item -mno-eflags
13397 @opindex mno-eflags
13399 Do not mark ABI switches in e_flags.
13401 @item -mcond-move
13402 @opindex mcond-move
13404 Enable the use of conditional-move instructions (default).
13406 This switch is mainly for debugging the compiler and will likely be removed
13407 in a future version.
13409 @item -mno-cond-move
13410 @opindex mno-cond-move
13412 Disable the use of conditional-move instructions.
13414 This switch is mainly for debugging the compiler and will likely be removed
13415 in a future version.
13417 @item -mscc
13418 @opindex mscc
13420 Enable the use of conditional set instructions (default).
13422 This switch is mainly for debugging the compiler and will likely be removed
13423 in a future version.
13425 @item -mno-scc
13426 @opindex mno-scc
13428 Disable the use of conditional set instructions.
13430 This switch is mainly for debugging the compiler and will likely be removed
13431 in a future version.
13433 @item -mcond-exec
13434 @opindex mcond-exec
13436 Enable the use of conditional execution (default).
13438 This switch is mainly for debugging the compiler and will likely be removed
13439 in a future version.
13441 @item -mno-cond-exec
13442 @opindex mno-cond-exec
13444 Disable the use of conditional execution.
13446 This switch is mainly for debugging the compiler and will likely be removed
13447 in a future version.
13449 @item -mvliw-branch
13450 @opindex mvliw-branch
13452 Run a pass to pack branches into VLIW instructions (default).
13454 This switch is mainly for debugging the compiler and will likely be removed
13455 in a future version.
13457 @item -mno-vliw-branch
13458 @opindex mno-vliw-branch
13460 Do not run a pass to pack branches into VLIW instructions.
13462 This switch is mainly for debugging the compiler and will likely be removed
13463 in a future version.
13465 @item -mmulti-cond-exec
13466 @opindex mmulti-cond-exec
13468 Enable optimization of @code{&&} and @code{||} in conditional execution
13469 (default).
13471 This switch is mainly for debugging the compiler and will likely be removed
13472 in a future version.
13474 @item -mno-multi-cond-exec
13475 @opindex mno-multi-cond-exec
13477 Disable optimization of @code{&&} and @code{||} in conditional execution.
13479 This switch is mainly for debugging the compiler and will likely be removed
13480 in a future version.
13482 @item -mnested-cond-exec
13483 @opindex mnested-cond-exec
13485 Enable nested conditional execution optimizations (default).
13487 This switch is mainly for debugging the compiler and will likely be removed
13488 in a future version.
13490 @item -mno-nested-cond-exec
13491 @opindex mno-nested-cond-exec
13493 Disable nested conditional execution optimizations.
13495 This switch is mainly for debugging the compiler and will likely be removed
13496 in a future version.
13498 @item -moptimize-membar
13499 @opindex moptimize-membar
13501 This switch removes redundant @code{membar} instructions from the
13502 compiler-generated code.  It is enabled by default.
13504 @item -mno-optimize-membar
13505 @opindex mno-optimize-membar
13507 This switch disables the automatic removal of redundant @code{membar}
13508 instructions from the generated code.
13510 @item -mtomcat-stats
13511 @opindex mtomcat-stats
13513 Cause gas to print out tomcat statistics.
13515 @item -mcpu=@var{cpu}
13516 @opindex mcpu
13518 Select the processor type for which to generate code.  Possible values are
13519 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
13520 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
13522 @end table
13524 @node GNU/Linux Options
13525 @subsection GNU/Linux Options
13527 These @samp{-m} options are defined for GNU/Linux targets:
13529 @table @gcctabopt
13530 @item -mglibc
13531 @opindex mglibc
13532 Use the GNU C library.  This is the default except
13533 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
13535 @item -muclibc
13536 @opindex muclibc
13537 Use uClibc C library.  This is the default on
13538 @samp{*-*-linux-*uclibc*} targets.
13540 @item -mbionic
13541 @opindex mbionic
13542 Use Bionic C library.  This is the default on
13543 @samp{*-*-linux-*android*} targets.
13545 @item -mandroid
13546 @opindex mandroid
13547 Compile code compatible with Android platform.  This is the default on
13548 @samp{*-*-linux-*android*} targets.
13550 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
13551 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
13552 this option makes the GCC driver pass Android-specific options to the linker.
13553 Finally, this option causes the preprocessor macro @code{__ANDROID__}
13554 to be defined.
13556 @item -tno-android-cc
13557 @opindex tno-android-cc
13558 Disable compilation effects of @option{-mandroid}, i.e., do not enable
13559 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
13560 @option{-fno-rtti} by default.
13562 @item -tno-android-ld
13563 @opindex tno-android-ld
13564 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
13565 linking options to the linker.
13567 @end table
13569 @node H8/300 Options
13570 @subsection H8/300 Options
13572 These @samp{-m} options are defined for the H8/300 implementations:
13574 @table @gcctabopt
13575 @item -mrelax
13576 @opindex mrelax
13577 Shorten some address references at link time, when possible; uses the
13578 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
13579 ld, Using ld}, for a fuller description.
13581 @item -mh
13582 @opindex mh
13583 Generate code for the H8/300H@.
13585 @item -ms
13586 @opindex ms
13587 Generate code for the H8S@.
13589 @item -mn
13590 @opindex mn
13591 Generate code for the H8S and H8/300H in the normal mode.  This switch
13592 must be used either with @option{-mh} or @option{-ms}.
13594 @item -ms2600
13595 @opindex ms2600
13596 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
13598 @item -mexr
13599 @opindex mexr
13600 Extended registers are stored on stack before execution of function
13601 with monitor attribute. Default option is @option{-mexr}.
13602 This option is valid only for H8S targets.
13604 @item -mno-exr
13605 @opindex mno-exr
13606 Extended registers are not stored on stack before execution of function 
13607 with monitor attribute. Default option is @option{-mno-exr}. 
13608 This option is valid only for H8S targets.
13610 @item -mint32
13611 @opindex mint32
13612 Make @code{int} data 32 bits by default.
13614 @item -malign-300
13615 @opindex malign-300
13616 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
13617 The default for the H8/300H and H8S is to align longs and floats on
13618 4-byte boundaries.
13619 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
13620 This option has no effect on the H8/300.
13621 @end table
13623 @node HPPA Options
13624 @subsection HPPA Options
13625 @cindex HPPA Options
13627 These @samp{-m} options are defined for the HPPA family of computers:
13629 @table @gcctabopt
13630 @item -march=@var{architecture-type}
13631 @opindex march
13632 Generate code for the specified architecture.  The choices for
13633 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
13634 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
13635 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
13636 architecture option for your machine.  Code compiled for lower numbered
13637 architectures runs on higher numbered architectures, but not the
13638 other way around.
13640 @item -mpa-risc-1-0
13641 @itemx -mpa-risc-1-1
13642 @itemx -mpa-risc-2-0
13643 @opindex mpa-risc-1-0
13644 @opindex mpa-risc-1-1
13645 @opindex mpa-risc-2-0
13646 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
13648 @item -mjump-in-delay
13649 @opindex mjump-in-delay
13650 Fill delay slots of function calls with unconditional jump instructions
13651 by modifying the return pointer for the function call to be the target
13652 of the conditional jump.
13654 @item -mdisable-fpregs
13655 @opindex mdisable-fpregs
13656 Prevent floating-point registers from being used in any manner.  This is
13657 necessary for compiling kernels that perform lazy context switching of
13658 floating-point registers.  If you use this option and attempt to perform
13659 floating-point operations, the compiler aborts.
13661 @item -mdisable-indexing
13662 @opindex mdisable-indexing
13663 Prevent the compiler from using indexing address modes.  This avoids some
13664 rather obscure problems when compiling MIG generated code under MACH@.
13666 @item -mno-space-regs
13667 @opindex mno-space-regs
13668 Generate code that assumes the target has no space registers.  This allows
13669 GCC to generate faster indirect calls and use unscaled index address modes.
13671 Such code is suitable for level 0 PA systems and kernels.
13673 @item -mfast-indirect-calls
13674 @opindex mfast-indirect-calls
13675 Generate code that assumes calls never cross space boundaries.  This
13676 allows GCC to emit code that performs faster indirect calls.
13678 This option does not work in the presence of shared libraries or nested
13679 functions.
13681 @item -mfixed-range=@var{register-range}
13682 @opindex mfixed-range
13683 Generate code treating the given register range as fixed registers.
13684 A fixed register is one that the register allocator cannot use.  This is
13685 useful when compiling kernel code.  A register range is specified as
13686 two registers separated by a dash.  Multiple register ranges can be
13687 specified separated by a comma.
13689 @item -mlong-load-store
13690 @opindex mlong-load-store
13691 Generate 3-instruction load and store sequences as sometimes required by
13692 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13693 the HP compilers.
13695 @item -mportable-runtime
13696 @opindex mportable-runtime
13697 Use the portable calling conventions proposed by HP for ELF systems.
13699 @item -mgas
13700 @opindex mgas
13701 Enable the use of assembler directives only GAS understands.
13703 @item -mschedule=@var{cpu-type}
13704 @opindex mschedule
13705 Schedule code according to the constraints for the machine type
13706 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13707 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13708 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13709 proper scheduling option for your machine.  The default scheduling is
13710 @samp{8000}.
13712 @item -mlinker-opt
13713 @opindex mlinker-opt
13714 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13715 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13716 linkers in which they give bogus error messages when linking some programs.
13718 @item -msoft-float
13719 @opindex msoft-float
13720 Generate output containing library calls for floating point.
13721 @strong{Warning:} the requisite libraries are not available for all HPPA
13722 targets.  Normally the facilities of the machine's usual C compiler are
13723 used, but this cannot be done directly in cross-compilation.  You must make
13724 your own arrangements to provide suitable library functions for
13725 cross-compilation.
13727 @option{-msoft-float} changes the calling convention in the output file;
13728 therefore, it is only useful if you compile @emph{all} of a program with
13729 this option.  In particular, you need to compile @file{libgcc.a}, the
13730 library that comes with GCC, with @option{-msoft-float} in order for
13731 this to work.
13733 @item -msio
13734 @opindex msio
13735 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13736 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13737 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13738 options are available under HP-UX and HI-UX@.
13740 @item -mgnu-ld
13741 @opindex mgnu-ld
13742 Use options specific to GNU @command{ld}.
13743 This passes @option{-shared} to @command{ld} when
13744 building a shared library.  It is the default when GCC is configured,
13745 explicitly or implicitly, with the GNU linker.  This option does not
13746 affect which @command{ld} is called; it only changes what parameters
13747 are passed to that @command{ld}.
13748 The @command{ld} that is called is determined by the
13749 @option{--with-ld} configure option, GCC's program search path, and
13750 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13751 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13752 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13754 @item -mhp-ld
13755 @opindex mhp-ld
13756 Use options specific to HP @command{ld}.
13757 This passes @option{-b} to @command{ld} when building
13758 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13759 links.  It is the default when GCC is configured, explicitly or
13760 implicitly, with the HP linker.  This option does not affect
13761 which @command{ld} is called; it only changes what parameters are passed to that
13762 @command{ld}.
13763 The @command{ld} that is called is determined by the @option{--with-ld}
13764 configure option, GCC's program search path, and finally by the user's
13765 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13766 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13767 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13769 @item -mlong-calls
13770 @opindex mno-long-calls
13771 Generate code that uses long call sequences.  This ensures that a call
13772 is always able to reach linker generated stubs.  The default is to generate
13773 long calls only when the distance from the call site to the beginning
13774 of the function or translation unit, as the case may be, exceeds a
13775 predefined limit set by the branch type being used.  The limits for
13776 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13777 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13778 240,000 bytes.
13780 Distances are measured from the beginning of functions when using the
13781 @option{-ffunction-sections} option, or when using the @option{-mgas}
13782 and @option{-mno-portable-runtime} options together under HP-UX with
13783 the SOM linker.
13785 It is normally not desirable to use this option as it degrades
13786 performance.  However, it may be useful in large applications,
13787 particularly when partial linking is used to build the application.
13789 The types of long calls used depends on the capabilities of the
13790 assembler and linker, and the type of code being generated.  The
13791 impact on systems that support long absolute calls, and long pic
13792 symbol-difference or pc-relative calls should be relatively small.
13793 However, an indirect call is used on 32-bit ELF systems in pic code
13794 and it is quite long.
13796 @item -munix=@var{unix-std}
13797 @opindex march
13798 Generate compiler predefines and select a startfile for the specified
13799 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13800 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13801 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13802 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13803 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13804 and later.
13806 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13807 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13808 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13809 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13810 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13811 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13813 It is @emph{important} to note that this option changes the interfaces
13814 for various library routines.  It also affects the operational behavior
13815 of the C library.  Thus, @emph{extreme} care is needed in using this
13816 option.
13818 Library code that is intended to operate with more than one UNIX
13819 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13820 as appropriate.  Most GNU software doesn't provide this capability.
13822 @item -nolibdld
13823 @opindex nolibdld
13824 Suppress the generation of link options to search libdld.sl when the
13825 @option{-static} option is specified on HP-UX 10 and later.
13827 @item -static
13828 @opindex static
13829 The HP-UX implementation of setlocale in libc has a dependency on
13830 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13831 when the @option{-static} option is specified, special link options
13832 are needed to resolve this dependency.
13834 On HP-UX 10 and later, the GCC driver adds the necessary options to
13835 link with libdld.sl when the @option{-static} option is specified.
13836 This causes the resulting binary to be dynamic.  On the 64-bit port,
13837 the linkers generate dynamic binaries by default in any case.  The
13838 @option{-nolibdld} option can be used to prevent the GCC driver from
13839 adding these link options.
13841 @item -threads
13842 @opindex threads
13843 Add support for multithreading with the @dfn{dce thread} library
13844 under HP-UX@.  This option sets flags for both the preprocessor and
13845 linker.
13846 @end table
13848 @node i386 and x86-64 Options
13849 @subsection Intel 386 and AMD x86-64 Options
13850 @cindex i386 Options
13851 @cindex x86-64 Options
13852 @cindex Intel 386 Options
13853 @cindex AMD x86-64 Options
13855 These @samp{-m} options are defined for the i386 and x86-64 family of
13856 computers:
13858 @table @gcctabopt
13860 @item -march=@var{cpu-type}
13861 @opindex march
13862 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13863 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13864 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13865 to generate code that may not run at all on processors other than the one
13866 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13867 @option{-mtune=@var{cpu-type}}.
13869 The choices for @var{cpu-type} are:
13871 @table @samp
13872 @item native
13873 This selects the CPU to generate code for at compilation time by determining
13874 the processor type of the compiling machine.  Using @option{-march=native}
13875 enables all instruction subsets supported by the local machine (hence
13876 the result might not run on different machines).  Using @option{-mtune=native}
13877 produces code optimized for the local machine under the constraints
13878 of the selected instruction set.  
13880 @item i386
13881 Original Intel i386 CPU@.
13883 @item i486
13884 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13886 @item i586
13887 @itemx pentium
13888 Intel Pentium CPU with no MMX support.
13890 @item pentium-mmx
13891 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13893 @item pentiumpro
13894 Intel Pentium Pro CPU@.
13896 @item i686
13897 When used with @option{-march}, the Pentium Pro
13898 instruction set is used, so the code runs on all i686 family chips.
13899 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13901 @item pentium2
13902 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13903 support.
13905 @item pentium3
13906 @itemx pentium3m
13907 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13908 set support.
13910 @item pentium-m
13911 Intel Pentium M; low-power version of Intel Pentium III CPU
13912 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13914 @item pentium4
13915 @itemx pentium4m
13916 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13918 @item prescott
13919 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13920 set support.
13922 @item nocona
13923 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13924 SSE2 and SSE3 instruction set support.
13926 @item core2
13927 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13928 instruction set support.
13930 @item corei7
13931 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13932 and SSE4.2 instruction set support.
13934 @item corei7-avx
13935 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13936 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13938 @item core-avx-i
13939 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13940 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13941 set support.
13943 @item core-avx2
13944 Intel Core CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
13945 SSE4.1, SSE4.2, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2
13946 and F16C instruction set support.
13948 @item atom
13949 Intel Atom CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
13950 instruction set support.
13952 @item slm
13953 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
13954 SSE4.1 and SSE4.2 instruction set support.
13956 @item k6
13957 AMD K6 CPU with MMX instruction set support.
13959 @item k6-2
13960 @itemx k6-3
13961 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13963 @item athlon
13964 @itemx athlon-tbird
13965 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13966 support.
13968 @item athlon-4
13969 @itemx athlon-xp
13970 @itemx athlon-mp
13971 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13972 instruction set support.
13974 @item k8
13975 @itemx opteron
13976 @itemx athlon64
13977 @itemx athlon-fx
13978 Processors based on the AMD K8 core with x86-64 instruction set support,
13979 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13980 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13981 instruction set extensions.)
13983 @item k8-sse3
13984 @itemx opteron-sse3
13985 @itemx athlon64-sse3
13986 Improved versions of AMD K8 cores with SSE3 instruction set support.
13988 @item amdfam10
13989 @itemx barcelona
13990 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13991 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13992 instruction set extensions.)
13994 @item bdver1
13995 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13996 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13997 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13998 @item bdver2
13999 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14000 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
14001 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
14002 extensions.)
14003 @item bdver3
14004 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14005 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
14006 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
14007 extensions.
14009 @item btver1
14010 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
14011 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
14012 instruction set extensions.)
14014 @item btver2
14015 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
14016 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
14017 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
14019 @item winchip-c6
14020 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
14021 set support.
14023 @item winchip2
14024 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
14025 instruction set support.
14027 @item c3
14028 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
14029 implemented for this chip.)
14031 @item c3-2
14032 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
14033 (No scheduling is
14034 implemented for this chip.)
14036 @item geode
14037 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
14038 @end table
14040 @item -mtune=@var{cpu-type}
14041 @opindex mtune
14042 Tune to @var{cpu-type} everything applicable about the generated code, except
14043 for the ABI and the set of available instructions.  
14044 While picking a specific @var{cpu-type} schedules things appropriately
14045 for that particular chip, the compiler does not generate any code that
14046 cannot run on the default machine type unless you use a
14047 @option{-march=@var{cpu-type}} option.
14048 For example, if GCC is configured for i686-pc-linux-gnu
14049 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
14050 but still runs on i686 machines.
14052 The choices for @var{cpu-type} are the same as for @option{-march}.
14053 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
14055 @table @samp
14056 @item generic
14057 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
14058 If you know the CPU on which your code will run, then you should use
14059 the corresponding @option{-mtune} or @option{-march} option instead of
14060 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
14061 of your application will have, then you should use this option.
14063 As new processors are deployed in the marketplace, the behavior of this
14064 option will change.  Therefore, if you upgrade to a newer version of
14065 GCC, code generation controlled by this option will change to reflect
14066 the processors
14067 that are most common at the time that version of GCC is released.
14069 There is no @option{-march=generic} option because @option{-march}
14070 indicates the instruction set the compiler can use, and there is no
14071 generic instruction set applicable to all processors.  In contrast,
14072 @option{-mtune} indicates the processor (or, in this case, collection of
14073 processors) for which the code is optimized.
14074 @end table
14076 @item -mcpu=@var{cpu-type}
14077 @opindex mcpu
14078 A deprecated synonym for @option{-mtune}.
14080 @item -mfpmath=@var{unit}
14081 @opindex mfpmath
14082 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
14083 for @var{unit} are:
14085 @table @samp
14086 @item 387
14087 Use the standard 387 floating-point coprocessor present on the majority of chips and
14088 emulated otherwise.  Code compiled with this option runs almost everywhere.
14089 The temporary results are computed in 80-bit precision instead of the precision
14090 specified by the type, resulting in slightly different results compared to most
14091 of other chips.  See @option{-ffloat-store} for more detailed description.
14093 This is the default choice for i386 compiler.
14095 @item sse
14096 Use scalar floating-point instructions present in the SSE instruction set.
14097 This instruction set is supported by Pentium III and newer chips,
14098 and in the AMD line
14099 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
14100 instruction set supports only single-precision arithmetic, thus the double and
14101 extended-precision arithmetic are still done using 387.  A later version, present
14102 only in Pentium 4 and AMD x86-64 chips, supports double-precision
14103 arithmetic too.
14105 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
14106 or @option{-msse2} switches to enable SSE extensions and make this option
14107 effective.  For the x86-64 compiler, these extensions are enabled by default.
14109 The resulting code should be considerably faster in the majority of cases and avoid
14110 the numerical instability problems of 387 code, but may break some existing
14111 code that expects temporaries to be 80 bits.
14113 This is the default choice for the x86-64 compiler.
14115 @item sse,387
14116 @itemx sse+387
14117 @itemx both
14118 Attempt to utilize both instruction sets at once.  This effectively doubles the
14119 amount of available registers, and on chips with separate execution units for
14120 387 and SSE the execution resources too.  Use this option with care, as it is
14121 still experimental, because the GCC register allocator does not model separate
14122 functional units well, resulting in unstable performance.
14123 @end table
14125 @item -masm=@var{dialect}
14126 @opindex masm=@var{dialect}
14127 Output assembly instructions using selected @var{dialect}.  Supported
14128 choices are @samp{intel} or @samp{att} (the default).  Darwin does
14129 not support @samp{intel}.
14131 @item -mieee-fp
14132 @itemx -mno-ieee-fp
14133 @opindex mieee-fp
14134 @opindex mno-ieee-fp
14135 Control whether or not the compiler uses IEEE floating-point
14136 comparisons.  These correctly handle the case where the result of a
14137 comparison is unordered.
14139 @item -msoft-float
14140 @opindex msoft-float
14141 Generate output containing library calls for floating point.
14143 @strong{Warning:} the requisite libraries are not part of GCC@.
14144 Normally the facilities of the machine's usual C compiler are used, but
14145 this can't be done directly in cross-compilation.  You must make your
14146 own arrangements to provide suitable library functions for
14147 cross-compilation.
14149 On machines where a function returns floating-point results in the 80387
14150 register stack, some floating-point opcodes may be emitted even if
14151 @option{-msoft-float} is used.
14153 @item -mno-fp-ret-in-387
14154 @opindex mno-fp-ret-in-387
14155 Do not use the FPU registers for return values of functions.
14157 The usual calling convention has functions return values of types
14158 @code{float} and @code{double} in an FPU register, even if there
14159 is no FPU@.  The idea is that the operating system should emulate
14160 an FPU@.
14162 The option @option{-mno-fp-ret-in-387} causes such values to be returned
14163 in ordinary CPU registers instead.
14165 @item -mno-fancy-math-387
14166 @opindex mno-fancy-math-387
14167 Some 387 emulators do not support the @code{sin}, @code{cos} and
14168 @code{sqrt} instructions for the 387.  Specify this option to avoid
14169 generating those instructions.  This option is the default on FreeBSD,
14170 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
14171 indicates that the target CPU always has an FPU and so the
14172 instruction does not need emulation.  These
14173 instructions are not generated unless you also use the
14174 @option{-funsafe-math-optimizations} switch.
14176 @item -malign-double
14177 @itemx -mno-align-double
14178 @opindex malign-double
14179 @opindex mno-align-double
14180 Control whether GCC aligns @code{double}, @code{long double}, and
14181 @code{long long} variables on a two-word boundary or a one-word
14182 boundary.  Aligning @code{double} variables on a two-word boundary
14183 produces code that runs somewhat faster on a Pentium at the
14184 expense of more memory.
14186 On x86-64, @option{-malign-double} is enabled by default.
14188 @strong{Warning:} if you use the @option{-malign-double} switch,
14189 structures containing the above types are aligned differently than
14190 the published application binary interface specifications for the 386
14191 and are not binary compatible with structures in code compiled
14192 without that switch.
14194 @item -m96bit-long-double
14195 @itemx -m128bit-long-double
14196 @opindex m96bit-long-double
14197 @opindex m128bit-long-double
14198 These switches control the size of @code{long double} type.  The i386
14199 application binary interface specifies the size to be 96 bits,
14200 so @option{-m96bit-long-double} is the default in 32-bit mode.
14202 Modern architectures (Pentium and newer) prefer @code{long double}
14203 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
14204 conforming to the ABI, this is not possible.  So specifying
14205 @option{-m128bit-long-double} aligns @code{long double}
14206 to a 16-byte boundary by padding the @code{long double} with an additional
14207 32-bit zero.
14209 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
14210 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
14212 Notice that neither of these options enable any extra precision over the x87
14213 standard of 80 bits for a @code{long double}.
14215 @strong{Warning:} if you override the default value for your target ABI, this
14216 changes the size of 
14217 structures and arrays containing @code{long double} variables,
14218 as well as modifying the function calling convention for functions taking
14219 @code{long double}.  Hence they are not binary-compatible
14220 with code compiled without that switch.
14222 @item -mlong-double-64
14223 @itemx -mlong-double-80
14224 @opindex mlong-double-64
14225 @opindex mlong-double-80
14226 These switches control the size of @code{long double} type. A size
14227 of 64 bits makes the @code{long double} type equivalent to the @code{double}
14228 type. This is the default for Bionic C library.
14230 @strong{Warning:} if you override the default value for your target ABI, this
14231 changes the size of
14232 structures and arrays containing @code{long double} variables,
14233 as well as modifying the function calling convention for functions taking
14234 @code{long double}.  Hence they are not binary-compatible
14235 with code compiled without that switch.
14237 @item -mlarge-data-threshold=@var{threshold}
14238 @opindex mlarge-data-threshold
14239 When @option{-mcmodel=medium} is specified, data objects larger than
14240 @var{threshold} are placed in the large data section.  This value must be the
14241 same across all objects linked into the binary, and defaults to 65535.
14243 @item -mrtd
14244 @opindex mrtd
14245 Use a different function-calling convention, in which functions that
14246 take a fixed number of arguments return with the @code{ret @var{num}}
14247 instruction, which pops their arguments while returning.  This saves one
14248 instruction in the caller since there is no need to pop the arguments
14249 there.
14251 You can specify that an individual function is called with this calling
14252 sequence with the function attribute @samp{stdcall}.  You can also
14253 override the @option{-mrtd} option by using the function attribute
14254 @samp{cdecl}.  @xref{Function Attributes}.
14256 @strong{Warning:} this calling convention is incompatible with the one
14257 normally used on Unix, so you cannot use it if you need to call
14258 libraries compiled with the Unix compiler.
14260 Also, you must provide function prototypes for all functions that
14261 take variable numbers of arguments (including @code{printf});
14262 otherwise incorrect code is generated for calls to those
14263 functions.
14265 In addition, seriously incorrect code results if you call a
14266 function with too many arguments.  (Normally, extra arguments are
14267 harmlessly ignored.)
14269 @item -mregparm=@var{num}
14270 @opindex mregparm
14271 Control how many registers are used to pass integer arguments.  By
14272 default, no registers are used to pass arguments, and at most 3
14273 registers can be used.  You can control this behavior for a specific
14274 function by using the function attribute @samp{regparm}.
14275 @xref{Function Attributes}.
14277 @strong{Warning:} if you use this switch, and
14278 @var{num} is nonzero, then you must build all modules with the same
14279 value, including any libraries.  This includes the system libraries and
14280 startup modules.
14282 @item -msseregparm
14283 @opindex msseregparm
14284 Use SSE register passing conventions for float and double arguments
14285 and return values.  You can control this behavior for a specific
14286 function by using the function attribute @samp{sseregparm}.
14287 @xref{Function Attributes}.
14289 @strong{Warning:} if you use this switch then you must build all
14290 modules with the same value, including any libraries.  This includes
14291 the system libraries and startup modules.
14293 @item -mvect8-ret-in-mem
14294 @opindex mvect8-ret-in-mem
14295 Return 8-byte vectors in memory instead of MMX registers.  This is the
14296 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
14297 Studio compilers until version 12.  Later compiler versions (starting
14298 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
14299 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
14300 you need to remain compatible with existing code produced by those
14301 previous compiler versions or older versions of GCC@.
14303 @item -mpc32
14304 @itemx -mpc64
14305 @itemx -mpc80
14306 @opindex mpc32
14307 @opindex mpc64
14308 @opindex mpc80
14310 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
14311 is specified, the significands of results of floating-point operations are
14312 rounded to 24 bits (single precision); @option{-mpc64} rounds the
14313 significands of results of floating-point operations to 53 bits (double
14314 precision) and @option{-mpc80} rounds the significands of results of
14315 floating-point operations to 64 bits (extended double precision), which is
14316 the default.  When this option is used, floating-point operations in higher
14317 precisions are not available to the programmer without setting the FPU
14318 control word explicitly.
14320 Setting the rounding of floating-point operations to less than the default
14321 80 bits can speed some programs by 2% or more.  Note that some mathematical
14322 libraries assume that extended-precision (80-bit) floating-point operations
14323 are enabled by default; routines in such libraries could suffer significant
14324 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14325 when this option is used to set the precision to less than extended precision.
14327 @item -mstackrealign
14328 @opindex mstackrealign
14329 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14330 option generates an alternate prologue and epilogue that realigns the
14331 run-time stack if necessary.  This supports mixing legacy codes that keep
14332 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14333 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14334 applicable to individual functions.
14336 @item -mpreferred-stack-boundary=@var{num}
14337 @opindex mpreferred-stack-boundary
14338 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14339 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14340 the default is 4 (16 bytes or 128 bits).
14342 @strong{Warning:} When generating code for the x86-64 architecture with
14343 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14344 used to keep the stack boundary aligned to 8 byte boundary.  Since
14345 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14346 intended to be used in controlled environment where stack space is
14347 important limitation.  This option will lead to wrong code when functions
14348 compiled with 16 byte stack alignment (such as functions from a standard
14349 library) are called with misaligned stack.  In this case, SSE
14350 instructions may lead to misaligned memory access traps.  In addition,
14351 variable arguments will be handled incorrectly for 16 byte aligned
14352 objects (including x87 long double and __int128), leading to wrong
14353 results.  You must build all modules with
14354 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14355 includes the system libraries and startup modules.
14357 @item -mincoming-stack-boundary=@var{num}
14358 @opindex mincoming-stack-boundary
14359 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14360 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14361 the one specified by @option{-mpreferred-stack-boundary} is used.
14363 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14364 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14365 suffer significant run time performance penalties.  On Pentium III, the
14366 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14367 properly if it is not 16-byte aligned.
14369 To ensure proper alignment of this values on the stack, the stack boundary
14370 must be as aligned as that required by any value stored on the stack.
14371 Further, every function must be generated such that it keeps the stack
14372 aligned.  Thus calling a function compiled with a higher preferred
14373 stack boundary from a function compiled with a lower preferred stack
14374 boundary most likely misaligns the stack.  It is recommended that
14375 libraries that use callbacks always use the default setting.
14377 This extra alignment does consume extra stack space, and generally
14378 increases code size.  Code that is sensitive to stack space usage, such
14379 as embedded systems and operating system kernels, may want to reduce the
14380 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14382 @item -mmmx
14383 @itemx -mno-mmx
14384 @itemx -msse
14385 @itemx -mno-sse
14386 @itemx -msse2
14387 @itemx -mno-sse2
14388 @itemx -msse3
14389 @itemx -mno-sse3
14390 @itemx -mssse3
14391 @itemx -mno-ssse3
14392 @itemx -msse4.1
14393 @need 800
14394 @itemx -mno-sse4.1
14395 @itemx -msse4.2
14396 @itemx -mno-sse4.2
14397 @itemx -msse4
14398 @itemx -mno-sse4
14399 @itemx -mavx
14400 @itemx -mno-avx
14401 @itemx -mavx2
14402 @itemx -mno-avx2
14403 @itemx -mavx512f
14404 @itemx -mno-avx512f
14405 @need 800
14406 @itemx -mavx512pf
14407 @itemx -mno-avx512pf
14408 @itemx -mavx512er
14409 @itemx -mno-avx512er
14410 @itemx -mavx512cd
14411 @itemx -mno-avx512cd
14412 @itemx -maes
14413 @itemx -mno-aes
14414 @itemx -mpclmul
14415 @itemx -mno-pclmul
14416 @need 800
14417 @itemx -mfsgsbase
14418 @itemx -mno-fsgsbase
14419 @itemx -mrdrnd
14420 @itemx -mno-rdrnd
14421 @itemx -mf16c
14422 @itemx -mno-f16c
14423 @itemx -mfma
14424 @itemx -mno-fma
14425 @itemx -msse4a
14426 @itemx -mno-sse4a
14427 @itemx -mfma4
14428 @itemx -mno-fma4
14429 @need 800
14430 @itemx -mxop
14431 @itemx -mno-xop
14432 @itemx -mlwp
14433 @itemx -mno-lwp
14434 @itemx -m3dnow
14435 @itemx -mno-3dnow
14436 @itemx -mpopcnt
14437 @itemx -mno-popcnt
14438 @itemx -mabm
14439 @itemx -mno-abm
14440 @itemx -mbmi
14441 @itemx -mbmi2
14442 @itemx -mno-bmi
14443 @itemx -mno-bmi2
14444 @itemx -mlzcnt
14445 @itemx -mno-lzcnt
14446 @itemx -mrtm
14447 @itemx -mtbm
14448 @itemx -mno-tbm
14449 @opindex mmmx
14450 @opindex mno-mmx
14451 @opindex msse
14452 @opindex mno-sse
14453 @opindex m3dnow
14454 @opindex mno-3dnow
14455 These switches enable or disable the use of instructions in the MMX, SSE,
14456 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
14457 AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2,
14458 LZCNT, RTM or 3DNow!@:
14459 extended instruction sets.
14460 These extensions are also available as built-in functions: see
14461 @ref{X86 Built-in Functions}, for details of the functions enabled and
14462 disabled by these switches.
14464 To generate SSE/SSE2 instructions automatically from floating-point
14465 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
14467 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
14468 generates new AVX instructions or AVX equivalence for all SSEx instructions
14469 when needed.
14471 These options enable GCC to use these extended instructions in
14472 generated code, even without @option{-mfpmath=sse}.  Applications that
14473 perform run-time CPU detection must compile separate files for each
14474 supported architecture, using the appropriate flags.  In particular,
14475 the file containing the CPU detection code should be compiled without
14476 these options.
14478 @item -mdump-tune-features
14479 @opindex mdump-tune-features
14480 This option instructs GCC to dump the names of the x86 performance 
14481 tuning features and default settings. The names can be used in 
14482 @option{-mtune-ctrl=@var{feature-list}}.
14484 @item -mtune-ctrl=@var{feature-list}
14485 @opindex mtune-ctrl=@var{feature-list}
14486 This option is used to do fine grain control of x86 code generation features.
14487 @var{feature-list} is a comma separated list of @var{feature} names. See also
14488 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
14489 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
14490 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
14491 developers. Using it may lead to code paths not covered by testing and can
14492 potentially result in compiler ICEs or runtime errors.
14494 @item -mno-default
14495 @opindex mno-default
14496 This option instructs GCC to turn off all tunable features. See also 
14497 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
14499 @item -mcld
14500 @opindex mcld
14501 This option instructs GCC to emit a @code{cld} instruction in the prologue
14502 of functions that use string instructions.  String instructions depend on
14503 the DF flag to select between autoincrement or autodecrement mode.  While the
14504 ABI specifies the DF flag to be cleared on function entry, some operating
14505 systems violate this specification by not clearing the DF flag in their
14506 exception dispatchers.  The exception handler can be invoked with the DF flag
14507 set, which leads to wrong direction mode when string instructions are used.
14508 This option can be enabled by default on 32-bit x86 targets by configuring
14509 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
14510 instructions can be suppressed with the @option{-mno-cld} compiler option
14511 in this case.
14513 @item -mvzeroupper
14514 @opindex mvzeroupper
14515 This option instructs GCC to emit a @code{vzeroupper} instruction
14516 before a transfer of control flow out of the function to minimize
14517 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
14518 intrinsics.
14520 @item -mprefer-avx128
14521 @opindex mprefer-avx128
14522 This option instructs GCC to use 128-bit AVX instructions instead of
14523 256-bit AVX instructions in the auto-vectorizer.
14525 @item -mcx16
14526 @opindex mcx16
14527 This option enables GCC to generate @code{CMPXCHG16B} instructions.
14528 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
14529 (or oword) data types.  
14530 This is useful for high-resolution counters that can be updated
14531 by multiple processors (or cores).  This instruction is generated as part of
14532 atomic built-in functions: see @ref{__sync Builtins} or
14533 @ref{__atomic Builtins} for details.
14535 @item -msahf
14536 @opindex msahf
14537 This option enables generation of @code{SAHF} instructions in 64-bit code.
14538 Early Intel Pentium 4 CPUs with Intel 64 support,
14539 prior to the introduction of Pentium 4 G1 step in December 2005,
14540 lacked the @code{LAHF} and @code{SAHF} instructions
14541 which were supported by AMD64.
14542 These are load and store instructions, respectively, for certain status flags.
14543 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
14544 @code{drem}, and @code{remainder} built-in functions;
14545 see @ref{Other Builtins} for details.
14547 @item -mmovbe
14548 @opindex mmovbe
14549 This option enables use of the @code{movbe} instruction to implement
14550 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
14552 @item -mcrc32
14553 @opindex mcrc32
14554 This option enables built-in functions @code{__builtin_ia32_crc32qi},
14555 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
14556 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
14558 @item -mrecip
14559 @opindex mrecip
14560 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
14561 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
14562 with an additional Newton-Raphson step
14563 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
14564 (and their vectorized
14565 variants) for single-precision floating-point arguments.  These instructions
14566 are generated only when @option{-funsafe-math-optimizations} is enabled
14567 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
14568 Note that while the throughput of the sequence is higher than the throughput
14569 of the non-reciprocal instruction, the precision of the sequence can be
14570 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
14572 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
14573 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
14574 combination), and doesn't need @option{-mrecip}.
14576 Also note that GCC emits the above sequence with additional Newton-Raphson step
14577 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
14578 already with @option{-ffast-math} (or the above option combination), and
14579 doesn't need @option{-mrecip}.
14581 @item -mrecip=@var{opt}
14582 @opindex mrecip=opt
14583 This option controls which reciprocal estimate instructions
14584 may be used.  @var{opt} is a comma-separated list of options, which may
14585 be preceded by a @samp{!} to invert the option:
14587 @table @samp
14588 @item all
14589 Enable all estimate instructions.
14591 @item default
14592 Enable the default instructions, equivalent to @option{-mrecip}.
14594 @item none
14595 Disable all estimate instructions, equivalent to @option{-mno-recip}.
14597 @item div
14598 Enable the approximation for scalar division.
14600 @item vec-div
14601 Enable the approximation for vectorized division.
14603 @item sqrt
14604 Enable the approximation for scalar square root.
14606 @item vec-sqrt
14607 Enable the approximation for vectorized square root.
14608 @end table
14610 So, for example, @option{-mrecip=all,!sqrt} enables
14611 all of the reciprocal approximations, except for square root.
14613 @item -mveclibabi=@var{type}
14614 @opindex mveclibabi
14615 Specifies the ABI type to use for vectorizing intrinsics using an
14616 external library.  Supported values for @var{type} are @samp{svml} 
14617 for the Intel short
14618 vector math library and @samp{acml} for the AMD math core library.
14619 To use this option, both @option{-ftree-vectorize} and
14620 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
14621 ABI-compatible library must be specified at link time.
14623 GCC currently emits calls to @code{vmldExp2},
14624 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
14625 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
14626 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
14627 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
14628 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
14629 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
14630 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
14631 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
14632 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
14633 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
14634 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
14635 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
14636 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
14637 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
14638 when @option{-mveclibabi=acml} is used.  
14640 @item -mabi=@var{name}
14641 @opindex mabi
14642 Generate code for the specified calling convention.  Permissible values
14643 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
14644 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
14645 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
14646 You can control this behavior for a specific function by
14647 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
14648 @xref{Function Attributes}.
14650 @item -mtls-dialect=@var{type}
14651 @opindex mtls-dialect
14652 Generate code to access thread-local storage using the @samp{gnu} or
14653 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
14654 @samp{gnu2} is more efficient, but it may add compile- and run-time
14655 requirements that cannot be satisfied on all systems.
14657 @item -mpush-args
14658 @itemx -mno-push-args
14659 @opindex mpush-args
14660 @opindex mno-push-args
14661 Use PUSH operations to store outgoing parameters.  This method is shorter
14662 and usually equally fast as method using SUB/MOV operations and is enabled
14663 by default.  In some cases disabling it may improve performance because of
14664 improved scheduling and reduced dependencies.
14666 @item -maccumulate-outgoing-args
14667 @opindex maccumulate-outgoing-args
14668 If enabled, the maximum amount of space required for outgoing arguments is
14669 computed in the function prologue.  This is faster on most modern CPUs
14670 because of reduced dependencies, improved scheduling and reduced stack usage
14671 when the preferred stack boundary is not equal to 2.  The drawback is a notable
14672 increase in code size.  This switch implies @option{-mno-push-args}.
14674 @item -mthreads
14675 @opindex mthreads
14676 Support thread-safe exception handling on MinGW.  Programs that rely
14677 on thread-safe exception handling must compile and link all code with the
14678 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
14679 @code{-D_MT}; when linking, it links in a special thread helper library
14680 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
14682 @item -mno-align-stringops
14683 @opindex mno-align-stringops
14684 Do not align the destination of inlined string operations.  This switch reduces
14685 code size and improves performance in case the destination is already aligned,
14686 but GCC doesn't know about it.
14688 @item -minline-all-stringops
14689 @opindex minline-all-stringops
14690 By default GCC inlines string operations only when the destination is 
14691 known to be aligned to least a 4-byte boundary.  
14692 This enables more inlining and increases code
14693 size, but may improve performance of code that depends on fast
14694 @code{memcpy}, @code{strlen},
14695 and @code{memset} for short lengths.
14697 @item -minline-stringops-dynamically
14698 @opindex minline-stringops-dynamically
14699 For string operations of unknown size, use run-time checks with
14700 inline code for small blocks and a library call for large blocks.
14702 @item -mstringop-strategy=@var{alg}
14703 @opindex mstringop-strategy=@var{alg}
14704 Override the internal decision heuristic for the particular algorithm to use
14705 for inlining string operations.  The allowed values for @var{alg} are:
14707 @table @samp
14708 @item rep_byte
14709 @itemx rep_4byte
14710 @itemx rep_8byte
14711 Expand using i386 @code{rep} prefix of the specified size.
14713 @item byte_loop
14714 @itemx loop
14715 @itemx unrolled_loop
14716 Expand into an inline loop.
14718 @item libcall
14719 Always use a library call.
14720 @end table
14722 @item -mmemcpy-strategy=@var{strategy}
14723 @opindex mmemcpy-strategy=@var{strategy}
14724 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
14725 should be inlined and what inline algorithm to use when the expected size
14726 of the copy operation is known. @var{strategy} 
14727 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
14728 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
14729 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
14730 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
14731 in the list must be specified in increasing order.  The minimal byte size for 
14732 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
14733 preceding range.
14735 @item -mmemset-strategy=@var{strategy}
14736 @opindex mmemset-strategy=@var{strategy}
14737 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
14738 @code{__builtin_memset} expansion.
14740 @item -momit-leaf-frame-pointer
14741 @opindex momit-leaf-frame-pointer
14742 Don't keep the frame pointer in a register for leaf functions.  This
14743 avoids the instructions to save, set up, and restore frame pointers and
14744 makes an extra register available in leaf functions.  The option
14745 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14746 which might make debugging harder.
14748 @item -mtls-direct-seg-refs
14749 @itemx -mno-tls-direct-seg-refs
14750 @opindex mtls-direct-seg-refs
14751 Controls whether TLS variables may be accessed with offsets from the
14752 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14753 or whether the thread base pointer must be added.  Whether or not this
14754 is valid depends on the operating system, and whether it maps the
14755 segment to cover the entire TLS area.
14757 For systems that use the GNU C Library, the default is on.
14759 @item -msse2avx
14760 @itemx -mno-sse2avx
14761 @opindex msse2avx
14762 Specify that the assembler should encode SSE instructions with VEX
14763 prefix.  The option @option{-mavx} turns this on by default.
14765 @item -mfentry
14766 @itemx -mno-fentry
14767 @opindex mfentry
14768 If profiling is active (@option{-pg}), put the profiling
14769 counter call before the prologue.
14770 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14771 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14773 @item -m8bit-idiv
14774 @itemx -mno-8bit-idiv
14775 @opindex 8bit-idiv
14776 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14777 much faster than 32-bit/64-bit integer divide.  This option generates a
14778 run-time check.  If both dividend and divisor are within range of 0
14779 to 255, 8-bit unsigned integer divide is used instead of
14780 32-bit/64-bit integer divide.
14782 @item -mavx256-split-unaligned-load
14783 @itemx -mavx256-split-unaligned-store
14784 @opindex avx256-split-unaligned-load
14785 @opindex avx256-split-unaligned-store
14786 Split 32-byte AVX unaligned load and store.
14788 @item -mstack-protector-guard=@var{guard}
14789 @opindex mstack-protector-guard=@var{guard}
14790 Generate stack protection code using canary at @var{guard}.  Supported
14791 locations are @samp{global} for global canary or @samp{tls} for per-thread
14792 canary in the TLS block (the default).  This option has effect only when
14793 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
14795 @end table
14797 These @samp{-m} switches are supported in addition to the above
14798 on x86-64 processors in 64-bit environments.
14800 @table @gcctabopt
14801 @item -m32
14802 @itemx -m64
14803 @itemx -mx32
14804 @opindex m32
14805 @opindex m64
14806 @opindex mx32
14807 Generate code for a 32-bit or 64-bit environment.
14808 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14809 to 32 bits, and
14810 generates code that runs on any i386 system.
14812 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14813 types to 64 bits, and generates code for the x86-64 architecture.
14814 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14815 and @option{-mdynamic-no-pic} options.
14817 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14818 to 32 bits, and
14819 generates code for the x86-64 architecture.
14821 @item -mno-red-zone
14822 @opindex mno-red-zone
14823 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14824 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14825 stack pointer that is not modified by signal or interrupt handlers
14826 and therefore can be used for temporary data without adjusting the stack
14827 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14829 @item -mcmodel=small
14830 @opindex mcmodel=small
14831 Generate code for the small code model: the program and its symbols must
14832 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14833 Programs can be statically or dynamically linked.  This is the default
14834 code model.
14836 @item -mcmodel=kernel
14837 @opindex mcmodel=kernel
14838 Generate code for the kernel code model.  The kernel runs in the
14839 negative 2 GB of the address space.
14840 This model has to be used for Linux kernel code.
14842 @item -mcmodel=medium
14843 @opindex mcmodel=medium
14844 Generate code for the medium model: the program is linked in the lower 2
14845 GB of the address space.  Small symbols are also placed there.  Symbols
14846 with sizes larger than @option{-mlarge-data-threshold} are put into
14847 large data or BSS sections and can be located above 2GB.  Programs can
14848 be statically or dynamically linked.
14850 @item -mcmodel=large
14851 @opindex mcmodel=large
14852 Generate code for the large model.  This model makes no assumptions
14853 about addresses and sizes of sections.
14855 @item -maddress-mode=long
14856 @opindex maddress-mode=long
14857 Generate code for long address mode.  This is only supported for 64-bit
14858 and x32 environments.  It is the default address mode for 64-bit
14859 environments.
14861 @item -maddress-mode=short
14862 @opindex maddress-mode=short
14863 Generate code for short address mode.  This is only supported for 32-bit
14864 and x32 environments.  It is the default address mode for 32-bit and
14865 x32 environments.
14866 @end table
14868 @node i386 and x86-64 Windows Options
14869 @subsection i386 and x86-64 Windows Options
14870 @cindex i386 and x86-64 Windows Options
14872 These additional options are available for Microsoft Windows targets:
14874 @table @gcctabopt
14875 @item -mconsole
14876 @opindex mconsole
14877 This option
14878 specifies that a console application is to be generated, by
14879 instructing the linker to set the PE header subsystem type
14880 required for console applications.
14881 This option is available for Cygwin and MinGW targets and is
14882 enabled by default on those targets.
14884 @item -mdll
14885 @opindex mdll
14886 This option is available for Cygwin and MinGW targets.  It
14887 specifies that a DLL---a dynamic link library---is to be
14888 generated, enabling the selection of the required runtime
14889 startup object and entry point.
14891 @item -mnop-fun-dllimport
14892 @opindex mnop-fun-dllimport
14893 This option is available for Cygwin and MinGW targets.  It
14894 specifies that the @code{dllimport} attribute should be ignored.
14896 @item -mthread
14897 @opindex mthread
14898 This option is available for MinGW targets. It specifies
14899 that MinGW-specific thread support is to be used.
14901 @item -municode
14902 @opindex municode
14903 This option is available for MinGW-w64 targets.  It causes
14904 the @code{UNICODE} preprocessor macro to be predefined, and
14905 chooses Unicode-capable runtime startup code.
14907 @item -mwin32
14908 @opindex mwin32
14909 This option is available for Cygwin and MinGW targets.  It
14910 specifies that the typical Microsoft Windows predefined macros are to
14911 be set in the pre-processor, but does not influence the choice
14912 of runtime library/startup code.
14914 @item -mwindows
14915 @opindex mwindows
14916 This option is available for Cygwin and MinGW targets.  It
14917 specifies that a GUI application is to be generated by
14918 instructing the linker to set the PE header subsystem type
14919 appropriately.
14921 @item -fno-set-stack-executable
14922 @opindex fno-set-stack-executable
14923 This option is available for MinGW targets. It specifies that
14924 the executable flag for the stack used by nested functions isn't
14925 set. This is necessary for binaries running in kernel mode of
14926 Microsoft Windows, as there the User32 API, which is used to set executable
14927 privileges, isn't available.
14929 @item -fwritable-relocated-rdata
14930 @opindex fno-writable-relocated-rdata
14931 This option is available for MinGW and Cygwin targets.  It specifies
14932 that relocated-data in read-only section is put into .data
14933 section.  This is a necessary for older runtimes not supporting
14934 modification of .rdata sections for pseudo-relocation.
14936 @item -mpe-aligned-commons
14937 @opindex mpe-aligned-commons
14938 This option is available for Cygwin and MinGW targets.  It
14939 specifies that the GNU extension to the PE file format that
14940 permits the correct alignment of COMMON variables should be
14941 used when generating code.  It is enabled by default if
14942 GCC detects that the target assembler found during configuration
14943 supports the feature.
14944 @end table
14946 See also under @ref{i386 and x86-64 Options} for standard options.
14948 @node IA-64 Options
14949 @subsection IA-64 Options
14950 @cindex IA-64 Options
14952 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14954 @table @gcctabopt
14955 @item -mbig-endian
14956 @opindex mbig-endian
14957 Generate code for a big-endian target.  This is the default for HP-UX@.
14959 @item -mlittle-endian
14960 @opindex mlittle-endian
14961 Generate code for a little-endian target.  This is the default for AIX5
14962 and GNU/Linux.
14964 @item -mgnu-as
14965 @itemx -mno-gnu-as
14966 @opindex mgnu-as
14967 @opindex mno-gnu-as
14968 Generate (or don't) code for the GNU assembler.  This is the default.
14969 @c Also, this is the default if the configure option @option{--with-gnu-as}
14970 @c is used.
14972 @item -mgnu-ld
14973 @itemx -mno-gnu-ld
14974 @opindex mgnu-ld
14975 @opindex mno-gnu-ld
14976 Generate (or don't) code for the GNU linker.  This is the default.
14977 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14978 @c is used.
14980 @item -mno-pic
14981 @opindex mno-pic
14982 Generate code that does not use a global pointer register.  The result
14983 is not position independent code, and violates the IA-64 ABI@.
14985 @item -mvolatile-asm-stop
14986 @itemx -mno-volatile-asm-stop
14987 @opindex mvolatile-asm-stop
14988 @opindex mno-volatile-asm-stop
14989 Generate (or don't) a stop bit immediately before and after volatile asm
14990 statements.
14992 @item -mregister-names
14993 @itemx -mno-register-names
14994 @opindex mregister-names
14995 @opindex mno-register-names
14996 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14997 the stacked registers.  This may make assembler output more readable.
14999 @item -mno-sdata
15000 @itemx -msdata
15001 @opindex mno-sdata
15002 @opindex msdata
15003 Disable (or enable) optimizations that use the small data section.  This may
15004 be useful for working around optimizer bugs.
15006 @item -mconstant-gp
15007 @opindex mconstant-gp
15008 Generate code that uses a single constant global pointer value.  This is
15009 useful when compiling kernel code.
15011 @item -mauto-pic
15012 @opindex mauto-pic
15013 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
15014 This is useful when compiling firmware code.
15016 @item -minline-float-divide-min-latency
15017 @opindex minline-float-divide-min-latency
15018 Generate code for inline divides of floating-point values
15019 using the minimum latency algorithm.
15021 @item -minline-float-divide-max-throughput
15022 @opindex minline-float-divide-max-throughput
15023 Generate code for inline divides of floating-point values
15024 using the maximum throughput algorithm.
15026 @item -mno-inline-float-divide
15027 @opindex mno-inline-float-divide
15028 Do not generate inline code for divides of floating-point values.
15030 @item -minline-int-divide-min-latency
15031 @opindex minline-int-divide-min-latency
15032 Generate code for inline divides of integer values
15033 using the minimum latency algorithm.
15035 @item -minline-int-divide-max-throughput
15036 @opindex minline-int-divide-max-throughput
15037 Generate code for inline divides of integer values
15038 using the maximum throughput algorithm.
15040 @item -mno-inline-int-divide
15041 @opindex mno-inline-int-divide
15042 Do not generate inline code for divides of integer values.
15044 @item -minline-sqrt-min-latency
15045 @opindex minline-sqrt-min-latency
15046 Generate code for inline square roots
15047 using the minimum latency algorithm.
15049 @item -minline-sqrt-max-throughput
15050 @opindex minline-sqrt-max-throughput
15051 Generate code for inline square roots
15052 using the maximum throughput algorithm.
15054 @item -mno-inline-sqrt
15055 @opindex mno-inline-sqrt
15056 Do not generate inline code for @code{sqrt}.
15058 @item -mfused-madd
15059 @itemx -mno-fused-madd
15060 @opindex mfused-madd
15061 @opindex mno-fused-madd
15062 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
15063 instructions.  The default is to use these instructions.
15065 @item -mno-dwarf2-asm
15066 @itemx -mdwarf2-asm
15067 @opindex mno-dwarf2-asm
15068 @opindex mdwarf2-asm
15069 Don't (or do) generate assembler code for the DWARF 2 line number debugging
15070 info.  This may be useful when not using the GNU assembler.
15072 @item -mearly-stop-bits
15073 @itemx -mno-early-stop-bits
15074 @opindex mearly-stop-bits
15075 @opindex mno-early-stop-bits
15076 Allow stop bits to be placed earlier than immediately preceding the
15077 instruction that triggered the stop bit.  This can improve instruction
15078 scheduling, but does not always do so.
15080 @item -mfixed-range=@var{register-range}
15081 @opindex mfixed-range
15082 Generate code treating the given register range as fixed registers.
15083 A fixed register is one that the register allocator cannot use.  This is
15084 useful when compiling kernel code.  A register range is specified as
15085 two registers separated by a dash.  Multiple register ranges can be
15086 specified separated by a comma.
15088 @item -mtls-size=@var{tls-size}
15089 @opindex mtls-size
15090 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
15093 @item -mtune=@var{cpu-type}
15094 @opindex mtune
15095 Tune the instruction scheduling for a particular CPU, Valid values are
15096 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
15097 and @samp{mckinley}.
15099 @item -milp32
15100 @itemx -mlp64
15101 @opindex milp32
15102 @opindex mlp64
15103 Generate code for a 32-bit or 64-bit environment.
15104 The 32-bit environment sets int, long and pointer to 32 bits.
15105 The 64-bit environment sets int to 32 bits and long and pointer
15106 to 64 bits.  These are HP-UX specific flags.
15108 @item -mno-sched-br-data-spec
15109 @itemx -msched-br-data-spec
15110 @opindex mno-sched-br-data-spec
15111 @opindex msched-br-data-spec
15112 (Dis/En)able data speculative scheduling before reload.
15113 This results in generation of @code{ld.a} instructions and
15114 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15115 The default is 'disable'.
15117 @item -msched-ar-data-spec
15118 @itemx -mno-sched-ar-data-spec
15119 @opindex msched-ar-data-spec
15120 @opindex mno-sched-ar-data-spec
15121 (En/Dis)able data speculative scheduling after reload.
15122 This results in generation of @code{ld.a} instructions and
15123 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15124 The default is 'enable'.
15126 @item -mno-sched-control-spec
15127 @itemx -msched-control-spec
15128 @opindex mno-sched-control-spec
15129 @opindex msched-control-spec
15130 (Dis/En)able control speculative scheduling.  This feature is
15131 available only during region scheduling (i.e.@: before reload).
15132 This results in generation of the @code{ld.s} instructions and
15133 the corresponding check instructions @code{chk.s}.
15134 The default is 'disable'.
15136 @item -msched-br-in-data-spec
15137 @itemx -mno-sched-br-in-data-spec
15138 @opindex msched-br-in-data-spec
15139 @opindex mno-sched-br-in-data-spec
15140 (En/Dis)able speculative scheduling of the instructions that
15141 are dependent on the data speculative loads before reload.
15142 This is effective only with @option{-msched-br-data-spec} enabled.
15143 The default is 'enable'.
15145 @item -msched-ar-in-data-spec
15146 @itemx -mno-sched-ar-in-data-spec
15147 @opindex msched-ar-in-data-spec
15148 @opindex mno-sched-ar-in-data-spec
15149 (En/Dis)able speculative scheduling of the instructions that
15150 are dependent on the data speculative loads after reload.
15151 This is effective only with @option{-msched-ar-data-spec} enabled.
15152 The default is 'enable'.
15154 @item -msched-in-control-spec
15155 @itemx -mno-sched-in-control-spec
15156 @opindex msched-in-control-spec
15157 @opindex mno-sched-in-control-spec
15158 (En/Dis)able speculative scheduling of the instructions that
15159 are dependent on the control speculative loads.
15160 This is effective only with @option{-msched-control-spec} enabled.
15161 The default is 'enable'.
15163 @item -mno-sched-prefer-non-data-spec-insns
15164 @itemx -msched-prefer-non-data-spec-insns
15165 @opindex mno-sched-prefer-non-data-spec-insns
15166 @opindex msched-prefer-non-data-spec-insns
15167 If enabled, data-speculative instructions are chosen for schedule
15168 only if there are no other choices at the moment.  This makes
15169 the use of the data speculation much more conservative.
15170 The default is 'disable'.
15172 @item -mno-sched-prefer-non-control-spec-insns
15173 @itemx -msched-prefer-non-control-spec-insns
15174 @opindex mno-sched-prefer-non-control-spec-insns
15175 @opindex msched-prefer-non-control-spec-insns
15176 If enabled, control-speculative instructions are chosen for schedule
15177 only if there are no other choices at the moment.  This makes
15178 the use of the control speculation much more conservative.
15179 The default is 'disable'.
15181 @item -mno-sched-count-spec-in-critical-path
15182 @itemx -msched-count-spec-in-critical-path
15183 @opindex mno-sched-count-spec-in-critical-path
15184 @opindex msched-count-spec-in-critical-path
15185 If enabled, speculative dependencies are considered during
15186 computation of the instructions priorities.  This makes the use of the
15187 speculation a bit more conservative.
15188 The default is 'disable'.
15190 @item -msched-spec-ldc
15191 @opindex msched-spec-ldc
15192 Use a simple data speculation check.  This option is on by default.
15194 @item -msched-control-spec-ldc
15195 @opindex msched-spec-ldc
15196 Use a simple check for control speculation.  This option is on by default.
15198 @item -msched-stop-bits-after-every-cycle
15199 @opindex msched-stop-bits-after-every-cycle
15200 Place a stop bit after every cycle when scheduling.  This option is on
15201 by default.
15203 @item -msched-fp-mem-deps-zero-cost
15204 @opindex msched-fp-mem-deps-zero-cost
15205 Assume that floating-point stores and loads are not likely to cause a conflict
15206 when placed into the same instruction group.  This option is disabled by
15207 default.
15209 @item -msel-sched-dont-check-control-spec
15210 @opindex msel-sched-dont-check-control-spec
15211 Generate checks for control speculation in selective scheduling.
15212 This flag is disabled by default.
15214 @item -msched-max-memory-insns=@var{max-insns}
15215 @opindex msched-max-memory-insns
15216 Limit on the number of memory insns per instruction group, giving lower
15217 priority to subsequent memory insns attempting to schedule in the same
15218 instruction group. Frequently useful to prevent cache bank conflicts.
15219 The default value is 1.
15221 @item -msched-max-memory-insns-hard-limit
15222 @opindex msched-max-memory-insns-hard-limit
15223 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
15224 disallowing more than that number in an instruction group.
15225 Otherwise, the limit is ``soft'', meaning that non-memory operations
15226 are preferred when the limit is reached, but memory operations may still
15227 be scheduled.
15229 @end table
15231 @node LM32 Options
15232 @subsection LM32 Options
15233 @cindex LM32 options
15235 These @option{-m} options are defined for the LatticeMico32 architecture:
15237 @table @gcctabopt
15238 @item -mbarrel-shift-enabled
15239 @opindex mbarrel-shift-enabled
15240 Enable barrel-shift instructions.
15242 @item -mdivide-enabled
15243 @opindex mdivide-enabled
15244 Enable divide and modulus instructions.
15246 @item -mmultiply-enabled
15247 @opindex multiply-enabled
15248 Enable multiply instructions.
15250 @item -msign-extend-enabled
15251 @opindex msign-extend-enabled
15252 Enable sign extend instructions.
15254 @item -muser-enabled
15255 @opindex muser-enabled
15256 Enable user-defined instructions.
15258 @end table
15260 @node M32C Options
15261 @subsection M32C Options
15262 @cindex M32C options
15264 @table @gcctabopt
15265 @item -mcpu=@var{name}
15266 @opindex mcpu=
15267 Select the CPU for which code is generated.  @var{name} may be one of
15268 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
15269 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
15270 the M32C/80 series.
15272 @item -msim
15273 @opindex msim
15274 Specifies that the program will be run on the simulator.  This causes
15275 an alternate runtime library to be linked in which supports, for
15276 example, file I/O@.  You must not use this option when generating
15277 programs that will run on real hardware; you must provide your own
15278 runtime library for whatever I/O functions are needed.
15280 @item -memregs=@var{number}
15281 @opindex memregs=
15282 Specifies the number of memory-based pseudo-registers GCC uses
15283 during code generation.  These pseudo-registers are used like real
15284 registers, so there is a tradeoff between GCC's ability to fit the
15285 code into available registers, and the performance penalty of using
15286 memory instead of registers.  Note that all modules in a program must
15287 be compiled with the same value for this option.  Because of that, you
15288 must not use this option with GCC's default runtime libraries.
15290 @end table
15292 @node M32R/D Options
15293 @subsection M32R/D Options
15294 @cindex M32R/D options
15296 These @option{-m} options are defined for Renesas M32R/D architectures:
15298 @table @gcctabopt
15299 @item -m32r2
15300 @opindex m32r2
15301 Generate code for the M32R/2@.
15303 @item -m32rx
15304 @opindex m32rx
15305 Generate code for the M32R/X@.
15307 @item -m32r
15308 @opindex m32r
15309 Generate code for the M32R@.  This is the default.
15311 @item -mmodel=small
15312 @opindex mmodel=small
15313 Assume all objects live in the lower 16MB of memory (so that their addresses
15314 can be loaded with the @code{ld24} instruction), and assume all subroutines
15315 are reachable with the @code{bl} instruction.
15316 This is the default.
15318 The addressability of a particular object can be set with the
15319 @code{model} attribute.
15321 @item -mmodel=medium
15322 @opindex mmodel=medium
15323 Assume objects may be anywhere in the 32-bit address space (the compiler
15324 generates @code{seth/add3} instructions to load their addresses), and
15325 assume all subroutines are reachable with the @code{bl} instruction.
15327 @item -mmodel=large
15328 @opindex mmodel=large
15329 Assume objects may be anywhere in the 32-bit address space (the compiler
15330 generates @code{seth/add3} instructions to load their addresses), and
15331 assume subroutines may not be reachable with the @code{bl} instruction
15332 (the compiler generates the much slower @code{seth/add3/jl}
15333 instruction sequence).
15335 @item -msdata=none
15336 @opindex msdata=none
15337 Disable use of the small data area.  Variables are put into
15338 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
15339 @code{section} attribute has been specified).
15340 This is the default.
15342 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
15343 Objects may be explicitly put in the small data area with the
15344 @code{section} attribute using one of these sections.
15346 @item -msdata=sdata
15347 @opindex msdata=sdata
15348 Put small global and static data in the small data area, but do not
15349 generate special code to reference them.
15351 @item -msdata=use
15352 @opindex msdata=use
15353 Put small global and static data in the small data area, and generate
15354 special instructions to reference them.
15356 @item -G @var{num}
15357 @opindex G
15358 @cindex smaller data references
15359 Put global and static objects less than or equal to @var{num} bytes
15360 into the small data or BSS sections instead of the normal data or BSS
15361 sections.  The default value of @var{num} is 8.
15362 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
15363 for this option to have any effect.
15365 All modules should be compiled with the same @option{-G @var{num}} value.
15366 Compiling with different values of @var{num} may or may not work; if it
15367 doesn't the linker gives an error message---incorrect code is not
15368 generated.
15370 @item -mdebug
15371 @opindex mdebug
15372 Makes the M32R-specific code in the compiler display some statistics
15373 that might help in debugging programs.
15375 @item -malign-loops
15376 @opindex malign-loops
15377 Align all loops to a 32-byte boundary.
15379 @item -mno-align-loops
15380 @opindex mno-align-loops
15381 Do not enforce a 32-byte alignment for loops.  This is the default.
15383 @item -missue-rate=@var{number}
15384 @opindex missue-rate=@var{number}
15385 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15386 or 2.
15388 @item -mbranch-cost=@var{number}
15389 @opindex mbranch-cost=@var{number}
15390 @var{number} can only be 1 or 2.  If it is 1 then branches are
15391 preferred over conditional code, if it is 2, then the opposite applies.
15393 @item -mflush-trap=@var{number}
15394 @opindex mflush-trap=@var{number}
15395 Specifies the trap number to use to flush the cache.  The default is
15396 12.  Valid numbers are between 0 and 15 inclusive.
15398 @item -mno-flush-trap
15399 @opindex mno-flush-trap
15400 Specifies that the cache cannot be flushed by using a trap.
15402 @item -mflush-func=@var{name}
15403 @opindex mflush-func=@var{name}
15404 Specifies the name of the operating system function to call to flush
15405 the cache.  The default is @emph{_flush_cache}, but a function call
15406 is only used if a trap is not available.
15408 @item -mno-flush-func
15409 @opindex mno-flush-func
15410 Indicates that there is no OS function for flushing the cache.
15412 @end table
15414 @node M680x0 Options
15415 @subsection M680x0 Options
15416 @cindex M680x0 options
15418 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15419 The default settings depend on which architecture was selected when
15420 the compiler was configured; the defaults for the most common choices
15421 are given below.
15423 @table @gcctabopt
15424 @item -march=@var{arch}
15425 @opindex march
15426 Generate code for a specific M680x0 or ColdFire instruction set
15427 architecture.  Permissible values of @var{arch} for M680x0
15428 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15429 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15430 architectures are selected according to Freescale's ISA classification
15431 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15432 @samp{isab} and @samp{isac}.
15434 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15435 code for a ColdFire target.  The @var{arch} in this macro is one of the
15436 @option{-march} arguments given above.
15438 When used together, @option{-march} and @option{-mtune} select code
15439 that runs on a family of similar processors but that is optimized
15440 for a particular microarchitecture.
15442 @item -mcpu=@var{cpu}
15443 @opindex mcpu
15444 Generate code for a specific M680x0 or ColdFire processor.
15445 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15446 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15447 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15448 below, which also classifies the CPUs into families:
15450 @multitable @columnfractions 0.20 0.80
15451 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15452 @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}
15453 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
15454 @item @samp{5206e} @tab @samp{5206e}
15455 @item @samp{5208} @tab @samp{5207} @samp{5208}
15456 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
15457 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
15458 @item @samp{5216} @tab @samp{5214} @samp{5216}
15459 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
15460 @item @samp{5225} @tab @samp{5224} @samp{5225}
15461 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
15462 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
15463 @item @samp{5249} @tab @samp{5249}
15464 @item @samp{5250} @tab @samp{5250}
15465 @item @samp{5271} @tab @samp{5270} @samp{5271}
15466 @item @samp{5272} @tab @samp{5272}
15467 @item @samp{5275} @tab @samp{5274} @samp{5275}
15468 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
15469 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
15470 @item @samp{5307} @tab @samp{5307}
15471 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
15472 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
15473 @item @samp{5407} @tab @samp{5407}
15474 @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}
15475 @end multitable
15477 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
15478 @var{arch} is compatible with @var{cpu}.  Other combinations of
15479 @option{-mcpu} and @option{-march} are rejected.
15481 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
15482 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
15483 where the value of @var{family} is given by the table above.
15485 @item -mtune=@var{tune}
15486 @opindex mtune
15487 Tune the code for a particular microarchitecture within the
15488 constraints set by @option{-march} and @option{-mcpu}.
15489 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
15490 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
15491 and @samp{cpu32}.  The ColdFire microarchitectures
15492 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
15494 You can also use @option{-mtune=68020-40} for code that needs
15495 to run relatively well on 68020, 68030 and 68040 targets.
15496 @option{-mtune=68020-60} is similar but includes 68060 targets
15497 as well.  These two options select the same tuning decisions as
15498 @option{-m68020-40} and @option{-m68020-60} respectively.
15500 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
15501 when tuning for 680x0 architecture @var{arch}.  It also defines
15502 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
15503 option is used.  If GCC is tuning for a range of architectures,
15504 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
15505 it defines the macros for every architecture in the range.
15507 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
15508 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
15509 of the arguments given above.
15511 @item -m68000
15512 @itemx -mc68000
15513 @opindex m68000
15514 @opindex mc68000
15515 Generate output for a 68000.  This is the default
15516 when the compiler is configured for 68000-based systems.
15517 It is equivalent to @option{-march=68000}.
15519 Use this option for microcontrollers with a 68000 or EC000 core,
15520 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15522 @item -m68010
15523 @opindex m68010
15524 Generate output for a 68010.  This is the default
15525 when the compiler is configured for 68010-based systems.
15526 It is equivalent to @option{-march=68010}.
15528 @item -m68020
15529 @itemx -mc68020
15530 @opindex m68020
15531 @opindex mc68020
15532 Generate output for a 68020.  This is the default
15533 when the compiler is configured for 68020-based systems.
15534 It is equivalent to @option{-march=68020}.
15536 @item -m68030
15537 @opindex m68030
15538 Generate output for a 68030.  This is the default when the compiler is
15539 configured for 68030-based systems.  It is equivalent to
15540 @option{-march=68030}.
15542 @item -m68040
15543 @opindex m68040
15544 Generate output for a 68040.  This is the default when the compiler is
15545 configured for 68040-based systems.  It is equivalent to
15546 @option{-march=68040}.
15548 This option inhibits the use of 68881/68882 instructions that have to be
15549 emulated by software on the 68040.  Use this option if your 68040 does not
15550 have code to emulate those instructions.
15552 @item -m68060
15553 @opindex m68060
15554 Generate output for a 68060.  This is the default when the compiler is
15555 configured for 68060-based systems.  It is equivalent to
15556 @option{-march=68060}.
15558 This option inhibits the use of 68020 and 68881/68882 instructions that
15559 have to be emulated by software on the 68060.  Use this option if your 68060
15560 does not have code to emulate those instructions.
15562 @item -mcpu32
15563 @opindex mcpu32
15564 Generate output for a CPU32.  This is the default
15565 when the compiler is configured for CPU32-based systems.
15566 It is equivalent to @option{-march=cpu32}.
15568 Use this option for microcontrollers with a
15569 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
15570 68336, 68340, 68341, 68349 and 68360.
15572 @item -m5200
15573 @opindex m5200
15574 Generate output for a 520X ColdFire CPU@.  This is the default
15575 when the compiler is configured for 520X-based systems.
15576 It is equivalent to @option{-mcpu=5206}, and is now deprecated
15577 in favor of that option.
15579 Use this option for microcontroller with a 5200 core, including
15580 the MCF5202, MCF5203, MCF5204 and MCF5206.
15582 @item -m5206e
15583 @opindex m5206e
15584 Generate output for a 5206e ColdFire CPU@.  The option is now
15585 deprecated in favor of the equivalent @option{-mcpu=5206e}.
15587 @item -m528x
15588 @opindex m528x
15589 Generate output for a member of the ColdFire 528X family.
15590 The option is now deprecated in favor of the equivalent
15591 @option{-mcpu=528x}.
15593 @item -m5307
15594 @opindex m5307
15595 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
15596 in favor of the equivalent @option{-mcpu=5307}.
15598 @item -m5407
15599 @opindex m5407
15600 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
15601 in favor of the equivalent @option{-mcpu=5407}.
15603 @item -mcfv4e
15604 @opindex mcfv4e
15605 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
15606 This includes use of hardware floating-point instructions.
15607 The option is equivalent to @option{-mcpu=547x}, and is now
15608 deprecated in favor of that option.
15610 @item -m68020-40
15611 @opindex m68020-40
15612 Generate output for a 68040, without using any of the new instructions.
15613 This results in code that can run relatively efficiently on either a
15614 68020/68881 or a 68030 or a 68040.  The generated code does use the
15615 68881 instructions that are emulated on the 68040.
15617 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
15619 @item -m68020-60
15620 @opindex m68020-60
15621 Generate output for a 68060, without using any of the new instructions.
15622 This results in code that can run relatively efficiently on either a
15623 68020/68881 or a 68030 or a 68040.  The generated code does use the
15624 68881 instructions that are emulated on the 68060.
15626 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
15628 @item -mhard-float
15629 @itemx -m68881
15630 @opindex mhard-float
15631 @opindex m68881
15632 Generate floating-point instructions.  This is the default for 68020
15633 and above, and for ColdFire devices that have an FPU@.  It defines the
15634 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
15635 on ColdFire targets.
15637 @item -msoft-float
15638 @opindex msoft-float
15639 Do not generate floating-point instructions; use library calls instead.
15640 This is the default for 68000, 68010, and 68832 targets.  It is also
15641 the default for ColdFire devices that have no FPU.
15643 @item -mdiv
15644 @itemx -mno-div
15645 @opindex mdiv
15646 @opindex mno-div
15647 Generate (do not generate) ColdFire hardware divide and remainder
15648 instructions.  If @option{-march} is used without @option{-mcpu},
15649 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
15650 architectures.  Otherwise, the default is taken from the target CPU
15651 (either the default CPU, or the one specified by @option{-mcpu}).  For
15652 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
15653 @option{-mcpu=5206e}.
15655 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
15657 @item -mshort
15658 @opindex mshort
15659 Consider type @code{int} to be 16 bits wide, like @code{short int}.
15660 Additionally, parameters passed on the stack are also aligned to a
15661 16-bit boundary even on targets whose API mandates promotion to 32-bit.
15663 @item -mno-short
15664 @opindex mno-short
15665 Do not consider type @code{int} to be 16 bits wide.  This is the default.
15667 @item -mnobitfield
15668 @itemx -mno-bitfield
15669 @opindex mnobitfield
15670 @opindex mno-bitfield
15671 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
15672 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
15674 @item -mbitfield
15675 @opindex mbitfield
15676 Do use the bit-field instructions.  The @option{-m68020} option implies
15677 @option{-mbitfield}.  This is the default if you use a configuration
15678 designed for a 68020.
15680 @item -mrtd
15681 @opindex mrtd
15682 Use a different function-calling convention, in which functions
15683 that take a fixed number of arguments return with the @code{rtd}
15684 instruction, which pops their arguments while returning.  This
15685 saves one instruction in the caller since there is no need to pop
15686 the arguments there.
15688 This calling convention is incompatible with the one normally
15689 used on Unix, so you cannot use it if you need to call libraries
15690 compiled with the Unix compiler.
15692 Also, you must provide function prototypes for all functions that
15693 take variable numbers of arguments (including @code{printf});
15694 otherwise incorrect code is generated for calls to those
15695 functions.
15697 In addition, seriously incorrect code results if you call a
15698 function with too many arguments.  (Normally, extra arguments are
15699 harmlessly ignored.)
15701 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
15702 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15704 @item -mno-rtd
15705 @opindex mno-rtd
15706 Do not use the calling conventions selected by @option{-mrtd}.
15707 This is the default.
15709 @item -malign-int
15710 @itemx -mno-align-int
15711 @opindex malign-int
15712 @opindex mno-align-int
15713 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
15714 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
15715 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
15716 Aligning variables on 32-bit boundaries produces code that runs somewhat
15717 faster on processors with 32-bit busses at the expense of more memory.
15719 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
15720 aligns structures containing the above types differently than
15721 most published application binary interface specifications for the m68k.
15723 @item -mpcrel
15724 @opindex mpcrel
15725 Use the pc-relative addressing mode of the 68000 directly, instead of
15726 using a global offset table.  At present, this option implies @option{-fpic},
15727 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
15728 not presently supported with @option{-mpcrel}, though this could be supported for
15729 68020 and higher processors.
15731 @item -mno-strict-align
15732 @itemx -mstrict-align
15733 @opindex mno-strict-align
15734 @opindex mstrict-align
15735 Do not (do) assume that unaligned memory references are handled by
15736 the system.
15738 @item -msep-data
15739 Generate code that allows the data segment to be located in a different
15740 area of memory from the text segment.  This allows for execute-in-place in
15741 an environment without virtual memory management.  This option implies
15742 @option{-fPIC}.
15744 @item -mno-sep-data
15745 Generate code that assumes that the data segment follows the text segment.
15746 This is the default.
15748 @item -mid-shared-library
15749 Generate code that supports shared libraries via the library ID method.
15750 This allows for execute-in-place and shared libraries in an environment
15751 without virtual memory management.  This option implies @option{-fPIC}.
15753 @item -mno-id-shared-library
15754 Generate code that doesn't assume ID-based shared libraries are being used.
15755 This is the default.
15757 @item -mshared-library-id=n
15758 Specifies the identification number of the ID-based shared library being
15759 compiled.  Specifying a value of 0 generates more compact code; specifying
15760 other values forces the allocation of that number to the current
15761 library, but is no more space- or time-efficient than omitting this option.
15763 @item -mxgot
15764 @itemx -mno-xgot
15765 @opindex mxgot
15766 @opindex mno-xgot
15767 When generating position-independent code for ColdFire, generate code
15768 that works if the GOT has more than 8192 entries.  This code is
15769 larger and slower than code generated without this option.  On M680x0
15770 processors, this option is not needed; @option{-fPIC} suffices.
15772 GCC normally uses a single instruction to load values from the GOT@.
15773 While this is relatively efficient, it only works if the GOT
15774 is smaller than about 64k.  Anything larger causes the linker
15775 to report an error such as:
15777 @cindex relocation truncated to fit (ColdFire)
15778 @smallexample
15779 relocation truncated to fit: R_68K_GOT16O foobar
15780 @end smallexample
15782 If this happens, you should recompile your code with @option{-mxgot}.
15783 It should then work with very large GOTs.  However, code generated with
15784 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15785 the value of a global symbol.
15787 Note that some linkers, including newer versions of the GNU linker,
15788 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15789 you should only need to use @option{-mxgot} when compiling a single
15790 object file that accesses more than 8192 GOT entries.  Very few do.
15792 These options have no effect unless GCC is generating
15793 position-independent code.
15795 @end table
15797 @node MCore Options
15798 @subsection MCore Options
15799 @cindex MCore options
15801 These are the @samp{-m} options defined for the Motorola M*Core
15802 processors.
15804 @table @gcctabopt
15806 @item -mhardlit
15807 @itemx -mno-hardlit
15808 @opindex mhardlit
15809 @opindex mno-hardlit
15810 Inline constants into the code stream if it can be done in two
15811 instructions or less.
15813 @item -mdiv
15814 @itemx -mno-div
15815 @opindex mdiv
15816 @opindex mno-div
15817 Use the divide instruction.  (Enabled by default).
15819 @item -mrelax-immediate
15820 @itemx -mno-relax-immediate
15821 @opindex mrelax-immediate
15822 @opindex mno-relax-immediate
15823 Allow arbitrary-sized immediates in bit operations.
15825 @item -mwide-bitfields
15826 @itemx -mno-wide-bitfields
15827 @opindex mwide-bitfields
15828 @opindex mno-wide-bitfields
15829 Always treat bit-fields as @code{int}-sized.
15831 @item -m4byte-functions
15832 @itemx -mno-4byte-functions
15833 @opindex m4byte-functions
15834 @opindex mno-4byte-functions
15835 Force all functions to be aligned to a 4-byte boundary.
15837 @item -mcallgraph-data
15838 @itemx -mno-callgraph-data
15839 @opindex mcallgraph-data
15840 @opindex mno-callgraph-data
15841 Emit callgraph information.
15843 @item -mslow-bytes
15844 @itemx -mno-slow-bytes
15845 @opindex mslow-bytes
15846 @opindex mno-slow-bytes
15847 Prefer word access when reading byte quantities.
15849 @item -mlittle-endian
15850 @itemx -mbig-endian
15851 @opindex mlittle-endian
15852 @opindex mbig-endian
15853 Generate code for a little-endian target.
15855 @item -m210
15856 @itemx -m340
15857 @opindex m210
15858 @opindex m340
15859 Generate code for the 210 processor.
15861 @item -mno-lsim
15862 @opindex mno-lsim
15863 Assume that runtime support has been provided and so omit the
15864 simulator library (@file{libsim.a)} from the linker command line.
15866 @item -mstack-increment=@var{size}
15867 @opindex mstack-increment
15868 Set the maximum amount for a single stack increment operation.  Large
15869 values can increase the speed of programs that contain functions
15870 that need a large amount of stack space, but they can also trigger a
15871 segmentation fault if the stack is extended too much.  The default
15872 value is 0x1000.
15874 @end table
15876 @node MeP Options
15877 @subsection MeP Options
15878 @cindex MeP options
15880 @table @gcctabopt
15882 @item -mabsdiff
15883 @opindex mabsdiff
15884 Enables the @code{abs} instruction, which is the absolute difference
15885 between two registers.
15887 @item -mall-opts
15888 @opindex mall-opts
15889 Enables all the optional instructions---average, multiply, divide, bit
15890 operations, leading zero, absolute difference, min/max, clip, and
15891 saturation.
15894 @item -maverage
15895 @opindex maverage
15896 Enables the @code{ave} instruction, which computes the average of two
15897 registers.
15899 @item -mbased=@var{n}
15900 @opindex mbased=
15901 Variables of size @var{n} bytes or smaller are placed in the
15902 @code{.based} section by default.  Based variables use the @code{$tp}
15903 register as a base register, and there is a 128-byte limit to the
15904 @code{.based} section.
15906 @item -mbitops
15907 @opindex mbitops
15908 Enables the bit operation instructions---bit test (@code{btstm}), set
15909 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15910 test-and-set (@code{tas}).
15912 @item -mc=@var{name}
15913 @opindex mc=
15914 Selects which section constant data is placed in.  @var{name} may
15915 be @code{tiny}, @code{near}, or @code{far}.
15917 @item -mclip
15918 @opindex mclip
15919 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15920 useful unless you also provide @code{-mminmax}.
15922 @item -mconfig=@var{name}
15923 @opindex mconfig=
15924 Selects one of the built-in core configurations.  Each MeP chip has
15925 one or more modules in it; each module has a core CPU and a variety of
15926 coprocessors, optional instructions, and peripherals.  The
15927 @code{MeP-Integrator} tool, not part of GCC, provides these
15928 configurations through this option; using this option is the same as
15929 using all the corresponding command-line options.  The default
15930 configuration is @code{default}.
15932 @item -mcop
15933 @opindex mcop
15934 Enables the coprocessor instructions.  By default, this is a 32-bit
15935 coprocessor.  Note that the coprocessor is normally enabled via the
15936 @code{-mconfig=} option.
15938 @item -mcop32
15939 @opindex mcop32
15940 Enables the 32-bit coprocessor's instructions.
15942 @item -mcop64
15943 @opindex mcop64
15944 Enables the 64-bit coprocessor's instructions.
15946 @item -mivc2
15947 @opindex mivc2
15948 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15950 @item -mdc
15951 @opindex mdc
15952 Causes constant variables to be placed in the @code{.near} section.
15954 @item -mdiv
15955 @opindex mdiv
15956 Enables the @code{div} and @code{divu} instructions.
15958 @item -meb
15959 @opindex meb
15960 Generate big-endian code.
15962 @item -mel
15963 @opindex mel
15964 Generate little-endian code.
15966 @item -mio-volatile
15967 @opindex mio-volatile
15968 Tells the compiler that any variable marked with the @code{io}
15969 attribute is to be considered volatile.
15971 @item -ml
15972 @opindex ml
15973 Causes variables to be assigned to the @code{.far} section by default.
15975 @item -mleadz
15976 @opindex mleadz
15977 Enables the @code{leadz} (leading zero) instruction.
15979 @item -mm
15980 @opindex mm
15981 Causes variables to be assigned to the @code{.near} section by default.
15983 @item -mminmax
15984 @opindex mminmax
15985 Enables the @code{min} and @code{max} instructions.
15987 @item -mmult
15988 @opindex mmult
15989 Enables the multiplication and multiply-accumulate instructions.
15991 @item -mno-opts
15992 @opindex mno-opts
15993 Disables all the optional instructions enabled by @code{-mall-opts}.
15995 @item -mrepeat
15996 @opindex mrepeat
15997 Enables the @code{repeat} and @code{erepeat} instructions, used for
15998 low-overhead looping.
16000 @item -ms
16001 @opindex ms
16002 Causes all variables to default to the @code{.tiny} section.  Note
16003 that there is a 65536-byte limit to this section.  Accesses to these
16004 variables use the @code{%gp} base register.
16006 @item -msatur
16007 @opindex msatur
16008 Enables the saturation instructions.  Note that the compiler does not
16009 currently generate these itself, but this option is included for
16010 compatibility with other tools, like @code{as}.
16012 @item -msdram
16013 @opindex msdram
16014 Link the SDRAM-based runtime instead of the default ROM-based runtime.
16016 @item -msim
16017 @opindex msim
16018 Link the simulator runtime libraries.
16020 @item -msimnovec
16021 @opindex msimnovec
16022 Link the simulator runtime libraries, excluding built-in support
16023 for reset and exception vectors and tables.
16025 @item -mtf
16026 @opindex mtf
16027 Causes all functions to default to the @code{.far} section.  Without
16028 this option, functions default to the @code{.near} section.
16030 @item -mtiny=@var{n}
16031 @opindex mtiny=
16032 Variables that are @var{n} bytes or smaller are allocated to the
16033 @code{.tiny} section.  These variables use the @code{$gp} base
16034 register.  The default for this option is 4, but note that there's a
16035 65536-byte limit to the @code{.tiny} section.
16037 @end table
16039 @node MicroBlaze Options
16040 @subsection MicroBlaze Options
16041 @cindex MicroBlaze Options
16043 @table @gcctabopt
16045 @item -msoft-float
16046 @opindex msoft-float
16047 Use software emulation for floating point (default).
16049 @item -mhard-float
16050 @opindex mhard-float
16051 Use hardware floating-point instructions.
16053 @item -mmemcpy
16054 @opindex mmemcpy
16055 Do not optimize block moves, use @code{memcpy}.
16057 @item -mno-clearbss
16058 @opindex mno-clearbss
16059 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
16061 @item -mcpu=@var{cpu-type}
16062 @opindex mcpu=
16063 Use features of, and schedule code for, the given CPU.
16064 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
16065 where @var{X} is a major version, @var{YY} is the minor version, and
16066 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
16067 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
16069 @item -mxl-soft-mul
16070 @opindex mxl-soft-mul
16071 Use software multiply emulation (default).
16073 @item -mxl-soft-div
16074 @opindex mxl-soft-div
16075 Use software emulation for divides (default).
16077 @item -mxl-barrel-shift
16078 @opindex mxl-barrel-shift
16079 Use the hardware barrel shifter.
16081 @item -mxl-pattern-compare
16082 @opindex mxl-pattern-compare
16083 Use pattern compare instructions.
16085 @item -msmall-divides
16086 @opindex msmall-divides
16087 Use table lookup optimization for small signed integer divisions.
16089 @item -mxl-stack-check
16090 @opindex mxl-stack-check
16091 This option is deprecated.  Use @option{-fstack-check} instead.
16093 @item -mxl-gp-opt
16094 @opindex mxl-gp-opt
16095 Use GP-relative @code{.sdata}/@code{.sbss} sections.
16097 @item -mxl-multiply-high
16098 @opindex mxl-multiply-high
16099 Use multiply high instructions for high part of 32x32 multiply.
16101 @item -mxl-float-convert
16102 @opindex mxl-float-convert
16103 Use hardware floating-point conversion instructions.
16105 @item -mxl-float-sqrt
16106 @opindex mxl-float-sqrt
16107 Use hardware floating-point square root instruction.
16109 @item -mbig-endian
16110 @opindex mbig-endian
16111 Generate code for a big-endian target.
16113 @item -mlittle-endian
16114 @opindex mlittle-endian
16115 Generate code for a little-endian target.
16117 @item -mxl-reorder
16118 @opindex mxl-reorder
16119 Use reorder instructions (swap and byte reversed load/store).
16121 @item -mxl-mode-@var{app-model}
16122 Select application model @var{app-model}.  Valid models are
16123 @table @samp
16124 @item executable
16125 normal executable (default), uses startup code @file{crt0.o}.
16127 @item xmdstub
16128 for use with Xilinx Microprocessor Debugger (XMD) based
16129 software intrusive debug agent called xmdstub. This uses startup file
16130 @file{crt1.o} and sets the start address of the program to 0x800.
16132 @item bootstrap
16133 for applications that are loaded using a bootloader.
16134 This model uses startup file @file{crt2.o} which does not contain a processor
16135 reset vector handler. This is suitable for transferring control on a
16136 processor reset to the bootloader rather than the application.
16138 @item novectors
16139 for applications that do not require any of the
16140 MicroBlaze vectors. This option may be useful for applications running
16141 within a monitoring application. This model uses @file{crt3.o} as a startup file.
16142 @end table
16144 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
16145 @option{-mxl-mode-@var{app-model}}.
16147 @end table
16149 @node MIPS Options
16150 @subsection MIPS Options
16151 @cindex MIPS options
16153 @table @gcctabopt
16155 @item -EB
16156 @opindex EB
16157 Generate big-endian code.
16159 @item -EL
16160 @opindex EL
16161 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
16162 configurations.
16164 @item -march=@var{arch}
16165 @opindex march
16166 Generate code that runs on @var{arch}, which can be the name of a
16167 generic MIPS ISA, or the name of a particular processor.
16168 The ISA names are:
16169 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
16170 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
16171 The processor names are:
16172 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
16173 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
16174 @samp{5kc}, @samp{5kf},
16175 @samp{20kc},
16176 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
16177 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
16178 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
16179 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
16180 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
16181 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
16182 @samp{m4k},
16183 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
16184 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
16185 @samp{orion},
16186 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
16187 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
16188 @samp{rm7000}, @samp{rm9000},
16189 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
16190 @samp{sb1},
16191 @samp{sr71000},
16192 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
16193 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
16194 @samp{xlr} and @samp{xlp}.
16195 The special value @samp{from-abi} selects the
16196 most compatible architecture for the selected ABI (that is,
16197 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
16199 The native Linux/GNU toolchain also supports the value @samp{native},
16200 which selects the best architecture option for the host processor.
16201 @option{-march=native} has no effect if GCC does not recognize
16202 the processor.
16204 In processor names, a final @samp{000} can be abbreviated as @samp{k}
16205 (for example, @option{-march=r2k}).  Prefixes are optional, and
16206 @samp{vr} may be written @samp{r}.
16208 Names of the form @samp{@var{n}f2_1} refer to processors with
16209 FPUs clocked at half the rate of the core, names of the form
16210 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
16211 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
16212 processors with FPUs clocked a ratio of 3:2 with respect to the core.
16213 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
16214 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
16215 accepted as synonyms for @samp{@var{n}f1_1}.
16217 GCC defines two macros based on the value of this option.  The first
16218 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
16219 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
16220 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
16221 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
16222 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
16224 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
16225 above.  In other words, it has the full prefix and does not
16226 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
16227 the macro names the resolved architecture (either @samp{"mips1"} or
16228 @samp{"mips3"}).  It names the default architecture when no
16229 @option{-march} option is given.
16231 @item -mtune=@var{arch}
16232 @opindex mtune
16233 Optimize for @var{arch}.  Among other things, this option controls
16234 the way instructions are scheduled, and the perceived cost of arithmetic
16235 operations.  The list of @var{arch} values is the same as for
16236 @option{-march}.
16238 When this option is not used, GCC optimizes for the processor
16239 specified by @option{-march}.  By using @option{-march} and
16240 @option{-mtune} together, it is possible to generate code that
16241 runs on a family of processors, but optimize the code for one
16242 particular member of that family.
16244 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
16245 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
16246 @option{-march} ones described above.
16248 @item -mips1
16249 @opindex mips1
16250 Equivalent to @option{-march=mips1}.
16252 @item -mips2
16253 @opindex mips2
16254 Equivalent to @option{-march=mips2}.
16256 @item -mips3
16257 @opindex mips3
16258 Equivalent to @option{-march=mips3}.
16260 @item -mips4
16261 @opindex mips4
16262 Equivalent to @option{-march=mips4}.
16264 @item -mips32
16265 @opindex mips32
16266 Equivalent to @option{-march=mips32}.
16268 @item -mips32r2
16269 @opindex mips32r2
16270 Equivalent to @option{-march=mips32r2}.
16272 @item -mips64
16273 @opindex mips64
16274 Equivalent to @option{-march=mips64}.
16276 @item -mips64r2
16277 @opindex mips64r2
16278 Equivalent to @option{-march=mips64r2}.
16280 @item -mips16
16281 @itemx -mno-mips16
16282 @opindex mips16
16283 @opindex mno-mips16
16284 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16285 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16287 MIPS16 code generation can also be controlled on a per-function basis
16288 by means of @code{mips16} and @code{nomips16} attributes.
16289 @xref{Function Attributes}, for more information.
16291 @item -mflip-mips16
16292 @opindex mflip-mips16
16293 Generate MIPS16 code on alternating functions.  This option is provided
16294 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16295 not intended for ordinary use in compiling user code.
16297 @item -minterlink-compressed
16298 @item -mno-interlink-compressed
16299 @opindex minterlink-compressed
16300 @opindex mno-interlink-compressed
16301 Require (do not require) that code using the standard (uncompressed) MIPS ISA
16302 be link-compatible with MIPS16 and microMIPS code, and vice versa.
16304 For example, code using the standard ISA encoding cannot jump directly
16305 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
16306 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
16307 knows that the target of the jump is not compressed.
16309 @item -minterlink-mips16
16310 @itemx -mno-interlink-mips16
16311 @opindex minterlink-mips16
16312 @opindex mno-interlink-mips16
16313 Aliases of @option{-minterlink-compressed} and
16314 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
16315 and are retained for backwards compatibility.
16317 @item -mabi=32
16318 @itemx -mabi=o64
16319 @itemx -mabi=n32
16320 @itemx -mabi=64
16321 @itemx -mabi=eabi
16322 @opindex mabi=32
16323 @opindex mabi=o64
16324 @opindex mabi=n32
16325 @opindex mabi=64
16326 @opindex mabi=eabi
16327 Generate code for the given ABI@.
16329 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
16330 generates 64-bit code when you select a 64-bit architecture, but you
16331 can use @option{-mgp32} to get 32-bit code instead.
16333 For information about the O64 ABI, see
16334 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
16336 GCC supports a variant of the o32 ABI in which floating-point registers
16337 are 64 rather than 32 bits wide.  You can select this combination with
16338 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
16339 and @code{mfhc1} instructions and is therefore only supported for
16340 MIPS32R2 processors.
16342 The register assignments for arguments and return values remain the
16343 same, but each scalar value is passed in a single 64-bit register
16344 rather than a pair of 32-bit registers.  For example, scalar
16345 floating-point values are returned in @samp{$f0} only, not a
16346 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
16347 remains the same, but all 64 bits are saved.
16349 @item -mabicalls
16350 @itemx -mno-abicalls
16351 @opindex mabicalls
16352 @opindex mno-abicalls
16353 Generate (do not generate) code that is suitable for SVR4-style
16354 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
16355 systems.
16357 @item -mshared
16358 @itemx -mno-shared
16359 Generate (do not generate) code that is fully position-independent,
16360 and that can therefore be linked into shared libraries.  This option
16361 only affects @option{-mabicalls}.
16363 All @option{-mabicalls} code has traditionally been position-independent,
16364 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
16365 as an extension, the GNU toolchain allows executables to use absolute
16366 accesses for locally-binding symbols.  It can also use shorter GP
16367 initialization sequences and generate direct calls to locally-defined
16368 functions.  This mode is selected by @option{-mno-shared}.
16370 @option{-mno-shared} depends on binutils 2.16 or higher and generates
16371 objects that can only be linked by the GNU linker.  However, the option
16372 does not affect the ABI of the final executable; it only affects the ABI
16373 of relocatable objects.  Using @option{-mno-shared} generally makes
16374 executables both smaller and quicker.
16376 @option{-mshared} is the default.
16378 @item -mplt
16379 @itemx -mno-plt
16380 @opindex mplt
16381 @opindex mno-plt
16382 Assume (do not assume) that the static and dynamic linkers
16383 support PLTs and copy relocations.  This option only affects
16384 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
16385 has no effect without @option{-msym32}.
16387 You can make @option{-mplt} the default by configuring
16388 GCC with @option{--with-mips-plt}.  The default is
16389 @option{-mno-plt} otherwise.
16391 @item -mxgot
16392 @itemx -mno-xgot
16393 @opindex mxgot
16394 @opindex mno-xgot
16395 Lift (do not lift) the usual restrictions on the size of the global
16396 offset table.
16398 GCC normally uses a single instruction to load values from the GOT@.
16399 While this is relatively efficient, it only works if the GOT
16400 is smaller than about 64k.  Anything larger causes the linker
16401 to report an error such as:
16403 @cindex relocation truncated to fit (MIPS)
16404 @smallexample
16405 relocation truncated to fit: R_MIPS_GOT16 foobar
16406 @end smallexample
16408 If this happens, you should recompile your code with @option{-mxgot}.
16409 This works with very large GOTs, although the code is also
16410 less efficient, since it takes three instructions to fetch the
16411 value of a global symbol.
16413 Note that some linkers can create multiple GOTs.  If you have such a
16414 linker, you should only need to use @option{-mxgot} when a single object
16415 file accesses more than 64k's worth of GOT entries.  Very few do.
16417 These options have no effect unless GCC is generating position
16418 independent code.
16420 @item -mgp32
16421 @opindex mgp32
16422 Assume that general-purpose registers are 32 bits wide.
16424 @item -mgp64
16425 @opindex mgp64
16426 Assume that general-purpose registers are 64 bits wide.
16428 @item -mfp32
16429 @opindex mfp32
16430 Assume that floating-point registers are 32 bits wide.
16432 @item -mfp64
16433 @opindex mfp64
16434 Assume that floating-point registers are 64 bits wide.
16436 @item -mhard-float
16437 @opindex mhard-float
16438 Use floating-point coprocessor instructions.
16440 @item -msoft-float
16441 @opindex msoft-float
16442 Do not use floating-point coprocessor instructions.  Implement
16443 floating-point calculations using library calls instead.
16445 @item -mno-float
16446 @opindex mno-float
16447 Equivalent to @option{-msoft-float}, but additionally asserts that the
16448 program being compiled does not perform any floating-point operations.
16449 This option is presently supported only by some bare-metal MIPS
16450 configurations, where it may select a special set of libraries
16451 that lack all floating-point support (including, for example, the
16452 floating-point @code{printf} formats).  
16453 If code compiled with @code{-mno-float} accidentally contains
16454 floating-point operations, it is likely to suffer a link-time
16455 or run-time failure.
16457 @item -msingle-float
16458 @opindex msingle-float
16459 Assume that the floating-point coprocessor only supports single-precision
16460 operations.
16462 @item -mdouble-float
16463 @opindex mdouble-float
16464 Assume that the floating-point coprocessor supports double-precision
16465 operations.  This is the default.
16467 @item -mabs=2008
16468 @itemx -mabs=legacy
16469 @opindex mabs=2008
16470 @opindex mabs=legacy
16471 These options control the treatment of the special not-a-number (NaN)
16472 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
16473 @code{neg.@i{fmt}} machine instructions.
16475 By default or when the @option{-mabs=legacy} is used the legacy
16476 treatment is selected.  In this case these instructions are considered
16477 arithmetic and avoided where correct operation is required and the
16478 input operand might be a NaN.  A longer sequence of instructions that
16479 manipulate the sign bit of floating-point datum manually is used
16480 instead unless the @option{-ffinite-math-only} option has also been
16481 specified.
16483 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
16484 this case these instructions are considered non-arithmetic and therefore
16485 operating correctly in all cases, including in particular where the
16486 input operand is a NaN.  These instructions are therefore always used
16487 for the respective operations.
16489 @item -mnan=2008
16490 @itemx -mnan=legacy
16491 @opindex mnan=2008
16492 @opindex mnan=legacy
16493 These options control the encoding of the special not-a-number (NaN)
16494 IEEE 754 floating-point data.
16496 The @option{-mnan=legacy} option selects the legacy encoding.  In this
16497 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
16498 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
16499 by the first bit of their trailing significand field being 1.
16501 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
16502 this case qNaNs are denoted by the first bit of their trailing
16503 significand field being 1, whereas sNaNs are denoted by the first bit of
16504 their trailing significand field being 0.
16506 The default is @option{-mnan=legacy} unless GCC has been configured with
16507 @option{--with-nan=2008}.
16509 @item -mllsc
16510 @itemx -mno-llsc
16511 @opindex mllsc
16512 @opindex mno-llsc
16513 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
16514 implement atomic memory built-in functions.  When neither option is
16515 specified, GCC uses the instructions if the target architecture
16516 supports them.
16518 @option{-mllsc} is useful if the runtime environment can emulate the
16519 instructions and @option{-mno-llsc} can be useful when compiling for
16520 nonstandard ISAs.  You can make either option the default by
16521 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
16522 respectively.  @option{--with-llsc} is the default for some
16523 configurations; see the installation documentation for details.
16525 @item -mdsp
16526 @itemx -mno-dsp
16527 @opindex mdsp
16528 @opindex mno-dsp
16529 Use (do not use) revision 1 of the MIPS DSP ASE@.
16530 @xref{MIPS DSP Built-in Functions}.  This option defines the
16531 preprocessor macro @samp{__mips_dsp}.  It also defines
16532 @samp{__mips_dsp_rev} to 1.
16534 @item -mdspr2
16535 @itemx -mno-dspr2
16536 @opindex mdspr2
16537 @opindex mno-dspr2
16538 Use (do not use) revision 2 of the MIPS DSP ASE@.
16539 @xref{MIPS DSP Built-in Functions}.  This option defines the
16540 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
16541 It also defines @samp{__mips_dsp_rev} to 2.
16543 @item -msmartmips
16544 @itemx -mno-smartmips
16545 @opindex msmartmips
16546 @opindex mno-smartmips
16547 Use (do not use) the MIPS SmartMIPS ASE.
16549 @item -mpaired-single
16550 @itemx -mno-paired-single
16551 @opindex mpaired-single
16552 @opindex mno-paired-single
16553 Use (do not use) paired-single floating-point instructions.
16554 @xref{MIPS Paired-Single Support}.  This option requires
16555 hardware floating-point support to be enabled.
16557 @item -mdmx
16558 @itemx -mno-mdmx
16559 @opindex mdmx
16560 @opindex mno-mdmx
16561 Use (do not use) MIPS Digital Media Extension instructions.
16562 This option can only be used when generating 64-bit code and requires
16563 hardware floating-point support to be enabled.
16565 @item -mips3d
16566 @itemx -mno-mips3d
16567 @opindex mips3d
16568 @opindex mno-mips3d
16569 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
16570 The option @option{-mips3d} implies @option{-mpaired-single}.
16572 @item -mmicromips
16573 @itemx -mno-micromips
16574 @opindex mmicromips
16575 @opindex mno-mmicromips
16576 Generate (do not generate) microMIPS code.
16578 MicroMIPS code generation can also be controlled on a per-function basis
16579 by means of @code{micromips} and @code{nomicromips} attributes.
16580 @xref{Function Attributes}, for more information.
16582 @item -mmt
16583 @itemx -mno-mt
16584 @opindex mmt
16585 @opindex mno-mt
16586 Use (do not use) MT Multithreading instructions.
16588 @item -mmcu
16589 @itemx -mno-mcu
16590 @opindex mmcu
16591 @opindex mno-mcu
16592 Use (do not use) the MIPS MCU ASE instructions.
16594 @item -meva
16595 @itemx -mno-eva
16596 @opindex meva
16597 @opindex mno-eva
16598 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
16600 @item -mlong64
16601 @opindex mlong64
16602 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
16603 an explanation of the default and the way that the pointer size is
16604 determined.
16606 @item -mlong32
16607 @opindex mlong32
16608 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
16610 The default size of @code{int}s, @code{long}s and pointers depends on
16611 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
16612 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
16613 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
16614 or the same size as integer registers, whichever is smaller.
16616 @item -msym32
16617 @itemx -mno-sym32
16618 @opindex msym32
16619 @opindex mno-sym32
16620 Assume (do not assume) that all symbols have 32-bit values, regardless
16621 of the selected ABI@.  This option is useful in combination with
16622 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
16623 to generate shorter and faster references to symbolic addresses.
16625 @item -G @var{num}
16626 @opindex G
16627 Put definitions of externally-visible data in a small data section
16628 if that data is no bigger than @var{num} bytes.  GCC can then generate
16629 more efficient accesses to the data; see @option{-mgpopt} for details.
16631 The default @option{-G} option depends on the configuration.
16633 @item -mlocal-sdata
16634 @itemx -mno-local-sdata
16635 @opindex mlocal-sdata
16636 @opindex mno-local-sdata
16637 Extend (do not extend) the @option{-G} behavior to local data too,
16638 such as to static variables in C@.  @option{-mlocal-sdata} is the
16639 default for all configurations.
16641 If the linker complains that an application is using too much small data,
16642 you might want to try rebuilding the less performance-critical parts with
16643 @option{-mno-local-sdata}.  You might also want to build large
16644 libraries with @option{-mno-local-sdata}, so that the libraries leave
16645 more room for the main program.
16647 @item -mextern-sdata
16648 @itemx -mno-extern-sdata
16649 @opindex mextern-sdata
16650 @opindex mno-extern-sdata
16651 Assume (do not assume) that externally-defined data is in
16652 a small data section if the size of that data is within the @option{-G} limit.
16653 @option{-mextern-sdata} is the default for all configurations.
16655 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
16656 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
16657 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
16658 is placed in a small data section.  If @var{Var} is defined by another
16659 module, you must either compile that module with a high-enough
16660 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
16661 definition.  If @var{Var} is common, you must link the application
16662 with a high-enough @option{-G} setting.
16664 The easiest way of satisfying these restrictions is to compile
16665 and link every module with the same @option{-G} option.  However,
16666 you may wish to build a library that supports several different
16667 small data limits.  You can do this by compiling the library with
16668 the highest supported @option{-G} setting and additionally using
16669 @option{-mno-extern-sdata} to stop the library from making assumptions
16670 about externally-defined data.
16672 @item -mgpopt
16673 @itemx -mno-gpopt
16674 @opindex mgpopt
16675 @opindex mno-gpopt
16676 Use (do not use) GP-relative accesses for symbols that are known to be
16677 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
16678 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
16679 configurations.
16681 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
16682 might not hold the value of @code{_gp}.  For example, if the code is
16683 part of a library that might be used in a boot monitor, programs that
16684 call boot monitor routines pass an unknown value in @code{$gp}.
16685 (In such situations, the boot monitor itself is usually compiled
16686 with @option{-G0}.)
16688 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
16689 @option{-mno-extern-sdata}.
16691 @item -membedded-data
16692 @itemx -mno-embedded-data
16693 @opindex membedded-data
16694 @opindex mno-embedded-data
16695 Allocate variables to the read-only data section first if possible, then
16696 next in the small data section if possible, otherwise in data.  This gives
16697 slightly slower code than the default, but reduces the amount of RAM required
16698 when executing, and thus may be preferred for some embedded systems.
16700 @item -muninit-const-in-rodata
16701 @itemx -mno-uninit-const-in-rodata
16702 @opindex muninit-const-in-rodata
16703 @opindex mno-uninit-const-in-rodata
16704 Put uninitialized @code{const} variables in the read-only data section.
16705 This option is only meaningful in conjunction with @option{-membedded-data}.
16707 @item -mcode-readable=@var{setting}
16708 @opindex mcode-readable
16709 Specify whether GCC may generate code that reads from executable sections.
16710 There are three possible settings:
16712 @table @gcctabopt
16713 @item -mcode-readable=yes
16714 Instructions may freely access executable sections.  This is the
16715 default setting.
16717 @item -mcode-readable=pcrel
16718 MIPS16 PC-relative load instructions can access executable sections,
16719 but other instructions must not do so.  This option is useful on 4KSc
16720 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
16721 It is also useful on processors that can be configured to have a dual
16722 instruction/data SRAM interface and that, like the M4K, automatically
16723 redirect PC-relative loads to the instruction RAM.
16725 @item -mcode-readable=no
16726 Instructions must not access executable sections.  This option can be
16727 useful on targets that are configured to have a dual instruction/data
16728 SRAM interface but that (unlike the M4K) do not automatically redirect
16729 PC-relative loads to the instruction RAM.
16730 @end table
16732 @item -msplit-addresses
16733 @itemx -mno-split-addresses
16734 @opindex msplit-addresses
16735 @opindex mno-split-addresses
16736 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
16737 relocation operators.  This option has been superseded by
16738 @option{-mexplicit-relocs} but is retained for backwards compatibility.
16740 @item -mexplicit-relocs
16741 @itemx -mno-explicit-relocs
16742 @opindex mexplicit-relocs
16743 @opindex mno-explicit-relocs
16744 Use (do not use) assembler relocation operators when dealing with symbolic
16745 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
16746 is to use assembler macros instead.
16748 @option{-mexplicit-relocs} is the default if GCC was configured
16749 to use an assembler that supports relocation operators.
16751 @item -mcheck-zero-division
16752 @itemx -mno-check-zero-division
16753 @opindex mcheck-zero-division
16754 @opindex mno-check-zero-division
16755 Trap (do not trap) on integer division by zero.
16757 The default is @option{-mcheck-zero-division}.
16759 @item -mdivide-traps
16760 @itemx -mdivide-breaks
16761 @opindex mdivide-traps
16762 @opindex mdivide-breaks
16763 MIPS systems check for division by zero by generating either a
16764 conditional trap or a break instruction.  Using traps results in
16765 smaller code, but is only supported on MIPS II and later.  Also, some
16766 versions of the Linux kernel have a bug that prevents trap from
16767 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
16768 allow conditional traps on architectures that support them and
16769 @option{-mdivide-breaks} to force the use of breaks.
16771 The default is usually @option{-mdivide-traps}, but this can be
16772 overridden at configure time using @option{--with-divide=breaks}.
16773 Divide-by-zero checks can be completely disabled using
16774 @option{-mno-check-zero-division}.
16776 @item -mmemcpy
16777 @itemx -mno-memcpy
16778 @opindex mmemcpy
16779 @opindex mno-memcpy
16780 Force (do not force) the use of @code{memcpy()} for non-trivial block
16781 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
16782 most constant-sized copies.
16784 @item -mlong-calls
16785 @itemx -mno-long-calls
16786 @opindex mlong-calls
16787 @opindex mno-long-calls
16788 Disable (do not disable) use of the @code{jal} instruction.  Calling
16789 functions using @code{jal} is more efficient but requires the caller
16790 and callee to be in the same 256 megabyte segment.
16792 This option has no effect on abicalls code.  The default is
16793 @option{-mno-long-calls}.
16795 @item -mmad
16796 @itemx -mno-mad
16797 @opindex mmad
16798 @opindex mno-mad
16799 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
16800 instructions, as provided by the R4650 ISA@.
16802 @item -mimadd
16803 @itemx -mno-imadd
16804 @opindex mimadd
16805 @opindex mno-imadd
16806 Enable (disable) use of the @code{madd} and @code{msub} integer
16807 instructions.  The default is @option{-mimadd} on architectures
16808 that support @code{madd} and @code{msub} except for the 74k 
16809 architecture where it was found to generate slower code.
16811 @item -mfused-madd
16812 @itemx -mno-fused-madd
16813 @opindex mfused-madd
16814 @opindex mno-fused-madd
16815 Enable (disable) use of the floating-point multiply-accumulate
16816 instructions, when they are available.  The default is
16817 @option{-mfused-madd}.
16819 On the R8000 CPU when multiply-accumulate instructions are used,
16820 the intermediate product is calculated to infinite precision
16821 and is not subject to the FCSR Flush to Zero bit.  This may be
16822 undesirable in some circumstances.  On other processors the result
16823 is numerically identical to the equivalent computation using
16824 separate multiply, add, subtract and negate instructions.
16826 @item -nocpp
16827 @opindex nocpp
16828 Tell the MIPS assembler to not run its preprocessor over user
16829 assembler files (with a @samp{.s} suffix) when assembling them.
16831 @item -mfix-24k
16832 @item -mno-fix-24k
16833 @opindex mfix-24k
16834 @opindex mno-fix-24k
16835 Work around the 24K E48 (lost data on stores during refill) errata.
16836 The workarounds are implemented by the assembler rather than by GCC@.
16838 @item -mfix-r4000
16839 @itemx -mno-fix-r4000
16840 @opindex mfix-r4000
16841 @opindex mno-fix-r4000
16842 Work around certain R4000 CPU errata:
16843 @itemize @minus
16844 @item
16845 A double-word or a variable shift may give an incorrect result if executed
16846 immediately after starting an integer division.
16847 @item
16848 A double-word or a variable shift may give an incorrect result if executed
16849 while an integer multiplication is in progress.
16850 @item
16851 An integer division may give an incorrect result if started in a delay slot
16852 of a taken branch or a jump.
16853 @end itemize
16855 @item -mfix-r4400
16856 @itemx -mno-fix-r4400
16857 @opindex mfix-r4400
16858 @opindex mno-fix-r4400
16859 Work around certain R4400 CPU errata:
16860 @itemize @minus
16861 @item
16862 A double-word or a variable shift may give an incorrect result if executed
16863 immediately after starting an integer division.
16864 @end itemize
16866 @item -mfix-r10000
16867 @itemx -mno-fix-r10000
16868 @opindex mfix-r10000
16869 @opindex mno-fix-r10000
16870 Work around certain R10000 errata:
16871 @itemize @minus
16872 @item
16873 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16874 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16875 @end itemize
16877 This option can only be used if the target architecture supports
16878 branch-likely instructions.  @option{-mfix-r10000} is the default when
16879 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16880 otherwise.
16882 @item -mfix-vr4120
16883 @itemx -mno-fix-vr4120
16884 @opindex mfix-vr4120
16885 Work around certain VR4120 errata:
16886 @itemize @minus
16887 @item
16888 @code{dmultu} does not always produce the correct result.
16889 @item
16890 @code{div} and @code{ddiv} do not always produce the correct result if one
16891 of the operands is negative.
16892 @end itemize
16893 The workarounds for the division errata rely on special functions in
16894 @file{libgcc.a}.  At present, these functions are only provided by
16895 the @code{mips64vr*-elf} configurations.
16897 Other VR4120 errata require a NOP to be inserted between certain pairs of
16898 instructions.  These errata are handled by the assembler, not by GCC itself.
16900 @item -mfix-vr4130
16901 @opindex mfix-vr4130
16902 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16903 workarounds are implemented by the assembler rather than by GCC,
16904 although GCC avoids using @code{mflo} and @code{mfhi} if the
16905 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16906 instructions are available instead.
16908 @item -mfix-sb1
16909 @itemx -mno-fix-sb1
16910 @opindex mfix-sb1
16911 Work around certain SB-1 CPU core errata.
16912 (This flag currently works around the SB-1 revision 2
16913 ``F1'' and ``F2'' floating-point errata.)
16915 @item -mr10k-cache-barrier=@var{setting}
16916 @opindex mr10k-cache-barrier
16917 Specify whether GCC should insert cache barriers to avoid the
16918 side-effects of speculation on R10K processors.
16920 In common with many processors, the R10K tries to predict the outcome
16921 of a conditional branch and speculatively executes instructions from
16922 the ``taken'' branch.  It later aborts these instructions if the
16923 predicted outcome is wrong.  However, on the R10K, even aborted
16924 instructions can have side effects.
16926 This problem only affects kernel stores and, depending on the system,
16927 kernel loads.  As an example, a speculatively-executed store may load
16928 the target memory into cache and mark the cache line as dirty, even if
16929 the store itself is later aborted.  If a DMA operation writes to the
16930 same area of memory before the ``dirty'' line is flushed, the cached
16931 data overwrites the DMA-ed data.  See the R10K processor manual
16932 for a full description, including other potential problems.
16934 One workaround is to insert cache barrier instructions before every memory
16935 access that might be speculatively executed and that might have side
16936 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16937 controls GCC's implementation of this workaround.  It assumes that
16938 aborted accesses to any byte in the following regions does not have
16939 side effects:
16941 @enumerate
16942 @item
16943 the memory occupied by the current function's stack frame;
16945 @item
16946 the memory occupied by an incoming stack argument;
16948 @item
16949 the memory occupied by an object with a link-time-constant address.
16950 @end enumerate
16952 It is the kernel's responsibility to ensure that speculative
16953 accesses to these regions are indeed safe.
16955 If the input program contains a function declaration such as:
16957 @smallexample
16958 void foo (void);
16959 @end smallexample
16961 then the implementation of @code{foo} must allow @code{j foo} and
16962 @code{jal foo} to be executed speculatively.  GCC honors this
16963 restriction for functions it compiles itself.  It expects non-GCC
16964 functions (such as hand-written assembly code) to do the same.
16966 The option has three forms:
16968 @table @gcctabopt
16969 @item -mr10k-cache-barrier=load-store
16970 Insert a cache barrier before a load or store that might be
16971 speculatively executed and that might have side effects even
16972 if aborted.
16974 @item -mr10k-cache-barrier=store
16975 Insert a cache barrier before a store that might be speculatively
16976 executed and that might have side effects even if aborted.
16978 @item -mr10k-cache-barrier=none
16979 Disable the insertion of cache barriers.  This is the default setting.
16980 @end table
16982 @item -mflush-func=@var{func}
16983 @itemx -mno-flush-func
16984 @opindex mflush-func
16985 Specifies the function to call to flush the I and D caches, or to not
16986 call any such function.  If called, the function must take the same
16987 arguments as the common @code{_flush_func()}, that is, the address of the
16988 memory range for which the cache is being flushed, the size of the
16989 memory range, and the number 3 (to flush both caches).  The default
16990 depends on the target GCC was configured for, but commonly is either
16991 @samp{_flush_func} or @samp{__cpu_flush}.
16993 @item mbranch-cost=@var{num}
16994 @opindex mbranch-cost
16995 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16996 This cost is only a heuristic and is not guaranteed to produce
16997 consistent results across releases.  A zero cost redundantly selects
16998 the default, which is based on the @option{-mtune} setting.
17000 @item -mbranch-likely
17001 @itemx -mno-branch-likely
17002 @opindex mbranch-likely
17003 @opindex mno-branch-likely
17004 Enable or disable use of Branch Likely instructions, regardless of the
17005 default for the selected architecture.  By default, Branch Likely
17006 instructions may be generated if they are supported by the selected
17007 architecture.  An exception is for the MIPS32 and MIPS64 architectures
17008 and processors that implement those architectures; for those, Branch
17009 Likely instructions are not be generated by default because the MIPS32
17010 and MIPS64 architectures specifically deprecate their use.
17012 @item -mfp-exceptions
17013 @itemx -mno-fp-exceptions
17014 @opindex mfp-exceptions
17015 Specifies whether FP exceptions are enabled.  This affects how
17016 FP instructions are scheduled for some processors.
17017 The default is that FP exceptions are
17018 enabled.
17020 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
17021 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
17022 FP pipe.
17024 @item -mvr4130-align
17025 @itemx -mno-vr4130-align
17026 @opindex mvr4130-align
17027 The VR4130 pipeline is two-way superscalar, but can only issue two
17028 instructions together if the first one is 8-byte aligned.  When this
17029 option is enabled, GCC aligns pairs of instructions that it
17030 thinks should execute in parallel.
17032 This option only has an effect when optimizing for the VR4130.
17033 It normally makes code faster, but at the expense of making it bigger.
17034 It is enabled by default at optimization level @option{-O3}.
17036 @item -msynci
17037 @itemx -mno-synci
17038 @opindex msynci
17039 Enable (disable) generation of @code{synci} instructions on
17040 architectures that support it.  The @code{synci} instructions (if
17041 enabled) are generated when @code{__builtin___clear_cache()} is
17042 compiled.
17044 This option defaults to @code{-mno-synci}, but the default can be
17045 overridden by configuring with @code{--with-synci}.
17047 When compiling code for single processor systems, it is generally safe
17048 to use @code{synci}.  However, on many multi-core (SMP) systems, it
17049 does not invalidate the instruction caches on all cores and may lead
17050 to undefined behavior.
17052 @item -mrelax-pic-calls
17053 @itemx -mno-relax-pic-calls
17054 @opindex mrelax-pic-calls
17055 Try to turn PIC calls that are normally dispatched via register
17056 @code{$25} into direct calls.  This is only possible if the linker can
17057 resolve the destination at link-time and if the destination is within
17058 range for a direct call.
17060 @option{-mrelax-pic-calls} is the default if GCC was configured to use
17061 an assembler and a linker that support the @code{.reloc} assembly
17062 directive and @code{-mexplicit-relocs} is in effect.  With
17063 @code{-mno-explicit-relocs}, this optimization can be performed by the
17064 assembler and the linker alone without help from the compiler.
17066 @item -mmcount-ra-address
17067 @itemx -mno-mcount-ra-address
17068 @opindex mmcount-ra-address
17069 @opindex mno-mcount-ra-address
17070 Emit (do not emit) code that allows @code{_mcount} to modify the
17071 calling function's return address.  When enabled, this option extends
17072 the usual @code{_mcount} interface with a new @var{ra-address}
17073 parameter, which has type @code{intptr_t *} and is passed in register
17074 @code{$12}.  @code{_mcount} can then modify the return address by
17075 doing both of the following:
17076 @itemize
17077 @item
17078 Returning the new address in register @code{$31}.
17079 @item
17080 Storing the new address in @code{*@var{ra-address}},
17081 if @var{ra-address} is nonnull.
17082 @end itemize
17084 The default is @option{-mno-mcount-ra-address}.
17086 @end table
17088 @node MMIX Options
17089 @subsection MMIX Options
17090 @cindex MMIX Options
17092 These options are defined for the MMIX:
17094 @table @gcctabopt
17095 @item -mlibfuncs
17096 @itemx -mno-libfuncs
17097 @opindex mlibfuncs
17098 @opindex mno-libfuncs
17099 Specify that intrinsic library functions are being compiled, passing all
17100 values in registers, no matter the size.
17102 @item -mepsilon
17103 @itemx -mno-epsilon
17104 @opindex mepsilon
17105 @opindex mno-epsilon
17106 Generate floating-point comparison instructions that compare with respect
17107 to the @code{rE} epsilon register.
17109 @item -mabi=mmixware
17110 @itemx -mabi=gnu
17111 @opindex mabi=mmixware
17112 @opindex mabi=gnu
17113 Generate code that passes function parameters and return values that (in
17114 the called function) are seen as registers @code{$0} and up, as opposed to
17115 the GNU ABI which uses global registers @code{$231} and up.
17117 @item -mzero-extend
17118 @itemx -mno-zero-extend
17119 @opindex mzero-extend
17120 @opindex mno-zero-extend
17121 When reading data from memory in sizes shorter than 64 bits, use (do not
17122 use) zero-extending load instructions by default, rather than
17123 sign-extending ones.
17125 @item -mknuthdiv
17126 @itemx -mno-knuthdiv
17127 @opindex mknuthdiv
17128 @opindex mno-knuthdiv
17129 Make the result of a division yielding a remainder have the same sign as
17130 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
17131 remainder follows the sign of the dividend.  Both methods are
17132 arithmetically valid, the latter being almost exclusively used.
17134 @item -mtoplevel-symbols
17135 @itemx -mno-toplevel-symbols
17136 @opindex mtoplevel-symbols
17137 @opindex mno-toplevel-symbols
17138 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
17139 code can be used with the @code{PREFIX} assembly directive.
17141 @item -melf
17142 @opindex melf
17143 Generate an executable in the ELF format, rather than the default
17144 @samp{mmo} format used by the @command{mmix} simulator.
17146 @item -mbranch-predict
17147 @itemx -mno-branch-predict
17148 @opindex mbranch-predict
17149 @opindex mno-branch-predict
17150 Use (do not use) the probable-branch instructions, when static branch
17151 prediction indicates a probable branch.
17153 @item -mbase-addresses
17154 @itemx -mno-base-addresses
17155 @opindex mbase-addresses
17156 @opindex mno-base-addresses
17157 Generate (do not generate) code that uses @emph{base addresses}.  Using a
17158 base address automatically generates a request (handled by the assembler
17159 and the linker) for a constant to be set up in a global register.  The
17160 register is used for one or more base address requests within the range 0
17161 to 255 from the value held in the register.  The generally leads to short
17162 and fast code, but the number of different data items that can be
17163 addressed is limited.  This means that a program that uses lots of static
17164 data may require @option{-mno-base-addresses}.
17166 @item -msingle-exit
17167 @itemx -mno-single-exit
17168 @opindex msingle-exit
17169 @opindex mno-single-exit
17170 Force (do not force) generated code to have a single exit point in each
17171 function.
17172 @end table
17174 @node MN10300 Options
17175 @subsection MN10300 Options
17176 @cindex MN10300 options
17178 These @option{-m} options are defined for Matsushita MN10300 architectures:
17180 @table @gcctabopt
17181 @item -mmult-bug
17182 @opindex mmult-bug
17183 Generate code to avoid bugs in the multiply instructions for the MN10300
17184 processors.  This is the default.
17186 @item -mno-mult-bug
17187 @opindex mno-mult-bug
17188 Do not generate code to avoid bugs in the multiply instructions for the
17189 MN10300 processors.
17191 @item -mam33
17192 @opindex mam33
17193 Generate code using features specific to the AM33 processor.
17195 @item -mno-am33
17196 @opindex mno-am33
17197 Do not generate code using features specific to the AM33 processor.  This
17198 is the default.
17200 @item -mam33-2
17201 @opindex mam33-2
17202 Generate code using features specific to the AM33/2.0 processor.
17204 @item -mam34
17205 @opindex mam34
17206 Generate code using features specific to the AM34 processor.
17208 @item -mtune=@var{cpu-type}
17209 @opindex mtune
17210 Use the timing characteristics of the indicated CPU type when
17211 scheduling instructions.  This does not change the targeted processor
17212 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
17213 @samp{am33-2} or @samp{am34}.
17215 @item -mreturn-pointer-on-d0
17216 @opindex mreturn-pointer-on-d0
17217 When generating a function that returns a pointer, return the pointer
17218 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
17219 only in @code{a0}, and attempts to call such functions without a prototype
17220 result in errors.  Note that this option is on by default; use
17221 @option{-mno-return-pointer-on-d0} to disable it.
17223 @item -mno-crt0
17224 @opindex mno-crt0
17225 Do not link in the C run-time initialization object file.
17227 @item -mrelax
17228 @opindex mrelax
17229 Indicate to the linker that it should perform a relaxation optimization pass
17230 to shorten branches, calls and absolute memory addresses.  This option only
17231 has an effect when used on the command line for the final link step.
17233 This option makes symbolic debugging impossible.
17235 @item -mliw
17236 @opindex mliw
17237 Allow the compiler to generate @emph{Long Instruction Word}
17238 instructions if the target is the @samp{AM33} or later.  This is the
17239 default.  This option defines the preprocessor macro @samp{__LIW__}.
17241 @item -mnoliw
17242 @opindex mnoliw
17243 Do not allow the compiler to generate @emph{Long Instruction Word}
17244 instructions.  This option defines the preprocessor macro
17245 @samp{__NO_LIW__}.
17247 @item -msetlb
17248 @opindex msetlb
17249 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
17250 instructions if the target is the @samp{AM33} or later.  This is the
17251 default.  This option defines the preprocessor macro @samp{__SETLB__}.
17253 @item -mnosetlb
17254 @opindex mnosetlb
17255 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
17256 instructions.  This option defines the preprocessor macro
17257 @samp{__NO_SETLB__}.
17259 @end table
17261 @node Moxie Options
17262 @subsection Moxie Options
17263 @cindex Moxie Options
17265 @table @gcctabopt
17267 @item -meb
17268 @opindex meb
17269 Generate big-endian code.  This is the default for @samp{moxie-*-*}
17270 configurations.
17272 @item -mel
17273 @opindex mel
17274 Generate little-endian code.
17276 @item -mno-crt0
17277 @opindex mno-crt0
17278 Do not link in the C run-time initialization object file.
17280 @end table
17282 @node PDP-11 Options
17283 @subsection PDP-11 Options
17284 @cindex PDP-11 Options
17286 These options are defined for the PDP-11:
17288 @table @gcctabopt
17289 @item -mfpu
17290 @opindex mfpu
17291 Use hardware FPP floating point.  This is the default.  (FIS floating
17292 point on the PDP-11/40 is not supported.)
17294 @item -msoft-float
17295 @opindex msoft-float
17296 Do not use hardware floating point.
17298 @item -mac0
17299 @opindex mac0
17300 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
17302 @item -mno-ac0
17303 @opindex mno-ac0
17304 Return floating-point results in memory.  This is the default.
17306 @item -m40
17307 @opindex m40
17308 Generate code for a PDP-11/40.
17310 @item -m45
17311 @opindex m45
17312 Generate code for a PDP-11/45.  This is the default.
17314 @item -m10
17315 @opindex m10
17316 Generate code for a PDP-11/10.
17318 @item -mbcopy-builtin
17319 @opindex mbcopy-builtin
17320 Use inline @code{movmemhi} patterns for copying memory.  This is the
17321 default.
17323 @item -mbcopy
17324 @opindex mbcopy
17325 Do not use inline @code{movmemhi} patterns for copying memory.
17327 @item -mint16
17328 @itemx -mno-int32
17329 @opindex mint16
17330 @opindex mno-int32
17331 Use 16-bit @code{int}.  This is the default.
17333 @item -mint32
17334 @itemx -mno-int16
17335 @opindex mint32
17336 @opindex mno-int16
17337 Use 32-bit @code{int}.
17339 @item -mfloat64
17340 @itemx -mno-float32
17341 @opindex mfloat64
17342 @opindex mno-float32
17343 Use 64-bit @code{float}.  This is the default.
17345 @item -mfloat32
17346 @itemx -mno-float64
17347 @opindex mfloat32
17348 @opindex mno-float64
17349 Use 32-bit @code{float}.
17351 @item -mabshi
17352 @opindex mabshi
17353 Use @code{abshi2} pattern.  This is the default.
17355 @item -mno-abshi
17356 @opindex mno-abshi
17357 Do not use @code{abshi2} pattern.
17359 @item -mbranch-expensive
17360 @opindex mbranch-expensive
17361 Pretend that branches are expensive.  This is for experimenting with
17362 code generation only.
17364 @item -mbranch-cheap
17365 @opindex mbranch-cheap
17366 Do not pretend that branches are expensive.  This is the default.
17368 @item -munix-asm
17369 @opindex munix-asm
17370 Use Unix assembler syntax.  This is the default when configured for
17371 @samp{pdp11-*-bsd}.
17373 @item -mdec-asm
17374 @opindex mdec-asm
17375 Use DEC assembler syntax.  This is the default when configured for any
17376 PDP-11 target other than @samp{pdp11-*-bsd}.
17377 @end table
17379 @node picoChip Options
17380 @subsection picoChip Options
17381 @cindex picoChip options
17383 These @samp{-m} options are defined for picoChip implementations:
17385 @table @gcctabopt
17387 @item -mae=@var{ae_type}
17388 @opindex mcpu
17389 Set the instruction set, register set, and instruction scheduling
17390 parameters for array element type @var{ae_type}.  Supported values
17391 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
17393 @option{-mae=ANY} selects a completely generic AE type.  Code
17394 generated with this option runs on any of the other AE types.  The
17395 code is not as efficient as it would be if compiled for a specific
17396 AE type, and some types of operation (e.g., multiplication) do not
17397 work properly on all types of AE.
17399 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
17400 for compiled code, and is the default.
17402 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
17403 option may suffer from poor performance of byte (char) manipulation,
17404 since the DSP AE does not provide hardware support for byte load/stores.
17406 @item -msymbol-as-address
17407 Enable the compiler to directly use a symbol name as an address in a
17408 load/store instruction, without first loading it into a
17409 register.  Typically, the use of this option generates larger
17410 programs, which run faster than when the option isn't used.  However, the
17411 results vary from program to program, so it is left as a user option,
17412 rather than being permanently enabled.
17414 @item -mno-inefficient-warnings
17415 Disables warnings about the generation of inefficient code.  These
17416 warnings can be generated, for example, when compiling code that
17417 performs byte-level memory operations on the MAC AE type.  The MAC AE has
17418 no hardware support for byte-level memory operations, so all byte
17419 load/stores must be synthesized from word load/store operations.  This is
17420 inefficient and a warning is generated to indicate
17421 that you should rewrite the code to avoid byte operations, or to target
17422 an AE type that has the necessary hardware support.  This option disables
17423 these warnings.
17425 @end table
17427 @node PowerPC Options
17428 @subsection PowerPC Options
17429 @cindex PowerPC options
17431 These are listed under @xref{RS/6000 and PowerPC Options}.
17433 @node RL78 Options
17434 @subsection RL78 Options
17435 @cindex RL78 Options
17437 @table @gcctabopt
17439 @item -msim
17440 @opindex msim
17441 Links in additional target libraries to support operation within a
17442 simulator.
17444 @item -mmul=none
17445 @itemx -mmul=g13
17446 @itemx -mmul=rl78
17447 @opindex mmul
17448 Specifies the type of hardware multiplication support to be used.  The
17449 default is @code{none}, which uses software multiplication functions.
17450 The @code{g13} option is for the hardware multiply/divide peripheral
17451 only on the RL78/G13 targets.  The @code{rl78} option is for the
17452 standard hardware multiplication defined in the RL78 software manual.
17454 @end table
17456 @node RS/6000 and PowerPC Options
17457 @subsection IBM RS/6000 and PowerPC Options
17458 @cindex RS/6000 and PowerPC Options
17459 @cindex IBM RS/6000 and PowerPC Options
17461 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
17462 @table @gcctabopt
17463 @item -mpowerpc-gpopt
17464 @itemx -mno-powerpc-gpopt
17465 @itemx -mpowerpc-gfxopt
17466 @itemx -mno-powerpc-gfxopt
17467 @need 800
17468 @itemx -mpowerpc64
17469 @itemx -mno-powerpc64
17470 @itemx -mmfcrf
17471 @itemx -mno-mfcrf
17472 @itemx -mpopcntb
17473 @itemx -mno-popcntb
17474 @itemx -mpopcntd
17475 @itemx -mno-popcntd
17476 @itemx -mfprnd
17477 @itemx -mno-fprnd
17478 @need 800
17479 @itemx -mcmpb
17480 @itemx -mno-cmpb
17481 @itemx -mmfpgpr
17482 @itemx -mno-mfpgpr
17483 @itemx -mhard-dfp
17484 @itemx -mno-hard-dfp
17485 @opindex mpowerpc-gpopt
17486 @opindex mno-powerpc-gpopt
17487 @opindex mpowerpc-gfxopt
17488 @opindex mno-powerpc-gfxopt
17489 @opindex mpowerpc64
17490 @opindex mno-powerpc64
17491 @opindex mmfcrf
17492 @opindex mno-mfcrf
17493 @opindex mpopcntb
17494 @opindex mno-popcntb
17495 @opindex mpopcntd
17496 @opindex mno-popcntd
17497 @opindex mfprnd
17498 @opindex mno-fprnd
17499 @opindex mcmpb
17500 @opindex mno-cmpb
17501 @opindex mmfpgpr
17502 @opindex mno-mfpgpr
17503 @opindex mhard-dfp
17504 @opindex mno-hard-dfp
17505 You use these options to specify which instructions are available on the
17506 processor you are using.  The default value of these options is
17507 determined when configuring GCC@.  Specifying the
17508 @option{-mcpu=@var{cpu_type}} overrides the specification of these
17509 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
17510 rather than the options listed above.
17512 Specifying @option{-mpowerpc-gpopt} allows
17513 GCC to use the optional PowerPC architecture instructions in the
17514 General Purpose group, including floating-point square root.  Specifying
17515 @option{-mpowerpc-gfxopt} allows GCC to
17516 use the optional PowerPC architecture instructions in the Graphics
17517 group, including floating-point select.
17519 The @option{-mmfcrf} option allows GCC to generate the move from
17520 condition register field instruction implemented on the POWER4
17521 processor and other processors that support the PowerPC V2.01
17522 architecture.
17523 The @option{-mpopcntb} option allows GCC to generate the popcount and
17524 double-precision FP reciprocal estimate instruction implemented on the
17525 POWER5 processor and other processors that support the PowerPC V2.02
17526 architecture.
17527 The @option{-mpopcntd} option allows GCC to generate the popcount
17528 instruction implemented on the POWER7 processor and other processors
17529 that support the PowerPC V2.06 architecture.
17530 The @option{-mfprnd} option allows GCC to generate the FP round to
17531 integer instructions implemented on the POWER5+ processor and other
17532 processors that support the PowerPC V2.03 architecture.
17533 The @option{-mcmpb} option allows GCC to generate the compare bytes
17534 instruction implemented on the POWER6 processor and other processors
17535 that support the PowerPC V2.05 architecture.
17536 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
17537 general-purpose register instructions implemented on the POWER6X
17538 processor and other processors that support the extended PowerPC V2.05
17539 architecture.
17540 The @option{-mhard-dfp} option allows GCC to generate the decimal
17541 floating-point instructions implemented on some POWER processors.
17543 The @option{-mpowerpc64} option allows GCC to generate the additional
17544 64-bit instructions that are found in the full PowerPC64 architecture
17545 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
17546 @option{-mno-powerpc64}.
17548 @item -mcpu=@var{cpu_type}
17549 @opindex mcpu
17550 Set architecture type, register usage, and
17551 instruction scheduling parameters for machine type @var{cpu_type}.
17552 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
17553 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
17554 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
17555 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
17556 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
17557 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
17558 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
17559 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
17560 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
17561 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
17562 @samp{powerpc64}, and @samp{rs64}.
17564 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
17565 PowerPC and 64-bit PowerPC architecture machine
17566 types, with an appropriate, generic processor model assumed for
17567 scheduling purposes.
17569 The other options specify a specific processor.  Code generated under
17570 those options runs best on that processor, and may not run at all on
17571 others.
17573 The @option{-mcpu} options automatically enable or disable the
17574 following options:
17576 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
17577 -mpopcntb -mpopcntd  -mpowerpc64 @gol
17578 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
17579 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
17580 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector -mquad-memory}
17582 The particular options set for any particular CPU varies between
17583 compiler versions, depending on what setting seems to produce optimal
17584 code for that CPU; it doesn't necessarily reflect the actual hardware's
17585 capabilities.  If you wish to set an individual option to a particular
17586 value, you may specify it after the @option{-mcpu} option, like
17587 @option{-mcpu=970 -mno-altivec}.
17589 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
17590 not enabled or disabled by the @option{-mcpu} option at present because
17591 AIX does not have full support for these options.  You may still
17592 enable or disable them individually if you're sure it'll work in your
17593 environment.
17595 @item -mtune=@var{cpu_type}
17596 @opindex mtune
17597 Set the instruction scheduling parameters for machine type
17598 @var{cpu_type}, but do not set the architecture type or register usage,
17599 as @option{-mcpu=@var{cpu_type}} does.  The same
17600 values for @var{cpu_type} are used for @option{-mtune} as for
17601 @option{-mcpu}.  If both are specified, the code generated uses the
17602 architecture and registers set by @option{-mcpu}, but the
17603 scheduling parameters set by @option{-mtune}.
17605 @item -mcmodel=small
17606 @opindex mcmodel=small
17607 Generate PowerPC64 code for the small model: The TOC is limited to
17608 64k.
17610 @item -mcmodel=medium
17611 @opindex mcmodel=medium
17612 Generate PowerPC64 code for the medium model: The TOC and other static
17613 data may be up to a total of 4G in size.
17615 @item -mcmodel=large
17616 @opindex mcmodel=large
17617 Generate PowerPC64 code for the large model: The TOC may be up to 4G
17618 in size.  Other data and code is only limited by the 64-bit address
17619 space.
17621 @item -maltivec
17622 @itemx -mno-altivec
17623 @opindex maltivec
17624 @opindex mno-altivec
17625 Generate code that uses (does not use) AltiVec instructions, and also
17626 enable the use of built-in functions that allow more direct access to
17627 the AltiVec instruction set.  You may also need to set
17628 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
17629 enhancements.
17631 @item -mvrsave
17632 @itemx -mno-vrsave
17633 @opindex mvrsave
17634 @opindex mno-vrsave
17635 Generate VRSAVE instructions when generating AltiVec code.
17637 @item -mgen-cell-microcode
17638 @opindex mgen-cell-microcode
17639 Generate Cell microcode instructions.
17641 @item -mwarn-cell-microcode
17642 @opindex mwarn-cell-microcode
17643 Warn when a Cell microcode instruction is emitted.  An example
17644 of a Cell microcode instruction is a variable shift.
17646 @item -msecure-plt
17647 @opindex msecure-plt
17648 Generate code that allows @command{ld} and @command{ld.so}
17649 to build executables and shared
17650 libraries with non-executable @code{.plt} and @code{.got} sections.
17651 This is a PowerPC
17652 32-bit SYSV ABI option.
17654 @item -mbss-plt
17655 @opindex mbss-plt
17656 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
17657 fills in, and
17658 requires @code{.plt} and @code{.got}
17659 sections that are both writable and executable.
17660 This is a PowerPC 32-bit SYSV ABI option.
17662 @item -misel
17663 @itemx -mno-isel
17664 @opindex misel
17665 @opindex mno-isel
17666 This switch enables or disables the generation of ISEL instructions.
17668 @item -misel=@var{yes/no}
17669 This switch has been deprecated.  Use @option{-misel} and
17670 @option{-mno-isel} instead.
17672 @item -mspe
17673 @itemx -mno-spe
17674 @opindex mspe
17675 @opindex mno-spe
17676 This switch enables or disables the generation of SPE simd
17677 instructions.
17679 @item -mpaired
17680 @itemx -mno-paired
17681 @opindex mpaired
17682 @opindex mno-paired
17683 This switch enables or disables the generation of PAIRED simd
17684 instructions.
17686 @item -mspe=@var{yes/no}
17687 This option has been deprecated.  Use @option{-mspe} and
17688 @option{-mno-spe} instead.
17690 @item -mvsx
17691 @itemx -mno-vsx
17692 @opindex mvsx
17693 @opindex mno-vsx
17694 Generate code that uses (does not use) vector/scalar (VSX)
17695 instructions, and also enable the use of built-in functions that allow
17696 more direct access to the VSX instruction set.
17698 @item -mcrypto
17699 @itemx -mno-crypto
17700 @opindex mcrypto
17701 @opindex mno-crypto
17702 Enable the use (disable) of the built-in functions that allow direct
17703 access to the cryptographic instructions that were added in version
17704 2.07 of the PowerPC ISA.
17706 @item -mdirect-move
17707 @itemx -mno-direct-move
17708 @opindex mdirect-move
17709 @opindex mno-direct-move
17710 Generate code that uses (does not use) the instructions to move data
17711 between the general purpose registers and the vector/scalar (VSX)
17712 registers that were added in version 2.07 of the PowerPC ISA.
17714 @item -mpower8-fusion
17715 @itemx -mno-power8-fusion
17716 @opindex mpower8-fusion
17717 @opindex mno-power8-fusion
17718 Generate code that keeps (does not keeps) some integer operations
17719 adjacent so that the instructions can be fused together on power8 and
17720 later processors.
17722 @item -mpower8-vector
17723 @itemx -mno-power8-vector
17724 @opindex mpower8-vector
17725 @opindex mno-power8-vector
17726 Generate code that uses (does not use) the vector and scalar
17727 instructions that were added in version 2.07 of the PowerPC ISA.  Also
17728 enable the use of built-in functions that allow more direct access to
17729 the vector instructions.
17731 @item -mquad-memory
17732 @itemx -mno-quad-memory
17733 @opindex mquad-memory
17734 @opindex mno-quad-memory
17735 Generate code that uses (does not use) the quad word memory
17736 instructions.  The @option{-mquad-memory} option requires use of
17737 64-bit mode.
17739 @item -mfloat-gprs=@var{yes/single/double/no}
17740 @itemx -mfloat-gprs
17741 @opindex mfloat-gprs
17742 This switch enables or disables the generation of floating-point
17743 operations on the general-purpose registers for architectures that
17744 support it.
17746 The argument @var{yes} or @var{single} enables the use of
17747 single-precision floating-point operations.
17749 The argument @var{double} enables the use of single and
17750 double-precision floating-point operations.
17752 The argument @var{no} disables floating-point operations on the
17753 general-purpose registers.
17755 This option is currently only available on the MPC854x.
17757 @item -m32
17758 @itemx -m64
17759 @opindex m32
17760 @opindex m64
17761 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
17762 targets (including GNU/Linux).  The 32-bit environment sets int, long
17763 and pointer to 32 bits and generates code that runs on any PowerPC
17764 variant.  The 64-bit environment sets int to 32 bits and long and
17765 pointer to 64 bits, and generates code for PowerPC64, as for
17766 @option{-mpowerpc64}.
17768 @item -mfull-toc
17769 @itemx -mno-fp-in-toc
17770 @itemx -mno-sum-in-toc
17771 @itemx -mminimal-toc
17772 @opindex mfull-toc
17773 @opindex mno-fp-in-toc
17774 @opindex mno-sum-in-toc
17775 @opindex mminimal-toc
17776 Modify generation of the TOC (Table Of Contents), which is created for
17777 every executable file.  The @option{-mfull-toc} option is selected by
17778 default.  In that case, GCC allocates at least one TOC entry for
17779 each unique non-automatic variable reference in your program.  GCC
17780 also places floating-point constants in the TOC@.  However, only
17781 16,384 entries are available in the TOC@.
17783 If you receive a linker error message that saying you have overflowed
17784 the available TOC space, you can reduce the amount of TOC space used
17785 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
17786 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
17787 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
17788 generate code to calculate the sum of an address and a constant at
17789 run time instead of putting that sum into the TOC@.  You may specify one
17790 or both of these options.  Each causes GCC to produce very slightly
17791 slower and larger code at the expense of conserving TOC space.
17793 If you still run out of space in the TOC even when you specify both of
17794 these options, specify @option{-mminimal-toc} instead.  This option causes
17795 GCC to make only one TOC entry for every file.  When you specify this
17796 option, GCC produces code that is slower and larger but which
17797 uses extremely little TOC space.  You may wish to use this option
17798 only on files that contain less frequently-executed code.
17800 @item -maix64
17801 @itemx -maix32
17802 @opindex maix64
17803 @opindex maix32
17804 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
17805 @code{long} type, and the infrastructure needed to support them.
17806 Specifying @option{-maix64} implies @option{-mpowerpc64},
17807 while @option{-maix32} disables the 64-bit ABI and
17808 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
17810 @item -mxl-compat
17811 @itemx -mno-xl-compat
17812 @opindex mxl-compat
17813 @opindex mno-xl-compat
17814 Produce code that conforms more closely to IBM XL compiler semantics
17815 when using AIX-compatible ABI@.  Pass floating-point arguments to
17816 prototyped functions beyond the register save area (RSA) on the stack
17817 in addition to argument FPRs.  Do not assume that most significant
17818 double in 128-bit long double value is properly rounded when comparing
17819 values and converting to double.  Use XL symbol names for long double
17820 support routines.
17822 The AIX calling convention was extended but not initially documented to
17823 handle an obscure K&R C case of calling a function that takes the
17824 address of its arguments with fewer arguments than declared.  IBM XL
17825 compilers access floating-point arguments that do not fit in the
17826 RSA from the stack when a subroutine is compiled without
17827 optimization.  Because always storing floating-point arguments on the
17828 stack is inefficient and rarely needed, this option is not enabled by
17829 default and only is necessary when calling subroutines compiled by IBM
17830 XL compilers without optimization.
17832 @item -mpe
17833 @opindex mpe
17834 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
17835 application written to use message passing with special startup code to
17836 enable the application to run.  The system must have PE installed in the
17837 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
17838 must be overridden with the @option{-specs=} option to specify the
17839 appropriate directory location.  The Parallel Environment does not
17840 support threads, so the @option{-mpe} option and the @option{-pthread}
17841 option are incompatible.
17843 @item -malign-natural
17844 @itemx -malign-power
17845 @opindex malign-natural
17846 @opindex malign-power
17847 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
17848 @option{-malign-natural} overrides the ABI-defined alignment of larger
17849 types, such as floating-point doubles, on their natural size-based boundary.
17850 The option @option{-malign-power} instructs GCC to follow the ABI-specified
17851 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
17853 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
17854 is not supported.
17856 @item -msoft-float
17857 @itemx -mhard-float
17858 @opindex msoft-float
17859 @opindex mhard-float
17860 Generate code that does not use (uses) the floating-point register set.
17861 Software floating-point emulation is provided if you use the
17862 @option{-msoft-float} option, and pass the option to GCC when linking.
17864 @item -msingle-float
17865 @itemx -mdouble-float
17866 @opindex msingle-float
17867 @opindex mdouble-float
17868 Generate code for single- or double-precision floating-point operations.
17869 @option{-mdouble-float} implies @option{-msingle-float}.
17871 @item -msimple-fpu
17872 @opindex msimple-fpu
17873 Do not generate @code{sqrt} and @code{div} instructions for hardware
17874 floating-point unit.
17876 @item -mfpu=@var{name}
17877 @opindex mfpu
17878 Specify type of floating-point unit.  Valid values for @var{name} are
17879 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
17880 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
17881 @samp{sp_full} (equivalent to @option{-msingle-float}),
17882 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17884 @item -mxilinx-fpu
17885 @opindex mxilinx-fpu
17886 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17888 @item -mmultiple
17889 @itemx -mno-multiple
17890 @opindex mmultiple
17891 @opindex mno-multiple
17892 Generate code that uses (does not use) the load multiple word
17893 instructions and the store multiple word instructions.  These
17894 instructions are generated by default on POWER systems, and not
17895 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17896 PowerPC systems, since those instructions do not work when the
17897 processor is in little-endian mode.  The exceptions are PPC740 and
17898 PPC750 which permit these instructions in little-endian mode.
17900 @item -mstring
17901 @itemx -mno-string
17902 @opindex mstring
17903 @opindex mno-string
17904 Generate code that uses (does not use) the load string instructions
17905 and the store string word instructions to save multiple registers and
17906 do small block moves.  These instructions are generated by default on
17907 POWER systems, and not generated on PowerPC systems.  Do not use
17908 @option{-mstring} on little-endian PowerPC systems, since those
17909 instructions do not work when the processor is in little-endian mode.
17910 The exceptions are PPC740 and PPC750 which permit these instructions
17911 in little-endian mode.
17913 @item -mupdate
17914 @itemx -mno-update
17915 @opindex mupdate
17916 @opindex mno-update
17917 Generate code that uses (does not use) the load or store instructions
17918 that update the base register to the address of the calculated memory
17919 location.  These instructions are generated by default.  If you use
17920 @option{-mno-update}, there is a small window between the time that the
17921 stack pointer is updated and the address of the previous frame is
17922 stored, which means code that walks the stack frame across interrupts or
17923 signals may get corrupted data.
17925 @item -mavoid-indexed-addresses
17926 @itemx -mno-avoid-indexed-addresses
17927 @opindex mavoid-indexed-addresses
17928 @opindex mno-avoid-indexed-addresses
17929 Generate code that tries to avoid (not avoid) the use of indexed load
17930 or store instructions. These instructions can incur a performance
17931 penalty on Power6 processors in certain situations, such as when
17932 stepping through large arrays that cross a 16M boundary.  This option
17933 is enabled by default when targeting Power6 and disabled otherwise.
17935 @item -mfused-madd
17936 @itemx -mno-fused-madd
17937 @opindex mfused-madd
17938 @opindex mno-fused-madd
17939 Generate code that uses (does not use) the floating-point multiply and
17940 accumulate instructions.  These instructions are generated by default
17941 if hardware floating point is used.  The machine-dependent
17942 @option{-mfused-madd} option is now mapped to the machine-independent
17943 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
17944 mapped to @option{-ffp-contract=off}.
17946 @item -mmulhw
17947 @itemx -mno-mulhw
17948 @opindex mmulhw
17949 @opindex mno-mulhw
17950 Generate code that uses (does not use) the half-word multiply and
17951 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
17952 These instructions are generated by default when targeting those
17953 processors.
17955 @item -mdlmzb
17956 @itemx -mno-dlmzb
17957 @opindex mdlmzb
17958 @opindex mno-dlmzb
17959 Generate code that uses (does not use) the string-search @samp{dlmzb}
17960 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
17961 generated by default when targeting those processors.
17963 @item -mno-bit-align
17964 @itemx -mbit-align
17965 @opindex mno-bit-align
17966 @opindex mbit-align
17967 On System V.4 and embedded PowerPC systems do not (do) force structures
17968 and unions that contain bit-fields to be aligned to the base type of the
17969 bit-field.
17971 For example, by default a structure containing nothing but 8
17972 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17973 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17974 the structure is aligned to a 1-byte boundary and is 1 byte in
17975 size.
17977 @item -mno-strict-align
17978 @itemx -mstrict-align
17979 @opindex mno-strict-align
17980 @opindex mstrict-align
17981 On System V.4 and embedded PowerPC systems do not (do) assume that
17982 unaligned memory references are handled by the system.
17984 @item -mrelocatable
17985 @itemx -mno-relocatable
17986 @opindex mrelocatable
17987 @opindex mno-relocatable
17988 Generate code that allows (does not allow) a static executable to be
17989 relocated to a different address at run time.  A simple embedded
17990 PowerPC system loader should relocate the entire contents of
17991 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17992 a table of 32-bit addresses generated by this option.  For this to
17993 work, all objects linked together must be compiled with
17994 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17995 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17997 @item -mrelocatable-lib
17998 @itemx -mno-relocatable-lib
17999 @opindex mrelocatable-lib
18000 @opindex mno-relocatable-lib
18001 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
18002 @code{.fixup} section to allow static executables to be relocated at
18003 run time, but @option{-mrelocatable-lib} does not use the smaller stack
18004 alignment of @option{-mrelocatable}.  Objects compiled with
18005 @option{-mrelocatable-lib} may be linked with objects compiled with
18006 any combination of the @option{-mrelocatable} options.
18008 @item -mno-toc
18009 @itemx -mtoc
18010 @opindex mno-toc
18011 @opindex mtoc
18012 On System V.4 and embedded PowerPC systems do not (do) assume that
18013 register 2 contains a pointer to a global area pointing to the addresses
18014 used in the program.
18016 @item -mlittle
18017 @itemx -mlittle-endian
18018 @opindex mlittle
18019 @opindex mlittle-endian
18020 On System V.4 and embedded PowerPC systems compile code for the
18021 processor in little-endian mode.  The @option{-mlittle-endian} option is
18022 the same as @option{-mlittle}.
18024 @item -mbig
18025 @itemx -mbig-endian
18026 @opindex mbig
18027 @opindex mbig-endian
18028 On System V.4 and embedded PowerPC systems compile code for the
18029 processor in big-endian mode.  The @option{-mbig-endian} option is
18030 the same as @option{-mbig}.
18032 @item -mdynamic-no-pic
18033 @opindex mdynamic-no-pic
18034 On Darwin and Mac OS X systems, compile code so that it is not
18035 relocatable, but that its external references are relocatable.  The
18036 resulting code is suitable for applications, but not shared
18037 libraries.
18039 @item -msingle-pic-base
18040 @opindex msingle-pic-base
18041 Treat the register used for PIC addressing as read-only, rather than
18042 loading it in the prologue for each function.  The runtime system is
18043 responsible for initializing this register with an appropriate value
18044 before execution begins.
18046 @item -mprioritize-restricted-insns=@var{priority}
18047 @opindex mprioritize-restricted-insns
18048 This option controls the priority that is assigned to
18049 dispatch-slot restricted instructions during the second scheduling
18050 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
18051 or @samp{2} to assign no, highest, or second-highest (respectively) 
18052 priority to dispatch-slot restricted
18053 instructions.
18055 @item -msched-costly-dep=@var{dependence_type}
18056 @opindex msched-costly-dep
18057 This option controls which dependences are considered costly
18058 by the target during instruction scheduling.  The argument
18059 @var{dependence_type} takes one of the following values:
18061 @table @asis
18062 @item @samp{no}
18063 No dependence is costly.
18065 @item @samp{all}
18066 All dependences are costly.
18068 @item @samp{true_store_to_load}
18069 A true dependence from store to load is costly.
18071 @item @samp{store_to_load}
18072 Any dependence from store to load is costly.
18074 @item @var{number}
18075 Any dependence for which the latency is greater than or equal to 
18076 @var{number} is costly.
18077 @end table
18079 @item -minsert-sched-nops=@var{scheme}
18080 @opindex minsert-sched-nops
18081 This option controls which NOP insertion scheme is used during
18082 the second scheduling pass.  The argument @var{scheme} takes one of the
18083 following values:
18085 @table @asis
18086 @item @samp{no}
18087 Don't insert NOPs.
18089 @item @samp{pad}
18090 Pad with NOPs any dispatch group that has vacant issue slots,
18091 according to the scheduler's grouping.
18093 @item @samp{regroup_exact}
18094 Insert NOPs to force costly dependent insns into
18095 separate groups.  Insert exactly as many NOPs as needed to force an insn
18096 to a new group, according to the estimated processor grouping.
18098 @item @var{number}
18099 Insert NOPs to force costly dependent insns into
18100 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
18101 @end table
18103 @item -mcall-sysv
18104 @opindex mcall-sysv
18105 On System V.4 and embedded PowerPC systems compile code using calling
18106 conventions that adhere to the March 1995 draft of the System V
18107 Application Binary Interface, PowerPC processor supplement.  This is the
18108 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
18110 @item -mcall-sysv-eabi
18111 @itemx -mcall-eabi
18112 @opindex mcall-sysv-eabi
18113 @opindex mcall-eabi
18114 Specify both @option{-mcall-sysv} and @option{-meabi} options.
18116 @item -mcall-sysv-noeabi
18117 @opindex mcall-sysv-noeabi
18118 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
18120 @item -mcall-aixdesc
18121 @opindex m
18122 On System V.4 and embedded PowerPC systems compile code for the AIX
18123 operating system.
18125 @item -mcall-linux
18126 @opindex mcall-linux
18127 On System V.4 and embedded PowerPC systems compile code for the
18128 Linux-based GNU system.
18130 @item -mcall-freebsd
18131 @opindex mcall-freebsd
18132 On System V.4 and embedded PowerPC systems compile code for the
18133 FreeBSD operating system.
18135 @item -mcall-netbsd
18136 @opindex mcall-netbsd
18137 On System V.4 and embedded PowerPC systems compile code for the
18138 NetBSD operating system.
18140 @item -mcall-openbsd
18141 @opindex mcall-netbsd
18142 On System V.4 and embedded PowerPC systems compile code for the
18143 OpenBSD operating system.
18145 @item -maix-struct-return
18146 @opindex maix-struct-return
18147 Return all structures in memory (as specified by the AIX ABI)@.
18149 @item -msvr4-struct-return
18150 @opindex msvr4-struct-return
18151 Return structures smaller than 8 bytes in registers (as specified by the
18152 SVR4 ABI)@.
18154 @item -mabi=@var{abi-type}
18155 @opindex mabi
18156 Extend the current ABI with a particular extension, or remove such extension.
18157 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
18158 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
18160 @item -mabi=spe
18161 @opindex mabi=spe
18162 Extend the current ABI with SPE ABI extensions.  This does not change
18163 the default ABI, instead it adds the SPE ABI extensions to the current
18164 ABI@.
18166 @item -mabi=no-spe
18167 @opindex mabi=no-spe
18168 Disable Book-E SPE ABI extensions for the current ABI@.
18170 @item -mabi=ibmlongdouble
18171 @opindex mabi=ibmlongdouble
18172 Change the current ABI to use IBM extended-precision long double.
18173 This is a PowerPC 32-bit SYSV ABI option.
18175 @item -mabi=ieeelongdouble
18176 @opindex mabi=ieeelongdouble
18177 Change the current ABI to use IEEE extended-precision long double.
18178 This is a PowerPC 32-bit Linux ABI option.
18180 @item -mprototype
18181 @itemx -mno-prototype
18182 @opindex mprototype
18183 @opindex mno-prototype
18184 On System V.4 and embedded PowerPC systems assume that all calls to
18185 variable argument functions are properly prototyped.  Otherwise, the
18186 compiler must insert an instruction before every non-prototyped call to
18187 set or clear bit 6 of the condition code register (@var{CR}) to
18188 indicate whether floating-point values are passed in the floating-point
18189 registers in case the function takes variable arguments.  With
18190 @option{-mprototype}, only calls to prototyped variable argument functions
18191 set or clear the bit.
18193 @item -msim
18194 @opindex msim
18195 On embedded PowerPC systems, assume that the startup module is called
18196 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
18197 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
18198 configurations.
18200 @item -mmvme
18201 @opindex mmvme
18202 On embedded PowerPC systems, assume that the startup module is called
18203 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
18204 @file{libc.a}.
18206 @item -mads
18207 @opindex mads
18208 On embedded PowerPC systems, assume that the startup module is called
18209 @file{crt0.o} and the standard C libraries are @file{libads.a} and
18210 @file{libc.a}.
18212 @item -myellowknife
18213 @opindex myellowknife
18214 On embedded PowerPC systems, assume that the startup module is called
18215 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
18216 @file{libc.a}.
18218 @item -mvxworks
18219 @opindex mvxworks
18220 On System V.4 and embedded PowerPC systems, specify that you are
18221 compiling for a VxWorks system.
18223 @item -memb
18224 @opindex memb
18225 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
18226 header to indicate that @samp{eabi} extended relocations are used.
18228 @item -meabi
18229 @itemx -mno-eabi
18230 @opindex meabi
18231 @opindex mno-eabi
18232 On System V.4 and embedded PowerPC systems do (do not) adhere to the
18233 Embedded Applications Binary Interface (EABI), which is a set of
18234 modifications to the System V.4 specifications.  Selecting @option{-meabi}
18235 means that the stack is aligned to an 8-byte boundary, a function
18236 @code{__eabi} is called from @code{main} to set up the EABI
18237 environment, and the @option{-msdata} option can use both @code{r2} and
18238 @code{r13} to point to two separate small data areas.  Selecting
18239 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
18240 no EABI initialization function is called from @code{main}, and the
18241 @option{-msdata} option only uses @code{r13} to point to a single
18242 small data area.  The @option{-meabi} option is on by default if you
18243 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
18245 @item -msdata=eabi
18246 @opindex msdata=eabi
18247 On System V.4 and embedded PowerPC systems, put small initialized
18248 @code{const} global and static data in the @samp{.sdata2} section, which
18249 is pointed to by register @code{r2}.  Put small initialized
18250 non-@code{const} global and static data in the @samp{.sdata} section,
18251 which is pointed to by register @code{r13}.  Put small uninitialized
18252 global and static data in the @samp{.sbss} section, which is adjacent to
18253 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
18254 incompatible with the @option{-mrelocatable} option.  The
18255 @option{-msdata=eabi} option also sets the @option{-memb} option.
18257 @item -msdata=sysv
18258 @opindex msdata=sysv
18259 On System V.4 and embedded PowerPC systems, put small global and static
18260 data in the @samp{.sdata} section, which is pointed to by register
18261 @code{r13}.  Put small uninitialized global and static data in the
18262 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
18263 The @option{-msdata=sysv} option is incompatible with the
18264 @option{-mrelocatable} option.
18266 @item -msdata=default
18267 @itemx -msdata
18268 @opindex msdata=default
18269 @opindex msdata
18270 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
18271 compile code the same as @option{-msdata=eabi}, otherwise compile code the
18272 same as @option{-msdata=sysv}.
18274 @item -msdata=data
18275 @opindex msdata=data
18276 On System V.4 and embedded PowerPC systems, put small global
18277 data in the @samp{.sdata} section.  Put small uninitialized global
18278 data in the @samp{.sbss} section.  Do not use register @code{r13}
18279 to address small data however.  This is the default behavior unless
18280 other @option{-msdata} options are used.
18282 @item -msdata=none
18283 @itemx -mno-sdata
18284 @opindex msdata=none
18285 @opindex mno-sdata
18286 On embedded PowerPC systems, put all initialized global and static data
18287 in the @samp{.data} section, and all uninitialized data in the
18288 @samp{.bss} section.
18290 @item -mblock-move-inline-limit=@var{num}
18291 @opindex mblock-move-inline-limit
18292 Inline all block moves (such as calls to @code{memcpy} or structure
18293 copies) less than or equal to @var{num} bytes.  The minimum value for
18294 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
18295 targets.  The default value is target-specific.
18297 @item -G @var{num}
18298 @opindex G
18299 @cindex smaller data references (PowerPC)
18300 @cindex .sdata/.sdata2 references (PowerPC)
18301 On embedded PowerPC systems, put global and static items less than or
18302 equal to @var{num} bytes into the small data or BSS sections instead of
18303 the normal data or BSS section.  By default, @var{num} is 8.  The
18304 @option{-G @var{num}} switch is also passed to the linker.
18305 All modules should be compiled with the same @option{-G @var{num}} value.
18307 @item -mregnames
18308 @itemx -mno-regnames
18309 @opindex mregnames
18310 @opindex mno-regnames
18311 On System V.4 and embedded PowerPC systems do (do not) emit register
18312 names in the assembly language output using symbolic forms.
18314 @item -mlongcall
18315 @itemx -mno-longcall
18316 @opindex mlongcall
18317 @opindex mno-longcall
18318 By default assume that all calls are far away so that a longer and more
18319 expensive calling sequence is required.  This is required for calls
18320 farther than 32 megabytes (33,554,432 bytes) from the current location.
18321 A short call is generated if the compiler knows
18322 the call cannot be that far away.  This setting can be overridden by
18323 the @code{shortcall} function attribute, or by @code{#pragma
18324 longcall(0)}.
18326 Some linkers are capable of detecting out-of-range calls and generating
18327 glue code on the fly.  On these systems, long calls are unnecessary and
18328 generate slower code.  As of this writing, the AIX linker can do this,
18329 as can the GNU linker for PowerPC/64.  It is planned to add this feature
18330 to the GNU linker for 32-bit PowerPC systems as well.
18332 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
18333 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
18334 addresses represent the callee and the branch island.  The
18335 Darwin/PPC linker prefers the first address and generates a @code{bl
18336 callee} if the PPC @code{bl} instruction reaches the callee directly;
18337 otherwise, the linker generates @code{bl L42} to call the branch
18338 island.  The branch island is appended to the body of the
18339 calling function; it computes the full 32-bit address of the callee
18340 and jumps to it.
18342 On Mach-O (Darwin) systems, this option directs the compiler emit to
18343 the glue for every direct call, and the Darwin linker decides whether
18344 to use or discard it.
18346 In the future, GCC may ignore all longcall specifications
18347 when the linker is known to generate glue.
18349 @item -mtls-markers
18350 @itemx -mno-tls-markers
18351 @opindex mtls-markers
18352 @opindex mno-tls-markers
18353 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
18354 specifying the function argument.  The relocation allows the linker to
18355 reliably associate function call with argument setup instructions for
18356 TLS optimization, which in turn allows GCC to better schedule the
18357 sequence.
18359 @item -pthread
18360 @opindex pthread
18361 Adds support for multithreading with the @dfn{pthreads} library.
18362 This option sets flags for both the preprocessor and linker.
18364 @item -mrecip
18365 @itemx -mno-recip
18366 @opindex mrecip
18367 This option enables use of the reciprocal estimate and
18368 reciprocal square root estimate instructions with additional
18369 Newton-Raphson steps to increase precision instead of doing a divide or
18370 square root and divide for floating-point arguments.  You should use
18371 the @option{-ffast-math} option when using @option{-mrecip} (or at
18372 least @option{-funsafe-math-optimizations},
18373 @option{-finite-math-only}, @option{-freciprocal-math} and
18374 @option{-fno-trapping-math}).  Note that while the throughput of the
18375 sequence is generally higher than the throughput of the non-reciprocal
18376 instruction, the precision of the sequence can be decreased by up to 2
18377 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
18378 roots.
18380 @item -mrecip=@var{opt}
18381 @opindex mrecip=opt
18382 This option controls which reciprocal estimate instructions
18383 may be used.  @var{opt} is a comma-separated list of options, which may
18384 be preceded by a @code{!} to invert the option:
18385 @code{all}: enable all estimate instructions,
18386 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
18387 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
18388 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
18389 @code{divf}: enable the single-precision reciprocal approximation instructions;
18390 @code{divd}: enable the double-precision reciprocal approximation instructions;
18391 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
18392 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
18393 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
18395 So, for example, @option{-mrecip=all,!rsqrtd} enables
18396 all of the reciprocal estimate instructions, except for the
18397 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
18398 which handle the double-precision reciprocal square root calculations.
18400 @item -mrecip-precision
18401 @itemx -mno-recip-precision
18402 @opindex mrecip-precision
18403 Assume (do not assume) that the reciprocal estimate instructions
18404 provide higher-precision estimates than is mandated by the PowerPC
18405 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
18406 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
18407 The double-precision square root estimate instructions are not generated by
18408 default on low-precision machines, since they do not provide an
18409 estimate that converges after three steps.
18411 @item -mveclibabi=@var{type}
18412 @opindex mveclibabi
18413 Specifies the ABI type to use for vectorizing intrinsics using an
18414 external library.  The only type supported at present is @code{mass},
18415 which specifies to use IBM's Mathematical Acceleration Subsystem
18416 (MASS) libraries for vectorizing intrinsics using external libraries.
18417 GCC currently emits calls to @code{acosd2}, @code{acosf4},
18418 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
18419 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
18420 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
18421 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
18422 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
18423 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
18424 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
18425 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
18426 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
18427 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
18428 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
18429 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
18430 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
18431 for power7.  Both @option{-ftree-vectorize} and
18432 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
18433 libraries must be specified at link time.
18435 @item -mfriz
18436 @itemx -mno-friz
18437 @opindex mfriz
18438 Generate (do not generate) the @code{friz} instruction when the
18439 @option{-funsafe-math-optimizations} option is used to optimize
18440 rounding of floating-point values to 64-bit integer and back to floating
18441 point.  The @code{friz} instruction does not return the same value if
18442 the floating-point number is too large to fit in an integer.
18444 @item -mpointers-to-nested-functions
18445 @itemx -mno-pointers-to-nested-functions
18446 @opindex mpointers-to-nested-functions
18447 Generate (do not generate) code to load up the static chain register
18448 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
18449 systems where a function pointer points to a 3-word descriptor giving
18450 the function address, TOC value to be loaded in register @var{r2}, and
18451 static chain value to be loaded in register @var{r11}.  The
18452 @option{-mpointers-to-nested-functions} is on by default.  You cannot
18453 call through pointers to nested functions or pointers
18454 to functions compiled in other languages that use the static chain if
18455 you use the @option{-mno-pointers-to-nested-functions}.
18457 @item -msave-toc-indirect
18458 @itemx -mno-save-toc-indirect
18459 @opindex msave-toc-indirect
18460 Generate (do not generate) code to save the TOC value in the reserved
18461 stack location in the function prologue if the function calls through
18462 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
18463 saved in the prologue, it is saved just before the call through the
18464 pointer.  The @option{-mno-save-toc-indirect} option is the default.
18466 @item -mcompat-align-parm
18467 @itemx -mno-compat-align-parm
18468 @opindex mcompat-align-parm
18469 Generate (do not generate) code to pass structure parameters with a
18470 maximum alignment of 64 bits, for compatibility with older versions
18471 of GCC.
18473 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
18474 structure parameter on a 128-bit boundary when that structure contained
18475 a member requiring 128-bit alignment.  This is corrected in more
18476 recent versions of GCC.  This option may be used to generate code
18477 that is compatible with functions compiled with older versions of
18478 GCC.
18480 The @option{-mno-compat-align-parm} option is the default.
18481 @end table
18483 @node RX Options
18484 @subsection RX Options
18485 @cindex RX Options
18487 These command-line options are defined for RX targets:
18489 @table @gcctabopt
18490 @item -m64bit-doubles
18491 @itemx -m32bit-doubles
18492 @opindex m64bit-doubles
18493 @opindex m32bit-doubles
18494 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18495 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18496 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
18497 works on 32-bit values, which is why the default is
18498 @option{-m32bit-doubles}.
18500 @item -fpu
18501 @itemx -nofpu
18502 @opindex fpu
18503 @opindex nofpu
18504 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
18505 floating-point hardware.  The default is enabled for the @var{RX600}
18506 series and disabled for the @var{RX200} series.
18508 Floating-point instructions are only generated for 32-bit floating-point 
18509 values, however, so the FPU hardware is not used for doubles if the
18510 @option{-m64bit-doubles} option is used.
18512 @emph{Note} If the @option{-fpu} option is enabled then
18513 @option{-funsafe-math-optimizations} is also enabled automatically.
18514 This is because the RX FPU instructions are themselves unsafe.
18516 @item -mcpu=@var{name}
18517 @opindex -mcpu
18518 Selects the type of RX CPU to be targeted.  Currently three types are
18519 supported, the generic @var{RX600} and @var{RX200} series hardware and
18520 the specific @var{RX610} CPU.  The default is @var{RX600}.
18522 The only difference between @var{RX600} and @var{RX610} is that the
18523 @var{RX610} does not support the @code{MVTIPL} instruction.
18525 The @var{RX200} series does not have a hardware floating-point unit
18526 and so @option{-nofpu} is enabled by default when this type is
18527 selected.
18529 @item -mbig-endian-data
18530 @itemx -mlittle-endian-data
18531 @opindex mbig-endian-data
18532 @opindex mlittle-endian-data
18533 Store data (but not code) in the big-endian format.  The default is
18534 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
18535 format.
18537 @item -msmall-data-limit=@var{N}
18538 @opindex msmall-data-limit
18539 Specifies the maximum size in bytes of global and static variables
18540 which can be placed into the small data area.  Using the small data
18541 area can lead to smaller and faster code, but the size of area is
18542 limited and it is up to the programmer to ensure that the area does
18543 not overflow.  Also when the small data area is used one of the RX's
18544 registers (usually @code{r13}) is reserved for use pointing to this
18545 area, so it is no longer available for use by the compiler.  This
18546 could result in slower and/or larger code if variables are pushed onto
18547 the stack instead of being held in this register.
18549 Note, common variables (variables that have not been initialized) and
18550 constants are not placed into the small data area as they are assigned
18551 to other sections in the output executable.
18553 The default value is zero, which disables this feature.  Note, this
18554 feature is not enabled by default with higher optimization levels
18555 (@option{-O2} etc) because of the potentially detrimental effects of
18556 reserving a register.  It is up to the programmer to experiment and
18557 discover whether this feature is of benefit to their program.  See the
18558 description of the @option{-mpid} option for a description of how the
18559 actual register to hold the small data area pointer is chosen.
18561 @item -msim
18562 @itemx -mno-sim
18563 @opindex msim
18564 @opindex mno-sim
18565 Use the simulator runtime.  The default is to use the libgloss
18566 board-specific runtime.
18568 @item -mas100-syntax
18569 @itemx -mno-as100-syntax
18570 @opindex mas100-syntax
18571 @opindex mno-as100-syntax
18572 When generating assembler output use a syntax that is compatible with
18573 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
18574 assembler, but it has some restrictions so it is not generated by default.
18576 @item -mmax-constant-size=@var{N}
18577 @opindex mmax-constant-size
18578 Specifies the maximum size, in bytes, of a constant that can be used as
18579 an operand in a RX instruction.  Although the RX instruction set does
18580 allow constants of up to 4 bytes in length to be used in instructions,
18581 a longer value equates to a longer instruction.  Thus in some
18582 circumstances it can be beneficial to restrict the size of constants
18583 that are used in instructions.  Constants that are too big are instead
18584 placed into a constant pool and referenced via register indirection.
18586 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
18587 or 4 means that constants of any size are allowed.
18589 @item -mrelax
18590 @opindex mrelax
18591 Enable linker relaxation.  Linker relaxation is a process whereby the
18592 linker attempts to reduce the size of a program by finding shorter
18593 versions of various instructions.  Disabled by default.
18595 @item -mint-register=@var{N}
18596 @opindex mint-register
18597 Specify the number of registers to reserve for fast interrupt handler
18598 functions.  The value @var{N} can be between 0 and 4.  A value of 1
18599 means that register @code{r13} is reserved for the exclusive use
18600 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
18601 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
18602 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
18603 A value of 0, the default, does not reserve any registers.
18605 @item -msave-acc-in-interrupts
18606 @opindex msave-acc-in-interrupts
18607 Specifies that interrupt handler functions should preserve the
18608 accumulator register.  This is only necessary if normal code might use
18609 the accumulator register, for example because it performs 64-bit
18610 multiplications.  The default is to ignore the accumulator as this
18611 makes the interrupt handlers faster.
18613 @item -mpid
18614 @itemx -mno-pid
18615 @opindex mpid
18616 @opindex mno-pid
18617 Enables the generation of position independent data.  When enabled any
18618 access to constant data is done via an offset from a base address
18619 held in a register.  This allows the location of constant data to be
18620 determined at run time without requiring the executable to be
18621 relocated, which is a benefit to embedded applications with tight
18622 memory constraints.  Data that can be modified is not affected by this
18623 option.
18625 Note, using this feature reserves a register, usually @code{r13}, for
18626 the constant data base address.  This can result in slower and/or
18627 larger code, especially in complicated functions.
18629 The actual register chosen to hold the constant data base address
18630 depends upon whether the @option{-msmall-data-limit} and/or the
18631 @option{-mint-register} command-line options are enabled.  Starting
18632 with register @code{r13} and proceeding downwards, registers are
18633 allocated first to satisfy the requirements of @option{-mint-register},
18634 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
18635 is possible for the small data area register to be @code{r8} if both
18636 @option{-mint-register=4} and @option{-mpid} are specified on the
18637 command line.
18639 By default this feature is not enabled.  The default can be restored
18640 via the @option{-mno-pid} command-line option.
18642 @item -mno-warn-multiple-fast-interrupts
18643 @itemx -mwarn-multiple-fast-interrupts
18644 @opindex mno-warn-multiple-fast-interrupts
18645 @opindex mwarn-multiple-fast-interrupts
18646 Prevents GCC from issuing a warning message if it finds more than one
18647 fast interrupt handler when it is compiling a file.  The default is to
18648 issue a warning for each extra fast interrupt handler found, as the RX
18649 only supports one such interrupt.
18651 @end table
18653 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
18654 has special significance to the RX port when used with the
18655 @code{interrupt} function attribute.  This attribute indicates a
18656 function intended to process fast interrupts.  GCC ensures
18657 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
18658 and/or @code{r13} and only provided that the normal use of the
18659 corresponding registers have been restricted via the
18660 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
18661 options.
18663 @node S/390 and zSeries Options
18664 @subsection S/390 and zSeries Options
18665 @cindex S/390 and zSeries Options
18667 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
18669 @table @gcctabopt
18670 @item -mhard-float
18671 @itemx -msoft-float
18672 @opindex mhard-float
18673 @opindex msoft-float
18674 Use (do not use) the hardware floating-point instructions and registers
18675 for floating-point operations.  When @option{-msoft-float} is specified,
18676 functions in @file{libgcc.a} are used to perform floating-point
18677 operations.  When @option{-mhard-float} is specified, the compiler
18678 generates IEEE floating-point instructions.  This is the default.
18680 @item -mhard-dfp
18681 @itemx -mno-hard-dfp
18682 @opindex mhard-dfp
18683 @opindex mno-hard-dfp
18684 Use (do not use) the hardware decimal-floating-point instructions for
18685 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
18686 specified, functions in @file{libgcc.a} are used to perform
18687 decimal-floating-point operations.  When @option{-mhard-dfp} is
18688 specified, the compiler generates decimal-floating-point hardware
18689 instructions.  This is the default for @option{-march=z9-ec} or higher.
18691 @item -mlong-double-64
18692 @itemx -mlong-double-128
18693 @opindex mlong-double-64
18694 @opindex mlong-double-128
18695 These switches control the size of @code{long double} type. A size
18696 of 64 bits makes the @code{long double} type equivalent to the @code{double}
18697 type. This is the default.
18699 @item -mbackchain
18700 @itemx -mno-backchain
18701 @opindex mbackchain
18702 @opindex mno-backchain
18703 Store (do not store) the address of the caller's frame as backchain pointer
18704 into the callee's stack frame.
18705 A backchain may be needed to allow debugging using tools that do not understand
18706 DWARF 2 call frame information.
18707 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
18708 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
18709 the backchain is placed into the topmost word of the 96/160 byte register
18710 save area.
18712 In general, code compiled with @option{-mbackchain} is call-compatible with
18713 code compiled with @option{-mmo-backchain}; however, use of the backchain
18714 for debugging purposes usually requires that the whole binary is built with
18715 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
18716 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18717 to build a linux kernel use @option{-msoft-float}.
18719 The default is to not maintain the backchain.
18721 @item -mpacked-stack
18722 @itemx -mno-packed-stack
18723 @opindex mpacked-stack
18724 @opindex mno-packed-stack
18725 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
18726 specified, the compiler uses the all fields of the 96/160 byte register save
18727 area only for their default purpose; unused fields still take up stack space.
18728 When @option{-mpacked-stack} is specified, register save slots are densely
18729 packed at the top of the register save area; unused space is reused for other
18730 purposes, allowing for more efficient use of the available stack space.
18731 However, when @option{-mbackchain} is also in effect, the topmost word of
18732 the save area is always used to store the backchain, and the return address
18733 register is always saved two words below the backchain.
18735 As long as the stack frame backchain is not used, code generated with
18736 @option{-mpacked-stack} is call-compatible with code generated with
18737 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
18738 S/390 or zSeries generated code that uses the stack frame backchain at run
18739 time, not just for debugging purposes.  Such code is not call-compatible
18740 with code compiled with @option{-mpacked-stack}.  Also, note that the
18741 combination of @option{-mbackchain},
18742 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18743 to build a linux kernel use @option{-msoft-float}.
18745 The default is to not use the packed stack layout.
18747 @item -msmall-exec
18748 @itemx -mno-small-exec
18749 @opindex msmall-exec
18750 @opindex mno-small-exec
18751 Generate (or do not generate) code using the @code{bras} instruction
18752 to do subroutine calls.
18753 This only works reliably if the total executable size does not
18754 exceed 64k.  The default is to use the @code{basr} instruction instead,
18755 which does not have this limitation.
18757 @item -m64
18758 @itemx -m31
18759 @opindex m64
18760 @opindex m31
18761 When @option{-m31} is specified, generate code compliant to the
18762 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
18763 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
18764 particular to generate 64-bit instructions.  For the @samp{s390}
18765 targets, the default is @option{-m31}, while the @samp{s390x}
18766 targets default to @option{-m64}.
18768 @item -mzarch
18769 @itemx -mesa
18770 @opindex mzarch
18771 @opindex mesa
18772 When @option{-mzarch} is specified, generate code using the
18773 instructions available on z/Architecture.
18774 When @option{-mesa} is specified, generate code using the
18775 instructions available on ESA/390.  Note that @option{-mesa} is
18776 not possible with @option{-m64}.
18777 When generating code compliant to the GNU/Linux for S/390 ABI,
18778 the default is @option{-mesa}.  When generating code compliant
18779 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
18781 @item -mmvcle
18782 @itemx -mno-mvcle
18783 @opindex mmvcle
18784 @opindex mno-mvcle
18785 Generate (or do not generate) code using the @code{mvcle} instruction
18786 to perform block moves.  When @option{-mno-mvcle} is specified,
18787 use a @code{mvc} loop instead.  This is the default unless optimizing for
18788 size.
18790 @item -mdebug
18791 @itemx -mno-debug
18792 @opindex mdebug
18793 @opindex mno-debug
18794 Print (or do not print) additional debug information when compiling.
18795 The default is to not print debug information.
18797 @item -march=@var{cpu-type}
18798 @opindex march
18799 Generate code that runs on @var{cpu-type}, which is the name of a system
18800 representing a certain processor type.  Possible values for
18801 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
18802 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
18803 When generating code using the instructions available on z/Architecture,
18804 the default is @option{-march=z900}.  Otherwise, the default is
18805 @option{-march=g5}.
18807 @item -mtune=@var{cpu-type}
18808 @opindex mtune
18809 Tune to @var{cpu-type} everything applicable about the generated code,
18810 except for the ABI and the set of available instructions.
18811 The list of @var{cpu-type} values is the same as for @option{-march}.
18812 The default is the value used for @option{-march}.
18814 @item -mtpf-trace
18815 @itemx -mno-tpf-trace
18816 @opindex mtpf-trace
18817 @opindex mno-tpf-trace
18818 Generate code that adds (does not add) in TPF OS specific branches to trace
18819 routines in the operating system.  This option is off by default, even
18820 when compiling for the TPF OS@.
18822 @item -mfused-madd
18823 @itemx -mno-fused-madd
18824 @opindex mfused-madd
18825 @opindex mno-fused-madd
18826 Generate code that uses (does not use) the floating-point multiply and
18827 accumulate instructions.  These instructions are generated by default if
18828 hardware floating point is used.
18830 @item -mwarn-framesize=@var{framesize}
18831 @opindex mwarn-framesize
18832 Emit a warning if the current function exceeds the given frame size.  Because
18833 this is a compile-time check it doesn't need to be a real problem when the program
18834 runs.  It is intended to identify functions that most probably cause
18835 a stack overflow.  It is useful to be used in an environment with limited stack
18836 size e.g.@: the linux kernel.
18838 @item -mwarn-dynamicstack
18839 @opindex mwarn-dynamicstack
18840 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
18841 arrays.  This is generally a bad idea with a limited stack size.
18843 @item -mstack-guard=@var{stack-guard}
18844 @itemx -mstack-size=@var{stack-size}
18845 @opindex mstack-guard
18846 @opindex mstack-size
18847 If these options are provided the S/390 back end emits additional instructions in
18848 the function prologue that trigger a trap if the stack size is @var{stack-guard}
18849 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
18850 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
18851 the frame size of the compiled function is chosen.
18852 These options are intended to be used to help debugging stack overflow problems.
18853 The additionally emitted code causes only little overhead and hence can also be
18854 used in production-like systems without greater performance degradation.  The given
18855 values have to be exact powers of 2 and @var{stack-size} has to be greater than
18856 @var{stack-guard} without exceeding 64k.
18857 In order to be efficient the extra code makes the assumption that the stack starts
18858 at an address aligned to the value given by @var{stack-size}.
18859 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
18860 @end table
18862 @node Score Options
18863 @subsection Score Options
18864 @cindex Score Options
18866 These options are defined for Score implementations:
18868 @table @gcctabopt
18869 @item -meb
18870 @opindex meb
18871 Compile code for big-endian mode.  This is the default.
18873 @item -mel
18874 @opindex mel
18875 Compile code for little-endian mode.
18877 @item -mnhwloop
18878 @opindex mnhwloop
18879 Disable generation of @code{bcnz} instructions.
18881 @item -muls
18882 @opindex muls
18883 Enable generation of unaligned load and store instructions.
18885 @item -mmac
18886 @opindex mmac
18887 Enable the use of multiply-accumulate instructions. Disabled by default.
18889 @item -mscore5
18890 @opindex mscore5
18891 Specify the SCORE5 as the target architecture.
18893 @item -mscore5u
18894 @opindex mscore5u
18895 Specify the SCORE5U of the target architecture.
18897 @item -mscore7
18898 @opindex mscore7
18899 Specify the SCORE7 as the target architecture. This is the default.
18901 @item -mscore7d
18902 @opindex mscore7d
18903 Specify the SCORE7D as the target architecture.
18904 @end table
18906 @node SH Options
18907 @subsection SH Options
18909 These @samp{-m} options are defined for the SH implementations:
18911 @table @gcctabopt
18912 @item -m1
18913 @opindex m1
18914 Generate code for the SH1.
18916 @item -m2
18917 @opindex m2
18918 Generate code for the SH2.
18920 @item -m2e
18921 Generate code for the SH2e.
18923 @item -m2a-nofpu
18924 @opindex m2a-nofpu
18925 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18926 that the floating-point unit is not used.
18928 @item -m2a-single-only
18929 @opindex m2a-single-only
18930 Generate code for the SH2a-FPU, in such a way that no double-precision
18931 floating-point operations are used.
18933 @item -m2a-single
18934 @opindex m2a-single
18935 Generate code for the SH2a-FPU assuming the floating-point unit is in
18936 single-precision mode by default.
18938 @item -m2a
18939 @opindex m2a
18940 Generate code for the SH2a-FPU assuming the floating-point unit is in
18941 double-precision mode by default.
18943 @item -m3
18944 @opindex m3
18945 Generate code for the SH3.
18947 @item -m3e
18948 @opindex m3e
18949 Generate code for the SH3e.
18951 @item -m4-nofpu
18952 @opindex m4-nofpu
18953 Generate code for the SH4 without a floating-point unit.
18955 @item -m4-single-only
18956 @opindex m4-single-only
18957 Generate code for the SH4 with a floating-point unit that only
18958 supports single-precision arithmetic.
18960 @item -m4-single
18961 @opindex m4-single
18962 Generate code for the SH4 assuming the floating-point unit is in
18963 single-precision mode by default.
18965 @item -m4
18966 @opindex m4
18967 Generate code for the SH4.
18969 @item -m4a-nofpu
18970 @opindex m4a-nofpu
18971 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
18972 floating-point unit is not used.
18974 @item -m4a-single-only
18975 @opindex m4a-single-only
18976 Generate code for the SH4a, in such a way that no double-precision
18977 floating-point operations are used.
18979 @item -m4a-single
18980 @opindex m4a-single
18981 Generate code for the SH4a assuming the floating-point unit is in
18982 single-precision mode by default.
18984 @item -m4a
18985 @opindex m4a
18986 Generate code for the SH4a.
18988 @item -m4al
18989 @opindex m4al
18990 Same as @option{-m4a-nofpu}, except that it implicitly passes
18991 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18992 instructions at the moment.
18994 @item -mb
18995 @opindex mb
18996 Compile code for the processor in big-endian mode.
18998 @item -ml
18999 @opindex ml
19000 Compile code for the processor in little-endian mode.
19002 @item -mdalign
19003 @opindex mdalign
19004 Align doubles at 64-bit boundaries.  Note that this changes the calling
19005 conventions, and thus some functions from the standard C library do
19006 not work unless you recompile it first with @option{-mdalign}.
19008 @item -mrelax
19009 @opindex mrelax
19010 Shorten some address references at link time, when possible; uses the
19011 linker option @option{-relax}.
19013 @item -mbigtable
19014 @opindex mbigtable
19015 Use 32-bit offsets in @code{switch} tables.  The default is to use
19016 16-bit offsets.
19018 @item -mbitops
19019 @opindex mbitops
19020 Enable the use of bit manipulation instructions on SH2A.
19022 @item -mfmovd
19023 @opindex mfmovd
19024 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
19025 alignment constraints.
19027 @item -mhitachi
19028 @opindex mhitachi
19029 Comply with the calling conventions defined by Renesas.
19031 @item -mrenesas
19032 @opindex mhitachi
19033 Comply with the calling conventions defined by Renesas.
19035 @item -mno-renesas
19036 @opindex mhitachi
19037 Comply with the calling conventions defined for GCC before the Renesas
19038 conventions were available.  This option is the default for all
19039 targets of the SH toolchain.
19041 @item -mnomacsave
19042 @opindex mnomacsave
19043 Mark the @code{MAC} register as call-clobbered, even if
19044 @option{-mhitachi} is given.
19046 @item -mieee
19047 @itemx -mno-ieee
19048 @opindex mieee
19049 @opindex mnoieee
19050 Control the IEEE compliance of floating-point comparisons, which affects the
19051 handling of cases where the result of a comparison is unordered.  By default
19052 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
19053 enabled @option{-mno-ieee} is implicitly set, which results in faster
19054 floating-point greater-equal and less-equal comparisons.  The implcit settings
19055 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
19057 @item -minline-ic_invalidate
19058 @opindex minline-ic_invalidate
19059 Inline code to invalidate instruction cache entries after setting up
19060 nested function trampolines.
19061 This option has no effect if @option{-musermode} is in effect and the selected
19062 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
19063 instruction.
19064 If the selected code generation option does not allow the use of the @code{icbi}
19065 instruction, and @option{-musermode} is not in effect, the inlined code
19066 manipulates the instruction cache address array directly with an associative
19067 write.  This not only requires privileged mode at run time, but it also
19068 fails if the cache line had been mapped via the TLB and has become unmapped.
19070 @item -misize
19071 @opindex misize
19072 Dump instruction size and location in the assembly code.
19074 @item -mpadstruct
19075 @opindex mpadstruct
19076 This option is deprecated.  It pads structures to multiple of 4 bytes,
19077 which is incompatible with the SH ABI@.
19079 @item -matomic-model=@var{model}
19080 @opindex matomic-model=@var{model}
19081 Sets the model of atomic operations and additional parameters as a comma
19082 separated list.  For details on the atomic built-in functions see
19083 @ref{__atomic Builtins}.  The following models and parameters are supported:
19085 @table @samp
19087 @item none
19088 Disable compiler generated atomic sequences and emit library calls for atomic
19089 operations.  This is the default if the target is not @code{sh-*-linux*}.
19091 @item soft-gusa
19092 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
19093 built-in functions.  The generated atomic sequences require additional support
19094 from the interrupt/exception handling code of the system and are only suitable
19095 for SH3* and SH4* single-core systems.  This option is enabled by default when
19096 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
19097 this option will also partially utilize the hardware atomic instructions
19098 @code{movli.l} and @code{movco.l} to create more efficient code, unless
19099 @samp{strict} is specified.  
19101 @item soft-tcb
19102 Generate software atomic sequences that use a variable in the thread control
19103 block.  This is a variation of the gUSA sequences which can also be used on
19104 SH1* and SH2* targets.  The generated atomic sequences require additional
19105 support from the interrupt/exception handling code of the system and are only
19106 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
19107 parameter has to be specified as well.
19109 @item soft-imask
19110 Generate software atomic sequences that temporarily disable interrupts by
19111 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
19112 in privileged mode and is only suitable for single-core systems.  Additional
19113 support from the interrupt/exception handling code of the system is not
19114 required.  This model is enabled by default when the target is
19115 @code{sh-*-linux*} and SH1* or SH2*.
19117 @item hard-llcs
19118 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
19119 instructions only.  This is only available on SH4A and is suitable for
19120 multi-core systems.  Since the hardware instructions support only 32 bit atomic
19121 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
19122 Code compiled with this option will also be compatible with other software
19123 atomic model interrupt/exception handling systems if executed on an SH4A
19124 system.  Additional support from the interrupt/exception handling code of the
19125 system is not required for this model.
19127 @item gbr-offset=
19128 This parameter specifies the offset in bytes of the variable in the thread
19129 control block structure that should be used by the generated atomic sequences
19130 when the @samp{soft-tcb} model has been selected.  For other models this
19131 parameter is ignored.  The specified value must be an integer multiple of four
19132 and in the range 0-1020.
19134 @item strict
19135 This parameter prevents mixed usage of multiple atomic models, even though they
19136 would be compatible, and will make the compiler generate atomic sequences of the
19137 specified model only.
19139 @end table
19141 @item -mtas
19142 @opindex mtas
19143 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
19144 Notice that depending on the particular hardware and software configuration
19145 this can degrade overall performance due to the operand cache line flushes
19146 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
19147 processors the @code{tas.b} instruction must be used with caution since it
19148 can result in data corruption for certain cache configurations.
19150 @item -mspace
19151 @opindex mspace
19152 Optimize for space instead of speed.  Implied by @option{-Os}.
19154 @item -mprefergot
19155 @opindex mprefergot
19156 When generating position-independent code, emit function calls using
19157 the Global Offset Table instead of the Procedure Linkage Table.
19159 @item -musermode
19160 @opindex musermode
19161 Don't generate privileged mode only code.  This option
19162 implies @option{-mno-inline-ic_invalidate}
19163 if the inlined code would not work in user mode.
19164 This is the default when the target is @code{sh-*-linux*}.
19166 @item -multcost=@var{number}
19167 @opindex multcost=@var{number}
19168 Set the cost to assume for a multiply insn.
19170 @item -mdiv=@var{strategy}
19171 @opindex mdiv=@var{strategy}
19172 Set the division strategy to be used for integer division operations.
19173 For SHmedia @var{strategy} can be one of: 
19175 @table @samp
19177 @item fp 
19178 Performs the operation in floating point.  This has a very high latency,
19179 but needs only a few instructions, so it might be a good choice if
19180 your code has enough easily-exploitable ILP to allow the compiler to
19181 schedule the floating-point instructions together with other instructions.
19182 Division by zero causes a floating-point exception.
19184 @item inv
19185 Uses integer operations to calculate the inverse of the divisor,
19186 and then multiplies the dividend with the inverse.  This strategy allows
19187 CSE and hoisting of the inverse calculation.  Division by zero calculates
19188 an unspecified result, but does not trap.
19190 @item inv:minlat
19191 A variant of @samp{inv} where, if no CSE or hoisting opportunities
19192 have been found, or if the entire operation has been hoisted to the same
19193 place, the last stages of the inverse calculation are intertwined with the
19194 final multiply to reduce the overall latency, at the expense of using a few
19195 more instructions, and thus offering fewer scheduling opportunities with
19196 other code.
19198 @item call
19199 Calls a library function that usually implements the @samp{inv:minlat}
19200 strategy.
19201 This gives high code density for @code{m5-*media-nofpu} compilations.
19203 @item call2
19204 Uses a different entry point of the same library function, where it
19205 assumes that a pointer to a lookup table has already been set up, which
19206 exposes the pointer load to CSE and code hoisting optimizations.
19208 @item inv:call
19209 @itemx inv:call2
19210 @itemx inv:fp
19211 Use the @samp{inv} algorithm for initial
19212 code generation, but if the code stays unoptimized, revert to the @samp{call},
19213 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
19214 potentially-trapping side effect of division by zero is carried by a
19215 separate instruction, so it is possible that all the integer instructions
19216 are hoisted out, but the marker for the side effect stays where it is.
19217 A recombination to floating-point operations or a call is not possible
19218 in that case.
19220 @item inv20u
19221 @itemx inv20l
19222 Variants of the @samp{inv:minlat} strategy.  In the case
19223 that the inverse calculation is not separated from the multiply, they speed
19224 up division where the dividend fits into 20 bits (plus sign where applicable)
19225 by inserting a test to skip a number of operations in this case; this test
19226 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
19227 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
19229 @end table
19231 For targets other than SHmedia @var{strategy} can be one of:
19233 @table @samp
19235 @item call-div1
19236 Calls a library function that uses the single-step division instruction
19237 @code{div1} to perform the operation.  Division by zero calculates an
19238 unspecified result and does not trap.  This is the default except for SH4,
19239 SH2A and SHcompact.
19241 @item call-fp
19242 Calls a library function that performs the operation in double precision
19243 floating point.  Division by zero causes a floating-point exception.  This is
19244 the default for SHcompact with FPU.  Specifying this for targets that do not
19245 have a double precision FPU will default to @code{call-div1}.
19247 @item call-table
19248 Calls a library function that uses a lookup table for small divisors and
19249 the @code{div1} instruction with case distinction for larger divisors.  Division
19250 by zero calculates an unspecified result and does not trap.  This is the default
19251 for SH4.  Specifying this for targets that do not have dynamic shift
19252 instructions will default to @code{call-div1}.
19254 @end table
19256 When a division strategy has not been specified the default strategy will be
19257 selected based on the current target.  For SH2A the default strategy is to
19258 use the @code{divs} and @code{divu} instructions instead of library function
19259 calls.
19261 @item -maccumulate-outgoing-args
19262 @opindex maccumulate-outgoing-args
19263 Reserve space once for outgoing arguments in the function prologue rather
19264 than around each call.  Generally beneficial for performance and size.  Also
19265 needed for unwinding to avoid changing the stack frame around conditional code.
19267 @item -mdivsi3_libfunc=@var{name}
19268 @opindex mdivsi3_libfunc=@var{name}
19269 Set the name of the library function used for 32-bit signed division to
19270 @var{name}.
19271 This only affects the name used in the @samp{call} and @samp{inv:call}
19272 division strategies, and the compiler still expects the same
19273 sets of input/output/clobbered registers as if this option were not present.
19275 @item -mfixed-range=@var{register-range}
19276 @opindex mfixed-range
19277 Generate code treating the given register range as fixed registers.
19278 A fixed register is one that the register allocator can not use.  This is
19279 useful when compiling kernel code.  A register range is specified as
19280 two registers separated by a dash.  Multiple register ranges can be
19281 specified separated by a comma.
19283 @item -mindexed-addressing
19284 @opindex mindexed-addressing
19285 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
19286 This is only safe if the hardware and/or OS implement 32-bit wrap-around
19287 semantics for the indexed addressing mode.  The architecture allows the
19288 implementation of processors with 64-bit MMU, which the OS could use to
19289 get 32-bit addressing, but since no current hardware implementation supports
19290 this or any other way to make the indexed addressing mode safe to use in
19291 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
19293 @item -mgettrcost=@var{number}
19294 @opindex mgettrcost=@var{number}
19295 Set the cost assumed for the @code{gettr} instruction to @var{number}.
19296 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
19298 @item -mpt-fixed
19299 @opindex mpt-fixed
19300 Assume @code{pt*} instructions won't trap.  This generally generates
19301 better-scheduled code, but is unsafe on current hardware.
19302 The current architecture
19303 definition says that @code{ptabs} and @code{ptrel} trap when the target 
19304 anded with 3 is 3.
19305 This has the unintentional effect of making it unsafe to schedule these
19306 instructions before a branch, or hoist them out of a loop.  For example,
19307 @code{__do_global_ctors}, a part of @file{libgcc}
19308 that runs constructors at program
19309 startup, calls functions in a list which is delimited by @minus{}1.  With the
19310 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
19311 That means that all the constructors run a bit more quickly, but when
19312 the loop comes to the end of the list, the program crashes because @code{ptabs}
19313 loads @minus{}1 into a target register.  
19315 Since this option is unsafe for any
19316 hardware implementing the current architecture specification, the default
19317 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
19318 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
19319 this deters register allocation from using target registers for storing
19320 ordinary integers.
19322 @item -minvalid-symbols
19323 @opindex minvalid-symbols
19324 Assume symbols might be invalid.  Ordinary function symbols generated by
19325 the compiler are always valid to load with
19326 @code{movi}/@code{shori}/@code{ptabs} or
19327 @code{movi}/@code{shori}/@code{ptrel},
19328 but with assembler and/or linker tricks it is possible
19329 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
19330 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
19331 It prevents cross-basic-block CSE, hoisting and most scheduling
19332 of symbol loads.  The default is @option{-mno-invalid-symbols}.
19334 @item -mbranch-cost=@var{num}
19335 @opindex mbranch-cost=@var{num}
19336 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
19337 make the compiler try to generate more branch-free code if possible.  
19338 If not specified the value is selected depending on the processor type that
19339 is being compiled for.
19341 @item -mzdcbranch
19342 @itemx -mno-zdcbranch
19343 @opindex mzdcbranch
19344 @opindex mno-zdcbranch
19345 Assume (do not assume) that zero displacement conditional branch instructions
19346 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
19347 compiler will try to prefer zero displacement branch code sequences.  This is
19348 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
19349 disabled by specifying @option{-mno-zdcbranch}.
19351 @item -mcbranchdi
19352 @opindex mcbranchdi
19353 Enable the @code{cbranchdi4} instruction pattern.
19355 @item -mcmpeqdi
19356 @opindex mcmpeqdi
19357 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
19358 is in effect.
19360 @item -mfused-madd
19361 @itemx -mno-fused-madd
19362 @opindex mfused-madd
19363 @opindex mno-fused-madd
19364 Generate code that uses (does not use) the floating-point multiply and
19365 accumulate instructions.  These instructions are generated by default
19366 if hardware floating point is used.  The machine-dependent
19367 @option{-mfused-madd} option is now mapped to the machine-independent
19368 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19369 mapped to @option{-ffp-contract=off}.
19371 @item -mfsca
19372 @itemx -mno-fsca
19373 @opindex mfsca
19374 @opindex mno-fsca
19375 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
19376 and cosine approximations.  The option @code{-mfsca} must be used in
19377 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
19378 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
19379 approximations even if @code{-funsafe-math-optimizations} is in effect.
19381 @item -mfsrra
19382 @itemx -mno-fsrra
19383 @opindex mfsrra
19384 @opindex mno-fsrra
19385 Allow or disallow the compiler to emit the @code{fsrra} instruction for
19386 reciprocal square root approximations.  The option @code{-mfsrra} must be used
19387 in combination with @code{-funsafe-math-optimizations} and
19388 @code{-ffinite-math-only}.  It is enabled by default when generating code for
19389 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
19390 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
19391 in effect.
19393 @item -mpretend-cmove
19394 @opindex mpretend-cmove
19395 Prefer zero-displacement conditional branches for conditional move instruction
19396 patterns.  This can result in faster code on the SH4 processor.
19398 @end table
19400 @node Solaris 2 Options
19401 @subsection Solaris 2 Options
19402 @cindex Solaris 2 options
19404 These @samp{-m} options are supported on Solaris 2:
19406 @table @gcctabopt
19407 @item -mimpure-text
19408 @opindex mimpure-text
19409 @option{-mimpure-text}, used in addition to @option{-shared}, tells
19410 the compiler to not pass @option{-z text} to the linker when linking a
19411 shared object.  Using this option, you can link position-dependent
19412 code into a shared object.
19414 @option{-mimpure-text} suppresses the ``relocations remain against
19415 allocatable but non-writable sections'' linker error message.
19416 However, the necessary relocations trigger copy-on-write, and the
19417 shared object is not actually shared across processes.  Instead of
19418 using @option{-mimpure-text}, you should compile all source code with
19419 @option{-fpic} or @option{-fPIC}.
19421 @end table
19423 These switches are supported in addition to the above on Solaris 2:
19425 @table @gcctabopt
19426 @item -pthreads
19427 @opindex pthreads
19428 Add support for multithreading using the POSIX threads library.  This
19429 option sets flags for both the preprocessor and linker.  This option does
19430 not affect the thread safety of object code produced  by the compiler or
19431 that of libraries supplied with it.
19433 @item -pthread
19434 @opindex pthread
19435 This is a synonym for @option{-pthreads}.
19436 @end table
19438 @node SPARC Options
19439 @subsection SPARC Options
19440 @cindex SPARC options
19442 These @samp{-m} options are supported on the SPARC:
19444 @table @gcctabopt
19445 @item -mno-app-regs
19446 @itemx -mapp-regs
19447 @opindex mno-app-regs
19448 @opindex mapp-regs
19449 Specify @option{-mapp-regs} to generate output using the global registers
19450 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
19451 is the default.
19453 To be fully SVR4 ABI-compliant at the cost of some performance loss,
19454 specify @option{-mno-app-regs}.  You should compile libraries and system
19455 software with this option.
19457 @item -mflat
19458 @itemx -mno-flat
19459 @opindex mflat
19460 @opindex mno-flat
19461 With @option{-mflat}, the compiler does not generate save/restore instructions
19462 and uses a ``flat'' or single register window model.  This model is compatible
19463 with the regular register window model.  The local registers and the input
19464 registers (0--5) are still treated as ``call-saved'' registers and are
19465 saved on the stack as needed.
19467 With @option{-mno-flat} (the default), the compiler generates save/restore
19468 instructions (except for leaf functions).  This is the normal operating mode.
19470 @item -mfpu
19471 @itemx -mhard-float
19472 @opindex mfpu
19473 @opindex mhard-float
19474 Generate output containing floating-point instructions.  This is the
19475 default.
19477 @item -mno-fpu
19478 @itemx -msoft-float
19479 @opindex mno-fpu
19480 @opindex msoft-float
19481 Generate output containing library calls for floating point.
19482 @strong{Warning:} the requisite libraries are not available for all SPARC
19483 targets.  Normally the facilities of the machine's usual C compiler are
19484 used, but this cannot be done directly in cross-compilation.  You must make
19485 your own arrangements to provide suitable library functions for
19486 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
19487 @samp{sparclite-*-*} do provide software floating-point support.
19489 @option{-msoft-float} changes the calling convention in the output file;
19490 therefore, it is only useful if you compile @emph{all} of a program with
19491 this option.  In particular, you need to compile @file{libgcc.a}, the
19492 library that comes with GCC, with @option{-msoft-float} in order for
19493 this to work.
19495 @item -mhard-quad-float
19496 @opindex mhard-quad-float
19497 Generate output containing quad-word (long double) floating-point
19498 instructions.
19500 @item -msoft-quad-float
19501 @opindex msoft-quad-float
19502 Generate output containing library calls for quad-word (long double)
19503 floating-point instructions.  The functions called are those specified
19504 in the SPARC ABI@.  This is the default.
19506 As of this writing, there are no SPARC implementations that have hardware
19507 support for the quad-word floating-point instructions.  They all invoke
19508 a trap handler for one of these instructions, and then the trap handler
19509 emulates the effect of the instruction.  Because of the trap handler overhead,
19510 this is much slower than calling the ABI library routines.  Thus the
19511 @option{-msoft-quad-float} option is the default.
19513 @item -mno-unaligned-doubles
19514 @itemx -munaligned-doubles
19515 @opindex mno-unaligned-doubles
19516 @opindex munaligned-doubles
19517 Assume that doubles have 8-byte alignment.  This is the default.
19519 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
19520 alignment only if they are contained in another type, or if they have an
19521 absolute address.  Otherwise, it assumes they have 4-byte alignment.
19522 Specifying this option avoids some rare compatibility problems with code
19523 generated by other compilers.  It is not the default because it results
19524 in a performance loss, especially for floating-point code.
19526 @item -mno-faster-structs
19527 @itemx -mfaster-structs
19528 @opindex mno-faster-structs
19529 @opindex mfaster-structs
19530 With @option{-mfaster-structs}, the compiler assumes that structures
19531 should have 8-byte alignment.  This enables the use of pairs of
19532 @code{ldd} and @code{std} instructions for copies in structure
19533 assignment, in place of twice as many @code{ld} and @code{st} pairs.
19534 However, the use of this changed alignment directly violates the SPARC
19535 ABI@.  Thus, it's intended only for use on targets where the developer
19536 acknowledges that their resulting code is not directly in line with
19537 the rules of the ABI@.
19539 @item -mcpu=@var{cpu_type}
19540 @opindex mcpu
19541 Set the instruction set, register set, and instruction scheduling parameters
19542 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
19543 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
19544 @samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934},
19545 @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
19546 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
19547 @samp{niagara3} and @samp{niagara4}.
19549 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
19550 which selects the best architecture option for the host processor.
19551 @option{-mcpu=native} has no effect if GCC does not recognize
19552 the processor.
19554 Default instruction scheduling parameters are used for values that select
19555 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
19556 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
19558 Here is a list of each supported architecture and their supported
19559 implementations.
19561 @table @asis
19562 @item v7
19563 cypress
19565 @item v8
19566 supersparc, hypersparc, leon, leon3
19568 @item sparclite
19569 f930, f934, sparclite86x
19571 @item sparclet
19572 tsc701
19574 @item v9
19575 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
19576 @end table
19578 By default (unless configured otherwise), GCC generates code for the V7
19579 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
19580 additionally optimizes it for the Cypress CY7C602 chip, as used in the
19581 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
19582 SPARCStation 1, 2, IPX etc.
19584 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
19585 architecture.  The only difference from V7 code is that the compiler emits
19586 the integer multiply and integer divide instructions which exist in SPARC-V8
19587 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
19588 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
19589 2000 series.
19591 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
19592 the SPARC architecture.  This adds the integer multiply, integer divide step
19593 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
19594 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
19595 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
19596 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
19597 MB86934 chip, which is the more recent SPARClite with FPU@.
19599 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
19600 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
19601 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
19602 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
19603 optimizes it for the TEMIC SPARClet chip.
19605 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
19606 architecture.  This adds 64-bit integer and floating-point move instructions,
19607 3 additional floating-point condition code registers and conditional move
19608 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
19609 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
19610 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
19611 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
19612 @option{-mcpu=niagara}, the compiler additionally optimizes it for
19613 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
19614 additionally optimizes it for Sun UltraSPARC T2 chips. With
19615 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
19616 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
19617 additionally optimizes it for Sun UltraSPARC T4 chips.
19619 @item -mtune=@var{cpu_type}
19620 @opindex mtune
19621 Set the instruction scheduling parameters for machine type
19622 @var{cpu_type}, but do not set the instruction set or register set that the
19623 option @option{-mcpu=@var{cpu_type}} does.
19625 The same values for @option{-mcpu=@var{cpu_type}} can be used for
19626 @option{-mtune=@var{cpu_type}}, but the only useful values are those
19627 that select a particular CPU implementation.  Those are @samp{cypress},
19628 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930},
19629 @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
19630 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and
19631 @samp{niagara4}.  With native Solaris and GNU/Linux toolchains, @samp{native}
19632 can also be used.
19634 @item -mv8plus
19635 @itemx -mno-v8plus
19636 @opindex mv8plus
19637 @opindex mno-v8plus
19638 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
19639 difference from the V8 ABI is that the global and out registers are
19640 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
19641 mode for all SPARC-V9 processors.
19643 @item -mvis
19644 @itemx -mno-vis
19645 @opindex mvis
19646 @opindex mno-vis
19647 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
19648 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
19650 @item -mvis2
19651 @itemx -mno-vis2
19652 @opindex mvis2
19653 @opindex mno-vis2
19654 With @option{-mvis2}, GCC generates code that takes advantage of
19655 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
19656 default is @option{-mvis2} when targeting a cpu that supports such
19657 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
19658 also sets @option{-mvis}.
19660 @item -mvis3
19661 @itemx -mno-vis3
19662 @opindex mvis3
19663 @opindex mno-vis3
19664 With @option{-mvis3}, GCC generates code that takes advantage of
19665 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
19666 default is @option{-mvis3} when targeting a cpu that supports such
19667 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
19668 also sets @option{-mvis2} and @option{-mvis}.
19670 @item -mcbcond
19671 @itemx -mno-cbcond
19672 @opindex mcbcond
19673 @opindex mno-cbcond
19674 With @option{-mcbcond}, GCC generates code that takes advantage of
19675 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
19676 The default is @option{-mcbcond} when targeting a cpu that supports such
19677 instructions, such as niagara-4 and later.
19679 @item -mpopc
19680 @itemx -mno-popc
19681 @opindex mpopc
19682 @opindex mno-popc
19683 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
19684 population count instruction.  The default is @option{-mpopc}
19685 when targeting a cpu that supports such instructions, such as Niagara-2 and
19686 later.
19688 @item -mfmaf
19689 @itemx -mno-fmaf
19690 @opindex mfmaf
19691 @opindex mno-fmaf
19692 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
19693 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
19694 when targeting a cpu that supports such instructions, such as Niagara-3 and
19695 later.
19697 @item -mfix-at697f
19698 @opindex mfix-at697f
19699 Enable the documented workaround for the single erratum of the Atmel AT697F
19700 processor (which corresponds to erratum #13 of the AT697E processor).
19702 @item -mfix-ut699
19703 @opindex mfix-ut699
19704 Enable the documented workarounds for the floating-point errata and the data
19705 cache nullify errata of the UT699 processor.
19706 @end table
19708 These @samp{-m} options are supported in addition to the above
19709 on SPARC-V9 processors in 64-bit environments:
19711 @table @gcctabopt
19712 @item -m32
19713 @itemx -m64
19714 @opindex m32
19715 @opindex m64
19716 Generate code for a 32-bit or 64-bit environment.
19717 The 32-bit environment sets int, long and pointer to 32 bits.
19718 The 64-bit environment sets int to 32 bits and long and pointer
19719 to 64 bits.
19721 @item -mcmodel=@var{which}
19722 @opindex mcmodel
19723 Set the code model to one of
19725 @table @samp
19726 @item medlow
19727 The Medium/Low code model: 64-bit addresses, programs
19728 must be linked in the low 32 bits of memory.  Programs can be statically
19729 or dynamically linked.
19731 @item medmid
19732 The Medium/Middle code model: 64-bit addresses, programs
19733 must be linked in the low 44 bits of memory, the text and data segments must
19734 be less than 2GB in size and the data segment must be located within 2GB of
19735 the text segment.
19737 @item medany
19738 The Medium/Anywhere code model: 64-bit addresses, programs
19739 may be linked anywhere in memory, the text and data segments must be less
19740 than 2GB in size and the data segment must be located within 2GB of the
19741 text segment.
19743 @item embmedany
19744 The Medium/Anywhere code model for embedded systems:
19745 64-bit addresses, the text and data segments must be less than 2GB in
19746 size, both starting anywhere in memory (determined at link time).  The
19747 global register %g4 points to the base of the data segment.  Programs
19748 are statically linked and PIC is not supported.
19749 @end table
19751 @item -mmemory-model=@var{mem-model}
19752 @opindex mmemory-model
19753 Set the memory model in force on the processor to one of
19755 @table @samp
19756 @item default
19757 The default memory model for the processor and operating system.
19759 @item rmo
19760 Relaxed Memory Order
19762 @item pso
19763 Partial Store Order
19765 @item tso
19766 Total Store Order
19768 @item sc
19769 Sequential Consistency
19770 @end table
19772 These memory models are formally defined in Appendix D of the Sparc V9
19773 architecture manual, as set in the processor's @code{PSTATE.MM} field.
19775 @item -mstack-bias
19776 @itemx -mno-stack-bias
19777 @opindex mstack-bias
19778 @opindex mno-stack-bias
19779 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
19780 frame pointer if present, are offset by @minus{}2047 which must be added back
19781 when making stack frame references.  This is the default in 64-bit mode.
19782 Otherwise, assume no such offset is present.
19783 @end table
19785 @node SPU Options
19786 @subsection SPU Options
19787 @cindex SPU options
19789 These @samp{-m} options are supported on the SPU:
19791 @table @gcctabopt
19792 @item -mwarn-reloc
19793 @itemx -merror-reloc
19794 @opindex mwarn-reloc
19795 @opindex merror-reloc
19797 The loader for SPU does not handle dynamic relocations.  By default, GCC
19798 gives an error when it generates code that requires a dynamic
19799 relocation.  @option{-mno-error-reloc} disables the error,
19800 @option{-mwarn-reloc} generates a warning instead.
19802 @item -msafe-dma
19803 @itemx -munsafe-dma
19804 @opindex msafe-dma
19805 @opindex munsafe-dma
19807 Instructions that initiate or test completion of DMA must not be
19808 reordered with respect to loads and stores of the memory that is being
19809 accessed.
19810 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
19811 memory accesses, but that can lead to inefficient code in places where the
19812 memory is known to not change.  Rather than mark the memory as volatile,
19813 you can use @option{-msafe-dma} to tell the compiler to treat
19814 the DMA instructions as potentially affecting all memory.  
19816 @item -mbranch-hints
19817 @opindex mbranch-hints
19819 By default, GCC generates a branch hint instruction to avoid
19820 pipeline stalls for always-taken or probably-taken branches.  A hint
19821 is not generated closer than 8 instructions away from its branch.
19822 There is little reason to disable them, except for debugging purposes,
19823 or to make an object a little bit smaller.
19825 @item -msmall-mem
19826 @itemx -mlarge-mem
19827 @opindex msmall-mem
19828 @opindex mlarge-mem
19830 By default, GCC generates code assuming that addresses are never larger
19831 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
19832 a full 32-bit address.
19834 @item -mstdmain
19835 @opindex mstdmain
19837 By default, GCC links against startup code that assumes the SPU-style
19838 main function interface (which has an unconventional parameter list).
19839 With @option{-mstdmain}, GCC links your program against startup
19840 code that assumes a C99-style interface to @code{main}, including a
19841 local copy of @code{argv} strings.
19843 @item -mfixed-range=@var{register-range}
19844 @opindex mfixed-range
19845 Generate code treating the given register range as fixed registers.
19846 A fixed register is one that the register allocator cannot use.  This is
19847 useful when compiling kernel code.  A register range is specified as
19848 two registers separated by a dash.  Multiple register ranges can be
19849 specified separated by a comma.
19851 @item -mea32
19852 @itemx -mea64
19853 @opindex mea32
19854 @opindex mea64
19855 Compile code assuming that pointers to the PPU address space accessed
19856 via the @code{__ea} named address space qualifier are either 32 or 64
19857 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
19858 all object code in an executable must be compiled with the same setting.
19860 @item -maddress-space-conversion
19861 @itemx -mno-address-space-conversion
19862 @opindex maddress-space-conversion
19863 @opindex mno-address-space-conversion
19864 Allow/disallow treating the @code{__ea} address space as superset
19865 of the generic address space.  This enables explicit type casts
19866 between @code{__ea} and generic pointer as well as implicit
19867 conversions of generic pointers to @code{__ea} pointers.  The
19868 default is to allow address space pointer conversions.
19870 @item -mcache-size=@var{cache-size}
19871 @opindex mcache-size
19872 This option controls the version of libgcc that the compiler links to an
19873 executable and selects a software-managed cache for accessing variables
19874 in the @code{__ea} address space with a particular cache size.  Possible
19875 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
19876 and @samp{128}.  The default cache size is 64KB.
19878 @item -matomic-updates
19879 @itemx -mno-atomic-updates
19880 @opindex matomic-updates
19881 @opindex mno-atomic-updates
19882 This option controls the version of libgcc that the compiler links to an
19883 executable and selects whether atomic updates to the software-managed
19884 cache of PPU-side variables are used.  If you use atomic updates, changes
19885 to a PPU variable from SPU code using the @code{__ea} named address space
19886 qualifier do not interfere with changes to other PPU variables residing
19887 in the same cache line from PPU code.  If you do not use atomic updates,
19888 such interference may occur; however, writing back cache lines is
19889 more efficient.  The default behavior is to use atomic updates.
19891 @item -mdual-nops
19892 @itemx -mdual-nops=@var{n}
19893 @opindex mdual-nops
19894 By default, GCC inserts nops to increase dual issue when it expects
19895 it to increase performance.  @var{n} can be a value from 0 to 10.  A
19896 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
19897 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
19899 @item -mhint-max-nops=@var{n}
19900 @opindex mhint-max-nops
19901 Maximum number of nops to insert for a branch hint.  A branch hint must
19902 be at least 8 instructions away from the branch it is affecting.  GCC
19903 inserts up to @var{n} nops to enforce this, otherwise it does not
19904 generate the branch hint.
19906 @item -mhint-max-distance=@var{n}
19907 @opindex mhint-max-distance
19908 The encoding of the branch hint instruction limits the hint to be within
19909 256 instructions of the branch it is affecting.  By default, GCC makes
19910 sure it is within 125.
19912 @item -msafe-hints
19913 @opindex msafe-hints
19914 Work around a hardware bug that causes the SPU to stall indefinitely.
19915 By default, GCC inserts the @code{hbrp} instruction to make sure
19916 this stall won't happen.
19918 @end table
19920 @node System V Options
19921 @subsection Options for System V
19923 These additional options are available on System V Release 4 for
19924 compatibility with other compilers on those systems:
19926 @table @gcctabopt
19927 @item -G
19928 @opindex G
19929 Create a shared object.
19930 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
19932 @item -Qy
19933 @opindex Qy
19934 Identify the versions of each tool used by the compiler, in a
19935 @code{.ident} assembler directive in the output.
19937 @item -Qn
19938 @opindex Qn
19939 Refrain from adding @code{.ident} directives to the output file (this is
19940 the default).
19942 @item -YP,@var{dirs}
19943 @opindex YP
19944 Search the directories @var{dirs}, and no others, for libraries
19945 specified with @option{-l}.
19947 @item -Ym,@var{dir}
19948 @opindex Ym
19949 Look in the directory @var{dir} to find the M4 preprocessor.
19950 The assembler uses this option.
19951 @c This is supposed to go with a -Yd for predefined M4 macro files, but
19952 @c the generic assembler that comes with Solaris takes just -Ym.
19953 @end table
19955 @node TILE-Gx Options
19956 @subsection TILE-Gx Options
19957 @cindex TILE-Gx options
19959 These @samp{-m} options are supported on the TILE-Gx:
19961 @table @gcctabopt
19962 @item -mcmodel=small
19963 @opindex mcmodel=small
19964 Generate code for the small model.  The distance for direct calls is
19965 limited to 500M in either direction.  PC-relative addresses are 32
19966 bits.  Absolute addresses support the full address range.
19968 @item -mcmodel=large
19969 @opindex mcmodel=large
19970 Generate code for the large model.  There is no limitation on call
19971 distance, pc-relative addresses, or absolute addresses.
19973 @item -mcpu=@var{name}
19974 @opindex mcpu
19975 Selects the type of CPU to be targeted.  Currently the only supported
19976 type is @samp{tilegx}.
19978 @item -m32
19979 @itemx -m64
19980 @opindex m32
19981 @opindex m64
19982 Generate code for a 32-bit or 64-bit environment.  The 32-bit
19983 environment sets int, long, and pointer to 32 bits.  The 64-bit
19984 environment sets int to 32 bits and long and pointer to 64 bits.
19985 @end table
19987 @node TILEPro Options
19988 @subsection TILEPro Options
19989 @cindex TILEPro options
19991 These @samp{-m} options are supported on the TILEPro:
19993 @table @gcctabopt
19994 @item -mcpu=@var{name}
19995 @opindex mcpu
19996 Selects the type of CPU to be targeted.  Currently the only supported
19997 type is @samp{tilepro}.
19999 @item -m32
20000 @opindex m32
20001 Generate code for a 32-bit environment, which sets int, long, and
20002 pointer to 32 bits.  This is the only supported behavior so the flag
20003 is essentially ignored.
20004 @end table
20006 @node V850 Options
20007 @subsection V850 Options
20008 @cindex V850 Options
20010 These @samp{-m} options are defined for V850 implementations:
20012 @table @gcctabopt
20013 @item -mlong-calls
20014 @itemx -mno-long-calls
20015 @opindex mlong-calls
20016 @opindex mno-long-calls
20017 Treat all calls as being far away (near).  If calls are assumed to be
20018 far away, the compiler always loads the function's address into a
20019 register, and calls indirect through the pointer.
20021 @item -mno-ep
20022 @itemx -mep
20023 @opindex mno-ep
20024 @opindex mep
20025 Do not optimize (do optimize) basic blocks that use the same index
20026 pointer 4 or more times to copy pointer into the @code{ep} register, and
20027 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
20028 option is on by default if you optimize.
20030 @item -mno-prolog-function
20031 @itemx -mprolog-function
20032 @opindex mno-prolog-function
20033 @opindex mprolog-function
20034 Do not use (do use) external functions to save and restore registers
20035 at the prologue and epilogue of a function.  The external functions
20036 are slower, but use less code space if more than one function saves
20037 the same number of registers.  The @option{-mprolog-function} option
20038 is on by default if you optimize.
20040 @item -mspace
20041 @opindex mspace
20042 Try to make the code as small as possible.  At present, this just turns
20043 on the @option{-mep} and @option{-mprolog-function} options.
20045 @item -mtda=@var{n}
20046 @opindex mtda
20047 Put static or global variables whose size is @var{n} bytes or less into
20048 the tiny data area that register @code{ep} points to.  The tiny data
20049 area can hold up to 256 bytes in total (128 bytes for byte references).
20051 @item -msda=@var{n}
20052 @opindex msda
20053 Put static or global variables whose size is @var{n} bytes or less into
20054 the small data area that register @code{gp} points to.  The small data
20055 area can hold up to 64 kilobytes.
20057 @item -mzda=@var{n}
20058 @opindex mzda
20059 Put static or global variables whose size is @var{n} bytes or less into
20060 the first 32 kilobytes of memory.
20062 @item -mv850
20063 @opindex mv850
20064 Specify that the target processor is the V850.
20066 @item -mv850e3v5
20067 @opindex mv850e3v5
20068 Specify that the target processor is the V850E3V5.  The preprocessor
20069 constant @samp{__v850e3v5__} is defined if this option is used.
20071 @item -mv850e2v4
20072 @opindex mv850e2v4
20073 Specify that the target processor is the V850E3V5.  This is an alias for
20074 the @option{-mv850e3v5} option.
20076 @item -mv850e2v3
20077 @opindex mv850e2v3
20078 Specify that the target processor is the V850E2V3.  The preprocessor
20079 constant @samp{__v850e2v3__} is defined if this option is used.
20081 @item -mv850e2
20082 @opindex mv850e2
20083 Specify that the target processor is the V850E2.  The preprocessor
20084 constant @samp{__v850e2__} is defined if this option is used.
20086 @item -mv850e1
20087 @opindex mv850e1
20088 Specify that the target processor is the V850E1.  The preprocessor
20089 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
20090 this option is used.
20092 @item -mv850es
20093 @opindex mv850es
20094 Specify that the target processor is the V850ES.  This is an alias for
20095 the @option{-mv850e1} option.
20097 @item -mv850e
20098 @opindex mv850e
20099 Specify that the target processor is the V850E@.  The preprocessor
20100 constant @samp{__v850e__} is defined if this option is used.
20102 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
20103 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
20104 are defined then a default target processor is chosen and the
20105 relevant @samp{__v850*__} preprocessor constant is defined.
20107 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
20108 defined, regardless of which processor variant is the target.
20110 @item -mdisable-callt
20111 @itemx -mno-disable-callt
20112 @opindex mdisable-callt
20113 @opindex mno-disable-callt
20114 This option suppresses generation of the @code{CALLT} instruction for the
20115 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
20116 architecture.
20118 This option is enabled by default when the RH850 ABI is
20119 in use (see @option{-mrh850-abi}), and disabled by default when the
20120 GCC ABI is in use.  If @code{CALLT} instructions are being generated
20121 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
20123 @item -mrelax
20124 @itemx -mno-relax
20125 @opindex mrelax
20126 @opindex mno-relax
20127 Pass on (or do not pass on) the @option{-mrelax} command line option
20128 to the assembler.
20130 @item -mlong-jumps
20131 @itemx -mno-long-jumps
20132 @opindex mlong-jumps
20133 @opindex mno-long-jumps
20134 Disable (or re-enable) the generation of PC-relative jump instructions.
20136 @item -msoft-float
20137 @itemx -mhard-float
20138 @opindex msoft-float
20139 @opindex mhard-float
20140 Disable (or re-enable) the generation of hardware floating point
20141 instructions.  This option is only significant when the target
20142 architecture is @samp{V850E2V3} or higher.  If hardware floating point
20143 instructions are being generated then the C preprocessor symbol
20144 @code{__FPU_OK__} will be defined, otherwise the symbol
20145 @code{__NO_FPU__} will be defined.
20147 @item -mloop
20148 @opindex mloop
20149 Enables the use of the e3v5 LOOP instruction.  The use of this
20150 instruction is not enabled by default when the e3v5 architecture is
20151 selected because its use is still experimental.
20153 @item -mrh850-abi
20154 @itemx -mghs
20155 @opindex mrh850-abi
20156 @opindex mghs
20157 Enables support for the RH850 version of the V850 ABI.  This is the
20158 default.  With this version of the ABI the following rules apply:
20160 @itemize
20161 @item
20162 Integer sized structures and unions are returned via a memory pointer
20163 rather than a register.
20165 @item
20166 Large structures and unions (more than 8 bytes in size) are passed by
20167 value.
20169 @item
20170 Functions are aligned to 16-bit boundaries.
20172 @item
20173 The @option{-m8byte-align} command line option is supported.
20175 @item
20176 The @option{-mdisable-callt} command line option is enabled by
20177 default.  The @option{-mno-disable-callt} command line option is not
20178 supported.
20179 @end itemize
20181 When this version of the ABI is enabled the C preprocessor symbol
20182 @code{__V850_RH850_ABI__} is defined.
20184 @item -mgcc-abi
20185 @opindex mgcc-abi
20186 Enables support for the old GCC version of the V850 ABI.  With this
20187 version of the ABI the following rules apply:
20189 @itemize
20190 @item
20191 Integer sized structures and unions are returned in register @code{r10}.
20193 @item
20194 Large structures and unions (more than 8 bytes in size) are passed by
20195 reference.
20197 @item
20198 Functions are aligned to 32-bit boundaries, unless optimizing for
20199 size.
20201 @item
20202 The @option{-m8byte-align} command line option is not supported.
20204 @item
20205 The @option{-mdisable-callt} command line option is supported but not
20206 enabled by default.
20207 @end itemize
20209 When this version of the ABI is enabled the C preprocessor symbol
20210 @code{__V850_GCC_ABI__} is defined.
20212 @item -m8byte-align
20213 @itemx -mno-8byte-align
20214 @opindex m8byte-align
20215 @opindex mno-8byte-align
20216 Enables support for @code{doubles} and @code{long long} types to be
20217 aligned on 8-byte boundaries.  The default is to restrict the
20218 alignment of all objects to at most 4-bytes.  When
20219 @option{-m8byte-align} is in effect the C preprocessor symbol
20220 @code{__V850_8BYTE_ALIGN__} will be defined.
20222 @item -mbig-switch
20223 @opindex mbig-switch
20224 Generate code suitable for big switch tables.  Use this option only if
20225 the assembler/linker complain about out of range branches within a switch
20226 table.
20228 @item -mapp-regs
20229 @opindex mapp-regs
20230 This option causes r2 and r5 to be used in the code generated by
20231 the compiler.  This setting is the default.
20233 @item -mno-app-regs
20234 @opindex mno-app-regs
20235 This option causes r2 and r5 to be treated as fixed registers.
20237 @end table
20239 @node VAX Options
20240 @subsection VAX Options
20241 @cindex VAX options
20243 These @samp{-m} options are defined for the VAX:
20245 @table @gcctabopt
20246 @item -munix
20247 @opindex munix
20248 Do not output certain jump instructions (@code{aobleq} and so on)
20249 that the Unix assembler for the VAX cannot handle across long
20250 ranges.
20252 @item -mgnu
20253 @opindex mgnu
20254 Do output those jump instructions, on the assumption that the
20255 GNU assembler is being used.
20257 @item -mg
20258 @opindex mg
20259 Output code for G-format floating-point numbers instead of D-format.
20260 @end table
20262 @node VMS Options
20263 @subsection VMS Options
20265 These @samp{-m} options are defined for the VMS implementations:
20267 @table @gcctabopt
20268 @item -mvms-return-codes
20269 @opindex mvms-return-codes
20270 Return VMS condition codes from @code{main}. The default is to return POSIX-style
20271 condition (e.g.@ error) codes.
20273 @item -mdebug-main=@var{prefix}
20274 @opindex mdebug-main=@var{prefix}
20275 Flag the first routine whose name starts with @var{prefix} as the main
20276 routine for the debugger.
20278 @item -mmalloc64
20279 @opindex mmalloc64
20280 Default to 64-bit memory allocation routines.
20282 @item -mpointer-size=@var{size}
20283 @opindex -mpointer-size=@var{size}
20284 Set the default size of pointers. Possible options for @var{size} are
20285 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
20286 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
20287 The later option disables @code{pragma pointer_size}.
20288 @end table
20290 @node VxWorks Options
20291 @subsection VxWorks Options
20292 @cindex VxWorks Options
20294 The options in this section are defined for all VxWorks targets.
20295 Options specific to the target hardware are listed with the other
20296 options for that target.
20298 @table @gcctabopt
20299 @item -mrtp
20300 @opindex mrtp
20301 GCC can generate code for both VxWorks kernels and real time processes
20302 (RTPs).  This option switches from the former to the latter.  It also
20303 defines the preprocessor macro @code{__RTP__}.
20305 @item -non-static
20306 @opindex non-static
20307 Link an RTP executable against shared libraries rather than static
20308 libraries.  The options @option{-static} and @option{-shared} can
20309 also be used for RTPs (@pxref{Link Options}); @option{-static}
20310 is the default.
20312 @item -Bstatic
20313 @itemx -Bdynamic
20314 @opindex Bstatic
20315 @opindex Bdynamic
20316 These options are passed down to the linker.  They are defined for
20317 compatibility with Diab.
20319 @item -Xbind-lazy
20320 @opindex Xbind-lazy
20321 Enable lazy binding of function calls.  This option is equivalent to
20322 @option{-Wl,-z,now} and is defined for compatibility with Diab.
20324 @item -Xbind-now
20325 @opindex Xbind-now
20326 Disable lazy binding of function calls.  This option is the default and
20327 is defined for compatibility with Diab.
20328 @end table
20330 @node x86-64 Options
20331 @subsection x86-64 Options
20332 @cindex x86-64 options
20334 These are listed under @xref{i386 and x86-64 Options}.
20336 @node Xstormy16 Options
20337 @subsection Xstormy16 Options
20338 @cindex Xstormy16 Options
20340 These options are defined for Xstormy16:
20342 @table @gcctabopt
20343 @item -msim
20344 @opindex msim
20345 Choose startup files and linker script suitable for the simulator.
20346 @end table
20348 @node Xtensa Options
20349 @subsection Xtensa Options
20350 @cindex Xtensa Options
20352 These options are supported for Xtensa targets:
20354 @table @gcctabopt
20355 @item -mconst16
20356 @itemx -mno-const16
20357 @opindex mconst16
20358 @opindex mno-const16
20359 Enable or disable use of @code{CONST16} instructions for loading
20360 constant values.  The @code{CONST16} instruction is currently not a
20361 standard option from Tensilica.  When enabled, @code{CONST16}
20362 instructions are always used in place of the standard @code{L32R}
20363 instructions.  The use of @code{CONST16} is enabled by default only if
20364 the @code{L32R} instruction is not available.
20366 @item -mfused-madd
20367 @itemx -mno-fused-madd
20368 @opindex mfused-madd
20369 @opindex mno-fused-madd
20370 Enable or disable use of fused multiply/add and multiply/subtract
20371 instructions in the floating-point option.  This has no effect if the
20372 floating-point option is not also enabled.  Disabling fused multiply/add
20373 and multiply/subtract instructions forces the compiler to use separate
20374 instructions for the multiply and add/subtract operations.  This may be
20375 desirable in some cases where strict IEEE 754-compliant results are
20376 required: the fused multiply add/subtract instructions do not round the
20377 intermediate result, thereby producing results with @emph{more} bits of
20378 precision than specified by the IEEE standard.  Disabling fused multiply
20379 add/subtract instructions also ensures that the program output is not
20380 sensitive to the compiler's ability to combine multiply and add/subtract
20381 operations.
20383 @item -mserialize-volatile
20384 @itemx -mno-serialize-volatile
20385 @opindex mserialize-volatile
20386 @opindex mno-serialize-volatile
20387 When this option is enabled, GCC inserts @code{MEMW} instructions before
20388 @code{volatile} memory references to guarantee sequential consistency.
20389 The default is @option{-mserialize-volatile}.  Use
20390 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
20392 @item -mforce-no-pic
20393 @opindex mforce-no-pic
20394 For targets, like GNU/Linux, where all user-mode Xtensa code must be
20395 position-independent code (PIC), this option disables PIC for compiling
20396 kernel code.
20398 @item -mtext-section-literals
20399 @itemx -mno-text-section-literals
20400 @opindex mtext-section-literals
20401 @opindex mno-text-section-literals
20402 Control the treatment of literal pools.  The default is
20403 @option{-mno-text-section-literals}, which places literals in a separate
20404 section in the output file.  This allows the literal pool to be placed
20405 in a data RAM/ROM, and it also allows the linker to combine literal
20406 pools from separate object files to remove redundant literals and
20407 improve code size.  With @option{-mtext-section-literals}, the literals
20408 are interspersed in the text section in order to keep them as close as
20409 possible to their references.  This may be necessary for large assembly
20410 files.
20412 @item -mtarget-align
20413 @itemx -mno-target-align
20414 @opindex mtarget-align
20415 @opindex mno-target-align
20416 When this option is enabled, GCC instructs the assembler to
20417 automatically align instructions to reduce branch penalties at the
20418 expense of some code density.  The assembler attempts to widen density
20419 instructions to align branch targets and the instructions following call
20420 instructions.  If there are not enough preceding safe density
20421 instructions to align a target, no widening is performed.  The
20422 default is @option{-mtarget-align}.  These options do not affect the
20423 treatment of auto-aligned instructions like @code{LOOP}, which the
20424 assembler always aligns, either by widening density instructions or
20425 by inserting NOP instructions.
20427 @item -mlongcalls
20428 @itemx -mno-longcalls
20429 @opindex mlongcalls
20430 @opindex mno-longcalls
20431 When this option is enabled, GCC instructs the assembler to translate
20432 direct calls to indirect calls unless it can determine that the target
20433 of a direct call is in the range allowed by the call instruction.  This
20434 translation typically occurs for calls to functions in other source
20435 files.  Specifically, the assembler translates a direct @code{CALL}
20436 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
20437 The default is @option{-mno-longcalls}.  This option should be used in
20438 programs where the call target can potentially be out of range.  This
20439 option is implemented in the assembler, not the compiler, so the
20440 assembly code generated by GCC still shows direct call
20441 instructions---look at the disassembled object code to see the actual
20442 instructions.  Note that the assembler uses an indirect call for
20443 every cross-file call, not just those that really are out of range.
20444 @end table
20446 @node zSeries Options
20447 @subsection zSeries Options
20448 @cindex zSeries options
20450 These are listed under @xref{S/390 and zSeries Options}.
20452 @node Code Gen Options
20453 @section Options for Code Generation Conventions
20454 @cindex code generation conventions
20455 @cindex options, code generation
20456 @cindex run-time options
20458 These machine-independent options control the interface conventions
20459 used in code generation.
20461 Most of them have both positive and negative forms; the negative form
20462 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
20463 one of the forms is listed---the one that is not the default.  You
20464 can figure out the other form by either removing @samp{no-} or adding
20467 @table @gcctabopt
20468 @item -fbounds-check
20469 @opindex fbounds-check
20470 For front ends that support it, generate additional code to check that
20471 indices used to access arrays are within the declared range.  This is
20472 currently only supported by the Java and Fortran front ends, where
20473 this option defaults to true and false respectively.
20475 @item -fstack-reuse=@var{reuse-level}
20476 @opindex fstack_reuse
20477 This option controls stack space reuse for user declared local/auto variables
20478 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
20479 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
20480 local variables and temporaries, @samp{named_vars} enables the reuse only for
20481 user defined local variables with names, and @samp{none} disables stack reuse
20482 completely. The default value is @samp{all}. The option is needed when the
20483 program extends the lifetime of a scoped local variable or a compiler generated
20484 temporary beyond the end point defined by the language.  When a lifetime of
20485 a variable ends, and if the variable lives in memory, the optimizing compiler
20486 has the freedom to reuse its stack space with other temporaries or scoped
20487 local variables whose live range does not overlap with it. Legacy code extending
20488 local lifetime will likely to break with the stack reuse optimization.
20490 For example,
20492 @smallexample
20493    int *p;
20494    @{
20495      int local1;
20497      p = &local1;
20498      local1 = 10;
20499      ....
20500    @}
20501    @{
20502       int local2;
20503       local2 = 20;
20504       ...
20505    @}
20507    if (*p == 10)  // out of scope use of local1
20508      @{
20510      @}
20511 @end smallexample
20513 Another example:
20514 @smallexample
20516    struct A
20517    @{
20518        A(int k) : i(k), j(k) @{ @}
20519        int i;
20520        int j;
20521    @};
20523    A *ap;
20525    void foo(const A& ar)
20526    @{
20527       ap = &ar;
20528    @}
20530    void bar()
20531    @{
20532       foo(A(10)); // temp object's lifetime ends when foo returns
20534       @{
20535         A a(20);
20536         ....
20537       @}
20538       ap->i+= 10;  // ap references out of scope temp whose space
20539                    // is reused with a. What is the value of ap->i?
20540    @}
20542 @end smallexample
20544 The lifetime of a compiler generated temporary is well defined by the C++
20545 standard. When a lifetime of a temporary ends, and if the temporary lives
20546 in memory, the optimizing compiler has the freedom to reuse its stack
20547 space with other temporaries or scoped local variables whose live range
20548 does not overlap with it. However some of the legacy code relies on
20549 the behavior of older compilers in which temporaries' stack space is
20550 not reused, the aggressive stack reuse can lead to runtime errors. This
20551 option is used to control the temporary stack reuse optimization.
20553 @item -ftrapv
20554 @opindex ftrapv
20555 This option generates traps for signed overflow on addition, subtraction,
20556 multiplication operations.
20558 @item -fwrapv
20559 @opindex fwrapv
20560 This option instructs the compiler to assume that signed arithmetic
20561 overflow of addition, subtraction and multiplication wraps around
20562 using twos-complement representation.  This flag enables some optimizations
20563 and disables others.  This option is enabled by default for the Java
20564 front end, as required by the Java language specification.
20566 @item -fexceptions
20567 @opindex fexceptions
20568 Enable exception handling.  Generates extra code needed to propagate
20569 exceptions.  For some targets, this implies GCC generates frame
20570 unwind information for all functions, which can produce significant data
20571 size overhead, although it does not affect execution.  If you do not
20572 specify this option, GCC enables it by default for languages like
20573 C++ that normally require exception handling, and disables it for
20574 languages like C that do not normally require it.  However, you may need
20575 to enable this option when compiling C code that needs to interoperate
20576 properly with exception handlers written in C++.  You may also wish to
20577 disable this option if you are compiling older C++ programs that don't
20578 use exception handling.
20580 @item -fnon-call-exceptions
20581 @opindex fnon-call-exceptions
20582 Generate code that allows trapping instructions to throw exceptions.
20583 Note that this requires platform-specific runtime support that does
20584 not exist everywhere.  Moreover, it only allows @emph{trapping}
20585 instructions to throw exceptions, i.e.@: memory references or floating-point
20586 instructions.  It does not allow exceptions to be thrown from
20587 arbitrary signal handlers such as @code{SIGALRM}.
20589 @item -fdelete-dead-exceptions
20590 @opindex fdelete-dead-exceptions
20591 Consider that instructions that may throw exceptions but don't otherwise
20592 contribute to the execution of the program can be optimized away.
20593 This option is enabled by default for the Ada front end, as permitted by
20594 the Ada language specification.
20595 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
20597 @item -funwind-tables
20598 @opindex funwind-tables
20599 Similar to @option{-fexceptions}, except that it just generates any needed
20600 static data, but does not affect the generated code in any other way.
20601 You normally do not need to enable this option; instead, a language processor
20602 that needs this handling enables it on your behalf.
20604 @item -fasynchronous-unwind-tables
20605 @opindex fasynchronous-unwind-tables
20606 Generate unwind table in DWARF 2 format, if supported by target machine.  The
20607 table is exact at each instruction boundary, so it can be used for stack
20608 unwinding from asynchronous events (such as debugger or garbage collector).
20610 @item -fpcc-struct-return
20611 @opindex fpcc-struct-return
20612 Return ``short'' @code{struct} and @code{union} values in memory like
20613 longer ones, rather than in registers.  This convention is less
20614 efficient, but it has the advantage of allowing intercallability between
20615 GCC-compiled files and files compiled with other compilers, particularly
20616 the Portable C Compiler (pcc).
20618 The precise convention for returning structures in memory depends
20619 on the target configuration macros.
20621 Short structures and unions are those whose size and alignment match
20622 that of some integer type.
20624 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
20625 switch is not binary compatible with code compiled with the
20626 @option{-freg-struct-return} switch.
20627 Use it to conform to a non-default application binary interface.
20629 @item -freg-struct-return
20630 @opindex freg-struct-return
20631 Return @code{struct} and @code{union} values in registers when possible.
20632 This is more efficient for small structures than
20633 @option{-fpcc-struct-return}.
20635 If you specify neither @option{-fpcc-struct-return} nor
20636 @option{-freg-struct-return}, GCC defaults to whichever convention is
20637 standard for the target.  If there is no standard convention, GCC
20638 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
20639 the principal compiler.  In those cases, we can choose the standard, and
20640 we chose the more efficient register return alternative.
20642 @strong{Warning:} code compiled with the @option{-freg-struct-return}
20643 switch is not binary compatible with code compiled with the
20644 @option{-fpcc-struct-return} switch.
20645 Use it to conform to a non-default application binary interface.
20647 @item -fshort-enums
20648 @opindex fshort-enums
20649 Allocate to an @code{enum} type only as many bytes as it needs for the
20650 declared range of possible values.  Specifically, the @code{enum} type
20651 is equivalent to the smallest integer type that has enough room.
20653 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
20654 code that is not binary compatible with code generated without that switch.
20655 Use it to conform to a non-default application binary interface.
20657 @item -fshort-double
20658 @opindex fshort-double
20659 Use the same size for @code{double} as for @code{float}.
20661 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
20662 code that is not binary compatible with code generated without that switch.
20663 Use it to conform to a non-default application binary interface.
20665 @item -fshort-wchar
20666 @opindex fshort-wchar
20667 Override the underlying type for @samp{wchar_t} to be @samp{short
20668 unsigned int} instead of the default for the target.  This option is
20669 useful for building programs to run under WINE@.
20671 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
20672 code that is not binary compatible with code generated without that switch.
20673 Use it to conform to a non-default application binary interface.
20675 @item -fno-common
20676 @opindex fno-common
20677 In C code, controls the placement of uninitialized global variables.
20678 Unix C compilers have traditionally permitted multiple definitions of
20679 such variables in different compilation units by placing the variables
20680 in a common block.
20681 This is the behavior specified by @option{-fcommon}, and is the default
20682 for GCC on most targets.
20683 On the other hand, this behavior is not required by ISO C, and on some
20684 targets may carry a speed or code size penalty on variable references.
20685 The @option{-fno-common} option specifies that the compiler should place
20686 uninitialized global variables in the data section of the object file,
20687 rather than generating them as common blocks.
20688 This has the effect that if the same variable is declared
20689 (without @code{extern}) in two different compilations,
20690 you get a multiple-definition error when you link them.
20691 In this case, you must compile with @option{-fcommon} instead.
20692 Compiling with @option{-fno-common} is useful on targets for which
20693 it provides better performance, or if you wish to verify that the
20694 program will work on other systems that always treat uninitialized
20695 variable declarations this way.
20697 @item -fno-ident
20698 @opindex fno-ident
20699 Ignore the @samp{#ident} directive.
20701 @item -finhibit-size-directive
20702 @opindex finhibit-size-directive
20703 Don't output a @code{.size} assembler directive, or anything else that
20704 would cause trouble if the function is split in the middle, and the
20705 two halves are placed at locations far apart in memory.  This option is
20706 used when compiling @file{crtstuff.c}; you should not need to use it
20707 for anything else.
20709 @item -fverbose-asm
20710 @opindex fverbose-asm
20711 Put extra commentary information in the generated assembly code to
20712 make it more readable.  This option is generally only of use to those
20713 who actually need to read the generated assembly code (perhaps while
20714 debugging the compiler itself).
20716 @option{-fno-verbose-asm}, the default, causes the
20717 extra information to be omitted and is useful when comparing two assembler
20718 files.
20720 @item -frecord-gcc-switches
20721 @opindex frecord-gcc-switches
20722 This switch causes the command line used to invoke the
20723 compiler to be recorded into the object file that is being created.
20724 This switch is only implemented on some targets and the exact format
20725 of the recording is target and binary file format dependent, but it
20726 usually takes the form of a section containing ASCII text.  This
20727 switch is related to the @option{-fverbose-asm} switch, but that
20728 switch only records information in the assembler output file as
20729 comments, so it never reaches the object file.
20730 See also @option{-grecord-gcc-switches} for another
20731 way of storing compiler options into the object file.
20733 @item -fpic
20734 @opindex fpic
20735 @cindex global offset table
20736 @cindex PIC
20737 Generate position-independent code (PIC) suitable for use in a shared
20738 library, if supported for the target machine.  Such code accesses all
20739 constant addresses through a global offset table (GOT)@.  The dynamic
20740 loader resolves the GOT entries when the program starts (the dynamic
20741 loader is not part of GCC; it is part of the operating system).  If
20742 the GOT size for the linked executable exceeds a machine-specific
20743 maximum size, you get an error message from the linker indicating that
20744 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
20745 instead.  (These maximums are 8k on the SPARC and 32k
20746 on the m68k and RS/6000.  The 386 has no such limit.)
20748 Position-independent code requires special support, and therefore works
20749 only on certain machines.  For the 386, GCC supports PIC for System V
20750 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
20751 position-independent.
20753 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20754 are defined to 1.
20756 @item -fPIC
20757 @opindex fPIC
20758 If supported for the target machine, emit position-independent code,
20759 suitable for dynamic linking and avoiding any limit on the size of the
20760 global offset table.  This option makes a difference on the m68k,
20761 PowerPC and SPARC@.
20763 Position-independent code requires special support, and therefore works
20764 only on certain machines.
20766 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20767 are defined to 2.
20769 @item -fpie
20770 @itemx -fPIE
20771 @opindex fpie
20772 @opindex fPIE
20773 These options are similar to @option{-fpic} and @option{-fPIC}, but
20774 generated position independent code can be only linked into executables.
20775 Usually these options are used when @option{-pie} GCC option is
20776 used during linking.
20778 @option{-fpie} and @option{-fPIE} both define the macros
20779 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
20780 for @option{-fpie} and 2 for @option{-fPIE}.
20782 @item -fno-jump-tables
20783 @opindex fno-jump-tables
20784 Do not use jump tables for switch statements even where it would be
20785 more efficient than other code generation strategies.  This option is
20786 of use in conjunction with @option{-fpic} or @option{-fPIC} for
20787 building code that forms part of a dynamic linker and cannot
20788 reference the address of a jump table.  On some targets, jump tables
20789 do not require a GOT and this option is not needed.
20791 @item -ffixed-@var{reg}
20792 @opindex ffixed
20793 Treat the register named @var{reg} as a fixed register; generated code
20794 should never refer to it (except perhaps as a stack pointer, frame
20795 pointer or in some other fixed role).
20797 @var{reg} must be the name of a register.  The register names accepted
20798 are machine-specific and are defined in the @code{REGISTER_NAMES}
20799 macro in the machine description macro file.
20801 This flag does not have a negative form, because it specifies a
20802 three-way choice.
20804 @item -fcall-used-@var{reg}
20805 @opindex fcall-used
20806 Treat the register named @var{reg} as an allocable register that is
20807 clobbered by function calls.  It may be allocated for temporaries or
20808 variables that do not live across a call.  Functions compiled this way
20809 do not save and restore the register @var{reg}.
20811 It is an error to use this flag with the frame pointer or stack pointer.
20812 Use of this flag for other registers that have fixed pervasive roles in
20813 the machine's execution model produces disastrous results.
20815 This flag does not have a negative form, because it specifies a
20816 three-way choice.
20818 @item -fcall-saved-@var{reg}
20819 @opindex fcall-saved
20820 Treat the register named @var{reg} as an allocable register saved by
20821 functions.  It may be allocated even for temporaries or variables that
20822 live across a call.  Functions compiled this way save and restore
20823 the register @var{reg} if they use it.
20825 It is an error to use this flag with the frame pointer or stack pointer.
20826 Use of this flag for other registers that have fixed pervasive roles in
20827 the machine's execution model produces disastrous results.
20829 A different sort of disaster results from the use of this flag for
20830 a register in which function values may be returned.
20832 This flag does not have a negative form, because it specifies a
20833 three-way choice.
20835 @item -fpack-struct[=@var{n}]
20836 @opindex fpack-struct
20837 Without a value specified, pack all structure members together without
20838 holes.  When a value is specified (which must be a small power of two), pack
20839 structure members according to this value, representing the maximum
20840 alignment (that is, objects with default alignment requirements larger than
20841 this are output potentially unaligned at the next fitting location.
20843 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
20844 code that is not binary compatible with code generated without that switch.
20845 Additionally, it makes the code suboptimal.
20846 Use it to conform to a non-default application binary interface.
20848 @item -finstrument-functions
20849 @opindex finstrument-functions
20850 Generate instrumentation calls for entry and exit to functions.  Just
20851 after function entry and just before function exit, the following
20852 profiling functions are called with the address of the current
20853 function and its call site.  (On some platforms,
20854 @code{__builtin_return_address} does not work beyond the current
20855 function, so the call site information may not be available to the
20856 profiling functions otherwise.)
20858 @smallexample
20859 void __cyg_profile_func_enter (void *this_fn,
20860                                void *call_site);
20861 void __cyg_profile_func_exit  (void *this_fn,
20862                                void *call_site);
20863 @end smallexample
20865 The first argument is the address of the start of the current function,
20866 which may be looked up exactly in the symbol table.
20868 This instrumentation is also done for functions expanded inline in other
20869 functions.  The profiling calls indicate where, conceptually, the
20870 inline function is entered and exited.  This means that addressable
20871 versions of such functions must be available.  If all your uses of a
20872 function are expanded inline, this may mean an additional expansion of
20873 code size.  If you use @samp{extern inline} in your C code, an
20874 addressable version of such functions must be provided.  (This is
20875 normally the case anyway, but if you get lucky and the optimizer always
20876 expands the functions inline, you might have gotten away without
20877 providing static copies.)
20879 A function may be given the attribute @code{no_instrument_function}, in
20880 which case this instrumentation is not done.  This can be used, for
20881 example, for the profiling functions listed above, high-priority
20882 interrupt routines, and any functions from which the profiling functions
20883 cannot safely be called (perhaps signal handlers, if the profiling
20884 routines generate output or allocate memory).
20886 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
20887 @opindex finstrument-functions-exclude-file-list
20889 Set the list of functions that are excluded from instrumentation (see
20890 the description of @code{-finstrument-functions}).  If the file that
20891 contains a function definition matches with one of @var{file}, then
20892 that function is not instrumented.  The match is done on substrings:
20893 if the @var{file} parameter is a substring of the file name, it is
20894 considered to be a match.
20896 For example:
20898 @smallexample
20899 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
20900 @end smallexample
20902 @noindent
20903 excludes any inline function defined in files whose pathnames
20904 contain @code{/bits/stl} or @code{include/sys}.
20906 If, for some reason, you want to include letter @code{','} in one of
20907 @var{sym}, write @code{'\,'}. For example,
20908 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
20909 (note the single quote surrounding the option).
20911 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
20912 @opindex finstrument-functions-exclude-function-list
20914 This is similar to @code{-finstrument-functions-exclude-file-list},
20915 but this option sets the list of function names to be excluded from
20916 instrumentation.  The function name to be matched is its user-visible
20917 name, such as @code{vector<int> blah(const vector<int> &)}, not the
20918 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
20919 match is done on substrings: if the @var{sym} parameter is a substring
20920 of the function name, it is considered to be a match.  For C99 and C++
20921 extended identifiers, the function name must be given in UTF-8, not
20922 using universal character names.
20924 @item -fstack-check
20925 @opindex fstack-check
20926 Generate code to verify that you do not go beyond the boundary of the
20927 stack.  You should specify this flag if you are running in an
20928 environment with multiple threads, but you only rarely need to specify it in
20929 a single-threaded environment since stack overflow is automatically
20930 detected on nearly all systems if there is only one stack.
20932 Note that this switch does not actually cause checking to be done; the
20933 operating system or the language runtime must do that.  The switch causes
20934 generation of code to ensure that they see the stack being extended.
20936 You can additionally specify a string parameter: @code{no} means no
20937 checking, @code{generic} means force the use of old-style checking,
20938 @code{specific} means use the best checking method and is equivalent
20939 to bare @option{-fstack-check}.
20941 Old-style checking is a generic mechanism that requires no specific
20942 target support in the compiler but comes with the following drawbacks:
20944 @enumerate
20945 @item
20946 Modified allocation strategy for large objects: they are always
20947 allocated dynamically if their size exceeds a fixed threshold.
20949 @item
20950 Fixed limit on the size of the static frame of functions: when it is
20951 topped by a particular function, stack checking is not reliable and
20952 a warning is issued by the compiler.
20954 @item
20955 Inefficiency: because of both the modified allocation strategy and the
20956 generic implementation, code performance is hampered.
20957 @end enumerate
20959 Note that old-style stack checking is also the fallback method for
20960 @code{specific} if no target support has been added in the compiler.
20962 @item -fstack-limit-register=@var{reg}
20963 @itemx -fstack-limit-symbol=@var{sym}
20964 @itemx -fno-stack-limit
20965 @opindex fstack-limit-register
20966 @opindex fstack-limit-symbol
20967 @opindex fno-stack-limit
20968 Generate code to ensure that the stack does not grow beyond a certain value,
20969 either the value of a register or the address of a symbol.  If a larger
20970 stack is required, a signal is raised at run time.  For most targets,
20971 the signal is raised before the stack overruns the boundary, so
20972 it is possible to catch the signal without taking special precautions.
20974 For instance, if the stack starts at absolute address @samp{0x80000000}
20975 and grows downwards, you can use the flags
20976 @option{-fstack-limit-symbol=__stack_limit} and
20977 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
20978 of 128KB@.  Note that this may only work with the GNU linker.
20980 @item -fsplit-stack
20981 @opindex fsplit-stack
20982 Generate code to automatically split the stack before it overflows.
20983 The resulting program has a discontiguous stack which can only
20984 overflow if the program is unable to allocate any more memory.  This
20985 is most useful when running threaded programs, as it is no longer
20986 necessary to calculate a good stack size to use for each thread.  This
20987 is currently only implemented for the i386 and x86_64 back ends running
20988 GNU/Linux.
20990 When code compiled with @option{-fsplit-stack} calls code compiled
20991 without @option{-fsplit-stack}, there may not be much stack space
20992 available for the latter code to run.  If compiling all code,
20993 including library code, with @option{-fsplit-stack} is not an option,
20994 then the linker can fix up these calls so that the code compiled
20995 without @option{-fsplit-stack} always has a large stack.  Support for
20996 this is implemented in the gold linker in GNU binutils release 2.21
20997 and later.
20999 @item -fleading-underscore
21000 @opindex fleading-underscore
21001 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
21002 change the way C symbols are represented in the object file.  One use
21003 is to help link with legacy assembly code.
21005 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
21006 generate code that is not binary compatible with code generated without that
21007 switch.  Use it to conform to a non-default application binary interface.
21008 Not all targets provide complete support for this switch.
21010 @item -ftls-model=@var{model}
21011 @opindex ftls-model
21012 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
21013 The @var{model} argument should be one of @code{global-dynamic},
21014 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
21015 Note that the choice is subject to optimization: the compiler may use
21016 a more efficient model for symbols not visible outside of the translation
21017 unit, or if @option{-fpic} is not given on the command line.
21019 The default without @option{-fpic} is @code{initial-exec}; with
21020 @option{-fpic} the default is @code{global-dynamic}.
21022 @item -fvisibility=@var{default|internal|hidden|protected}
21023 @opindex fvisibility
21024 Set the default ELF image symbol visibility to the specified option---all
21025 symbols are marked with this unless overridden within the code.
21026 Using this feature can very substantially improve linking and
21027 load times of shared object libraries, produce more optimized
21028 code, provide near-perfect API export and prevent symbol clashes.
21029 It is @strong{strongly} recommended that you use this in any shared objects
21030 you distribute.
21032 Despite the nomenclature, @code{default} always means public; i.e.,
21033 available to be linked against from outside the shared object.
21034 @code{protected} and @code{internal} are pretty useless in real-world
21035 usage so the only other commonly used option is @code{hidden}.
21036 The default if @option{-fvisibility} isn't specified is
21037 @code{default}, i.e., make every
21038 symbol public---this causes the same behavior as previous versions of
21039 GCC@.
21041 A good explanation of the benefits offered by ensuring ELF
21042 symbols have the correct visibility is given by ``How To Write
21043 Shared Libraries'' by Ulrich Drepper (which can be found at
21044 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
21045 solution made possible by this option to marking things hidden when
21046 the default is public is to make the default hidden and mark things
21047 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
21048 and @code{__attribute__ ((visibility("default")))} instead of
21049 @code{__declspec(dllexport)} you get almost identical semantics with
21050 identical syntax.  This is a great boon to those working with
21051 cross-platform projects.
21053 For those adding visibility support to existing code, you may find
21054 @samp{#pragma GCC visibility} of use.  This works by you enclosing
21055 the declarations you wish to set visibility for with (for example)
21056 @samp{#pragma GCC visibility push(hidden)} and
21057 @samp{#pragma GCC visibility pop}.
21058 Bear in mind that symbol visibility should be viewed @strong{as
21059 part of the API interface contract} and thus all new code should
21060 always specify visibility when it is not the default; i.e., declarations
21061 only for use within the local DSO should @strong{always} be marked explicitly
21062 as hidden as so to avoid PLT indirection overheads---making this
21063 abundantly clear also aids readability and self-documentation of the code.
21064 Note that due to ISO C++ specification requirements, @code{operator new} and
21065 @code{operator delete} must always be of default visibility.
21067 Be aware that headers from outside your project, in particular system
21068 headers and headers from any other library you use, may not be
21069 expecting to be compiled with visibility other than the default.  You
21070 may need to explicitly say @samp{#pragma GCC visibility push(default)}
21071 before including any such headers.
21073 @samp{extern} declarations are not affected by @option{-fvisibility}, so
21074 a lot of code can be recompiled with @option{-fvisibility=hidden} with
21075 no modifications.  However, this means that calls to @code{extern}
21076 functions with no explicit visibility use the PLT, so it is more
21077 effective to use @code{__attribute ((visibility))} and/or
21078 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
21079 declarations should be treated as hidden.
21081 Note that @option{-fvisibility} does affect C++ vague linkage
21082 entities. This means that, for instance, an exception class that is
21083 be thrown between DSOs must be explicitly marked with default
21084 visibility so that the @samp{type_info} nodes are unified between
21085 the DSOs.
21087 An overview of these techniques, their benefits and how to use them
21088 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
21090 @item -fstrict-volatile-bitfields
21091 @opindex fstrict-volatile-bitfields
21092 This option should be used if accesses to volatile bit-fields (or other
21093 structure fields, although the compiler usually honors those types
21094 anyway) should use a single access of the width of the
21095 field's type, aligned to a natural alignment if possible.  For
21096 example, targets with memory-mapped peripheral registers might require
21097 all such accesses to be 16 bits wide; with this flag you can
21098 declare all peripheral bit-fields as @code{unsigned short} (assuming short
21099 is 16 bits on these targets) to force GCC to use 16-bit accesses
21100 instead of, perhaps, a more efficient 32-bit access.
21102 If this option is disabled, the compiler uses the most efficient
21103 instruction.  In the previous example, that might be a 32-bit load
21104 instruction, even though that accesses bytes that do not contain
21105 any portion of the bit-field, or memory-mapped registers unrelated to
21106 the one being updated.
21108 If the target requires strict alignment, and honoring the field
21109 type would require violating this alignment, a warning is issued.
21110 If the field has @code{packed} attribute, the access is done without
21111 honoring the field type.  If the field doesn't have @code{packed}
21112 attribute, the access is done honoring the field type.  In both cases,
21113 GCC assumes that the user knows something about the target hardware
21114 that it is unaware of.
21116 The default value of this option is determined by the application binary
21117 interface for the target processor.
21119 @item -fsync-libcalls
21120 @opindex fsync-libcalls
21121 This option controls whether any out-of-line instance of the @code{__sync}
21122 family of functions may be used to implement the C++11 @code{__atomic}
21123 family of functions.
21125 The default value of this option is enabled, thus the only useful form
21126 of the option is @option{-fno-sync-libcalls}.  This option is used in
21127 the implementation of the @file{libatomic} runtime library.
21129 @end table
21131 @c man end
21133 @node Environment Variables
21134 @section Environment Variables Affecting GCC
21135 @cindex environment variables
21137 @c man begin ENVIRONMENT
21138 This section describes several environment variables that affect how GCC
21139 operates.  Some of them work by specifying directories or prefixes to use
21140 when searching for various kinds of files.  Some are used to specify other
21141 aspects of the compilation environment.
21143 Note that you can also specify places to search using options such as
21144 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
21145 take precedence over places specified using environment variables, which
21146 in turn take precedence over those specified by the configuration of GCC@.
21147 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
21148 GNU Compiler Collection (GCC) Internals}.
21150 @table @env
21151 @item LANG
21152 @itemx LC_CTYPE
21153 @c @itemx LC_COLLATE
21154 @itemx LC_MESSAGES
21155 @c @itemx LC_MONETARY
21156 @c @itemx LC_NUMERIC
21157 @c @itemx LC_TIME
21158 @itemx LC_ALL
21159 @findex LANG
21160 @findex LC_CTYPE
21161 @c @findex LC_COLLATE
21162 @findex LC_MESSAGES
21163 @c @findex LC_MONETARY
21164 @c @findex LC_NUMERIC
21165 @c @findex LC_TIME
21166 @findex LC_ALL
21167 @cindex locale
21168 These environment variables control the way that GCC uses
21169 localization information which allows GCC to work with different
21170 national conventions.  GCC inspects the locale categories
21171 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
21172 so.  These locale categories can be set to any value supported by your
21173 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
21174 Kingdom encoded in UTF-8.
21176 The @env{LC_CTYPE} environment variable specifies character
21177 classification.  GCC uses it to determine the character boundaries in
21178 a string; this is needed for some multibyte encodings that contain quote
21179 and escape characters that are otherwise interpreted as a string
21180 end or escape.
21182 The @env{LC_MESSAGES} environment variable specifies the language to
21183 use in diagnostic messages.
21185 If the @env{LC_ALL} environment variable is set, it overrides the value
21186 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
21187 and @env{LC_MESSAGES} default to the value of the @env{LANG}
21188 environment variable.  If none of these variables are set, GCC
21189 defaults to traditional C English behavior.
21191 @item TMPDIR
21192 @findex TMPDIR
21193 If @env{TMPDIR} is set, it specifies the directory to use for temporary
21194 files.  GCC uses temporary files to hold the output of one stage of
21195 compilation which is to be used as input to the next stage: for example,
21196 the output of the preprocessor, which is the input to the compiler
21197 proper.
21199 @item GCC_COMPARE_DEBUG
21200 @findex GCC_COMPARE_DEBUG
21201 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
21202 @option{-fcompare-debug} to the compiler driver.  See the documentation
21203 of this option for more details.
21205 @item GCC_EXEC_PREFIX
21206 @findex GCC_EXEC_PREFIX
21207 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
21208 names of the subprograms executed by the compiler.  No slash is added
21209 when this prefix is combined with the name of a subprogram, but you can
21210 specify a prefix that ends with a slash if you wish.
21212 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
21213 an appropriate prefix to use based on the pathname it is invoked with.
21215 If GCC cannot find the subprogram using the specified prefix, it
21216 tries looking in the usual places for the subprogram.
21218 The default value of @env{GCC_EXEC_PREFIX} is
21219 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
21220 the installed compiler. In many cases @var{prefix} is the value
21221 of @code{prefix} when you ran the @file{configure} script.
21223 Other prefixes specified with @option{-B} take precedence over this prefix.
21225 This prefix is also used for finding files such as @file{crt0.o} that are
21226 used for linking.
21228 In addition, the prefix is used in an unusual way in finding the
21229 directories to search for header files.  For each of the standard
21230 directories whose name normally begins with @samp{/usr/local/lib/gcc}
21231 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
21232 replacing that beginning with the specified prefix to produce an
21233 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
21234 @file{foo/bar} just before it searches the standard directory 
21235 @file{/usr/local/lib/bar}.
21236 If a standard directory begins with the configured
21237 @var{prefix} then the value of @var{prefix} is replaced by
21238 @env{GCC_EXEC_PREFIX} when looking for header files.
21240 @item COMPILER_PATH
21241 @findex COMPILER_PATH
21242 The value of @env{COMPILER_PATH} is a colon-separated list of
21243 directories, much like @env{PATH}.  GCC tries the directories thus
21244 specified when searching for subprograms, if it can't find the
21245 subprograms using @env{GCC_EXEC_PREFIX}.
21247 @item LIBRARY_PATH
21248 @findex LIBRARY_PATH
21249 The value of @env{LIBRARY_PATH} is a colon-separated list of
21250 directories, much like @env{PATH}.  When configured as a native compiler,
21251 GCC tries the directories thus specified when searching for special
21252 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
21253 using GCC also uses these directories when searching for ordinary
21254 libraries for the @option{-l} option (but directories specified with
21255 @option{-L} come first).
21257 @item LANG
21258 @findex LANG
21259 @cindex locale definition
21260 This variable is used to pass locale information to the compiler.  One way in
21261 which this information is used is to determine the character set to be used
21262 when character literals, string literals and comments are parsed in C and C++.
21263 When the compiler is configured to allow multibyte characters,
21264 the following values for @env{LANG} are recognized:
21266 @table @samp
21267 @item C-JIS
21268 Recognize JIS characters.
21269 @item C-SJIS
21270 Recognize SJIS characters.
21271 @item C-EUCJP
21272 Recognize EUCJP characters.
21273 @end table
21275 If @env{LANG} is not defined, or if it has some other value, then the
21276 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
21277 recognize and translate multibyte characters.
21278 @end table
21280 @noindent
21281 Some additional environment variables affect the behavior of the
21282 preprocessor.
21284 @include cppenv.texi
21286 @c man end
21288 @node Precompiled Headers
21289 @section Using Precompiled Headers
21290 @cindex precompiled headers
21291 @cindex speed of compilation
21293 Often large projects have many header files that are included in every
21294 source file.  The time the compiler takes to process these header files
21295 over and over again can account for nearly all of the time required to
21296 build the project.  To make builds faster, GCC allows you to
21297 @dfn{precompile} a header file.
21299 To create a precompiled header file, simply compile it as you would any
21300 other file, if necessary using the @option{-x} option to make the driver
21301 treat it as a C or C++ header file.  You may want to use a
21302 tool like @command{make} to keep the precompiled header up-to-date when
21303 the headers it contains change.
21305 A precompiled header file is searched for when @code{#include} is
21306 seen in the compilation.  As it searches for the included file
21307 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
21308 compiler looks for a precompiled header in each directory just before it
21309 looks for the include file in that directory.  The name searched for is
21310 the name specified in the @code{#include} with @samp{.gch} appended.  If
21311 the precompiled header file can't be used, it is ignored.
21313 For instance, if you have @code{#include "all.h"}, and you have
21314 @file{all.h.gch} in the same directory as @file{all.h}, then the
21315 precompiled header file is used if possible, and the original
21316 header is used otherwise.
21318 Alternatively, you might decide to put the precompiled header file in a
21319 directory and use @option{-I} to ensure that directory is searched
21320 before (or instead of) the directory containing the original header.
21321 Then, if you want to check that the precompiled header file is always
21322 used, you can put a file of the same name as the original header in this
21323 directory containing an @code{#error} command.
21325 This also works with @option{-include}.  So yet another way to use
21326 precompiled headers, good for projects not designed with precompiled
21327 header files in mind, is to simply take most of the header files used by
21328 a project, include them from another header file, precompile that header
21329 file, and @option{-include} the precompiled header.  If the header files
21330 have guards against multiple inclusion, they are skipped because
21331 they've already been included (in the precompiled header).
21333 If you need to precompile the same header file for different
21334 languages, targets, or compiler options, you can instead make a
21335 @emph{directory} named like @file{all.h.gch}, and put each precompiled
21336 header in the directory, perhaps using @option{-o}.  It doesn't matter
21337 what you call the files in the directory; every precompiled header in
21338 the directory is considered.  The first precompiled header
21339 encountered in the directory that is valid for this compilation is
21340 used; they're searched in no particular order.
21342 There are many other possibilities, limited only by your imagination,
21343 good sense, and the constraints of your build system.
21345 A precompiled header file can be used only when these conditions apply:
21347 @itemize
21348 @item
21349 Only one precompiled header can be used in a particular compilation.
21351 @item
21352 A precompiled header can't be used once the first C token is seen.  You
21353 can have preprocessor directives before a precompiled header; you cannot
21354 include a precompiled header from inside another header.
21356 @item
21357 The precompiled header file must be produced for the same language as
21358 the current compilation.  You can't use a C precompiled header for a C++
21359 compilation.
21361 @item
21362 The precompiled header file must have been produced by the same compiler
21363 binary as the current compilation is using.
21365 @item
21366 Any macros defined before the precompiled header is included must
21367 either be defined in the same way as when the precompiled header was
21368 generated, or must not affect the precompiled header, which usually
21369 means that they don't appear in the precompiled header at all.
21371 The @option{-D} option is one way to define a macro before a
21372 precompiled header is included; using a @code{#define} can also do it.
21373 There are also some options that define macros implicitly, like
21374 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
21375 defined this way.
21377 @item If debugging information is output when using the precompiled
21378 header, using @option{-g} or similar, the same kind of debugging information
21379 must have been output when building the precompiled header.  However,
21380 a precompiled header built using @option{-g} can be used in a compilation
21381 when no debugging information is being output.
21383 @item The same @option{-m} options must generally be used when building
21384 and using the precompiled header.  @xref{Submodel Options},
21385 for any cases where this rule is relaxed.
21387 @item Each of the following options must be the same when building and using
21388 the precompiled header:
21390 @gccoptlist{-fexceptions}
21392 @item
21393 Some other command-line options starting with @option{-f},
21394 @option{-p}, or @option{-O} must be defined in the same way as when
21395 the precompiled header was generated.  At present, it's not clear
21396 which options are safe to change and which are not; the safest choice
21397 is to use exactly the same options when generating and using the
21398 precompiled header.  The following are known to be safe:
21400 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
21401 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
21402 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
21403 -pedantic-errors}
21405 @end itemize
21407 For all of these except the last, the compiler automatically
21408 ignores the precompiled header if the conditions aren't met.  If you
21409 find an option combination that doesn't work and doesn't cause the
21410 precompiled header to be ignored, please consider filing a bug report,
21411 see @ref{Bugs}.
21413 If you do use differing options when generating and using the
21414 precompiled header, the actual behavior is a mixture of the
21415 behavior for the options.  For instance, if you use @option{-g} to
21416 generate the precompiled header but not when using it, you may or may
21417 not get debugging information for routines in the precompiled header.