2013-10-01 Joern Rennecke <joern.rennecke@embecosm.com>
[official-gcc.git] / gcc / doc / invoke.texi
blob6e3192f3cd08dc2aec05ee7ca38559b12bea22f1
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  -Wdelete-incomplete -Wno-cpp  @gol
244 -Wno-deprecated -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-loop-vectorize @gol
423 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
424 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
425 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
426 -ftree-vectorize -ftree-vrp @gol
427 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
428 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
429 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
430 -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
431 --param @var{name}=@var{value}
432 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
434 @item Preprocessor Options
435 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
436 @gccoptlist{-A@var{question}=@var{answer} @gol
437 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
438 -C  -dD  -dI  -dM  -dN @gol
439 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
440 -idirafter @var{dir} @gol
441 -include @var{file}  -imacros @var{file} @gol
442 -iprefix @var{file}  -iwithprefix @var{dir} @gol
443 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
444 -imultilib @var{dir} -isysroot @var{dir} @gol
445 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
446 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
447 -remap -trigraphs  -undef  -U@var{macro}  @gol
448 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
450 @item Assembler Option
451 @xref{Assembler Options,,Passing Options to the Assembler}.
452 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
454 @item Linker Options
455 @xref{Link Options,,Options for Linking}.
456 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
457 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
458 -s  -static -static-libgcc -static-libstdc++ @gol
459 -static-libasan -static-libtsan -static-libubsan @gol
460 -shared -shared-libgcc  -symbolic @gol
461 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
462 -u @var{symbol}}
464 @item Directory Options
465 @xref{Directory Options,,Options for Directory Search}.
466 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
467 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
468 --sysroot=@var{dir} --no-sysroot-suffix}
470 @item Machine Dependent Options
471 @xref{Submodel Options,,Hardware Models and Configurations}.
472 @c This list is ordered alphanumerically by subsection name.
473 @c Try and put the significant identifier (CPU or system) first,
474 @c so users have a clue at guessing where the ones they want will be.
476 @emph{AArch64 Options}
477 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
478 -mgeneral-regs-only @gol
479 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
480 -mstrict-align @gol
481 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
482 -mtls-dialect=desc  -mtls-dialect=traditional @gol
483 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
485 @emph{Adapteva Epiphany Options}
486 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
487 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
488 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
489 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
490 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
491 -msplit-vecmove-early -m1reg-@var{reg}}
493 @emph{ARC Options}
494 @gccoptlist{-mbarrel-shifter @gol
495 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
496 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
497 -mea -mno-mpy -mmul32x16 -mmul64 @gol
498 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
499 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
500 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
501 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
502 -mucb-mcount -mvolatile-cache @gol
503 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
504 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
505 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
506 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
507 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
508 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
510 @emph{ARM Options}
511 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
512 -mabi=@var{name} @gol
513 -mapcs-stack-check  -mno-apcs-stack-check @gol
514 -mapcs-float  -mno-apcs-float @gol
515 -mapcs-reentrant  -mno-apcs-reentrant @gol
516 -msched-prolog  -mno-sched-prolog @gol
517 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
518 -mfloat-abi=@var{name} @gol
519 -mfp16-format=@var{name}
520 -mthumb-interwork  -mno-thumb-interwork @gol
521 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
522 -mstructure-size-boundary=@var{n} @gol
523 -mabort-on-noreturn @gol
524 -mlong-calls  -mno-long-calls @gol
525 -msingle-pic-base  -mno-single-pic-base @gol
526 -mpic-register=@var{reg} @gol
527 -mnop-fun-dllimport @gol
528 -mpoke-function-name @gol
529 -mthumb  -marm @gol
530 -mtpcs-frame  -mtpcs-leaf-frame @gol
531 -mcaller-super-interworking  -mcallee-super-interworking @gol
532 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
533 -mword-relocations @gol
534 -mfix-cortex-m3-ldrd @gol
535 -munaligned-access @gol
536 -mneon-for-64bits @gol
537 -mrestrict-it}
539 @emph{AVR Options}
540 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
541 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
542 -mstrict-X -mtiny-stack -Waddr-space-convert}
544 @emph{Blackfin Options}
545 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
546 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
547 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
548 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
549 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
550 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
551 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
552 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
553 -micplb}
555 @emph{C6X Options}
556 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
557 -msim -msdata=@var{sdata-type}}
559 @emph{CRIS Options}
560 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
561 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
562 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
563 -mstack-align  -mdata-align  -mconst-align @gol
564 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
565 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
566 -mmul-bug-workaround  -mno-mul-bug-workaround}
568 @emph{CR16 Options}
569 @gccoptlist{-mmac @gol
570 -mcr16cplus -mcr16c @gol
571 -msim -mint32 -mbit-ops
572 -mdata-model=@var{model}}
574 @emph{Darwin Options}
575 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
576 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
577 -client_name  -compatibility_version  -current_version @gol
578 -dead_strip @gol
579 -dependency-file  -dylib_file  -dylinker_install_name @gol
580 -dynamic  -dynamiclib  -exported_symbols_list @gol
581 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
582 -force_flat_namespace  -headerpad_max_install_names @gol
583 -iframework @gol
584 -image_base  -init  -install_name  -keep_private_externs @gol
585 -multi_module  -multiply_defined  -multiply_defined_unused @gol
586 -noall_load   -no_dead_strip_inits_and_terms @gol
587 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
588 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
589 -private_bundle  -read_only_relocs  -sectalign @gol
590 -sectobjectsymbols  -whyload  -seg1addr @gol
591 -sectcreate  -sectobjectsymbols  -sectorder @gol
592 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
593 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
594 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
595 -single_module  -static  -sub_library  -sub_umbrella @gol
596 -twolevel_namespace  -umbrella  -undefined @gol
597 -unexported_symbols_list  -weak_reference_mismatches @gol
598 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
599 -mkernel -mone-byte-bool}
601 @emph{DEC Alpha Options}
602 @gccoptlist{-mno-fp-regs  -msoft-float @gol
603 -mieee  -mieee-with-inexact  -mieee-conformant @gol
604 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
605 -mtrap-precision=@var{mode}  -mbuild-constants @gol
606 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
607 -mbwx  -mmax  -mfix  -mcix @gol
608 -mfloat-vax  -mfloat-ieee @gol
609 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
610 -msmall-text  -mlarge-text @gol
611 -mmemory-latency=@var{time}}
613 @emph{FR30 Options}
614 @gccoptlist{-msmall-model -mno-lsim}
616 @emph{FRV Options}
617 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
618 -mhard-float  -msoft-float @gol
619 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
620 -mdouble  -mno-double @gol
621 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
622 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
623 -mlinked-fp  -mlong-calls  -malign-labels @gol
624 -mlibrary-pic  -macc-4  -macc-8 @gol
625 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
626 -moptimize-membar -mno-optimize-membar @gol
627 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
628 -mvliw-branch  -mno-vliw-branch @gol
629 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
630 -mno-nested-cond-exec  -mtomcat-stats @gol
631 -mTLS -mtls @gol
632 -mcpu=@var{cpu}}
634 @emph{GNU/Linux Options}
635 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
636 -tno-android-cc -tno-android-ld}
638 @emph{H8/300 Options}
639 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
641 @emph{HPPA Options}
642 @gccoptlist{-march=@var{architecture-type} @gol
643 -mdisable-fpregs  -mdisable-indexing @gol
644 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
645 -mfixed-range=@var{register-range} @gol
646 -mjump-in-delay -mlinker-opt -mlong-calls @gol
647 -mlong-load-store  -mno-disable-fpregs @gol
648 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
649 -mno-jump-in-delay  -mno-long-load-store @gol
650 -mno-portable-runtime  -mno-soft-float @gol
651 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
652 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
653 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
654 -munix=@var{unix-std}  -nolibdld  -static  -threads}
656 @emph{i386 and x86-64 Options}
657 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
658 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
659 -mfpmath=@var{unit} @gol
660 -masm=@var{dialect}  -mno-fancy-math-387 @gol
661 -mno-fp-ret-in-387  -msoft-float @gol
662 -mno-wide-multiply  -mrtd  -malign-double @gol
663 -mpreferred-stack-boundary=@var{num} @gol
664 -mincoming-stack-boundary=@var{num} @gol
665 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
666 -mrecip -mrecip=@var{opt} @gol
667 -mvzeroupper -mprefer-avx128 @gol
668 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
669 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd @gol
670 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
671 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
672 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mthreads @gol
673 -mno-align-stringops  -minline-all-stringops @gol
674 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
675 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy}
676 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
677 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
678 -mregparm=@var{num}  -msseregparm @gol
679 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
680 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
681 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
682 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
683 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
684 -msse2avx -mfentry -m8bit-idiv @gol
685 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
686 -mstack-protector-guard=@var{guard}}
688 @emph{i386 and x86-64 Windows Options}
689 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
690 -mnop-fun-dllimport -mthread @gol
691 -municode -mwin32 -mwindows -fno-set-stack-executable}
693 @emph{IA-64 Options}
694 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
695 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
696 -mconstant-gp  -mauto-pic  -mfused-madd @gol
697 -minline-float-divide-min-latency @gol
698 -minline-float-divide-max-throughput @gol
699 -mno-inline-float-divide @gol
700 -minline-int-divide-min-latency @gol
701 -minline-int-divide-max-throughput  @gol
702 -mno-inline-int-divide @gol
703 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
704 -mno-inline-sqrt @gol
705 -mdwarf2-asm -mearly-stop-bits @gol
706 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
707 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
708 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
709 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
710 -msched-spec-ldc -msched-spec-control-ldc @gol
711 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
712 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
713 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
714 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
716 @emph{LM32 Options}
717 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
718 -msign-extend-enabled -muser-enabled}
720 @emph{M32R/D Options}
721 @gccoptlist{-m32r2 -m32rx -m32r @gol
722 -mdebug @gol
723 -malign-loops -mno-align-loops @gol
724 -missue-rate=@var{number} @gol
725 -mbranch-cost=@var{number} @gol
726 -mmodel=@var{code-size-model-type} @gol
727 -msdata=@var{sdata-type} @gol
728 -mno-flush-func -mflush-func=@var{name} @gol
729 -mno-flush-trap -mflush-trap=@var{number} @gol
730 -G @var{num}}
732 @emph{M32C Options}
733 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
735 @emph{M680x0 Options}
736 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
737 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
738 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
739 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
740 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
741 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
742 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
743 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
744 -mxgot -mno-xgot}
746 @emph{MCore Options}
747 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
748 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
749 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
750 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
751 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
753 @emph{MeP Options}
754 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
755 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
756 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
757 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
758 -mtiny=@var{n}}
760 @emph{MicroBlaze Options}
761 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
762 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
763 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
764 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
765 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
767 @emph{MIPS Options}
768 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
769 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
770 -mips64  -mips64r2 @gol
771 -mips16  -mno-mips16  -mflip-mips16 @gol
772 -minterlink-compressed -mno-interlink-compressed @gol
773 -minterlink-mips16  -mno-interlink-mips16 @gol
774 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
775 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
776 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
777 -mno-float  -msingle-float  -mdouble-float @gol
778 -mabs=@var{mode}  -mnan=@var{encoding} @gol
779 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
780 -mmcu -mmno-mcu @gol
781 -meva -mno-eva @gol
782 -mmicromips -mno-micromips @gol
783 -mfpu=@var{fpu-type} @gol
784 -msmartmips  -mno-smartmips @gol
785 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
786 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
787 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
788 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
789 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
790 -membedded-data  -mno-embedded-data @gol
791 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
792 -mcode-readable=@var{setting} @gol
793 -msplit-addresses  -mno-split-addresses @gol
794 -mexplicit-relocs  -mno-explicit-relocs @gol
795 -mcheck-zero-division  -mno-check-zero-division @gol
796 -mdivide-traps  -mdivide-breaks @gol
797 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
798 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
799 -mfix-24k -mno-fix-24k @gol
800 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
801 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
802 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
803 -mflush-func=@var{func}  -mno-flush-func @gol
804 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
805 -mfp-exceptions -mno-fp-exceptions @gol
806 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
807 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
809 @emph{MMIX Options}
810 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
811 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
812 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
813 -mno-base-addresses  -msingle-exit  -mno-single-exit}
815 @emph{MN10300 Options}
816 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
817 -mno-am33 -mam33 -mam33-2 -mam34 @gol
818 -mtune=@var{cpu-type} @gol
819 -mreturn-pointer-on-d0 @gol
820 -mno-crt0  -mrelax -mliw -msetlb}
822 @emph{Moxie Options}
823 @gccoptlist{-meb -mel -mno-crt0}
825 @emph{MSP430 Options}
826 @gccoptlist{-msim -masm-hex -mmcu= -mlarge -msmall -mrelax}
828 @emph{PDP-11 Options}
829 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
830 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
831 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
832 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
833 -mbranch-expensive  -mbranch-cheap @gol
834 -munix-asm  -mdec-asm}
836 @emph{picoChip Options}
837 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
838 -msymbol-as-address -mno-inefficient-warnings}
840 @emph{PowerPC Options}
841 See RS/6000 and PowerPC Options.
843 @emph{RL78 Options}
844 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
846 @emph{RS/6000 and PowerPC Options}
847 @gccoptlist{-mcpu=@var{cpu-type} @gol
848 -mtune=@var{cpu-type} @gol
849 -mcmodel=@var{code-model} @gol
850 -mpowerpc64 @gol
851 -maltivec  -mno-altivec @gol
852 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
853 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
854 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
855 -mfprnd  -mno-fprnd @gol
856 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
857 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
858 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
859 -malign-power  -malign-natural @gol
860 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
861 -msingle-float -mdouble-float -msimple-fpu @gol
862 -mstring  -mno-string  -mupdate  -mno-update @gol
863 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
864 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
865 -mstrict-align  -mno-strict-align  -mrelocatable @gol
866 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
867 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
868 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
869 -mprioritize-restricted-insns=@var{priority} @gol
870 -msched-costly-dep=@var{dependence_type} @gol
871 -minsert-sched-nops=@var{scheme} @gol
872 -mcall-sysv  -mcall-netbsd @gol
873 -maix-struct-return  -msvr4-struct-return @gol
874 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
875 -mblock-move-inline-limit=@var{num} @gol
876 -misel -mno-isel @gol
877 -misel=yes  -misel=no @gol
878 -mspe -mno-spe @gol
879 -mspe=yes  -mspe=no @gol
880 -mpaired @gol
881 -mgen-cell-microcode -mwarn-cell-microcode @gol
882 -mvrsave -mno-vrsave @gol
883 -mmulhw -mno-mulhw @gol
884 -mdlmzb -mno-dlmzb @gol
885 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
886 -mprototype  -mno-prototype @gol
887 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
888 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
889 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
890 -mno-recip-precision @gol
891 -mveclibabi=@var{type} -mfriz -mno-friz @gol
892 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
893 -msave-toc-indirect -mno-save-toc-indirect @gol
894 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
895 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
896 -mquad-memory -mno-quad-memory @gol
897 -mcompat-align-parm -mno-compat-align-parm}
899 @emph{RX Options}
900 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
901 -mcpu=@gol
902 -mbig-endian-data -mlittle-endian-data @gol
903 -msmall-data @gol
904 -msim  -mno-sim@gol
905 -mas100-syntax -mno-as100-syntax@gol
906 -mrelax@gol
907 -mmax-constant-size=@gol
908 -mint-register=@gol
909 -mpid@gol
910 -mno-warn-multiple-fast-interrupts@gol
911 -msave-acc-in-interrupts}
913 @emph{S/390 and zSeries Options}
914 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
915 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
916 -mlong-double-64 -mlong-double-128 @gol
917 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
918 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
919 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
920 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
921 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
923 @emph{Score Options}
924 @gccoptlist{-meb -mel @gol
925 -mnhwloop @gol
926 -muls @gol
927 -mmac @gol
928 -mscore5 -mscore5u -mscore7 -mscore7d}
930 @emph{SH Options}
931 @gccoptlist{-m1  -m2  -m2e @gol
932 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
933 -m3  -m3e @gol
934 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
935 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
936 -m5-64media  -m5-64media-nofpu @gol
937 -m5-32media  -m5-32media-nofpu @gol
938 -m5-compact  -m5-compact-nofpu @gol
939 -mb  -ml  -mdalign  -mrelax @gol
940 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
941 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
942 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
943 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
944 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
945 -maccumulate-outgoing-args -minvalid-symbols @gol
946 -matomic-model=@var{atomic-model} @gol
947 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
948 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
949 -mpretend-cmove -mtas}
951 @emph{Solaris 2 Options}
952 @gccoptlist{-mimpure-text  -mno-impure-text @gol
953 -pthreads -pthread}
955 @emph{SPARC Options}
956 @gccoptlist{-mcpu=@var{cpu-type} @gol
957 -mtune=@var{cpu-type} @gol
958 -mcmodel=@var{code-model} @gol
959 -mmemory-model=@var{mem-model} @gol
960 -m32  -m64  -mapp-regs  -mno-app-regs @gol
961 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
962 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
963 -mhard-quad-float  -msoft-quad-float @gol
964 -mstack-bias  -mno-stack-bias @gol
965 -munaligned-doubles  -mno-unaligned-doubles @gol
966 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
967 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
968 -mcbcond -mno-cbcond @gol
969 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
970 -mfix-at697f -mfix-ut699}
972 @emph{SPU Options}
973 @gccoptlist{-mwarn-reloc -merror-reloc @gol
974 -msafe-dma -munsafe-dma @gol
975 -mbranch-hints @gol
976 -msmall-mem -mlarge-mem -mstdmain @gol
977 -mfixed-range=@var{register-range} @gol
978 -mea32 -mea64 @gol
979 -maddress-space-conversion -mno-address-space-conversion @gol
980 -mcache-size=@var{cache-size} @gol
981 -matomic-updates -mno-atomic-updates}
983 @emph{System V Options}
984 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
986 @emph{TILE-Gx Options}
987 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
989 @emph{TILEPro Options}
990 @gccoptlist{-mcpu=@var{cpu} -m32}
992 @emph{V850 Options}
993 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
994 -mprolog-function  -mno-prolog-function  -mspace @gol
995 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
996 -mapp-regs  -mno-app-regs @gol
997 -mdisable-callt  -mno-disable-callt @gol
998 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
999 -mv850e -mv850 -mv850e3v5 @gol
1000 -mloop @gol
1001 -mrelax @gol
1002 -mlong-jumps @gol
1003 -msoft-float @gol
1004 -mhard-float @gol
1005 -mgcc-abi @gol
1006 -mrh850-abi @gol
1007 -mbig-switch}
1009 @emph{VAX Options}
1010 @gccoptlist{-mg  -mgnu  -munix}
1012 @emph{VMS Options}
1013 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1014 -mpointer-size=@var{size}}
1016 @emph{VxWorks Options}
1017 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1018 -Xbind-lazy  -Xbind-now}
1020 @emph{x86-64 Options}
1021 See i386 and x86-64 Options.
1023 @emph{Xstormy16 Options}
1024 @gccoptlist{-msim}
1026 @emph{Xtensa Options}
1027 @gccoptlist{-mconst16 -mno-const16 @gol
1028 -mfused-madd  -mno-fused-madd @gol
1029 -mforce-no-pic @gol
1030 -mserialize-volatile  -mno-serialize-volatile @gol
1031 -mtext-section-literals  -mno-text-section-literals @gol
1032 -mtarget-align  -mno-target-align @gol
1033 -mlongcalls  -mno-longcalls}
1035 @emph{zSeries Options}
1036 See S/390 and zSeries Options.
1038 @item Code Generation Options
1039 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1040 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1041 -ffixed-@var{reg}  -fexceptions @gol
1042 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1043 -fasynchronous-unwind-tables @gol
1044 -finhibit-size-directive  -finstrument-functions @gol
1045 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1046 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1047 -fno-common  -fno-ident @gol
1048 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1049 -fno-jump-tables @gol
1050 -frecord-gcc-switches @gol
1051 -freg-struct-return  -fshort-enums @gol
1052 -fshort-double  -fshort-wchar @gol
1053 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1054 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1055 -fno-stack-limit -fsplit-stack @gol
1056 -fleading-underscore  -ftls-model=@var{model} @gol
1057 -fstack-reuse=@var{reuse_level} @gol
1058 -ftrapv  -fwrapv  -fbounds-check @gol
1059 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1060 @end table
1062 @menu
1063 * Overall Options::     Controlling the kind of output:
1064                         an executable, object files, assembler files,
1065                         or preprocessed source.
1066 * C Dialect Options::   Controlling the variant of C language compiled.
1067 * C++ Dialect Options:: Variations on C++.
1068 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1069                         and Objective-C++.
1070 * Language Independent Options:: Controlling how diagnostics should be
1071                         formatted.
1072 * Warning Options::     How picky should the compiler be?
1073 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1074 * Optimize Options::    How much optimization?
1075 * Preprocessor Options:: Controlling header files and macro definitions.
1076                          Also, getting dependency information for Make.
1077 * Assembler Options::   Passing options to the assembler.
1078 * Link Options::        Specifying libraries and so on.
1079 * Directory Options::   Where to find header files and libraries.
1080                         Where to find the compiler executable files.
1081 * Spec Files::          How to pass switches to sub-processes.
1082 * Target Options::      Running a cross-compiler, or an old version of GCC.
1083 @end menu
1085 @node Overall Options
1086 @section Options Controlling the Kind of Output
1088 Compilation can involve up to four stages: preprocessing, compilation
1089 proper, assembly and linking, always in that order.  GCC is capable of
1090 preprocessing and compiling several files either into several
1091 assembler input files, or into one assembler input file; then each
1092 assembler input file produces an object file, and linking combines all
1093 the object files (those newly compiled, and those specified as input)
1094 into an executable file.
1096 @cindex file name suffix
1097 For any given input file, the file name suffix determines what kind of
1098 compilation is done:
1100 @table @gcctabopt
1101 @item @var{file}.c
1102 C source code that must be preprocessed.
1104 @item @var{file}.i
1105 C source code that should not be preprocessed.
1107 @item @var{file}.ii
1108 C++ source code that should not be preprocessed.
1110 @item @var{file}.m
1111 Objective-C source code.  Note that you must link with the @file{libobjc}
1112 library to make an Objective-C program work.
1114 @item @var{file}.mi
1115 Objective-C source code that should not be preprocessed.
1117 @item @var{file}.mm
1118 @itemx @var{file}.M
1119 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1120 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1121 to a literal capital M@.
1123 @item @var{file}.mii
1124 Objective-C++ source code that should not be preprocessed.
1126 @item @var{file}.h
1127 C, C++, Objective-C or Objective-C++ header file to be turned into a
1128 precompiled header (default), or C, C++ header file to be turned into an
1129 Ada spec (via the @option{-fdump-ada-spec} switch).
1131 @item @var{file}.cc
1132 @itemx @var{file}.cp
1133 @itemx @var{file}.cxx
1134 @itemx @var{file}.cpp
1135 @itemx @var{file}.CPP
1136 @itemx @var{file}.c++
1137 @itemx @var{file}.C
1138 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1139 the last two letters must both be literally @samp{x}.  Likewise,
1140 @samp{.C} refers to a literal capital C@.
1142 @item @var{file}.mm
1143 @itemx @var{file}.M
1144 Objective-C++ source code that must be preprocessed.
1146 @item @var{file}.mii
1147 Objective-C++ source code that should not be preprocessed.
1149 @item @var{file}.hh
1150 @itemx @var{file}.H
1151 @itemx @var{file}.hp
1152 @itemx @var{file}.hxx
1153 @itemx @var{file}.hpp
1154 @itemx @var{file}.HPP
1155 @itemx @var{file}.h++
1156 @itemx @var{file}.tcc
1157 C++ header file to be turned into a precompiled header or Ada spec.
1159 @item @var{file}.f
1160 @itemx @var{file}.for
1161 @itemx @var{file}.ftn
1162 Fixed form Fortran source code that should not be preprocessed.
1164 @item @var{file}.F
1165 @itemx @var{file}.FOR
1166 @itemx @var{file}.fpp
1167 @itemx @var{file}.FPP
1168 @itemx @var{file}.FTN
1169 Fixed form Fortran source code that must be preprocessed (with the traditional
1170 preprocessor).
1172 @item @var{file}.f90
1173 @itemx @var{file}.f95
1174 @itemx @var{file}.f03
1175 @itemx @var{file}.f08
1176 Free form Fortran source code that should not be preprocessed.
1178 @item @var{file}.F90
1179 @itemx @var{file}.F95
1180 @itemx @var{file}.F03
1181 @itemx @var{file}.F08
1182 Free form Fortran source code that must be preprocessed (with the
1183 traditional preprocessor).
1185 @item @var{file}.go
1186 Go source code.
1188 @c FIXME: Descriptions of Java file types.
1189 @c @var{file}.java
1190 @c @var{file}.class
1191 @c @var{file}.zip
1192 @c @var{file}.jar
1194 @item @var{file}.ads
1195 Ada source code file that contains a library unit declaration (a
1196 declaration of a package, subprogram, or generic, or a generic
1197 instantiation), or a library unit renaming declaration (a package,
1198 generic, or subprogram renaming declaration).  Such files are also
1199 called @dfn{specs}.
1201 @item @var{file}.adb
1202 Ada source code file containing a library unit body (a subprogram or
1203 package body).  Such files are also called @dfn{bodies}.
1205 @c GCC also knows about some suffixes for languages not yet included:
1206 @c Pascal:
1207 @c @var{file}.p
1208 @c @var{file}.pas
1209 @c Ratfor:
1210 @c @var{file}.r
1212 @item @var{file}.s
1213 Assembler code.
1215 @item @var{file}.S
1216 @itemx @var{file}.sx
1217 Assembler code that must be preprocessed.
1219 @item @var{other}
1220 An object file to be fed straight into linking.
1221 Any file name with no recognized suffix is treated this way.
1222 @end table
1224 @opindex x
1225 You can specify the input language explicitly with the @option{-x} option:
1227 @table @gcctabopt
1228 @item -x @var{language}
1229 Specify explicitly the @var{language} for the following input files
1230 (rather than letting the compiler choose a default based on the file
1231 name suffix).  This option applies to all following input files until
1232 the next @option{-x} option.  Possible values for @var{language} are:
1233 @smallexample
1234 c  c-header  cpp-output
1235 c++  c++-header  c++-cpp-output
1236 objective-c  objective-c-header  objective-c-cpp-output
1237 objective-c++ objective-c++-header objective-c++-cpp-output
1238 assembler  assembler-with-cpp
1240 f77  f77-cpp-input f95  f95-cpp-input
1242 java
1243 @end smallexample
1245 @item -x none
1246 Turn off any specification of a language, so that subsequent files are
1247 handled according to their file name suffixes (as they are if @option{-x}
1248 has not been used at all).
1250 @item -pass-exit-codes
1251 @opindex pass-exit-codes
1252 Normally the @command{gcc} program exits with the code of 1 if any
1253 phase of the compiler returns a non-success return code.  If you specify
1254 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1255 the numerically highest error produced by any phase returning an error
1256 indication.  The C, C++, and Fortran front ends return 4 if an internal
1257 compiler error is encountered.
1258 @end table
1260 If you only want some of the stages of compilation, you can use
1261 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1262 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1263 @command{gcc} is to stop.  Note that some combinations (for example,
1264 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1266 @table @gcctabopt
1267 @item -c
1268 @opindex c
1269 Compile or assemble the source files, but do not link.  The linking
1270 stage simply is not done.  The ultimate output is in the form of an
1271 object file for each source file.
1273 By default, the object file name for a source file is made by replacing
1274 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1276 Unrecognized input files, not requiring compilation or assembly, are
1277 ignored.
1279 @item -S
1280 @opindex S
1281 Stop after the stage of compilation proper; do not assemble.  The output
1282 is in the form of an assembler code file for each non-assembler input
1283 file specified.
1285 By default, the assembler file name for a source file is made by
1286 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1288 Input files that don't require compilation are ignored.
1290 @item -E
1291 @opindex E
1292 Stop after the preprocessing stage; do not run the compiler proper.  The
1293 output is in the form of preprocessed source code, which is sent to the
1294 standard output.
1296 Input files that don't require preprocessing are ignored.
1298 @cindex output file option
1299 @item -o @var{file}
1300 @opindex o
1301 Place output in file @var{file}.  This applies to whatever
1302 sort of output is being produced, whether it be an executable file,
1303 an object file, an assembler file or preprocessed C code.
1305 If @option{-o} is not specified, the default is to put an executable
1306 file in @file{a.out}, the object file for
1307 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1308 assembler file in @file{@var{source}.s}, a precompiled header file in
1309 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1310 standard output.
1312 @item -v
1313 @opindex v
1314 Print (on standard error output) the commands executed to run the stages
1315 of compilation.  Also print the version number of the compiler driver
1316 program and of the preprocessor and the compiler proper.
1318 @item -###
1319 @opindex ###
1320 Like @option{-v} except the commands are not executed and arguments
1321 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1322 This is useful for shell scripts to capture the driver-generated command lines.
1324 @item -pipe
1325 @opindex pipe
1326 Use pipes rather than temporary files for communication between the
1327 various stages of compilation.  This fails to work on some systems where
1328 the assembler is unable to read from a pipe; but the GNU assembler has
1329 no trouble.
1331 @item --help
1332 @opindex help
1333 Print (on the standard output) a description of the command-line options
1334 understood by @command{gcc}.  If the @option{-v} option is also specified
1335 then @option{--help} is also passed on to the various processes
1336 invoked by @command{gcc}, so that they can display the command-line options
1337 they accept.  If the @option{-Wextra} option has also been specified
1338 (prior to the @option{--help} option), then command-line options that
1339 have no documentation associated with them are also displayed.
1341 @item --target-help
1342 @opindex target-help
1343 Print (on the standard output) a description of target-specific command-line
1344 options for each tool.  For some targets extra target-specific
1345 information may also be printed.
1347 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1348 Print (on the standard output) a description of the command-line
1349 options understood by the compiler that fit into all specified classes
1350 and qualifiers.  These are the supported classes:
1352 @table @asis
1353 @item @samp{optimizers}
1354 Display all of the optimization options supported by the
1355 compiler.
1357 @item @samp{warnings}
1358 Display all of the options controlling warning messages
1359 produced by the compiler.
1361 @item @samp{target}
1362 Display target-specific options.  Unlike the
1363 @option{--target-help} option however, target-specific options of the
1364 linker and assembler are not displayed.  This is because those
1365 tools do not currently support the extended @option{--help=} syntax.
1367 @item @samp{params}
1368 Display the values recognized by the @option{--param}
1369 option.
1371 @item @var{language}
1372 Display the options supported for @var{language}, where
1373 @var{language} is the name of one of the languages supported in this
1374 version of GCC@.
1376 @item @samp{common}
1377 Display the options that are common to all languages.
1378 @end table
1380 These are the supported qualifiers:
1382 @table @asis
1383 @item @samp{undocumented}
1384 Display only those options that are undocumented.
1386 @item @samp{joined}
1387 Display options taking an argument that appears after an equal
1388 sign in the same continuous piece of text, such as:
1389 @samp{--help=target}.
1391 @item @samp{separate}
1392 Display options taking an argument that appears as a separate word
1393 following the original option, such as: @samp{-o output-file}.
1394 @end table
1396 Thus for example to display all the undocumented target-specific
1397 switches supported by the compiler, use:
1399 @smallexample
1400 --help=target,undocumented
1401 @end smallexample
1403 The sense of a qualifier can be inverted by prefixing it with the
1404 @samp{^} character, so for example to display all binary warning
1405 options (i.e., ones that are either on or off and that do not take an
1406 argument) that have a description, use:
1408 @smallexample
1409 --help=warnings,^joined,^undocumented
1410 @end smallexample
1412 The argument to @option{--help=} should not consist solely of inverted
1413 qualifiers.
1415 Combining several classes is possible, although this usually
1416 restricts the output so much that there is nothing to display.  One
1417 case where it does work, however, is when one of the classes is
1418 @var{target}.  For example, to display all the target-specific
1419 optimization options, use:
1421 @smallexample
1422 --help=target,optimizers
1423 @end smallexample
1425 The @option{--help=} option can be repeated on the command line.  Each
1426 successive use displays its requested class of options, skipping
1427 those that have already been displayed.
1429 If the @option{-Q} option appears on the command line before the
1430 @option{--help=} option, then the descriptive text displayed by
1431 @option{--help=} is changed.  Instead of describing the displayed
1432 options, an indication is given as to whether the option is enabled,
1433 disabled or set to a specific value (assuming that the compiler
1434 knows this at the point where the @option{--help=} option is used).
1436 Here is a truncated example from the ARM port of @command{gcc}:
1438 @smallexample
1439   % gcc -Q -mabi=2 --help=target -c
1440   The following options are target specific:
1441   -mabi=                                2
1442   -mabort-on-noreturn                   [disabled]
1443   -mapcs                                [disabled]
1444 @end smallexample
1446 The output is sensitive to the effects of previous command-line
1447 options, so for example it is possible to find out which optimizations
1448 are enabled at @option{-O2} by using:
1450 @smallexample
1451 -Q -O2 --help=optimizers
1452 @end smallexample
1454 Alternatively you can discover which binary optimizations are enabled
1455 by @option{-O3} by using:
1457 @smallexample
1458 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1459 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1460 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1461 @end smallexample
1463 @item -no-canonical-prefixes
1464 @opindex no-canonical-prefixes
1465 Do not expand any symbolic links, resolve references to @samp{/../}
1466 or @samp{/./}, or make the path absolute when generating a relative
1467 prefix.
1469 @item --version
1470 @opindex version
1471 Display the version number and copyrights of the invoked GCC@.
1473 @item -wrapper
1474 @opindex wrapper
1475 Invoke all subcommands under a wrapper program.  The name of the
1476 wrapper program and its parameters are passed as a comma separated
1477 list.
1479 @smallexample
1480 gcc -c t.c -wrapper gdb,--args
1481 @end smallexample
1483 @noindent
1484 This invokes all subprograms of @command{gcc} under
1485 @samp{gdb --args}, thus the invocation of @command{cc1} is
1486 @samp{gdb --args cc1 @dots{}}.
1488 @item -fplugin=@var{name}.so
1489 Load the plugin code in file @var{name}.so, assumed to be a
1490 shared object to be dlopen'd by the compiler.  The base name of
1491 the shared object file is used to identify the plugin for the
1492 purposes of argument parsing (See
1493 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1494 Each plugin should define the callback functions specified in the
1495 Plugins API.
1497 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1498 Define an argument called @var{key} with a value of @var{value}
1499 for the plugin called @var{name}.
1501 @item -fdump-ada-spec@r{[}-slim@r{]}
1502 For C and C++ source and include files, generate corresponding Ada
1503 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1504 GNAT User's Guide}, which provides detailed documentation on this feature.
1506 @item -fdump-go-spec=@var{file}
1507 For input files in any language, generate corresponding Go
1508 declarations in @var{file}.  This generates Go @code{const},
1509 @code{type}, @code{var}, and @code{func} declarations which may be a
1510 useful way to start writing a Go interface to code written in some
1511 other language.
1513 @include @value{srcdir}/../libiberty/at-file.texi
1514 @end table
1516 @node Invoking G++
1517 @section Compiling C++ Programs
1519 @cindex suffixes for C++ source
1520 @cindex C++ source file suffixes
1521 C++ source files conventionally use one of the suffixes @samp{.C},
1522 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1523 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1524 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1525 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1526 files with these names and compiles them as C++ programs even if you
1527 call the compiler the same way as for compiling C programs (usually
1528 with the name @command{gcc}).
1530 @findex g++
1531 @findex c++
1532 However, the use of @command{gcc} does not add the C++ library.
1533 @command{g++} is a program that calls GCC and automatically specifies linking
1534 against the C++ library.  It treats @samp{.c},
1535 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1536 files unless @option{-x} is used.  This program is also useful when
1537 precompiling a C header file with a @samp{.h} extension for use in C++
1538 compilations.  On many systems, @command{g++} is also installed with
1539 the name @command{c++}.
1541 @cindex invoking @command{g++}
1542 When you compile C++ programs, you may specify many of the same
1543 command-line options that you use for compiling programs in any
1544 language; or command-line options meaningful for C and related
1545 languages; or options that are meaningful only for C++ programs.
1546 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1547 explanations of options for languages related to C@.
1548 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1549 explanations of options that are meaningful only for C++ programs.
1551 @node C Dialect Options
1552 @section Options Controlling C Dialect
1553 @cindex dialect options
1554 @cindex language dialect options
1555 @cindex options, dialect
1557 The following options control the dialect of C (or languages derived
1558 from C, such as C++, Objective-C and Objective-C++) that the compiler
1559 accepts:
1561 @table @gcctabopt
1562 @cindex ANSI support
1563 @cindex ISO support
1564 @item -ansi
1565 @opindex ansi
1566 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1567 equivalent to @option{-std=c++98}.
1569 This turns off certain features of GCC that are incompatible with ISO
1570 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1571 such as the @code{asm} and @code{typeof} keywords, and
1572 predefined macros such as @code{unix} and @code{vax} that identify the
1573 type of system you are using.  It also enables the undesirable and
1574 rarely used ISO trigraph feature.  For the C compiler,
1575 it disables recognition of C++ style @samp{//} comments as well as
1576 the @code{inline} keyword.
1578 The alternate keywords @code{__asm__}, @code{__extension__},
1579 @code{__inline__} and @code{__typeof__} continue to work despite
1580 @option{-ansi}.  You would not want to use them in an ISO C program, of
1581 course, but it is useful to put them in header files that might be included
1582 in compilations done with @option{-ansi}.  Alternate predefined macros
1583 such as @code{__unix__} and @code{__vax__} are also available, with or
1584 without @option{-ansi}.
1586 The @option{-ansi} option does not cause non-ISO programs to be
1587 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1588 addition to @option{-ansi}.  @xref{Warning Options}.
1590 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1591 option is used.  Some header files may notice this macro and refrain
1592 from declaring certain functions or defining certain macros that the
1593 ISO standard doesn't call for; this is to avoid interfering with any
1594 programs that might use these names for other things.
1596 Functions that are normally built in but do not have semantics
1597 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1598 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1599 built-in functions provided by GCC}, for details of the functions
1600 affected.
1602 @item -std=
1603 @opindex std
1604 Determine the language standard. @xref{Standards,,Language Standards
1605 Supported by GCC}, for details of these standard versions.  This option
1606 is currently only supported when compiling C or C++.
1608 The compiler can accept several base standards, such as @samp{c90} or
1609 @samp{c++98}, and GNU dialects of those standards, such as
1610 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1611 compiler accepts all programs following that standard plus those
1612 using GNU extensions that do not contradict it.  For example,
1613 @option{-std=c90} turns off certain features of GCC that are
1614 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1615 keywords, but not other GNU extensions that do not have a meaning in
1616 ISO C90, such as omitting the middle term of a @code{?:}
1617 expression. On the other hand, when a GNU dialect of a standard is
1618 specified, all features supported by the compiler are enabled, even when
1619 those features change the meaning of the base standard.  As a result, some
1620 strict-conforming programs may be rejected.  The particular standard
1621 is used by @option{-Wpedantic} to identify which features are GNU
1622 extensions given that version of the standard. For example
1623 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1624 comments, while @option{-std=gnu99 -Wpedantic} does not.
1626 A value for this option must be provided; possible values are
1628 @table @samp
1629 @item c90
1630 @itemx c89
1631 @itemx iso9899:1990
1632 Support all ISO C90 programs (certain GNU extensions that conflict
1633 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1635 @item iso9899:199409
1636 ISO C90 as modified in amendment 1.
1638 @item c99
1639 @itemx c9x
1640 @itemx iso9899:1999
1641 @itemx iso9899:199x
1642 ISO C99.  Note that this standard is not yet fully supported; see
1643 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1644 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1646 @item c11
1647 @itemx c1x
1648 @itemx iso9899:2011
1649 ISO C11, the 2011 revision of the ISO C standard.
1650 Support is incomplete and experimental.  The name @samp{c1x} is
1651 deprecated.
1653 @item gnu90
1654 @itemx gnu89
1655 GNU dialect of ISO C90 (including some C99 features). This
1656 is the default for C code.
1658 @item gnu99
1659 @itemx gnu9x
1660 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1661 this will become the default.  The name @samp{gnu9x} is deprecated.
1663 @item gnu11
1664 @itemx gnu1x
1665 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1666 name @samp{gnu1x} is deprecated.
1668 @item c++98
1669 @itemx c++03
1670 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1671 additional defect reports. Same as @option{-ansi} for C++ code.
1673 @item gnu++98
1674 @itemx gnu++03
1675 GNU dialect of @option{-std=c++98}.  This is the default for
1676 C++ code.
1678 @item c++11
1679 @itemx c++0x
1680 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1681 experimental, and may change in incompatible ways in future releases.
1682 The name @samp{c++0x} is deprecated.
1684 @item gnu++11
1685 @itemx gnu++0x
1686 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1687 experimental, and may change in incompatible ways in future releases.
1688 The name @samp{gnu++0x} is deprecated.
1690 @item c++1y
1691 The next revision of the ISO C++ standard, tentatively planned for
1692 2014.  Support is highly experimental, and will almost certainly
1693 change in incompatible ways in future releases.
1695 @item gnu++1y
1696 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1697 and will almost certainly change in incompatible ways in future
1698 releases.
1699 @end table
1701 @item -fgnu89-inline
1702 @opindex fgnu89-inline
1703 The option @option{-fgnu89-inline} tells GCC to use the traditional
1704 GNU semantics for @code{inline} functions when in C99 mode.
1705 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1706 is accepted and ignored by GCC versions 4.1.3 up to but not including
1707 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1708 C99 mode.  Using this option is roughly equivalent to adding the
1709 @code{gnu_inline} function attribute to all inline functions
1710 (@pxref{Function Attributes}).
1712 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1713 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1714 specifies the default behavior).  This option was first supported in
1715 GCC 4.3.  This option is not supported in @option{-std=c90} or
1716 @option{-std=gnu90} mode.
1718 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1719 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1720 in effect for @code{inline} functions.  @xref{Common Predefined
1721 Macros,,,cpp,The C Preprocessor}.
1723 @item -aux-info @var{filename}
1724 @opindex aux-info
1725 Output to the given filename prototyped declarations for all functions
1726 declared and/or defined in a translation unit, including those in header
1727 files.  This option is silently ignored in any language other than C@.
1729 Besides declarations, the file indicates, in comments, the origin of
1730 each declaration (source file and line), whether the declaration was
1731 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1732 @samp{O} for old, respectively, in the first character after the line
1733 number and the colon), and whether it came from a declaration or a
1734 definition (@samp{C} or @samp{F}, respectively, in the following
1735 character).  In the case of function definitions, a K&R-style list of
1736 arguments followed by their declarations is also provided, inside
1737 comments, after the declaration.
1739 @item -fallow-parameterless-variadic-functions
1740 Accept variadic functions without named parameters.
1742 Although it is possible to define such a function, this is not very
1743 useful as it is not possible to read the arguments.  This is only
1744 supported for C as this construct is allowed by C++.
1746 @item -fno-asm
1747 @opindex fno-asm
1748 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1749 keyword, so that code can use these words as identifiers.  You can use
1750 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1751 instead.  @option{-ansi} implies @option{-fno-asm}.
1753 In C++, this switch only affects the @code{typeof} keyword, since
1754 @code{asm} and @code{inline} are standard keywords.  You may want to
1755 use the @option{-fno-gnu-keywords} flag instead, which has the same
1756 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1757 switch only affects the @code{asm} and @code{typeof} keywords, since
1758 @code{inline} is a standard keyword in ISO C99.
1760 @item -fno-builtin
1761 @itemx -fno-builtin-@var{function}
1762 @opindex fno-builtin
1763 @cindex built-in functions
1764 Don't recognize built-in functions that do not begin with
1765 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1766 functions provided by GCC}, for details of the functions affected,
1767 including those which are not built-in functions when @option{-ansi} or
1768 @option{-std} options for strict ISO C conformance are used because they
1769 do not have an ISO standard meaning.
1771 GCC normally generates special code to handle certain built-in functions
1772 more efficiently; for instance, calls to @code{alloca} may become single
1773 instructions which adjust the stack directly, and calls to @code{memcpy}
1774 may become inline copy loops.  The resulting code is often both smaller
1775 and faster, but since the function calls no longer appear as such, you
1776 cannot set a breakpoint on those calls, nor can you change the behavior
1777 of the functions by linking with a different library.  In addition,
1778 when a function is recognized as a built-in function, GCC may use
1779 information about that function to warn about problems with calls to
1780 that function, or to generate more efficient code, even if the
1781 resulting code still contains calls to that function.  For example,
1782 warnings are given with @option{-Wformat} for bad calls to
1783 @code{printf} when @code{printf} is built in and @code{strlen} is
1784 known not to modify global memory.
1786 With the @option{-fno-builtin-@var{function}} option
1787 only the built-in function @var{function} is
1788 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1789 function is named that is not built-in in this version of GCC, this
1790 option is ignored.  There is no corresponding
1791 @option{-fbuiltin-@var{function}} option; if you wish to enable
1792 built-in functions selectively when using @option{-fno-builtin} or
1793 @option{-ffreestanding}, you may define macros such as:
1795 @smallexample
1796 #define abs(n)          __builtin_abs ((n))
1797 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1798 @end smallexample
1800 @item -fhosted
1801 @opindex fhosted
1802 @cindex hosted environment
1804 Assert that compilation targets a hosted environment.  This implies
1805 @option{-fbuiltin}.  A hosted environment is one in which the
1806 entire standard library is available, and in which @code{main} has a return
1807 type of @code{int}.  Examples are nearly everything except a kernel.
1808 This is equivalent to @option{-fno-freestanding}.
1810 @item -ffreestanding
1811 @opindex ffreestanding
1812 @cindex hosted environment
1814 Assert that compilation targets a freestanding environment.  This
1815 implies @option{-fno-builtin}.  A freestanding environment
1816 is one in which the standard library may not exist, and program startup may
1817 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1818 This is equivalent to @option{-fno-hosted}.
1820 @xref{Standards,,Language Standards Supported by GCC}, for details of
1821 freestanding and hosted environments.
1823 @item -fopenmp
1824 @opindex fopenmp
1825 @cindex OpenMP parallel
1826 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1827 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1828 compiler generates parallel code according to the OpenMP Application
1829 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1830 implies @option{-pthread}, and thus is only supported on targets that
1831 have support for @option{-pthread}.
1833 @item -fcilkplus
1834 @opindex fcilkplus
1835 @cindex Enable Cilk Plus
1836 Enable the usage of Cilk Plus language extension features for C/C++.
1837 When the option @option{-fcilkplus} is specified, enable the usage of
1838 the Cilk Plus Language extension features for C/C++.  The present
1839 implementation follows ABI version 0.9.  This is an experimental
1840 feature that is only partially complete, and whose interface may
1841 change in future versions of GCC as the official specification
1842 changes.  Currently only the array notation feature of the language
1843 specification has been implemented.  More features will be implemented
1844 in subsequent release cycles.
1846 @item -fgnu-tm
1847 @opindex fgnu-tm
1848 When the option @option{-fgnu-tm} is specified, the compiler
1849 generates code for the Linux variant of Intel's current Transactional
1850 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1851 an experimental feature whose interface may change in future versions
1852 of GCC, as the official specification changes.  Please note that not
1853 all architectures are supported for this feature.
1855 For more information on GCC's support for transactional memory,
1856 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1857 Transactional Memory Library}.
1859 Note that the transactional memory feature is not supported with
1860 non-call exceptions (@option{-fnon-call-exceptions}).
1862 @item -fms-extensions
1863 @opindex fms-extensions
1864 Accept some non-standard constructs used in Microsoft header files.
1866 In C++ code, this allows member names in structures to be similar
1867 to previous types declarations.
1869 @smallexample
1870 typedef int UOW;
1871 struct ABC @{
1872   UOW UOW;
1874 @end smallexample
1876 Some cases of unnamed fields in structures and unions are only
1877 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1878 fields within structs/unions}, for details.
1880 Note that this option is off for all targets but i?86 and x86_64
1881 targets using ms-abi.
1882 @item -fplan9-extensions
1883 Accept some non-standard constructs used in Plan 9 code.
1885 This enables @option{-fms-extensions}, permits passing pointers to
1886 structures with anonymous fields to functions that expect pointers to
1887 elements of the type of the field, and permits referring to anonymous
1888 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1889 struct/union fields within structs/unions}, for details.  This is only
1890 supported for C, not C++.
1892 @item -trigraphs
1893 @opindex trigraphs
1894 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1895 options for strict ISO C conformance) implies @option{-trigraphs}.
1897 @cindex traditional C language
1898 @cindex C language, traditional
1899 @item -traditional
1900 @itemx -traditional-cpp
1901 @opindex traditional-cpp
1902 @opindex traditional
1903 Formerly, these options caused GCC to attempt to emulate a pre-standard
1904 C compiler.  They are now only supported with the @option{-E} switch.
1905 The preprocessor continues to support a pre-standard mode.  See the GNU
1906 CPP manual for details.
1908 @item -fcond-mismatch
1909 @opindex fcond-mismatch
1910 Allow conditional expressions with mismatched types in the second and
1911 third arguments.  The value of such an expression is void.  This option
1912 is not supported for C++.
1914 @item -flax-vector-conversions
1915 @opindex flax-vector-conversions
1916 Allow implicit conversions between vectors with differing numbers of
1917 elements and/or incompatible element types.  This option should not be
1918 used for new code.
1920 @item -funsigned-char
1921 @opindex funsigned-char
1922 Let the type @code{char} be unsigned, like @code{unsigned char}.
1924 Each kind of machine has a default for what @code{char} should
1925 be.  It is either like @code{unsigned char} by default or like
1926 @code{signed char} by default.
1928 Ideally, a portable program should always use @code{signed char} or
1929 @code{unsigned char} when it depends on the signedness of an object.
1930 But many programs have been written to use plain @code{char} and
1931 expect it to be signed, or expect it to be unsigned, depending on the
1932 machines they were written for.  This option, and its inverse, let you
1933 make such a program work with the opposite default.
1935 The type @code{char} is always a distinct type from each of
1936 @code{signed char} or @code{unsigned char}, even though its behavior
1937 is always just like one of those two.
1939 @item -fsigned-char
1940 @opindex fsigned-char
1941 Let the type @code{char} be signed, like @code{signed char}.
1943 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1944 the negative form of @option{-funsigned-char}.  Likewise, the option
1945 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1947 @item -fsigned-bitfields
1948 @itemx -funsigned-bitfields
1949 @itemx -fno-signed-bitfields
1950 @itemx -fno-unsigned-bitfields
1951 @opindex fsigned-bitfields
1952 @opindex funsigned-bitfields
1953 @opindex fno-signed-bitfields
1954 @opindex fno-unsigned-bitfields
1955 These options control whether a bit-field is signed or unsigned, when the
1956 declaration does not use either @code{signed} or @code{unsigned}.  By
1957 default, such a bit-field is signed, because this is consistent: the
1958 basic integer types such as @code{int} are signed types.
1959 @end table
1961 @node C++ Dialect Options
1962 @section Options Controlling C++ Dialect
1964 @cindex compiler options, C++
1965 @cindex C++ options, command-line
1966 @cindex options, C++
1967 This section describes the command-line options that are only meaningful
1968 for C++ programs.  You can also use most of the GNU compiler options
1969 regardless of what language your program is in.  For example, you
1970 might compile a file @code{firstClass.C} like this:
1972 @smallexample
1973 g++ -g -frepo -O -c firstClass.C
1974 @end smallexample
1976 @noindent
1977 In this example, only @option{-frepo} is an option meant
1978 only for C++ programs; you can use the other options with any
1979 language supported by GCC@.
1981 Here is a list of options that are @emph{only} for compiling C++ programs:
1983 @table @gcctabopt
1985 @item -fabi-version=@var{n}
1986 @opindex fabi-version
1987 Use version @var{n} of the C++ ABI@.  The default is version 2.
1989 Version 0 refers to the version conforming most closely to
1990 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1991 will change in different versions of G++ as ABI bugs are fixed.
1993 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1995 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1997 Version 3 corrects an error in mangling a constant address as a
1998 template argument.
2000 Version 4, which first appeared in G++ 4.5, implements a standard
2001 mangling for vector types.
2003 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2004 attribute const/volatile on function pointer types, decltype of a
2005 plain decl, and use of a function parameter in the declaration of
2006 another parameter.
2008 Version 6, which first appeared in G++ 4.7, corrects the promotion
2009 behavior of C++11 scoped enums and the mangling of template argument
2010 packs, const/static_cast, prefix ++ and --, and a class scope function
2011 used as a template argument.
2013 See also @option{-Wabi}.
2015 @item -fno-access-control
2016 @opindex fno-access-control
2017 Turn off all access checking.  This switch is mainly useful for working
2018 around bugs in the access control code.
2020 @item -fcheck-new
2021 @opindex fcheck-new
2022 Check that the pointer returned by @code{operator new} is non-null
2023 before attempting to modify the storage allocated.  This check is
2024 normally unnecessary because the C++ standard specifies that
2025 @code{operator new} only returns @code{0} if it is declared
2026 @samp{throw()}, in which case the compiler always checks the
2027 return value even without this option.  In all other cases, when
2028 @code{operator new} has a non-empty exception specification, memory
2029 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2030 @samp{new (nothrow)}.
2032 @item -fconstexpr-depth=@var{n}
2033 @opindex fconstexpr-depth
2034 Set the maximum nested evaluation depth for C++11 constexpr functions
2035 to @var{n}.  A limit is needed to detect endless recursion during
2036 constant expression evaluation.  The minimum specified by the standard
2037 is 512.
2039 @item -fdeduce-init-list
2040 @opindex fdeduce-init-list
2041 Enable deduction of a template type parameter as
2042 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2044 @smallexample
2045 template <class T> auto forward(T t) -> decltype (realfn (t))
2047   return realfn (t);
2050 void f()
2052   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2054 @end smallexample
2056 This deduction was implemented as a possible extension to the
2057 originally proposed semantics for the C++11 standard, but was not part
2058 of the final standard, so it is disabled by default.  This option is
2059 deprecated, and may be removed in a future version of G++.
2061 @item -ffriend-injection
2062 @opindex ffriend-injection
2063 Inject friend functions into the enclosing namespace, so that they are
2064 visible outside the scope of the class in which they are declared.
2065 Friend functions were documented to work this way in the old Annotated
2066 C++ Reference Manual, and versions of G++ before 4.1 always worked
2067 that way.  However, in ISO C++ a friend function that is not declared
2068 in an enclosing scope can only be found using argument dependent
2069 lookup.  This option causes friends to be injected as they were in
2070 earlier releases.
2072 This option is for compatibility, and may be removed in a future
2073 release of G++.
2075 @item -fno-elide-constructors
2076 @opindex fno-elide-constructors
2077 The C++ standard allows an implementation to omit creating a temporary
2078 that is only used to initialize another object of the same type.
2079 Specifying this option disables that optimization, and forces G++ to
2080 call the copy constructor in all cases.
2082 @item -fno-enforce-eh-specs
2083 @opindex fno-enforce-eh-specs
2084 Don't generate code to check for violation of exception specifications
2085 at run time.  This option violates the C++ standard, but may be useful
2086 for reducing code size in production builds, much like defining
2087 @samp{NDEBUG}.  This does not give user code permission to throw
2088 exceptions in violation of the exception specifications; the compiler
2089 still optimizes based on the specifications, so throwing an
2090 unexpected exception results in undefined behavior at run time.
2092 @item -fextern-tls-init
2093 @itemx -fno-extern-tls-init
2094 @opindex fextern-tls-init
2095 @opindex fno-extern-tls-init
2096 The C++11 and OpenMP standards allow @samp{thread_local} and
2097 @samp{threadprivate} variables to have dynamic (runtime)
2098 initialization.  To support this, any use of such a variable goes
2099 through a wrapper function that performs any necessary initialization.
2100 When the use and definition of the variable are in the same
2101 translation unit, this overhead can be optimized away, but when the
2102 use is in a different translation unit there is significant overhead
2103 even if the variable doesn't actually need dynamic initialization.  If
2104 the programmer can be sure that no use of the variable in a
2105 non-defining TU needs to trigger dynamic initialization (either
2106 because the variable is statically initialized, or a use of the
2107 variable in the defining TU will be executed before any uses in
2108 another TU), they can avoid this overhead with the
2109 @option{-fno-extern-tls-init} option.
2111 On targets that support symbol aliases, the default is
2112 @option{-fextern-tls-init}.  On targets that do not support symbol
2113 aliases, the default is @option{-fno-extern-tls-init}.
2115 @item -ffor-scope
2116 @itemx -fno-for-scope
2117 @opindex ffor-scope
2118 @opindex fno-for-scope
2119 If @option{-ffor-scope} is specified, the scope of variables declared in
2120 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2121 as specified by the C++ standard.
2122 If @option{-fno-for-scope} is specified, the scope of variables declared in
2123 a @i{for-init-statement} extends to the end of the enclosing scope,
2124 as was the case in old versions of G++, and other (traditional)
2125 implementations of C++.
2127 If neither flag is given, the default is to follow the standard,
2128 but to allow and give a warning for old-style code that would
2129 otherwise be invalid, or have different behavior.
2131 @item -fno-gnu-keywords
2132 @opindex fno-gnu-keywords
2133 Do not recognize @code{typeof} as a keyword, so that code can use this
2134 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2135 @option{-ansi} implies @option{-fno-gnu-keywords}.
2137 @item -fno-implicit-templates
2138 @opindex fno-implicit-templates
2139 Never emit code for non-inline templates that are instantiated
2140 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2141 @xref{Template Instantiation}, for more information.
2143 @item -fno-implicit-inline-templates
2144 @opindex fno-implicit-inline-templates
2145 Don't emit code for implicit instantiations of inline templates, either.
2146 The default is to handle inlines differently so that compiles with and
2147 without optimization need the same set of explicit instantiations.
2149 @item -fno-implement-inlines
2150 @opindex fno-implement-inlines
2151 To save space, do not emit out-of-line copies of inline functions
2152 controlled by @samp{#pragma implementation}.  This causes linker
2153 errors if these functions are not inlined everywhere they are called.
2155 @item -fms-extensions
2156 @opindex fms-extensions
2157 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2158 int and getting a pointer to member function via non-standard syntax.
2160 @item -fno-nonansi-builtins
2161 @opindex fno-nonansi-builtins
2162 Disable built-in declarations of functions that are not mandated by
2163 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2164 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2166 @item -fnothrow-opt
2167 @opindex fnothrow-opt
2168 Treat a @code{throw()} exception specification as if it were a
2169 @code{noexcept} specification to reduce or eliminate the text size
2170 overhead relative to a function with no exception specification.  If
2171 the function has local variables of types with non-trivial
2172 destructors, the exception specification actually makes the
2173 function smaller because the EH cleanups for those variables can be
2174 optimized away.  The semantic effect is that an exception thrown out of
2175 a function with such an exception specification results in a call
2176 to @code{terminate} rather than @code{unexpected}.
2178 @item -fno-operator-names
2179 @opindex fno-operator-names
2180 Do not treat the operator name keywords @code{and}, @code{bitand},
2181 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2182 synonyms as keywords.
2184 @item -fno-optional-diags
2185 @opindex fno-optional-diags
2186 Disable diagnostics that the standard says a compiler does not need to
2187 issue.  Currently, the only such diagnostic issued by G++ is the one for
2188 a name having multiple meanings within a class.
2190 @item -fpermissive
2191 @opindex fpermissive
2192 Downgrade some diagnostics about nonconformant code from errors to
2193 warnings.  Thus, using @option{-fpermissive} allows some
2194 nonconforming code to compile.
2196 @item -fno-pretty-templates
2197 @opindex fno-pretty-templates
2198 When an error message refers to a specialization of a function
2199 template, the compiler normally prints the signature of the
2200 template followed by the template arguments and any typedefs or
2201 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2202 rather than @code{void f(int)}) so that it's clear which template is
2203 involved.  When an error message refers to a specialization of a class
2204 template, the compiler omits any template arguments that match
2205 the default template arguments for that template.  If either of these
2206 behaviors make it harder to understand the error message rather than
2207 easier, you can use @option{-fno-pretty-templates} to disable them.
2209 @item -frepo
2210 @opindex frepo
2211 Enable automatic template instantiation at link time.  This option also
2212 implies @option{-fno-implicit-templates}.  @xref{Template
2213 Instantiation}, for more information.
2215 @item -fno-rtti
2216 @opindex fno-rtti
2217 Disable generation of information about every class with virtual
2218 functions for use by the C++ run-time type identification features
2219 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2220 of the language, you can save some space by using this flag.  Note that
2221 exception handling uses the same information, but G++ generates it as
2222 needed. The @samp{dynamic_cast} operator can still be used for casts that
2223 do not require run-time type information, i.e.@: casts to @code{void *} or to
2224 unambiguous base classes.
2226 @item -fstats
2227 @opindex fstats
2228 Emit statistics about front-end processing at the end of the compilation.
2229 This information is generally only useful to the G++ development team.
2231 @item -fstrict-enums
2232 @opindex fstrict-enums
2233 Allow the compiler to optimize using the assumption that a value of
2234 enumerated type can only be one of the values of the enumeration (as
2235 defined in the C++ standard; basically, a value that can be
2236 represented in the minimum number of bits needed to represent all the
2237 enumerators).  This assumption may not be valid if the program uses a
2238 cast to convert an arbitrary integer value to the enumerated type.
2240 @item -ftemplate-backtrace-limit=@var{n}
2241 @opindex ftemplate-backtrace-limit
2242 Set the maximum number of template instantiation notes for a single
2243 warning or error to @var{n}.  The default value is 10.
2245 @item -ftemplate-depth=@var{n}
2246 @opindex ftemplate-depth
2247 Set the maximum instantiation depth for template classes to @var{n}.
2248 A limit on the template instantiation depth is needed to detect
2249 endless recursions during template class instantiation.  ANSI/ISO C++
2250 conforming programs must not rely on a maximum depth greater than 17
2251 (changed to 1024 in C++11).  The default value is 900, as the compiler
2252 can run out of stack space before hitting 1024 in some situations.
2254 @item -fno-threadsafe-statics
2255 @opindex fno-threadsafe-statics
2256 Do not emit the extra code to use the routines specified in the C++
2257 ABI for thread-safe initialization of local statics.  You can use this
2258 option to reduce code size slightly in code that doesn't need to be
2259 thread-safe.
2261 @item -fuse-cxa-atexit
2262 @opindex fuse-cxa-atexit
2263 Register destructors for objects with static storage duration with the
2264 @code{__cxa_atexit} function rather than the @code{atexit} function.
2265 This option is required for fully standards-compliant handling of static
2266 destructors, but only works if your C library supports
2267 @code{__cxa_atexit}.
2269 @item -fno-use-cxa-get-exception-ptr
2270 @opindex fno-use-cxa-get-exception-ptr
2271 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2272 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2273 if the runtime routine is not available.
2275 @item -fvisibility-inlines-hidden
2276 @opindex fvisibility-inlines-hidden
2277 This switch declares that the user does not attempt to compare
2278 pointers to inline functions or methods where the addresses of the two functions
2279 are taken in different shared objects.
2281 The effect of this is that GCC may, effectively, mark inline methods with
2282 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2283 appear in the export table of a DSO and do not require a PLT indirection
2284 when used within the DSO@.  Enabling this option can have a dramatic effect
2285 on load and link times of a DSO as it massively reduces the size of the
2286 dynamic export table when the library makes heavy use of templates.
2288 The behavior of this switch is not quite the same as marking the
2289 methods as hidden directly, because it does not affect static variables
2290 local to the function or cause the compiler to deduce that
2291 the function is defined in only one shared object.
2293 You may mark a method as having a visibility explicitly to negate the
2294 effect of the switch for that method.  For example, if you do want to
2295 compare pointers to a particular inline method, you might mark it as
2296 having default visibility.  Marking the enclosing class with explicit
2297 visibility has no effect.
2299 Explicitly instantiated inline methods are unaffected by this option
2300 as their linkage might otherwise cross a shared library boundary.
2301 @xref{Template Instantiation}.
2303 @item -fvisibility-ms-compat
2304 @opindex fvisibility-ms-compat
2305 This flag attempts to use visibility settings to make GCC's C++
2306 linkage model compatible with that of Microsoft Visual Studio.
2308 The flag makes these changes to GCC's linkage model:
2310 @enumerate
2311 @item
2312 It sets the default visibility to @code{hidden}, like
2313 @option{-fvisibility=hidden}.
2315 @item
2316 Types, but not their members, are not hidden by default.
2318 @item
2319 The One Definition Rule is relaxed for types without explicit
2320 visibility specifications that are defined in more than one
2321 shared object: those declarations are permitted if they are
2322 permitted when this option is not used.
2323 @end enumerate
2325 In new code it is better to use @option{-fvisibility=hidden} and
2326 export those classes that are intended to be externally visible.
2327 Unfortunately it is possible for code to rely, perhaps accidentally,
2328 on the Visual Studio behavior.
2330 Among the consequences of these changes are that static data members
2331 of the same type with the same name but defined in different shared
2332 objects are different, so changing one does not change the other;
2333 and that pointers to function members defined in different shared
2334 objects may not compare equal.  When this flag is given, it is a
2335 violation of the ODR to define types with the same name differently.
2337 @item -fvtable-verify=@var{std|preinit|none}
2338 @opindex fvtable-verify
2339 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2340 feature that verifies at runtime, for every virtual call that is made, that
2341 the vtable pointer through which the call is made is valid for the type of
2342 the object, and has not been corrupted or overwritten.  If an invalid vtable
2343 pointer is detected (at runtime), an error is reported and execution of the
2344 program is immediately halted.
2346 This option causes runtime data structures to be built, at program start up,
2347 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2348 control the timing of when these data structures are built.  In both cases the
2349 data structures are built before execution reaches 'main'.  The
2350 @option{-fvtable-verify=std} causes these data structure to be built after the
2351 shared libraries have been loaded and initialized.
2352 @option{-fvtable-verify=preinit} causes them to be built before the shared
2353 libraries have been loaded and initialized.
2355 If this option appears multiple times in the compiler line, with different
2356 values specified, 'none' will take highest priority over both 'std' and
2357 'preinit'; 'preinit' will take priority over 'std'.
2359 @item -fvtv-debug
2360 @opindex (fvtv-debug)
2361 Causes debug versions of the runtime functions for the vtable verification 
2362 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2363 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2364 compiler to keep track of which vtable pointers it found for each class, and
2365 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2366 file directory on the user's machine.
2368 Note:  This feature APPENDS data to the log file. If you want a fresh log
2369 file, be sure to delete any existing one.
2371 @item -fvtv-counts
2372 @opindex (fvtv-counts)
2373 This is a debugging flag.  When used in conjunction with
2374 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2375 causes the compiler to keep track of the total number of virtual calls
2376 it encountered and the number of verifications it inserted.  It also
2377 counts the number of calls to certain runtime library functions
2378 that it inserts.  This information, for each compilation unit, is written
2379 to a file named ``vtv_count_data.log'', in the dump_file directory on
2380 the user's machine.   It also counts the size of the vtable pointer sets
2381 for each class, and writes this information to ``vtv_class_set_sizes.log''
2382 in the same directory.
2384 Note:  This feature APPENDS data to the log files.  To get a fresh log
2385 files, be sure to delete any existing ones.
2387 @item -fno-weak
2388 @opindex fno-weak
2389 Do not use weak symbol support, even if it is provided by the linker.
2390 By default, G++ uses weak symbols if they are available.  This
2391 option exists only for testing, and should not be used by end-users;
2392 it results in inferior code and has no benefits.  This option may
2393 be removed in a future release of G++.
2395 @item -nostdinc++
2396 @opindex nostdinc++
2397 Do not search for header files in the standard directories specific to
2398 C++, but do still search the other standard directories.  (This option
2399 is used when building the C++ library.)
2400 @end table
2402 In addition, these optimization, warning, and code generation options
2403 have meanings only for C++ programs:
2405 @table @gcctabopt
2406 @item -fno-default-inline
2407 @opindex fno-default-inline
2408 Do not assume @samp{inline} for functions defined inside a class scope.
2409 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2410 functions have linkage like inline functions; they just aren't
2411 inlined by default.
2413 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2414 @opindex Wabi
2415 @opindex Wno-abi
2416 Warn when G++ generates code that is probably not compatible with the
2417 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2418 all such cases, there are probably some cases that are not warned about,
2419 even though G++ is generating incompatible code.  There may also be
2420 cases where warnings are emitted even though the code that is generated
2421 is compatible.
2423 You should rewrite your code to avoid these warnings if you are
2424 concerned about the fact that code generated by G++ may not be binary
2425 compatible with code generated by other compilers.
2427 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2429 @itemize @bullet
2431 @item
2432 A template with a non-type template parameter of reference type is
2433 mangled incorrectly:
2434 @smallexample
2435 extern int N;
2436 template <int &> struct S @{@};
2437 void n (S<N>) @{2@}
2438 @end smallexample
2440 This is fixed in @option{-fabi-version=3}.
2442 @item
2443 SIMD vector types declared using @code{__attribute ((vector_size))} are
2444 mangled in a non-standard way that does not allow for overloading of
2445 functions taking vectors of different sizes.
2447 The mangling is changed in @option{-fabi-version=4}.
2448 @end itemize
2450 The known incompatibilities in @option{-fabi-version=1} include:
2452 @itemize @bullet
2454 @item
2455 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2456 pack data into the same byte as a base class.  For example:
2458 @smallexample
2459 struct A @{ virtual void f(); int f1 : 1; @};
2460 struct B : public A @{ int f2 : 1; @};
2461 @end smallexample
2463 @noindent
2464 In this case, G++ places @code{B::f2} into the same byte
2465 as @code{A::f1}; other compilers do not.  You can avoid this problem
2466 by explicitly padding @code{A} so that its size is a multiple of the
2467 byte size on your platform; that causes G++ and other compilers to
2468 lay out @code{B} identically.
2470 @item
2471 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2472 tail padding when laying out virtual bases.  For example:
2474 @smallexample
2475 struct A @{ virtual void f(); char c1; @};
2476 struct B @{ B(); char c2; @};
2477 struct C : public A, public virtual B @{@};
2478 @end smallexample
2480 @noindent
2481 In this case, G++ does not place @code{B} into the tail-padding for
2482 @code{A}; other compilers do.  You can avoid this problem by
2483 explicitly padding @code{A} so that its size is a multiple of its
2484 alignment (ignoring virtual base classes); that causes G++ and other
2485 compilers to lay out @code{C} identically.
2487 @item
2488 Incorrect handling of bit-fields with declared widths greater than that
2489 of their underlying types, when the bit-fields appear in a union.  For
2490 example:
2492 @smallexample
2493 union U @{ int i : 4096; @};
2494 @end smallexample
2496 @noindent
2497 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2498 union too small by the number of bits in an @code{int}.
2500 @item
2501 Empty classes can be placed at incorrect offsets.  For example:
2503 @smallexample
2504 struct A @{@};
2506 struct B @{
2507   A a;
2508   virtual void f ();
2511 struct C : public B, public A @{@};
2512 @end smallexample
2514 @noindent
2515 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2516 it should be placed at offset zero.  G++ mistakenly believes that the
2517 @code{A} data member of @code{B} is already at offset zero.
2519 @item
2520 Names of template functions whose types involve @code{typename} or
2521 template template parameters can be mangled incorrectly.
2523 @smallexample
2524 template <typename Q>
2525 void f(typename Q::X) @{@}
2527 template <template <typename> class Q>
2528 void f(typename Q<int>::X) @{@}
2529 @end smallexample
2531 @noindent
2532 Instantiations of these templates may be mangled incorrectly.
2534 @end itemize
2536 It also warns about psABI-related changes.  The known psABI changes at this
2537 point include:
2539 @itemize @bullet
2541 @item
2542 For SysV/x86-64, unions with @code{long double} members are 
2543 passed in memory as specified in psABI.  For example:
2545 @smallexample
2546 union U @{
2547   long double ld;
2548   int i;
2550 @end smallexample
2552 @noindent
2553 @code{union U} is always passed in memory.
2555 @end itemize
2557 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2558 @opindex Wctor-dtor-privacy
2559 @opindex Wno-ctor-dtor-privacy
2560 Warn when a class seems unusable because all the constructors or
2561 destructors in that class are private, and it has neither friends nor
2562 public static member functions.  Also warn if there are no non-private
2563 methods, and there's at least one private member function that isn't
2564 a constructor or destructor.
2566 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2567 @opindex Wdelete-non-virtual-dtor
2568 @opindex Wno-delete-non-virtual-dtor
2569 Warn when @samp{delete} is used to destroy an instance of a class that
2570 has virtual functions and non-virtual destructor. It is unsafe to delete
2571 an instance of a derived class through a pointer to a base class if the
2572 base class does not have a virtual destructor.  This warning is enabled
2573 by @option{-Wall}.
2575 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2576 @opindex Wliteral-suffix
2577 @opindex Wno-literal-suffix
2578 Warn when a string or character literal is followed by a ud-suffix which does
2579 not begin with an underscore.  As a conforming extension, GCC treats such
2580 suffixes as separate preprocessing tokens in order to maintain backwards
2581 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2582 For example:
2584 @smallexample
2585 #define __STDC_FORMAT_MACROS
2586 #include <inttypes.h>
2587 #include <stdio.h>
2589 int main() @{
2590   int64_t i64 = 123;
2591   printf("My int64: %"PRId64"\n", i64);
2593 @end smallexample
2595 In this case, @code{PRId64} is treated as a separate preprocessing token.
2597 This warning is enabled by default.
2599 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2600 @opindex Wnarrowing
2601 @opindex Wno-narrowing
2602 Warn when a narrowing conversion prohibited by C++11 occurs within
2603 @samp{@{ @}}, e.g.
2605 @smallexample
2606 int i = @{ 2.2 @}; // error: narrowing from double to int
2607 @end smallexample
2609 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2611 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2612 required by the standard.  Note that this does not affect the meaning
2613 of well-formed code; narrowing conversions are still considered
2614 ill-formed in SFINAE context.
2616 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2617 @opindex Wnoexcept
2618 @opindex Wno-noexcept
2619 Warn when a noexcept-expression evaluates to false because of a call
2620 to a function that does not have a non-throwing exception
2621 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2622 the compiler to never throw an exception.
2624 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2625 @opindex Wnon-virtual-dtor
2626 @opindex Wno-non-virtual-dtor
2627 Warn when a class has virtual functions and an accessible non-virtual
2628 destructor, in which case it is possible but unsafe to delete
2629 an instance of a derived class through a pointer to the base class.
2630 This warning is also enabled if @option{-Weffc++} is specified.
2632 @item -Wreorder @r{(C++ and Objective-C++ only)}
2633 @opindex Wreorder
2634 @opindex Wno-reorder
2635 @cindex reordering, warning
2636 @cindex warning for reordering of member initializers
2637 Warn when the order of member initializers given in the code does not
2638 match the order in which they must be executed.  For instance:
2640 @smallexample
2641 struct A @{
2642   int i;
2643   int j;
2644   A(): j (0), i (1) @{ @}
2646 @end smallexample
2648 @noindent
2649 The compiler rearranges the member initializers for @samp{i}
2650 and @samp{j} to match the declaration order of the members, emitting
2651 a warning to that effect.  This warning is enabled by @option{-Wall}.
2653 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2654 @opindex fext-numeric-literals
2655 @opindex fno-ext-numeric-literals
2656 Accept imaginary, fixed-point, or machine-defined
2657 literal number suffixes as GNU extensions.
2658 When this option is turned off these suffixes are treated
2659 as C++11 user-defined literal numeric suffixes.
2660 This is on by default for all pre-C++11 dialects and all GNU dialects:
2661 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2662 @option{-std=gnu++1y}.
2663 This option is off by default
2664 for ISO C++11 onwards (@option{-std=c++11}, ...).
2665 @end table
2667 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2669 @table @gcctabopt
2670 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2671 @opindex Weffc++
2672 @opindex Wno-effc++
2673 Warn about violations of the following style guidelines from Scott Meyers'
2674 @cite{Effective C++, Second Edition} book:
2676 @itemize @bullet
2677 @item
2678 Item 11:  Define a copy constructor and an assignment operator for classes
2679 with dynamically-allocated memory.
2681 @item
2682 Item 12:  Prefer initialization to assignment in constructors.
2684 @item
2685 Item 14:  Make destructors virtual in base classes.
2687 @item
2688 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2690 @item
2691 Item 23:  Don't try to return a reference when you must return an object.
2693 @end itemize
2695 Also warn about violations of the following style guidelines from
2696 Scott Meyers' @cite{More Effective C++} book:
2698 @itemize @bullet
2699 @item
2700 Item 6:  Distinguish between prefix and postfix forms of increment and
2701 decrement operators.
2703 @item
2704 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2706 @end itemize
2708 When selecting this option, be aware that the standard library
2709 headers do not obey all of these guidelines; use @samp{grep -v}
2710 to filter out those warnings.
2712 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2713 @opindex Wstrict-null-sentinel
2714 @opindex Wno-strict-null-sentinel
2715 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2716 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2717 to @code{__null}.  Although it is a null pointer constant rather than a
2718 null pointer, it is guaranteed to be of the same size as a pointer.
2719 But this use is not portable across different compilers.
2721 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2722 @opindex Wno-non-template-friend
2723 @opindex Wnon-template-friend
2724 Disable warnings when non-templatized friend functions are declared
2725 within a template.  Since the advent of explicit template specification
2726 support in G++, if the name of the friend is an unqualified-id (i.e.,
2727 @samp{friend foo(int)}), the C++ language specification demands that the
2728 friend declare or define an ordinary, nontemplate function.  (Section
2729 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2730 could be interpreted as a particular specialization of a templatized
2731 function.  Because this non-conforming behavior is no longer the default
2732 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2733 check existing code for potential trouble spots and is on by default.
2734 This new compiler behavior can be turned off with
2735 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2736 but disables the helpful warning.
2738 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2739 @opindex Wold-style-cast
2740 @opindex Wno-old-style-cast
2741 Warn if an old-style (C-style) cast to a non-void type is used within
2742 a C++ program.  The new-style casts (@samp{dynamic_cast},
2743 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2744 less vulnerable to unintended effects and much easier to search for.
2746 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2747 @opindex Woverloaded-virtual
2748 @opindex Wno-overloaded-virtual
2749 @cindex overloaded virtual function, warning
2750 @cindex warning for overloaded virtual function
2751 Warn when a function declaration hides virtual functions from a
2752 base class.  For example, in:
2754 @smallexample
2755 struct A @{
2756   virtual void f();
2759 struct B: public A @{
2760   void f(int);
2762 @end smallexample
2764 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2765 like:
2767 @smallexample
2768 B* b;
2769 b->f();
2770 @end smallexample
2772 @noindent
2773 fails to compile.
2775 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2776 @opindex Wno-pmf-conversions
2777 @opindex Wpmf-conversions
2778 Disable the diagnostic for converting a bound pointer to member function
2779 to a plain pointer.
2781 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2782 @opindex Wsign-promo
2783 @opindex Wno-sign-promo
2784 Warn when overload resolution chooses a promotion from unsigned or
2785 enumerated type to a signed type, over a conversion to an unsigned type of
2786 the same size.  Previous versions of G++ tried to preserve
2787 unsignedness, but the standard mandates the current behavior.
2788 @end table
2790 @node Objective-C and Objective-C++ Dialect Options
2791 @section Options Controlling Objective-C and Objective-C++ Dialects
2793 @cindex compiler options, Objective-C and Objective-C++
2794 @cindex Objective-C and Objective-C++ options, command-line
2795 @cindex options, Objective-C and Objective-C++
2796 (NOTE: This manual does not describe the Objective-C and Objective-C++
2797 languages themselves.  @xref{Standards,,Language Standards
2798 Supported by GCC}, for references.)
2800 This section describes the command-line options that are only meaningful
2801 for Objective-C and Objective-C++ programs.  You can also use most of
2802 the language-independent GNU compiler options.
2803 For example, you might compile a file @code{some_class.m} like this:
2805 @smallexample
2806 gcc -g -fgnu-runtime -O -c some_class.m
2807 @end smallexample
2809 @noindent
2810 In this example, @option{-fgnu-runtime} is an option meant only for
2811 Objective-C and Objective-C++ programs; you can use the other options with
2812 any language supported by GCC@.
2814 Note that since Objective-C is an extension of the C language, Objective-C
2815 compilations may also use options specific to the C front-end (e.g.,
2816 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2817 C++-specific options (e.g., @option{-Wabi}).
2819 Here is a list of options that are @emph{only} for compiling Objective-C
2820 and Objective-C++ programs:
2822 @table @gcctabopt
2823 @item -fconstant-string-class=@var{class-name}
2824 @opindex fconstant-string-class
2825 Use @var{class-name} as the name of the class to instantiate for each
2826 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2827 class name is @code{NXConstantString} if the GNU runtime is being used, and
2828 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2829 @option{-fconstant-cfstrings} option, if also present, overrides the
2830 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2831 to be laid out as constant CoreFoundation strings.
2833 @item -fgnu-runtime
2834 @opindex fgnu-runtime
2835 Generate object code compatible with the standard GNU Objective-C
2836 runtime.  This is the default for most types of systems.
2838 @item -fnext-runtime
2839 @opindex fnext-runtime
2840 Generate output compatible with the NeXT runtime.  This is the default
2841 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2842 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2843 used.
2845 @item -fno-nil-receivers
2846 @opindex fno-nil-receivers
2847 Assume that all Objective-C message dispatches (@code{[receiver
2848 message:arg]}) in this translation unit ensure that the receiver is
2849 not @code{nil}.  This allows for more efficient entry points in the
2850 runtime to be used.  This option is only available in conjunction with
2851 the NeXT runtime and ABI version 0 or 1.
2853 @item -fobjc-abi-version=@var{n}
2854 @opindex fobjc-abi-version
2855 Use version @var{n} of the Objective-C ABI for the selected runtime.
2856 This option is currently supported only for the NeXT runtime.  In that
2857 case, Version 0 is the traditional (32-bit) ABI without support for
2858 properties and other Objective-C 2.0 additions.  Version 1 is the
2859 traditional (32-bit) ABI with support for properties and other
2860 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2861 nothing is specified, the default is Version 0 on 32-bit target
2862 machines, and Version 2 on 64-bit target machines.
2864 @item -fobjc-call-cxx-cdtors
2865 @opindex fobjc-call-cxx-cdtors
2866 For each Objective-C class, check if any of its instance variables is a
2867 C++ object with a non-trivial default constructor.  If so, synthesize a
2868 special @code{- (id) .cxx_construct} instance method which runs
2869 non-trivial default constructors on any such instance variables, in order,
2870 and then return @code{self}.  Similarly, check if any instance variable
2871 is a C++ object with a non-trivial destructor, and if so, synthesize a
2872 special @code{- (void) .cxx_destruct} method which runs
2873 all such default destructors, in reverse order.
2875 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2876 methods thusly generated only operate on instance variables
2877 declared in the current Objective-C class, and not those inherited
2878 from superclasses.  It is the responsibility of the Objective-C
2879 runtime to invoke all such methods in an object's inheritance
2880 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2881 by the runtime immediately after a new object instance is allocated;
2882 the @code{- (void) .cxx_destruct} methods are invoked immediately
2883 before the runtime deallocates an object instance.
2885 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2886 support for invoking the @code{- (id) .cxx_construct} and
2887 @code{- (void) .cxx_destruct} methods.
2889 @item -fobjc-direct-dispatch
2890 @opindex fobjc-direct-dispatch
2891 Allow fast jumps to the message dispatcher.  On Darwin this is
2892 accomplished via the comm page.
2894 @item -fobjc-exceptions
2895 @opindex fobjc-exceptions
2896 Enable syntactic support for structured exception handling in
2897 Objective-C, similar to what is offered by C++ and Java.  This option
2898 is required to use the Objective-C keywords @code{@@try},
2899 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2900 @code{@@synchronized}.  This option is available with both the GNU
2901 runtime and the NeXT runtime (but not available in conjunction with
2902 the NeXT runtime on Mac OS X 10.2 and earlier).
2904 @item -fobjc-gc
2905 @opindex fobjc-gc
2906 Enable garbage collection (GC) in Objective-C and Objective-C++
2907 programs.  This option is only available with the NeXT runtime; the
2908 GNU runtime has a different garbage collection implementation that
2909 does not require special compiler flags.
2911 @item -fobjc-nilcheck
2912 @opindex fobjc-nilcheck
2913 For the NeXT runtime with version 2 of the ABI, check for a nil
2914 receiver in method invocations before doing the actual method call.
2915 This is the default and can be disabled using
2916 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2917 checked for nil in this way no matter what this flag is set to.
2918 Currently this flag does nothing when the GNU runtime, or an older
2919 version of the NeXT runtime ABI, is used.
2921 @item -fobjc-std=objc1
2922 @opindex fobjc-std
2923 Conform to the language syntax of Objective-C 1.0, the language
2924 recognized by GCC 4.0.  This only affects the Objective-C additions to
2925 the C/C++ language; it does not affect conformance to C/C++ standards,
2926 which is controlled by the separate C/C++ dialect option flags.  When
2927 this option is used with the Objective-C or Objective-C++ compiler,
2928 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2929 This is useful if you need to make sure that your Objective-C code can
2930 be compiled with older versions of GCC@.
2932 @item -freplace-objc-classes
2933 @opindex freplace-objc-classes
2934 Emit a special marker instructing @command{ld(1)} not to statically link in
2935 the resulting object file, and allow @command{dyld(1)} to load it in at
2936 run time instead.  This is used in conjunction with the Fix-and-Continue
2937 debugging mode, where the object file in question may be recompiled and
2938 dynamically reloaded in the course of program execution, without the need
2939 to restart the program itself.  Currently, Fix-and-Continue functionality
2940 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2941 and later.
2943 @item -fzero-link
2944 @opindex fzero-link
2945 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2946 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2947 compile time) with static class references that get initialized at load time,
2948 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2949 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2950 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2951 for individual class implementations to be modified during program execution.
2952 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2953 regardless of command-line options.
2955 @item -gen-decls
2956 @opindex gen-decls
2957 Dump interface declarations for all classes seen in the source file to a
2958 file named @file{@var{sourcename}.decl}.
2960 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2961 @opindex Wassign-intercept
2962 @opindex Wno-assign-intercept
2963 Warn whenever an Objective-C assignment is being intercepted by the
2964 garbage collector.
2966 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2967 @opindex Wno-protocol
2968 @opindex Wprotocol
2969 If a class is declared to implement a protocol, a warning is issued for
2970 every method in the protocol that is not implemented by the class.  The
2971 default behavior is to issue a warning for every method not explicitly
2972 implemented in the class, even if a method implementation is inherited
2973 from the superclass.  If you use the @option{-Wno-protocol} option, then
2974 methods inherited from the superclass are considered to be implemented,
2975 and no warning is issued for them.
2977 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2978 @opindex Wselector
2979 @opindex Wno-selector
2980 Warn if multiple methods of different types for the same selector are
2981 found during compilation.  The check is performed on the list of methods
2982 in the final stage of compilation.  Additionally, a check is performed
2983 for each selector appearing in a @code{@@selector(@dots{})}
2984 expression, and a corresponding method for that selector has been found
2985 during compilation.  Because these checks scan the method table only at
2986 the end of compilation, these warnings are not produced if the final
2987 stage of compilation is not reached, for example because an error is
2988 found during compilation, or because the @option{-fsyntax-only} option is
2989 being used.
2991 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2992 @opindex Wstrict-selector-match
2993 @opindex Wno-strict-selector-match
2994 Warn if multiple methods with differing argument and/or return types are
2995 found for a given selector when attempting to send a message using this
2996 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2997 is off (which is the default behavior), the compiler omits such warnings
2998 if any differences found are confined to types that share the same size
2999 and alignment.
3001 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3002 @opindex Wundeclared-selector
3003 @opindex Wno-undeclared-selector
3004 Warn if a @code{@@selector(@dots{})} expression referring to an
3005 undeclared selector is found.  A selector is considered undeclared if no
3006 method with that name has been declared before the
3007 @code{@@selector(@dots{})} expression, either explicitly in an
3008 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3009 an @code{@@implementation} section.  This option always performs its
3010 checks as soon as a @code{@@selector(@dots{})} expression is found,
3011 while @option{-Wselector} only performs its checks in the final stage of
3012 compilation.  This also enforces the coding style convention
3013 that methods and selectors must be declared before being used.
3015 @item -print-objc-runtime-info
3016 @opindex print-objc-runtime-info
3017 Generate C header describing the largest structure that is passed by
3018 value, if any.
3020 @end table
3022 @node Language Independent Options
3023 @section Options to Control Diagnostic Messages Formatting
3024 @cindex options to control diagnostics formatting
3025 @cindex diagnostic messages
3026 @cindex message formatting
3028 Traditionally, diagnostic messages have been formatted irrespective of
3029 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3030 options described below
3031 to control the formatting algorithm for diagnostic messages, 
3032 e.g.@: how many characters per line, how often source location
3033 information should be reported.  Note that some language front ends may not
3034 honor these options.
3036 @table @gcctabopt
3037 @item -fmessage-length=@var{n}
3038 @opindex fmessage-length
3039 Try to format error messages so that they fit on lines of about @var{n}
3040 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
3041 the front ends supported by GCC@.  If @var{n} is zero, then no
3042 line-wrapping is done; each error message appears on a single
3043 line.
3045 @item -fdiagnostics-show-location=once
3046 @opindex fdiagnostics-show-location
3047 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3048 reporter to emit source location information @emph{once}; that is, in
3049 case the message is too long to fit on a single physical line and has to
3050 be wrapped, the source location won't be emitted (as prefix) again,
3051 over and over, in subsequent continuation lines.  This is the default
3052 behavior.
3054 @item -fdiagnostics-show-location=every-line
3055 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3056 messages reporter to emit the same source location information (as
3057 prefix) for physical lines that result from the process of breaking
3058 a message which is too long to fit on a single line.
3060 @item -fdiagnostics-color[=@var{WHEN}]
3061 @itemx -fno-diagnostics-color
3062 @opindex fdiagnostics-color
3063 @cindex highlight, color, colour
3064 @vindex GCC_COLORS @r{environment variable}
3065 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3066 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3067 variable isn't present in the environment, and @samp{auto} otherwise.
3068 @samp{auto} means to use color only when the standard error is a terminal.
3069 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3070 aliases for @option{-fdiagnostics-color=always} and
3071 @option{-fdiagnostics-color=never}, respectively.
3073 The colors are defined by the environment variable @env{GCC_COLORS}.
3074 Its value is a colon-separated list of capabilities and Select Graphic
3075 Rendition (SGR) substrings. SGR commands are interpreted by the
3076 terminal or terminal emulator.  (See the section in the documentation
3077 of your text terminal for permitted values and their meanings as
3078 character attributes.)  These substring values are integers in decimal
3079 representation and can be concatenated with semicolons.
3080 Common values to concatenate include
3081 @samp{1} for bold,
3082 @samp{4} for underline,
3083 @samp{5} for blink,
3084 @samp{7} for inverse,
3085 @samp{39} for default foreground color,
3086 @samp{30} to @samp{37} for foreground colors,
3087 @samp{90} to @samp{97} for 16-color mode foreground colors,
3088 @samp{38;5;0} to @samp{38;5;255}
3089 for 88-color and 256-color modes foreground colors,
3090 @samp{49} for default background color,
3091 @samp{40} to @samp{47} for background colors,
3092 @samp{100} to @samp{107} for 16-color mode background colors,
3093 and @samp{48;5;0} to @samp{48;5;255}
3094 for 88-color and 256-color modes background colors.
3096 The default @env{GCC_COLORS} is
3097 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3098 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3099 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3100 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3101 string disables colors.
3102 Supported capabilities are as follows.
3104 @table @code
3105 @item error=
3106 @vindex error GCC_COLORS @r{capability}
3107 SGR substring for error: markers.
3109 @item warning=
3110 @vindex warning GCC_COLORS @r{capability}
3111 SGR substring for warning: markers.
3113 @item note=
3114 @vindex note GCC_COLORS @r{capability}
3115 SGR substring for note: markers.
3117 @item caret=
3118 @vindex caret GCC_COLORS @r{capability}
3119 SGR substring for caret line.
3121 @item locus=
3122 @vindex locus GCC_COLORS @r{capability}
3123 SGR substring for location information, @samp{file:line} or
3124 @samp{file:line:column} etc.
3126 @item quote=
3127 @vindex quote GCC_COLORS @r{capability}
3128 SGR substring for information printed within quotes.
3129 @end table
3131 @item -fno-diagnostics-show-option
3132 @opindex fno-diagnostics-show-option
3133 @opindex fdiagnostics-show-option
3134 By default, each diagnostic emitted includes text indicating the
3135 command-line option that directly controls the diagnostic (if such an
3136 option is known to the diagnostic machinery).  Specifying the
3137 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3139 @item -fno-diagnostics-show-caret
3140 @opindex fno-diagnostics-show-caret
3141 @opindex fdiagnostics-show-caret
3142 By default, each diagnostic emitted includes the original source line
3143 and a caret '^' indicating the column.  This option suppresses this
3144 information.
3146 @end table
3148 @node Warning Options
3149 @section Options to Request or Suppress Warnings
3150 @cindex options to control warnings
3151 @cindex warning messages
3152 @cindex messages, warning
3153 @cindex suppressing warnings
3155 Warnings are diagnostic messages that report constructions that
3156 are not inherently erroneous but that are risky or suggest there
3157 may have been an error.
3159 The following language-independent options do not enable specific
3160 warnings but control the kinds of diagnostics produced by GCC@.
3162 @table @gcctabopt
3163 @cindex syntax checking
3164 @item -fsyntax-only
3165 @opindex fsyntax-only
3166 Check the code for syntax errors, but don't do anything beyond that.
3168 @item -fmax-errors=@var{n}
3169 @opindex fmax-errors
3170 Limits the maximum number of error messages to @var{n}, at which point
3171 GCC bails out rather than attempting to continue processing the source
3172 code.  If @var{n} is 0 (the default), there is no limit on the number
3173 of error messages produced.  If @option{-Wfatal-errors} is also
3174 specified, then @option{-Wfatal-errors} takes precedence over this
3175 option.
3177 @item -w
3178 @opindex w
3179 Inhibit all warning messages.
3181 @item -Werror
3182 @opindex Werror
3183 @opindex Wno-error
3184 Make all warnings into errors.
3186 @item -Werror=
3187 @opindex Werror=
3188 @opindex Wno-error=
3189 Make the specified warning into an error.  The specifier for a warning
3190 is appended; for example @option{-Werror=switch} turns the warnings
3191 controlled by @option{-Wswitch} into errors.  This switch takes a
3192 negative form, to be used to negate @option{-Werror} for specific
3193 warnings; for example @option{-Wno-error=switch} makes
3194 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3195 is in effect.
3197 The warning message for each controllable warning includes the
3198 option that controls the warning.  That option can then be used with
3199 @option{-Werror=} and @option{-Wno-error=} as described above.
3200 (Printing of the option in the warning message can be disabled using the
3201 @option{-fno-diagnostics-show-option} flag.)
3203 Note that specifying @option{-Werror=}@var{foo} automatically implies
3204 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3205 imply anything.
3207 @item -Wfatal-errors
3208 @opindex Wfatal-errors
3209 @opindex Wno-fatal-errors
3210 This option causes the compiler to abort compilation on the first error
3211 occurred rather than trying to keep going and printing further error
3212 messages.
3214 @end table
3216 You can request many specific warnings with options beginning with
3217 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3218 implicit declarations.  Each of these specific warning options also
3219 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3220 example, @option{-Wno-implicit}.  This manual lists only one of the
3221 two forms, whichever is not the default.  For further
3222 language-specific options also refer to @ref{C++ Dialect Options} and
3223 @ref{Objective-C and Objective-C++ Dialect Options}.
3225 When an unrecognized warning option is requested (e.g.,
3226 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3227 that the option is not recognized.  However, if the @option{-Wno-} form
3228 is used, the behavior is slightly different: no diagnostic is
3229 produced for @option{-Wno-unknown-warning} unless other diagnostics
3230 are being produced.  This allows the use of new @option{-Wno-} options
3231 with old compilers, but if something goes wrong, the compiler
3232 warns that an unrecognized option is present.
3234 @table @gcctabopt
3235 @item -Wpedantic
3236 @itemx -pedantic
3237 @opindex pedantic
3238 @opindex Wpedantic
3239 Issue all the warnings demanded by strict ISO C and ISO C++;
3240 reject all programs that use forbidden extensions, and some other
3241 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3242 version of the ISO C standard specified by any @option{-std} option used.
3244 Valid ISO C and ISO C++ programs should compile properly with or without
3245 this option (though a rare few require @option{-ansi} or a
3246 @option{-std} option specifying the required version of ISO C)@.  However,
3247 without this option, certain GNU extensions and traditional C and C++
3248 features are supported as well.  With this option, they are rejected.
3250 @option{-Wpedantic} does not cause warning messages for use of the
3251 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3252 warnings are also disabled in the expression that follows
3253 @code{__extension__}.  However, only system header files should use
3254 these escape routes; application programs should avoid them.
3255 @xref{Alternate Keywords}.
3257 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3258 C conformance.  They soon find that it does not do quite what they want:
3259 it finds some non-ISO practices, but not all---only those for which
3260 ISO C @emph{requires} a diagnostic, and some others for which
3261 diagnostics have been added.
3263 A feature to report any failure to conform to ISO C might be useful in
3264 some instances, but would require considerable additional work and would
3265 be quite different from @option{-Wpedantic}.  We don't have plans to
3266 support such a feature in the near future.
3268 Where the standard specified with @option{-std} represents a GNU
3269 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3270 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3271 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3272 where they are required by the base standard.  (It does not make sense
3273 for such warnings to be given only for features not in the specified GNU
3274 C dialect, since by definition the GNU dialects of C include all
3275 features the compiler supports with the given option, and there would be
3276 nothing to warn about.)
3278 @item -pedantic-errors
3279 @opindex pedantic-errors
3280 Like @option{-Wpedantic}, except that errors are produced rather than
3281 warnings.
3283 @item -Wall
3284 @opindex Wall
3285 @opindex Wno-all
3286 This enables all the warnings about constructions that some users
3287 consider questionable, and that are easy to avoid (or modify to
3288 prevent the warning), even in conjunction with macros.  This also
3289 enables some language-specific warnings described in @ref{C++ Dialect
3290 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3292 @option{-Wall} turns on the following warning flags:
3294 @gccoptlist{-Waddress   @gol
3295 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3296 -Wc++11-compat  @gol
3297 -Wchar-subscripts  @gol
3298 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3299 -Wimplicit-int @r{(C and Objective-C only)} @gol
3300 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3301 -Wcomment  @gol
3302 -Wformat   @gol
3303 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3304 -Wmaybe-uninitialized @gol
3305 -Wmissing-braces @r{(only for C/ObjC)} @gol
3306 -Wnonnull  @gol
3307 -Wparentheses  @gol
3308 -Wpointer-sign  @gol
3309 -Wreorder   @gol
3310 -Wreturn-type  @gol
3311 -Wsequence-point  @gol
3312 -Wsign-compare @r{(only in C++)}  @gol
3313 -Wstrict-aliasing  @gol
3314 -Wstrict-overflow=1  @gol
3315 -Wswitch  @gol
3316 -Wtrigraphs  @gol
3317 -Wuninitialized  @gol
3318 -Wunknown-pragmas  @gol
3319 -Wunused-function  @gol
3320 -Wunused-label     @gol
3321 -Wunused-value     @gol
3322 -Wunused-variable  @gol
3323 -Wvolatile-register-var @gol
3326 Note that some warning flags are not implied by @option{-Wall}.  Some of
3327 them warn about constructions that users generally do not consider
3328 questionable, but which occasionally you might wish to check for;
3329 others warn about constructions that are necessary or hard to avoid in
3330 some cases, and there is no simple way to modify the code to suppress
3331 the warning. Some of them are enabled by @option{-Wextra} but many of
3332 them must be enabled individually.
3334 @item -Wextra
3335 @opindex W
3336 @opindex Wextra
3337 @opindex Wno-extra
3338 This enables some extra warning flags that are not enabled by
3339 @option{-Wall}. (This option used to be called @option{-W}.  The older
3340 name is still supported, but the newer name is more descriptive.)
3342 @gccoptlist{-Wclobbered  @gol
3343 -Wempty-body  @gol
3344 -Wignored-qualifiers @gol
3345 -Wmissing-field-initializers  @gol
3346 -Wmissing-parameter-type @r{(C only)}  @gol
3347 -Wold-style-declaration @r{(C only)}  @gol
3348 -Woverride-init  @gol
3349 -Wsign-compare  @gol
3350 -Wtype-limits  @gol
3351 -Wuninitialized  @gol
3352 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3353 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3356 The option @option{-Wextra} also prints warning messages for the
3357 following cases:
3359 @itemize @bullet
3361 @item
3362 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3363 @samp{>}, or @samp{>=}.
3365 @item
3366 (C++ only) An enumerator and a non-enumerator both appear in a
3367 conditional expression.
3369 @item
3370 (C++ only) Ambiguous virtual bases.
3372 @item
3373 (C++ only) Subscripting an array that has been declared @samp{register}.
3375 @item
3376 (C++ only) Taking the address of a variable that has been declared
3377 @samp{register}.
3379 @item
3380 (C++ only) A base class is not initialized in a derived class's copy
3381 constructor.
3383 @end itemize
3385 @item -Wchar-subscripts
3386 @opindex Wchar-subscripts
3387 @opindex Wno-char-subscripts
3388 Warn if an array subscript has type @code{char}.  This is a common cause
3389 of error, as programmers often forget that this type is signed on some
3390 machines.
3391 This warning is enabled by @option{-Wall}.
3393 @item -Wcomment
3394 @opindex Wcomment
3395 @opindex Wno-comment
3396 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3397 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3398 This warning is enabled by @option{-Wall}.
3400 @item -Wno-coverage-mismatch
3401 @opindex Wno-coverage-mismatch
3402 Warn if feedback profiles do not match when using the
3403 @option{-fprofile-use} option.
3404 If a source file is changed between compiling with @option{-fprofile-gen} and
3405 with @option{-fprofile-use}, the files with the profile feedback can fail
3406 to match the source file and GCC cannot use the profile feedback
3407 information.  By default, this warning is enabled and is treated as an
3408 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3409 warning or @option{-Wno-error=coverage-mismatch} can be used to
3410 disable the error.  Disabling the error for this warning can result in
3411 poorly optimized code and is useful only in the
3412 case of very minor changes such as bug fixes to an existing code-base.
3413 Completely disabling the warning is not recommended.
3415 @item -Wno-cpp
3416 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3418 Suppress warning messages emitted by @code{#warning} directives.
3420 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3421 @opindex Wdouble-promotion
3422 @opindex Wno-double-promotion
3423 Give a warning when a value of type @code{float} is implicitly
3424 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3425 floating-point unit implement @code{float} in hardware, but emulate
3426 @code{double} in software.  On such a machine, doing computations
3427 using @code{double} values is much more expensive because of the
3428 overhead required for software emulation.
3430 It is easy to accidentally do computations with @code{double} because
3431 floating-point literals are implicitly of type @code{double}.  For
3432 example, in:
3433 @smallexample
3434 @group
3435 float area(float radius)
3437    return 3.14159 * radius * radius;
3439 @end group
3440 @end smallexample
3441 the compiler performs the entire computation with @code{double}
3442 because the floating-point literal is a @code{double}.
3444 @item -Wformat
3445 @itemx -Wformat=@var{n}
3446 @opindex Wformat
3447 @opindex Wno-format
3448 @opindex ffreestanding
3449 @opindex fno-builtin
3450 @opindex Wformat=
3451 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3452 the arguments supplied have types appropriate to the format string
3453 specified, and that the conversions specified in the format string make
3454 sense.  This includes standard functions, and others specified by format
3455 attributes (@pxref{Function Attributes}), in the @code{printf},
3456 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3457 not in the C standard) families (or other target-specific families).
3458 Which functions are checked without format attributes having been
3459 specified depends on the standard version selected, and such checks of
3460 functions without the attribute specified are disabled by
3461 @option{-ffreestanding} or @option{-fno-builtin}.
3463 The formats are checked against the format features supported by GNU
3464 libc version 2.2.  These include all ISO C90 and C99 features, as well
3465 as features from the Single Unix Specification and some BSD and GNU
3466 extensions.  Other library implementations may not support all these
3467 features; GCC does not support warning about features that go beyond a
3468 particular library's limitations.  However, if @option{-Wpedantic} is used
3469 with @option{-Wformat}, warnings are given about format features not
3470 in the selected standard version (but not for @code{strfmon} formats,
3471 since those are not in any version of the C standard).  @xref{C Dialect
3472 Options,,Options Controlling C Dialect}.
3474 @table @gcctabopt
3475 @item -Wformat=1
3476 @itemx -Wformat
3477 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3478 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3479 @option{-Wformat} also checks for null format arguments for several
3480 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3481 aspects of this level of format checking can be disabled by the
3482 options: @option{-Wno-format-contains-nul},
3483 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3484 @option{-Wformat} is enabled by @option{-Wall}.
3486 @item -Wno-format-contains-nul
3487 @opindex Wno-format-contains-nul
3488 @opindex Wformat-contains-nul
3489 If @option{-Wformat} is specified, do not warn about format strings that
3490 contain NUL bytes.
3492 @item -Wno-format-extra-args
3493 @opindex Wno-format-extra-args
3494 @opindex Wformat-extra-args
3495 If @option{-Wformat} is specified, do not warn about excess arguments to a
3496 @code{printf} or @code{scanf} format function.  The C standard specifies
3497 that such arguments are ignored.
3499 Where the unused arguments lie between used arguments that are
3500 specified with @samp{$} operand number specifications, normally
3501 warnings are still given, since the implementation could not know what
3502 type to pass to @code{va_arg} to skip the unused arguments.  However,
3503 in the case of @code{scanf} formats, this option suppresses the
3504 warning if the unused arguments are all pointers, since the Single
3505 Unix Specification says that such unused arguments are allowed.
3507 @item -Wno-format-zero-length
3508 @opindex Wno-format-zero-length
3509 @opindex Wformat-zero-length
3510 If @option{-Wformat} is specified, do not warn about zero-length formats.
3511 The C standard specifies that zero-length formats are allowed.
3514 @item -Wformat=2
3515 Enable @option{-Wformat} plus additional format checks.  Currently
3516 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3517 -Wformat-y2k}.
3519 @item -Wformat-nonliteral
3520 @opindex Wformat-nonliteral
3521 @opindex Wno-format-nonliteral
3522 If @option{-Wformat} is specified, also warn if the format string is not a
3523 string literal and so cannot be checked, unless the format function
3524 takes its format arguments as a @code{va_list}.
3526 @item -Wformat-security
3527 @opindex Wformat-security
3528 @opindex Wno-format-security
3529 If @option{-Wformat} is specified, also warn about uses of format
3530 functions that represent possible security problems.  At present, this
3531 warns about calls to @code{printf} and @code{scanf} functions where the
3532 format string is not a string literal and there are no format arguments,
3533 as in @code{printf (foo);}.  This may be a security hole if the format
3534 string came from untrusted input and contains @samp{%n}.  (This is
3535 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3536 in future warnings may be added to @option{-Wformat-security} that are not
3537 included in @option{-Wformat-nonliteral}.)
3539 @item -Wformat-y2k
3540 @opindex Wformat-y2k
3541 @opindex Wno-format-y2k
3542 If @option{-Wformat} is specified, also warn about @code{strftime}
3543 formats that may yield only a two-digit year.
3544 @end table
3546 @item -Wnonnull
3547 @opindex Wnonnull
3548 @opindex Wno-nonnull
3549 Warn about passing a null pointer for arguments marked as
3550 requiring a non-null value by the @code{nonnull} function attribute.
3552 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3553 can be disabled with the @option{-Wno-nonnull} option.
3555 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3556 @opindex Winit-self
3557 @opindex Wno-init-self
3558 Warn about uninitialized variables that are initialized with themselves.
3559 Note this option can only be used with the @option{-Wuninitialized} option.
3561 For example, GCC warns about @code{i} being uninitialized in the
3562 following snippet only when @option{-Winit-self} has been specified:
3563 @smallexample
3564 @group
3565 int f()
3567   int i = i;
3568   return i;
3570 @end group
3571 @end smallexample
3573 This warning is enabled by @option{-Wall} in C++.
3575 @item -Wimplicit-int @r{(C and Objective-C only)}
3576 @opindex Wimplicit-int
3577 @opindex Wno-implicit-int
3578 Warn when a declaration does not specify a type.
3579 This warning is enabled by @option{-Wall}.
3581 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3582 @opindex Wimplicit-function-declaration
3583 @opindex Wno-implicit-function-declaration
3584 Give a warning whenever a function is used before being declared. In
3585 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3586 enabled by default and it is made into an error by
3587 @option{-pedantic-errors}. This warning is also enabled by
3588 @option{-Wall}.
3590 @item -Wimplicit @r{(C and Objective-C only)}
3591 @opindex Wimplicit
3592 @opindex Wno-implicit
3593 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3594 This warning is enabled by @option{-Wall}.
3596 @item -Wignored-qualifiers @r{(C and C++ only)}
3597 @opindex Wignored-qualifiers
3598 @opindex Wno-ignored-qualifiers
3599 Warn if the return type of a function has a type qualifier
3600 such as @code{const}.  For ISO C such a type qualifier has no effect,
3601 since the value returned by a function is not an lvalue.
3602 For C++, the warning is only emitted for scalar types or @code{void}.
3603 ISO C prohibits qualified @code{void} return types on function
3604 definitions, so such return types always receive a warning
3605 even without this option.
3607 This warning is also enabled by @option{-Wextra}.
3609 @item -Wmain
3610 @opindex Wmain
3611 @opindex Wno-main
3612 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3613 a function with external linkage, returning int, taking either zero
3614 arguments, two, or three arguments of appropriate types.  This warning
3615 is enabled by default in C++ and is enabled by either @option{-Wall}
3616 or @option{-Wpedantic}.
3618 @item -Wmissing-braces
3619 @opindex Wmissing-braces
3620 @opindex Wno-missing-braces
3621 Warn if an aggregate or union initializer is not fully bracketed.  In
3622 the following example, the initializer for @samp{a} is not fully
3623 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3624 enabled by @option{-Wall} in C.
3626 @smallexample
3627 int a[2][2] = @{ 0, 1, 2, 3 @};
3628 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3629 @end smallexample
3631 This warning is enabled by @option{-Wall}.
3633 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3634 @opindex Wmissing-include-dirs
3635 @opindex Wno-missing-include-dirs
3636 Warn if a user-supplied include directory does not exist.
3638 @item -Wparentheses
3639 @opindex Wparentheses
3640 @opindex Wno-parentheses
3641 Warn if parentheses are omitted in certain contexts, such
3642 as when there is an assignment in a context where a truth value
3643 is expected, or when operators are nested whose precedence people
3644 often get confused about.
3646 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3647 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3648 interpretation from that of ordinary mathematical notation.
3650 Also warn about constructions where there may be confusion to which
3651 @code{if} statement an @code{else} branch belongs.  Here is an example of
3652 such a case:
3654 @smallexample
3655 @group
3657   if (a)
3658     if (b)
3659       foo ();
3660   else
3661     bar ();
3663 @end group
3664 @end smallexample
3666 In C/C++, every @code{else} branch belongs to the innermost possible
3667 @code{if} statement, which in this example is @code{if (b)}.  This is
3668 often not what the programmer expected, as illustrated in the above
3669 example by indentation the programmer chose.  When there is the
3670 potential for this confusion, GCC issues a warning when this flag
3671 is specified.  To eliminate the warning, add explicit braces around
3672 the innermost @code{if} statement so there is no way the @code{else}
3673 can belong to the enclosing @code{if}.  The resulting code
3674 looks like this:
3676 @smallexample
3677 @group
3679   if (a)
3680     @{
3681       if (b)
3682         foo ();
3683       else
3684         bar ();
3685     @}
3687 @end group
3688 @end smallexample
3690 Also warn for dangerous uses of the GNU extension to
3691 @code{?:} with omitted middle operand. When the condition
3692 in the @code{?}: operator is a boolean expression, the omitted value is
3693 always 1.  Often programmers expect it to be a value computed
3694 inside the conditional expression instead.
3696 This warning is enabled by @option{-Wall}.
3698 @item -Wsequence-point
3699 @opindex Wsequence-point
3700 @opindex Wno-sequence-point
3701 Warn about code that may have undefined semantics because of violations
3702 of sequence point rules in the C and C++ standards.
3704 The C and C++ standards define the order in which expressions in a C/C++
3705 program are evaluated in terms of @dfn{sequence points}, which represent
3706 a partial ordering between the execution of parts of the program: those
3707 executed before the sequence point, and those executed after it.  These
3708 occur after the evaluation of a full expression (one which is not part
3709 of a larger expression), after the evaluation of the first operand of a
3710 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3711 function is called (but after the evaluation of its arguments and the
3712 expression denoting the called function), and in certain other places.
3713 Other than as expressed by the sequence point rules, the order of
3714 evaluation of subexpressions of an expression is not specified.  All
3715 these rules describe only a partial order rather than a total order,
3716 since, for example, if two functions are called within one expression
3717 with no sequence point between them, the order in which the functions
3718 are called is not specified.  However, the standards committee have
3719 ruled that function calls do not overlap.
3721 It is not specified when between sequence points modifications to the
3722 values of objects take effect.  Programs whose behavior depends on this
3723 have undefined behavior; the C and C++ standards specify that ``Between
3724 the previous and next sequence point an object shall have its stored
3725 value modified at most once by the evaluation of an expression.
3726 Furthermore, the prior value shall be read only to determine the value
3727 to be stored.''.  If a program breaks these rules, the results on any
3728 particular implementation are entirely unpredictable.
3730 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3731 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3732 diagnosed by this option, and it may give an occasional false positive
3733 result, but in general it has been found fairly effective at detecting
3734 this sort of problem in programs.
3736 The standard is worded confusingly, therefore there is some debate
3737 over the precise meaning of the sequence point rules in subtle cases.
3738 Links to discussions of the problem, including proposed formal
3739 definitions, may be found on the GCC readings page, at
3740 @uref{http://gcc.gnu.org/@/readings.html}.
3742 This warning is enabled by @option{-Wall} for C and C++.
3744 @item -Wno-return-local-addr
3745 @opindex Wno-return-local-addr
3746 @opindex Wreturn-local-addr
3747 Do not warn about returning a pointer (or in C++, a reference) to a
3748 variable that goes out of scope after the function returns.
3750 @item -Wreturn-type
3751 @opindex Wreturn-type
3752 @opindex Wno-return-type
3753 Warn whenever a function is defined with a return type that defaults
3754 to @code{int}.  Also warn about any @code{return} statement with no
3755 return value in a function whose return type is not @code{void}
3756 (falling off the end of the function body is considered returning
3757 without a value), and about a @code{return} statement with an
3758 expression in a function whose return type is @code{void}.
3760 For C++, a function without return type always produces a diagnostic
3761 message, even when @option{-Wno-return-type} is specified.  The only
3762 exceptions are @samp{main} and functions defined in system headers.
3764 This warning is enabled by @option{-Wall}.
3766 @item -Wswitch
3767 @opindex Wswitch
3768 @opindex Wno-switch
3769 Warn whenever a @code{switch} statement has an index of enumerated type
3770 and lacks a @code{case} for one or more of the named codes of that
3771 enumeration.  (The presence of a @code{default} label prevents this
3772 warning.)  @code{case} labels outside the enumeration range also
3773 provoke warnings when this option is used (even if there is a
3774 @code{default} label).
3775 This warning is enabled by @option{-Wall}.
3777 @item -Wswitch-default
3778 @opindex Wswitch-default
3779 @opindex Wno-switch-default
3780 Warn whenever a @code{switch} statement does not have a @code{default}
3781 case.
3783 @item -Wswitch-enum
3784 @opindex Wswitch-enum
3785 @opindex Wno-switch-enum
3786 Warn whenever a @code{switch} statement has an index of enumerated type
3787 and lacks a @code{case} for one or more of the named codes of that
3788 enumeration.  @code{case} labels outside the enumeration range also
3789 provoke warnings when this option is used.  The only difference
3790 between @option{-Wswitch} and this option is that this option gives a
3791 warning about an omitted enumeration code even if there is a
3792 @code{default} label.
3794 @item -Wsync-nand @r{(C and C++ only)}
3795 @opindex Wsync-nand
3796 @opindex Wno-sync-nand
3797 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3798 built-in functions are used.  These functions changed semantics in GCC 4.4.
3800 @item -Wtrigraphs
3801 @opindex Wtrigraphs
3802 @opindex Wno-trigraphs
3803 Warn if any trigraphs are encountered that might change the meaning of
3804 the program (trigraphs within comments are not warned about).
3805 This warning is enabled by @option{-Wall}.
3807 @item -Wunused-but-set-parameter
3808 @opindex Wunused-but-set-parameter
3809 @opindex Wno-unused-but-set-parameter
3810 Warn whenever a function parameter is assigned to, but otherwise unused
3811 (aside from its declaration).
3813 To suppress this warning use the @samp{unused} attribute
3814 (@pxref{Variable Attributes}).
3816 This warning is also enabled by @option{-Wunused} together with
3817 @option{-Wextra}.
3819 @item -Wunused-but-set-variable
3820 @opindex Wunused-but-set-variable
3821 @opindex Wno-unused-but-set-variable
3822 Warn whenever a local variable is assigned to, but otherwise unused
3823 (aside from its declaration).
3824 This warning is enabled by @option{-Wall}.
3826 To suppress this warning use the @samp{unused} attribute
3827 (@pxref{Variable Attributes}).
3829 This warning is also enabled by @option{-Wunused}, which is enabled
3830 by @option{-Wall}.
3832 @item -Wunused-function
3833 @opindex Wunused-function
3834 @opindex Wno-unused-function
3835 Warn whenever a static function is declared but not defined or a
3836 non-inline static function is unused.
3837 This warning is enabled by @option{-Wall}.
3839 @item -Wunused-label
3840 @opindex Wunused-label
3841 @opindex Wno-unused-label
3842 Warn whenever a label is declared but not used.
3843 This warning is enabled by @option{-Wall}.
3845 To suppress this warning use the @samp{unused} attribute
3846 (@pxref{Variable Attributes}).
3848 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3849 @opindex Wunused-local-typedefs
3850 Warn when a typedef locally defined in a function is not used.
3851 This warning is enabled by @option{-Wall}.
3853 @item -Wunused-parameter
3854 @opindex Wunused-parameter
3855 @opindex Wno-unused-parameter
3856 Warn whenever a function parameter is unused aside from its declaration.
3858 To suppress this warning use the @samp{unused} attribute
3859 (@pxref{Variable Attributes}).
3861 @item -Wno-unused-result
3862 @opindex Wunused-result
3863 @opindex Wno-unused-result
3864 Do not warn if a caller of a function marked with attribute
3865 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3866 its return value. The default is @option{-Wunused-result}.
3868 @item -Wunused-variable
3869 @opindex Wunused-variable
3870 @opindex Wno-unused-variable
3871 Warn whenever a local variable or non-constant static variable is unused
3872 aside from its declaration.
3873 This warning is enabled by @option{-Wall}.
3875 To suppress this warning use the @samp{unused} attribute
3876 (@pxref{Variable Attributes}).
3878 @item -Wunused-value
3879 @opindex Wunused-value
3880 @opindex Wno-unused-value
3881 Warn whenever a statement computes a result that is explicitly not
3882 used. To suppress this warning cast the unused expression to
3883 @samp{void}. This includes an expression-statement or the left-hand
3884 side of a comma expression that contains no side effects. For example,
3885 an expression such as @samp{x[i,j]} causes a warning, while
3886 @samp{x[(void)i,j]} does not.
3888 This warning is enabled by @option{-Wall}.
3890 @item -Wunused
3891 @opindex Wunused
3892 @opindex Wno-unused
3893 All the above @option{-Wunused} options combined.
3895 In order to get a warning about an unused function parameter, you must
3896 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3897 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3899 @item -Wuninitialized
3900 @opindex Wuninitialized
3901 @opindex Wno-uninitialized
3902 Warn if an automatic variable is used without first being initialized
3903 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3904 warn if a non-static reference or non-static @samp{const} member
3905 appears in a class without constructors.
3907 If you want to warn about code that uses the uninitialized value of the
3908 variable in its own initializer, use the @option{-Winit-self} option.
3910 These warnings occur for individual uninitialized or clobbered
3911 elements of structure, union or array variables as well as for
3912 variables that are uninitialized or clobbered as a whole.  They do
3913 not occur for variables or elements declared @code{volatile}.  Because
3914 these warnings depend on optimization, the exact variables or elements
3915 for which there are warnings depends on the precise optimization
3916 options and version of GCC used.
3918 Note that there may be no warning about a variable that is used only
3919 to compute a value that itself is never used, because such
3920 computations may be deleted by data flow analysis before the warnings
3921 are printed.
3923 @item -Wmaybe-uninitialized
3924 @opindex Wmaybe-uninitialized
3925 @opindex Wno-maybe-uninitialized
3926 For an automatic variable, if there exists a path from the function
3927 entry to a use of the variable that is initialized, but there exist
3928 some other paths for which the variable is not initialized, the compiler
3929 emits a warning if it cannot prove the uninitialized paths are not
3930 executed at run time. These warnings are made optional because GCC is
3931 not smart enough to see all the reasons why the code might be correct
3932 in spite of appearing to have an error.  Here is one example of how
3933 this can happen:
3935 @smallexample
3936 @group
3938   int x;
3939   switch (y)
3940     @{
3941     case 1: x = 1;
3942       break;
3943     case 2: x = 4;
3944       break;
3945     case 3: x = 5;
3946     @}
3947   foo (x);
3949 @end group
3950 @end smallexample
3952 @noindent
3953 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3954 always initialized, but GCC doesn't know this. To suppress the
3955 warning, you need to provide a default case with assert(0) or
3956 similar code.
3958 @cindex @code{longjmp} warnings
3959 This option also warns when a non-volatile automatic variable might be
3960 changed by a call to @code{longjmp}.  These warnings as well are possible
3961 only in optimizing compilation.
3963 The compiler sees only the calls to @code{setjmp}.  It cannot know
3964 where @code{longjmp} will be called; in fact, a signal handler could
3965 call it at any point in the code.  As a result, you may get a warning
3966 even when there is in fact no problem because @code{longjmp} cannot
3967 in fact be called at the place that would cause a problem.
3969 Some spurious warnings can be avoided if you declare all the functions
3970 you use that never return as @code{noreturn}.  @xref{Function
3971 Attributes}.
3973 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3975 @item -Wunknown-pragmas
3976 @opindex Wunknown-pragmas
3977 @opindex Wno-unknown-pragmas
3978 @cindex warning for unknown pragmas
3979 @cindex unknown pragmas, warning
3980 @cindex pragmas, warning of unknown
3981 Warn when a @code{#pragma} directive is encountered that is not understood by 
3982 GCC@.  If this command-line option is used, warnings are even issued
3983 for unknown pragmas in system header files.  This is not the case if
3984 the warnings are only enabled by the @option{-Wall} command-line option.
3986 @item -Wno-pragmas
3987 @opindex Wno-pragmas
3988 @opindex Wpragmas
3989 Do not warn about misuses of pragmas, such as incorrect parameters,
3990 invalid syntax, or conflicts between pragmas.  See also
3991 @option{-Wunknown-pragmas}.
3993 @item -Wstrict-aliasing
3994 @opindex Wstrict-aliasing
3995 @opindex Wno-strict-aliasing
3996 This option is only active when @option{-fstrict-aliasing} is active.
3997 It warns about code that might break the strict aliasing rules that the
3998 compiler is using for optimization.  The warning does not catch all
3999 cases, but does attempt to catch the more common pitfalls.  It is
4000 included in @option{-Wall}.
4001 It is equivalent to @option{-Wstrict-aliasing=3}
4003 @item -Wstrict-aliasing=n
4004 @opindex Wstrict-aliasing=n
4005 This option is only active when @option{-fstrict-aliasing} is active.
4006 It warns about code that might break the strict aliasing rules that the
4007 compiler is using for optimization.
4008 Higher levels correspond to higher accuracy (fewer false positives).
4009 Higher levels also correspond to more effort, similar to the way @option{-O} 
4010 works.
4011 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4013 Level 1: Most aggressive, quick, least accurate.
4014 Possibly useful when higher levels
4015 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4016 false negatives.  However, it has many false positives.
4017 Warns for all pointer conversions between possibly incompatible types,
4018 even if never dereferenced.  Runs in the front end only.
4020 Level 2: Aggressive, quick, not too precise.
4021 May still have many false positives (not as many as level 1 though),
4022 and few false negatives (but possibly more than level 1).
4023 Unlike level 1, it only warns when an address is taken.  Warns about
4024 incomplete types.  Runs in the front end only.
4026 Level 3 (default for @option{-Wstrict-aliasing}):
4027 Should have very few false positives and few false
4028 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4029 Takes care of the common pun+dereference pattern in the front end:
4030 @code{*(int*)&some_float}.
4031 If optimization is enabled, it also runs in the back end, where it deals
4032 with multiple statement cases using flow-sensitive points-to information.
4033 Only warns when the converted pointer is dereferenced.
4034 Does not warn about incomplete types.
4036 @item -Wstrict-overflow
4037 @itemx -Wstrict-overflow=@var{n}
4038 @opindex Wstrict-overflow
4039 @opindex Wno-strict-overflow
4040 This option is only active when @option{-fstrict-overflow} is active.
4041 It warns about cases where the compiler optimizes based on the
4042 assumption that signed overflow does not occur.  Note that it does not
4043 warn about all cases where the code might overflow: it only warns
4044 about cases where the compiler implements some optimization.  Thus
4045 this warning depends on the optimization level.
4047 An optimization that assumes that signed overflow does not occur is
4048 perfectly safe if the values of the variables involved are such that
4049 overflow never does, in fact, occur.  Therefore this warning can
4050 easily give a false positive: a warning about code that is not
4051 actually a problem.  To help focus on important issues, several
4052 warning levels are defined.  No warnings are issued for the use of
4053 undefined signed overflow when estimating how many iterations a loop
4054 requires, in particular when determining whether a loop will be
4055 executed at all.
4057 @table @gcctabopt
4058 @item -Wstrict-overflow=1
4059 Warn about cases that are both questionable and easy to avoid.  For
4060 example,  with @option{-fstrict-overflow}, the compiler simplifies
4061 @code{x + 1 > x} to @code{1}.  This level of
4062 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4063 are not, and must be explicitly requested.
4065 @item -Wstrict-overflow=2
4066 Also warn about other cases where a comparison is simplified to a
4067 constant.  For example: @code{abs (x) >= 0}.  This can only be
4068 simplified when @option{-fstrict-overflow} is in effect, because
4069 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4070 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4071 @option{-Wstrict-overflow=2}.
4073 @item -Wstrict-overflow=3
4074 Also warn about other cases where a comparison is simplified.  For
4075 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4077 @item -Wstrict-overflow=4
4078 Also warn about other simplifications not covered by the above cases.
4079 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4081 @item -Wstrict-overflow=5
4082 Also warn about cases where the compiler reduces the magnitude of a
4083 constant involved in a comparison.  For example: @code{x + 2 > y} is
4084 simplified to @code{x + 1 >= y}.  This is reported only at the
4085 highest warning level because this simplification applies to many
4086 comparisons, so this warning level gives a very large number of
4087 false positives.
4088 @end table
4090 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4091 @opindex Wsuggest-attribute=
4092 @opindex Wno-suggest-attribute=
4093 Warn for cases where adding an attribute may be beneficial. The
4094 attributes currently supported are listed below.
4096 @table @gcctabopt
4097 @item -Wsuggest-attribute=pure
4098 @itemx -Wsuggest-attribute=const
4099 @itemx -Wsuggest-attribute=noreturn
4100 @opindex Wsuggest-attribute=pure
4101 @opindex Wno-suggest-attribute=pure
4102 @opindex Wsuggest-attribute=const
4103 @opindex Wno-suggest-attribute=const
4104 @opindex Wsuggest-attribute=noreturn
4105 @opindex Wno-suggest-attribute=noreturn
4107 Warn about functions that might be candidates for attributes
4108 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4109 functions visible in other compilation units or (in the case of @code{pure} and
4110 @code{const}) if it cannot prove that the function returns normally. A function
4111 returns normally if it doesn't contain an infinite loop or return abnormally
4112 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4113 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4114 higher.  Higher optimization levels improve the accuracy of the analysis.
4116 @item -Wsuggest-attribute=format
4117 @itemx -Wmissing-format-attribute
4118 @opindex Wsuggest-attribute=format
4119 @opindex Wmissing-format-attribute
4120 @opindex Wno-suggest-attribute=format
4121 @opindex Wno-missing-format-attribute
4122 @opindex Wformat
4123 @opindex Wno-format
4125 Warn about function pointers that might be candidates for @code{format}
4126 attributes.  Note these are only possible candidates, not absolute ones.
4127 GCC guesses that function pointers with @code{format} attributes that
4128 are used in assignment, initialization, parameter passing or return
4129 statements should have a corresponding @code{format} attribute in the
4130 resulting type.  I.e.@: the left-hand side of the assignment or
4131 initialization, the type of the parameter variable, or the return type
4132 of the containing function respectively should also have a @code{format}
4133 attribute to avoid the warning.
4135 GCC also warns about function definitions that might be
4136 candidates for @code{format} attributes.  Again, these are only
4137 possible candidates.  GCC guesses that @code{format} attributes
4138 might be appropriate for any function that calls a function like
4139 @code{vprintf} or @code{vscanf}, but this might not always be the
4140 case, and some functions for which @code{format} attributes are
4141 appropriate may not be detected.
4142 @end table
4144 @item -Warray-bounds
4145 @opindex Wno-array-bounds
4146 @opindex Warray-bounds
4147 This option is only active when @option{-ftree-vrp} is active
4148 (default for @option{-O2} and above). It warns about subscripts to arrays
4149 that are always out of bounds. This warning is enabled by @option{-Wall}.
4151 @item -Wno-div-by-zero
4152 @opindex Wno-div-by-zero
4153 @opindex Wdiv-by-zero
4154 Do not warn about compile-time integer division by zero.  Floating-point
4155 division by zero is not warned about, as it can be a legitimate way of
4156 obtaining infinities and NaNs.
4158 @item -Wsystem-headers
4159 @opindex Wsystem-headers
4160 @opindex Wno-system-headers
4161 @cindex warnings from system headers
4162 @cindex system headers, warnings from
4163 Print warning messages for constructs found in system header files.
4164 Warnings from system headers are normally suppressed, on the assumption
4165 that they usually do not indicate real problems and would only make the
4166 compiler output harder to read.  Using this command-line option tells
4167 GCC to emit warnings from system headers as if they occurred in user
4168 code.  However, note that using @option{-Wall} in conjunction with this
4169 option does @emph{not} warn about unknown pragmas in system
4170 headers---for that, @option{-Wunknown-pragmas} must also be used.
4172 @item -Wtrampolines
4173 @opindex Wtrampolines
4174 @opindex Wno-trampolines
4175  Warn about trampolines generated for pointers to nested functions.
4177  A trampoline is a small piece of data or code that is created at run
4178  time on the stack when the address of a nested function is taken, and
4179  is used to call the nested function indirectly.  For some targets, it
4180  is made up of data only and thus requires no special treatment.  But,
4181  for most targets, it is made up of code and thus requires the stack
4182  to be made executable in order for the program to work properly.
4184 @item -Wfloat-equal
4185 @opindex Wfloat-equal
4186 @opindex Wno-float-equal
4187 Warn if floating-point values are used in equality comparisons.
4189 The idea behind this is that sometimes it is convenient (for the
4190 programmer) to consider floating-point values as approximations to
4191 infinitely precise real numbers.  If you are doing this, then you need
4192 to compute (by analyzing the code, or in some other way) the maximum or
4193 likely maximum error that the computation introduces, and allow for it
4194 when performing comparisons (and when producing output, but that's a
4195 different problem).  In particular, instead of testing for equality, you
4196 should check to see whether the two values have ranges that overlap; and
4197 this is done with the relational operators, so equality comparisons are
4198 probably mistaken.
4200 @item -Wtraditional @r{(C and Objective-C only)}
4201 @opindex Wtraditional
4202 @opindex Wno-traditional
4203 Warn about certain constructs that behave differently in traditional and
4204 ISO C@.  Also warn about ISO C constructs that have no traditional C
4205 equivalent, and/or problematic constructs that should be avoided.
4207 @itemize @bullet
4208 @item
4209 Macro parameters that appear within string literals in the macro body.
4210 In traditional C macro replacement takes place within string literals,
4211 but in ISO C it does not.
4213 @item
4214 In traditional C, some preprocessor directives did not exist.
4215 Traditional preprocessors only considered a line to be a directive
4216 if the @samp{#} appeared in column 1 on the line.  Therefore
4217 @option{-Wtraditional} warns about directives that traditional C
4218 understands but ignores because the @samp{#} does not appear as the
4219 first character on the line.  It also suggests you hide directives like
4220 @samp{#pragma} not understood by traditional C by indenting them.  Some
4221 traditional implementations do not recognize @samp{#elif}, so this option
4222 suggests avoiding it altogether.
4224 @item
4225 A function-like macro that appears without arguments.
4227 @item
4228 The unary plus operator.
4230 @item
4231 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4232 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4233 constants.)  Note, these suffixes appear in macros defined in the system
4234 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4235 Use of these macros in user code might normally lead to spurious
4236 warnings, however GCC's integrated preprocessor has enough context to
4237 avoid warning in these cases.
4239 @item
4240 A function declared external in one block and then used after the end of
4241 the block.
4243 @item
4244 A @code{switch} statement has an operand of type @code{long}.
4246 @item
4247 A non-@code{static} function declaration follows a @code{static} one.
4248 This construct is not accepted by some traditional C compilers.
4250 @item
4251 The ISO type of an integer constant has a different width or
4252 signedness from its traditional type.  This warning is only issued if
4253 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4254 typically represent bit patterns, are not warned about.
4256 @item
4257 Usage of ISO string concatenation is detected.
4259 @item
4260 Initialization of automatic aggregates.
4262 @item
4263 Identifier conflicts with labels.  Traditional C lacks a separate
4264 namespace for labels.
4266 @item
4267 Initialization of unions.  If the initializer is zero, the warning is
4268 omitted.  This is done under the assumption that the zero initializer in
4269 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4270 initializer warnings and relies on default initialization to zero in the
4271 traditional C case.
4273 @item
4274 Conversions by prototypes between fixed/floating-point values and vice
4275 versa.  The absence of these prototypes when compiling with traditional
4276 C causes serious problems.  This is a subset of the possible
4277 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4279 @item
4280 Use of ISO C style function definitions.  This warning intentionally is
4281 @emph{not} issued for prototype declarations or variadic functions
4282 because these ISO C features appear in your code when using
4283 libiberty's traditional C compatibility macros, @code{PARAMS} and
4284 @code{VPARAMS}.  This warning is also bypassed for nested functions
4285 because that feature is already a GCC extension and thus not relevant to
4286 traditional C compatibility.
4287 @end itemize
4289 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4290 @opindex Wtraditional-conversion
4291 @opindex Wno-traditional-conversion
4292 Warn if a prototype causes a type conversion that is different from what
4293 would happen to the same argument in the absence of a prototype.  This
4294 includes conversions of fixed point to floating and vice versa, and
4295 conversions changing the width or signedness of a fixed-point argument
4296 except when the same as the default promotion.
4298 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4299 @opindex Wdeclaration-after-statement
4300 @opindex Wno-declaration-after-statement
4301 Warn when a declaration is found after a statement in a block.  This
4302 construct, known from C++, was introduced with ISO C99 and is by default
4303 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4304 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4306 @item -Wundef
4307 @opindex Wundef
4308 @opindex Wno-undef
4309 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4311 @item -Wno-endif-labels
4312 @opindex Wno-endif-labels
4313 @opindex Wendif-labels
4314 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4316 @item -Wshadow
4317 @opindex Wshadow
4318 @opindex Wno-shadow
4319 Warn whenever a local variable or type declaration shadows another variable,
4320 parameter, type, or class member (in C++), or whenever a built-in function
4321 is shadowed. Note that in C++, the compiler warns if a local variable
4322 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4324 @item -Wlarger-than=@var{len}
4325 @opindex Wlarger-than=@var{len}
4326 @opindex Wlarger-than-@var{len}
4327 Warn whenever an object of larger than @var{len} bytes is defined.
4329 @item -Wframe-larger-than=@var{len}
4330 @opindex Wframe-larger-than
4331 Warn if the size of a function frame is larger than @var{len} bytes.
4332 The computation done to determine the stack frame size is approximate
4333 and not conservative.
4334 The actual requirements may be somewhat greater than @var{len}
4335 even if you do not get a warning.  In addition, any space allocated
4336 via @code{alloca}, variable-length arrays, or related constructs
4337 is not included by the compiler when determining
4338 whether or not to issue a warning.
4340 @item -Wno-free-nonheap-object
4341 @opindex Wno-free-nonheap-object
4342 @opindex Wfree-nonheap-object
4343 Do not warn when attempting to free an object that was not allocated
4344 on the heap.
4346 @item -Wstack-usage=@var{len}
4347 @opindex Wstack-usage
4348 Warn if the stack usage of a function might be larger than @var{len} bytes.
4349 The computation done to determine the stack usage is conservative.
4350 Any space allocated via @code{alloca}, variable-length arrays, or related
4351 constructs is included by the compiler when determining whether or not to
4352 issue a warning.
4354 The message is in keeping with the output of @option{-fstack-usage}.
4356 @itemize
4357 @item
4358 If the stack usage is fully static but exceeds the specified amount, it's:
4360 @smallexample
4361   warning: stack usage is 1120 bytes
4362 @end smallexample
4363 @item
4364 If the stack usage is (partly) dynamic but bounded, it's:
4366 @smallexample
4367   warning: stack usage might be 1648 bytes
4368 @end smallexample
4369 @item
4370 If the stack usage is (partly) dynamic and not bounded, it's:
4372 @smallexample
4373   warning: stack usage might be unbounded
4374 @end smallexample
4375 @end itemize
4377 @item -Wunsafe-loop-optimizations
4378 @opindex Wunsafe-loop-optimizations
4379 @opindex Wno-unsafe-loop-optimizations
4380 Warn if the loop cannot be optimized because the compiler cannot
4381 assume anything on the bounds of the loop indices.  With
4382 @option{-funsafe-loop-optimizations} warn if the compiler makes
4383 such assumptions.
4385 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4386 @opindex Wno-pedantic-ms-format
4387 @opindex Wpedantic-ms-format
4388 When used in combination with @option{-Wformat}
4389 and @option{-pedantic} without GNU extensions, this option
4390 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4391 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4392 which depend on the MS runtime.
4394 @item -Wpointer-arith
4395 @opindex Wpointer-arith
4396 @opindex Wno-pointer-arith
4397 Warn about anything that depends on the ``size of'' a function type or
4398 of @code{void}.  GNU C assigns these types a size of 1, for
4399 convenience in calculations with @code{void *} pointers and pointers
4400 to functions.  In C++, warn also when an arithmetic operation involves
4401 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4403 @item -Wtype-limits
4404 @opindex Wtype-limits
4405 @opindex Wno-type-limits
4406 Warn if a comparison is always true or always false due to the limited
4407 range of the data type, but do not warn for constant expressions.  For
4408 example, warn if an unsigned variable is compared against zero with
4409 @samp{<} or @samp{>=}.  This warning is also enabled by
4410 @option{-Wextra}.
4412 @item -Wbad-function-cast @r{(C and Objective-C only)}
4413 @opindex Wbad-function-cast
4414 @opindex Wno-bad-function-cast
4415 Warn whenever a function call is cast to a non-matching type.
4416 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4418 @item -Wc++-compat @r{(C and Objective-C only)}
4419 Warn about ISO C constructs that are outside of the common subset of
4420 ISO C and ISO C++, e.g.@: request for implicit conversion from
4421 @code{void *} to a pointer to non-@code{void} type.
4423 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4424 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4425 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4426 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4427 enabled by @option{-Wall}.
4429 @item -Wcast-qual
4430 @opindex Wcast-qual
4431 @opindex Wno-cast-qual
4432 Warn whenever a pointer is cast so as to remove a type qualifier from
4433 the target type.  For example, warn if a @code{const char *} is cast
4434 to an ordinary @code{char *}.
4436 Also warn when making a cast that introduces a type qualifier in an
4437 unsafe way.  For example, casting @code{char **} to @code{const char **}
4438 is unsafe, as in this example:
4440 @smallexample
4441   /* p is char ** value.  */
4442   const char **q = (const char **) p;
4443   /* Assignment of readonly string to const char * is OK.  */
4444   *q = "string";
4445   /* Now char** pointer points to read-only memory.  */
4446   **p = 'b';
4447 @end smallexample
4449 @item -Wcast-align
4450 @opindex Wcast-align
4451 @opindex Wno-cast-align
4452 Warn whenever a pointer is cast such that the required alignment of the
4453 target is increased.  For example, warn if a @code{char *} is cast to
4454 an @code{int *} on machines where integers can only be accessed at
4455 two- or four-byte boundaries.
4457 @item -Wwrite-strings
4458 @opindex Wwrite-strings
4459 @opindex Wno-write-strings
4460 When compiling C, give string constants the type @code{const
4461 char[@var{length}]} so that copying the address of one into a
4462 non-@code{const} @code{char *} pointer produces a warning.  These
4463 warnings help you find at compile time code that can try to write
4464 into a string constant, but only if you have been very careful about
4465 using @code{const} in declarations and prototypes.  Otherwise, it is
4466 just a nuisance. This is why we did not make @option{-Wall} request
4467 these warnings.
4469 When compiling C++, warn about the deprecated conversion from string
4470 literals to @code{char *}.  This warning is enabled by default for C++
4471 programs.
4473 @item -Wclobbered
4474 @opindex Wclobbered
4475 @opindex Wno-clobbered
4476 Warn for variables that might be changed by @samp{longjmp} or
4477 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4479 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4480 @opindex Wconditionally-supported
4481 @opindex Wno-conditionally-supported
4482 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4484 @item -Wconversion
4485 @opindex Wconversion
4486 @opindex Wno-conversion
4487 Warn for implicit conversions that may alter a value. This includes
4488 conversions between real and integer, like @code{abs (x)} when
4489 @code{x} is @code{double}; conversions between signed and unsigned,
4490 like @code{unsigned ui = -1}; and conversions to smaller types, like
4491 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4492 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4493 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4494 conversions between signed and unsigned integers can be disabled by
4495 using @option{-Wno-sign-conversion}.
4497 For C++, also warn for confusing overload resolution for user-defined
4498 conversions; and conversions that never use a type conversion
4499 operator: conversions to @code{void}, the same type, a base class or a
4500 reference to them. Warnings about conversions between signed and
4501 unsigned integers are disabled by default in C++ unless
4502 @option{-Wsign-conversion} is explicitly enabled.
4504 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4505 @opindex Wconversion-null
4506 @opindex Wno-conversion-null
4507 Do not warn for conversions between @code{NULL} and non-pointer
4508 types. @option{-Wconversion-null} is enabled by default.
4510 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4511 @opindex Wzero-as-null-pointer-constant
4512 @opindex Wno-zero-as-null-pointer-constant
4513 Warn when a literal '0' is used as null pointer constant.  This can
4514 be useful to facilitate the conversion to @code{nullptr} in C++11.
4516 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4517 @opindex Wdelete-incomplete
4518 @opindex Wno-delete-incomplete
4519 Warn when deleting a pointer to incomplete type, which may cause
4520 undefined behavior at runtime.  This warning is enabled by default.
4522 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4523 @opindex Wuseless-cast
4524 @opindex Wno-useless-cast
4525 Warn when an expression is casted to its own type.
4527 @item -Wempty-body
4528 @opindex Wempty-body
4529 @opindex Wno-empty-body
4530 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4531 while} statement.  This warning is also enabled by @option{-Wextra}.
4533 @item -Wenum-compare
4534 @opindex Wenum-compare
4535 @opindex Wno-enum-compare
4536 Warn about a comparison between values of different enumerated types.
4537 In C++ enumeral mismatches in conditional expressions are also
4538 diagnosed and the warning is enabled by default.  In C this warning is 
4539 enabled by @option{-Wall}.
4541 @item -Wjump-misses-init @r{(C, Objective-C only)}
4542 @opindex Wjump-misses-init
4543 @opindex Wno-jump-misses-init
4544 Warn if a @code{goto} statement or a @code{switch} statement jumps
4545 forward across the initialization of a variable, or jumps backward to a
4546 label after the variable has been initialized.  This only warns about
4547 variables that are initialized when they are declared.  This warning is
4548 only supported for C and Objective-C; in C++ this sort of branch is an
4549 error in any case.
4551 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4552 can be disabled with the @option{-Wno-jump-misses-init} option.
4554 @item -Wsign-compare
4555 @opindex Wsign-compare
4556 @opindex Wno-sign-compare
4557 @cindex warning for comparison of signed and unsigned values
4558 @cindex comparison of signed and unsigned values, warning
4559 @cindex signed and unsigned values, comparison warning
4560 Warn when a comparison between signed and unsigned values could produce
4561 an incorrect result when the signed value is converted to unsigned.
4562 This warning is also enabled by @option{-Wextra}; to get the other warnings
4563 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4565 @item -Wsign-conversion
4566 @opindex Wsign-conversion
4567 @opindex Wno-sign-conversion
4568 Warn for implicit conversions that may change the sign of an integer
4569 value, like assigning a signed integer expression to an unsigned
4570 integer variable. An explicit cast silences the warning. In C, this
4571 option is enabled also by @option{-Wconversion}.
4573 @item -Wsizeof-pointer-memaccess
4574 @opindex Wsizeof-pointer-memaccess
4575 @opindex Wno-sizeof-pointer-memaccess
4576 Warn for suspicious length parameters to certain string and memory built-in
4577 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4578 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4579 but a pointer, and suggests a possible fix, or about
4580 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4581 @option{-Wall}.
4583 @item -Waddress
4584 @opindex Waddress
4585 @opindex Wno-address
4586 Warn about suspicious uses of memory addresses. These include using
4587 the address of a function in a conditional expression, such as
4588 @code{void func(void); if (func)}, and comparisons against the memory
4589 address of a string literal, such as @code{if (x == "abc")}.  Such
4590 uses typically indicate a programmer error: the address of a function
4591 always evaluates to true, so their use in a conditional usually
4592 indicate that the programmer forgot the parentheses in a function
4593 call; and comparisons against string literals result in unspecified
4594 behavior and are not portable in C, so they usually indicate that the
4595 programmer intended to use @code{strcmp}.  This warning is enabled by
4596 @option{-Wall}.
4598 @item -Wlogical-op
4599 @opindex Wlogical-op
4600 @opindex Wno-logical-op
4601 Warn about suspicious uses of logical operators in expressions.
4602 This includes using logical operators in contexts where a
4603 bit-wise operator is likely to be expected.
4605 @item -Waggregate-return
4606 @opindex Waggregate-return
4607 @opindex Wno-aggregate-return
4608 Warn if any functions that return structures or unions are defined or
4609 called.  (In languages where you can return an array, this also elicits
4610 a warning.)
4612 @item -Wno-aggressive-loop-optimizations
4613 @opindex Wno-aggressive-loop-optimizations
4614 @opindex Waggressive-loop-optimizations
4615 Warn if in a loop with constant number of iterations the compiler detects
4616 undefined behavior in some statement during one or more of the iterations.
4618 @item -Wno-attributes
4619 @opindex Wno-attributes
4620 @opindex Wattributes
4621 Do not warn if an unexpected @code{__attribute__} is used, such as
4622 unrecognized attributes, function attributes applied to variables,
4623 etc.  This does not stop errors for incorrect use of supported
4624 attributes.
4626 @item -Wno-builtin-macro-redefined
4627 @opindex Wno-builtin-macro-redefined
4628 @opindex Wbuiltin-macro-redefined
4629 Do not warn if certain built-in macros are redefined.  This suppresses
4630 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4631 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4633 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4634 @opindex Wstrict-prototypes
4635 @opindex Wno-strict-prototypes
4636 Warn if a function is declared or defined without specifying the
4637 argument types.  (An old-style function definition is permitted without
4638 a warning if preceded by a declaration that specifies the argument
4639 types.)
4641 @item -Wold-style-declaration @r{(C and Objective-C only)}
4642 @opindex Wold-style-declaration
4643 @opindex Wno-old-style-declaration
4644 Warn for obsolescent usages, according to the C Standard, in a
4645 declaration. For example, warn if storage-class specifiers like
4646 @code{static} are not the first things in a declaration.  This warning
4647 is also enabled by @option{-Wextra}.
4649 @item -Wold-style-definition @r{(C and Objective-C only)}
4650 @opindex Wold-style-definition
4651 @opindex Wno-old-style-definition
4652 Warn if an old-style function definition is used.  A warning is given
4653 even if there is a previous prototype.
4655 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4656 @opindex Wmissing-parameter-type
4657 @opindex Wno-missing-parameter-type
4658 A function parameter is declared without a type specifier in K&R-style
4659 functions:
4661 @smallexample
4662 void foo(bar) @{ @}
4663 @end smallexample
4665 This warning is also enabled by @option{-Wextra}.
4667 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4668 @opindex Wmissing-prototypes
4669 @opindex Wno-missing-prototypes
4670 Warn if a global function is defined without a previous prototype
4671 declaration.  This warning is issued even if the definition itself
4672 provides a prototype.  Use this option to detect global functions
4673 that do not have a matching prototype declaration in a header file.
4674 This option is not valid for C++ because all function declarations
4675 provide prototypes and a non-matching declaration will declare an
4676 overload rather than conflict with an earlier declaration.
4677 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4679 @item -Wmissing-declarations
4680 @opindex Wmissing-declarations
4681 @opindex Wno-missing-declarations
4682 Warn if a global function is defined without a previous declaration.
4683 Do so even if the definition itself provides a prototype.
4684 Use this option to detect global functions that are not declared in
4685 header files.  In C, no warnings are issued for functions with previous
4686 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4687 missing prototypes.  In C++, no warnings are issued for function templates,
4688 or for inline functions, or for functions in anonymous namespaces.
4690 @item -Wmissing-field-initializers
4691 @opindex Wmissing-field-initializers
4692 @opindex Wno-missing-field-initializers
4693 @opindex W
4694 @opindex Wextra
4695 @opindex Wno-extra
4696 Warn if a structure's initializer has some fields missing.  For
4697 example, the following code causes such a warning, because
4698 @code{x.h} is implicitly zero:
4700 @smallexample
4701 struct s @{ int f, g, h; @};
4702 struct s x = @{ 3, 4 @};
4703 @end smallexample
4705 This option does not warn about designated initializers, so the following
4706 modification does not trigger a warning:
4708 @smallexample
4709 struct s @{ int f, g, h; @};
4710 struct s x = @{ .f = 3, .g = 4 @};
4711 @end smallexample
4713 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4714 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4716 @item -Wno-multichar
4717 @opindex Wno-multichar
4718 @opindex Wmultichar
4719 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4720 Usually they indicate a typo in the user's code, as they have
4721 implementation-defined values, and should not be used in portable code.
4723 @item -Wnormalized=<none|id|nfc|nfkc>
4724 @opindex Wnormalized=
4725 @cindex NFC
4726 @cindex NFKC
4727 @cindex character set, input normalization
4728 In ISO C and ISO C++, two identifiers are different if they are
4729 different sequences of characters.  However, sometimes when characters
4730 outside the basic ASCII character set are used, you can have two
4731 different character sequences that look the same.  To avoid confusion,
4732 the ISO 10646 standard sets out some @dfn{normalization rules} which
4733 when applied ensure that two sequences that look the same are turned into
4734 the same sequence.  GCC can warn you if you are using identifiers that
4735 have not been normalized; this option controls that warning.
4737 There are four levels of warning supported by GCC@.  The default is
4738 @option{-Wnormalized=nfc}, which warns about any identifier that is
4739 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4740 recommended form for most uses.
4742 Unfortunately, there are some characters allowed in identifiers by
4743 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4744 identifiers.  That is, there's no way to use these symbols in portable
4745 ISO C or C++ and have all your identifiers in NFC@.
4746 @option{-Wnormalized=id} suppresses the warning for these characters.
4747 It is hoped that future versions of the standards involved will correct
4748 this, which is why this option is not the default.
4750 You can switch the warning off for all characters by writing
4751 @option{-Wnormalized=none}.  You should only do this if you
4752 are using some other normalization scheme (like ``D''), because
4753 otherwise you can easily create bugs that are literally impossible to see.
4755 Some characters in ISO 10646 have distinct meanings but look identical
4756 in some fonts or display methodologies, especially once formatting has
4757 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4758 LETTER N'', displays just like a regular @code{n} that has been
4759 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4760 normalization scheme to convert all these into a standard form as
4761 well, and GCC warns if your code is not in NFKC if you use
4762 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4763 about every identifier that contains the letter O because it might be
4764 confused with the digit 0, and so is not the default, but may be
4765 useful as a local coding convention if the programming environment 
4766 cannot be fixed to display these characters distinctly.
4768 @item -Wno-deprecated
4769 @opindex Wno-deprecated
4770 @opindex Wdeprecated
4771 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4773 @item -Wno-deprecated-declarations
4774 @opindex Wno-deprecated-declarations
4775 @opindex Wdeprecated-declarations
4776 Do not warn about uses of functions (@pxref{Function Attributes}),
4777 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4778 Attributes}) marked as deprecated by using the @code{deprecated}
4779 attribute.
4781 @item -Wno-overflow
4782 @opindex Wno-overflow
4783 @opindex Woverflow
4784 Do not warn about compile-time overflow in constant expressions.
4786 @item -Woverride-init @r{(C and Objective-C only)}
4787 @opindex Woverride-init
4788 @opindex Wno-override-init
4789 @opindex W
4790 @opindex Wextra
4791 @opindex Wno-extra
4792 Warn if an initialized field without side effects is overridden when
4793 using designated initializers (@pxref{Designated Inits, , Designated
4794 Initializers}).
4796 This warning is included in @option{-Wextra}.  To get other
4797 @option{-Wextra} warnings without this one, use @option{-Wextra
4798 -Wno-override-init}.
4800 @item -Wpacked
4801 @opindex Wpacked
4802 @opindex Wno-packed
4803 Warn if a structure is given the packed attribute, but the packed
4804 attribute has no effect on the layout or size of the structure.
4805 Such structures may be mis-aligned for little benefit.  For
4806 instance, in this code, the variable @code{f.x} in @code{struct bar}
4807 is misaligned even though @code{struct bar} does not itself
4808 have the packed attribute:
4810 @smallexample
4811 @group
4812 struct foo @{
4813   int x;
4814   char a, b, c, d;
4815 @} __attribute__((packed));
4816 struct bar @{
4817   char z;
4818   struct foo f;
4820 @end group
4821 @end smallexample
4823 @item -Wpacked-bitfield-compat
4824 @opindex Wpacked-bitfield-compat
4825 @opindex Wno-packed-bitfield-compat
4826 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4827 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4828 the change can lead to differences in the structure layout.  GCC
4829 informs you when the offset of such a field has changed in GCC 4.4.
4830 For example there is no longer a 4-bit padding between field @code{a}
4831 and @code{b} in this structure:
4833 @smallexample
4834 struct foo
4836   char a:4;
4837   char b:8;
4838 @} __attribute__ ((packed));
4839 @end smallexample
4841 This warning is enabled by default.  Use
4842 @option{-Wno-packed-bitfield-compat} to disable this warning.
4844 @item -Wpadded
4845 @opindex Wpadded
4846 @opindex Wno-padded
4847 Warn if padding is included in a structure, either to align an element
4848 of the structure or to align the whole structure.  Sometimes when this
4849 happens it is possible to rearrange the fields of the structure to
4850 reduce the padding and so make the structure smaller.
4852 @item -Wredundant-decls
4853 @opindex Wredundant-decls
4854 @opindex Wno-redundant-decls
4855 Warn if anything is declared more than once in the same scope, even in
4856 cases where multiple declaration is valid and changes nothing.
4858 @item -Wnested-externs @r{(C and Objective-C only)}
4859 @opindex Wnested-externs
4860 @opindex Wno-nested-externs
4861 Warn if an @code{extern} declaration is encountered within a function.
4863 @item -Wno-inherited-variadic-ctor
4864 @opindex Winherited-variadic-ctor
4865 @opindex Wno-inherited-variadic-ctor
4866 Suppress warnings about use of C++11 inheriting constructors when the
4867 base class inherited from has a C variadic constructor; the warning is
4868 on by default because the ellipsis is not inherited.
4870 @item -Winline
4871 @opindex Winline
4872 @opindex Wno-inline
4873 Warn if a function that is declared as inline cannot be inlined.
4874 Even with this option, the compiler does not warn about failures to
4875 inline functions declared in system headers.
4877 The compiler uses a variety of heuristics to determine whether or not
4878 to inline a function.  For example, the compiler takes into account
4879 the size of the function being inlined and the amount of inlining
4880 that has already been done in the current function.  Therefore,
4881 seemingly insignificant changes in the source program can cause the
4882 warnings produced by @option{-Winline} to appear or disappear.
4884 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4885 @opindex Wno-invalid-offsetof
4886 @opindex Winvalid-offsetof
4887 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4888 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4889 to a non-POD type is undefined.  In existing C++ implementations,
4890 however, @samp{offsetof} typically gives meaningful results even when
4891 applied to certain kinds of non-POD types (such as a simple
4892 @samp{struct} that fails to be a POD type only by virtue of having a
4893 constructor).  This flag is for users who are aware that they are
4894 writing nonportable code and who have deliberately chosen to ignore the
4895 warning about it.
4897 The restrictions on @samp{offsetof} may be relaxed in a future version
4898 of the C++ standard.
4900 @item -Wno-int-to-pointer-cast
4901 @opindex Wno-int-to-pointer-cast
4902 @opindex Wint-to-pointer-cast
4903 Suppress warnings from casts to pointer type of an integer of a
4904 different size. In C++, casting to a pointer type of smaller size is
4905 an error. @option{Wint-to-pointer-cast} is enabled by default.
4908 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4909 @opindex Wno-pointer-to-int-cast
4910 @opindex Wpointer-to-int-cast
4911 Suppress warnings from casts from a pointer to an integer type of a
4912 different size.
4914 @item -Winvalid-pch
4915 @opindex Winvalid-pch
4916 @opindex Wno-invalid-pch
4917 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4918 the search path but can't be used.
4920 @item -Wlong-long
4921 @opindex Wlong-long
4922 @opindex Wno-long-long
4923 Warn if @samp{long long} type is used.  This is enabled by either
4924 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4925 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4927 @item -Wvariadic-macros
4928 @opindex Wvariadic-macros
4929 @opindex Wno-variadic-macros
4930 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4931 alternate syntax when in pedantic ISO C99 mode.  This is default.
4932 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4934 @item -Wvarargs
4935 @opindex Wvarargs
4936 @opindex Wno-varargs
4937 Warn upon questionable usage of the macros used to handle variable
4938 arguments like @samp{va_start}.  This is default.  To inhibit the
4939 warning messages, use @option{-Wno-varargs}.
4941 @item -Wvector-operation-performance
4942 @opindex Wvector-operation-performance
4943 @opindex Wno-vector-operation-performance
4944 Warn if vector operation is not implemented via SIMD capabilities of the
4945 architecture.  Mainly useful for the performance tuning.
4946 Vector operation can be implemented @code{piecewise}, which means that the
4947 scalar operation is performed on every vector element; 
4948 @code{in parallel}, which means that the vector operation is implemented
4949 using scalars of wider type, which normally is more performance efficient;
4950 and @code{as a single scalar}, which means that vector fits into a
4951 scalar type.
4953 @item -Wno-virtual-move-assign
4954 @opindex Wvirtual-move-assign
4955 @opindex Wno-virtual-move-assign
4956 Suppress warnings about inheriting from a virtual base with a
4957 non-trivial C++11 move assignment operator.  This is dangerous because
4958 if the virtual base is reachable along more than one path, it will be
4959 moved multiple times, which can mean both objects end up in the
4960 moved-from state.  If the move assignment operator is written to avoid
4961 moving from a moved-from object, this warning can be disabled.
4963 @item -Wvla
4964 @opindex Wvla
4965 @opindex Wno-vla
4966 Warn if variable length array is used in the code.
4967 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4968 the variable length array.
4970 @item -Wvolatile-register-var
4971 @opindex Wvolatile-register-var
4972 @opindex Wno-volatile-register-var
4973 Warn if a register variable is declared volatile.  The volatile
4974 modifier does not inhibit all optimizations that may eliminate reads
4975 and/or writes to register variables.  This warning is enabled by
4976 @option{-Wall}.
4978 @item -Wdisabled-optimization
4979 @opindex Wdisabled-optimization
4980 @opindex Wno-disabled-optimization
4981 Warn if a requested optimization pass is disabled.  This warning does
4982 not generally indicate that there is anything wrong with your code; it
4983 merely indicates that GCC's optimizers are unable to handle the code
4984 effectively.  Often, the problem is that your code is too big or too
4985 complex; GCC refuses to optimize programs when the optimization
4986 itself is likely to take inordinate amounts of time.
4988 @item -Wpointer-sign @r{(C and Objective-C only)}
4989 @opindex Wpointer-sign
4990 @opindex Wno-pointer-sign
4991 Warn for pointer argument passing or assignment with different signedness.
4992 This option is only supported for C and Objective-C@.  It is implied by
4993 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4994 @option{-Wno-pointer-sign}.
4996 @item -Wstack-protector
4997 @opindex Wstack-protector
4998 @opindex Wno-stack-protector
4999 This option is only active when @option{-fstack-protector} is active.  It
5000 warns about functions that are not protected against stack smashing.
5002 @item -Wno-mudflap
5003 @opindex Wno-mudflap
5004 Suppress warnings about constructs that cannot be instrumented by
5005 @option{-fmudflap}.
5007 @item -Woverlength-strings
5008 @opindex Woverlength-strings
5009 @opindex Wno-overlength-strings
5010 Warn about string constants that are longer than the ``minimum
5011 maximum'' length specified in the C standard.  Modern compilers
5012 generally allow string constants that are much longer than the
5013 standard's minimum limit, but very portable programs should avoid
5014 using longer strings.
5016 The limit applies @emph{after} string constant concatenation, and does
5017 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5018 C99, it was raised to 4095.  C++98 does not specify a normative
5019 minimum maximum, so we do not diagnose overlength strings in C++@.
5021 This option is implied by @option{-Wpedantic}, and can be disabled with
5022 @option{-Wno-overlength-strings}.
5024 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5025 @opindex Wunsuffixed-float-constants
5027 Issue a warning for any floating constant that does not have
5028 a suffix.  When used together with @option{-Wsystem-headers} it
5029 warns about such constants in system header files.  This can be useful
5030 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5031 from the decimal floating-point extension to C99.
5032 @end table
5034 @node Debugging Options
5035 @section Options for Debugging Your Program or GCC
5036 @cindex options, debugging
5037 @cindex debugging information options
5039 GCC has various special options that are used for debugging
5040 either your program or GCC:
5042 @table @gcctabopt
5043 @item -g
5044 @opindex g
5045 Produce debugging information in the operating system's native format
5046 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5047 information.
5049 On most systems that use stabs format, @option{-g} enables use of extra
5050 debugging information that only GDB can use; this extra information
5051 makes debugging work better in GDB but probably makes other debuggers
5052 crash or
5053 refuse to read the program.  If you want to control for certain whether
5054 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5055 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5057 GCC allows you to use @option{-g} with
5058 @option{-O}.  The shortcuts taken by optimized code may occasionally
5059 produce surprising results: some variables you declared may not exist
5060 at all; flow of control may briefly move where you did not expect it;
5061 some statements may not be executed because they compute constant
5062 results or their values are already at hand; some statements may
5063 execute in different places because they have been moved out of loops.
5065 Nevertheless it proves possible to debug optimized output.  This makes
5066 it reasonable to use the optimizer for programs that might have bugs.
5068 The following options are useful when GCC is generated with the
5069 capability for more than one debugging format.
5071 @item -gsplit-dwarf
5072 @opindex gsplit-dwarf
5073 Separate as much dwarf debugging information as possible into a
5074 separate output file with the extension .dwo.  This option allows
5075 the build system to avoid linking files with debug information.  To
5076 be useful, this option requires a debugger capable of reading .dwo
5077 files.
5079 @item -ggdb
5080 @opindex ggdb
5081 Produce debugging information for use by GDB@.  This means to use the
5082 most expressive format available (DWARF 2, stabs, or the native format
5083 if neither of those are supported), including GDB extensions if at all
5084 possible.
5086 @item -gpubnames
5087 @opindex gpubnames
5088 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5090 @item -gstabs
5091 @opindex gstabs
5092 Produce debugging information in stabs format (if that is supported),
5093 without GDB extensions.  This is the format used by DBX on most BSD
5094 systems.  On MIPS, Alpha and System V Release 4 systems this option
5095 produces stabs debugging output that is not understood by DBX or SDB@.
5096 On System V Release 4 systems this option requires the GNU assembler.
5098 @item -feliminate-unused-debug-symbols
5099 @opindex feliminate-unused-debug-symbols
5100 Produce debugging information in stabs format (if that is supported),
5101 for only symbols that are actually used.
5103 @item -femit-class-debug-always
5104 Instead of emitting debugging information for a C++ class in only one
5105 object file, emit it in all object files using the class.  This option
5106 should be used only with debuggers that are unable to handle the way GCC
5107 normally emits debugging information for classes because using this
5108 option increases the size of debugging information by as much as a
5109 factor of two.
5111 @item -fdebug-types-section
5112 @opindex fdebug-types-section
5113 @opindex fno-debug-types-section
5114 When using DWARF Version 4 or higher, type DIEs can be put into
5115 their own @code{.debug_types} section instead of making them part of the
5116 @code{.debug_info} section.  It is more efficient to put them in a separate
5117 comdat sections since the linker can then remove duplicates.
5118 But not all DWARF consumers support @code{.debug_types} sections yet
5119 and on some objects @code{.debug_types} produces larger instead of smaller
5120 debugging information.
5122 @item -gstabs+
5123 @opindex gstabs+
5124 Produce debugging information in stabs format (if that is supported),
5125 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5126 use of these extensions is likely to make other debuggers crash or
5127 refuse to read the program.
5129 @item -gcoff
5130 @opindex gcoff
5131 Produce debugging information in COFF format (if that is supported).
5132 This is the format used by SDB on most System V systems prior to
5133 System V Release 4.
5135 @item -gxcoff
5136 @opindex gxcoff
5137 Produce debugging information in XCOFF format (if that is supported).
5138 This is the format used by the DBX debugger on IBM RS/6000 systems.
5140 @item -gxcoff+
5141 @opindex gxcoff+
5142 Produce debugging information in XCOFF format (if that is supported),
5143 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5144 use of these extensions is likely to make other debuggers crash or
5145 refuse to read the program, and may cause assemblers other than the GNU
5146 assembler (GAS) to fail with an error.
5148 @item -gdwarf-@var{version}
5149 @opindex gdwarf-@var{version}
5150 Produce debugging information in DWARF format (if that is supported).
5151 The value of @var{version} may be either 2, 3 or 4; the default version
5152 for most targets is 4.
5154 Note that with DWARF Version 2, some ports require and always
5155 use some non-conflicting DWARF 3 extensions in the unwind tables.
5157 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5158 for maximum benefit.
5160 @item -grecord-gcc-switches
5161 @opindex grecord-gcc-switches
5162 This switch causes the command-line options used to invoke the
5163 compiler that may affect code generation to be appended to the
5164 DW_AT_producer attribute in DWARF debugging information.  The options
5165 are concatenated with spaces separating them from each other and from
5166 the compiler version.  See also @option{-frecord-gcc-switches} for another
5167 way of storing compiler options into the object file.  This is the default.
5169 @item -gno-record-gcc-switches
5170 @opindex gno-record-gcc-switches
5171 Disallow appending command-line options to the DW_AT_producer attribute
5172 in DWARF debugging information.
5174 @item -gstrict-dwarf
5175 @opindex gstrict-dwarf
5176 Disallow using extensions of later DWARF standard version than selected
5177 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5178 DWARF extensions from later standard versions is allowed.
5180 @item -gno-strict-dwarf
5181 @opindex gno-strict-dwarf
5182 Allow using extensions of later DWARF standard version than selected with
5183 @option{-gdwarf-@var{version}}.
5185 @item -gvms
5186 @opindex gvms
5187 Produce debugging information in Alpha/VMS debug format (if that is
5188 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5190 @item -g@var{level}
5191 @itemx -ggdb@var{level}
5192 @itemx -gstabs@var{level}
5193 @itemx -gcoff@var{level}
5194 @itemx -gxcoff@var{level}
5195 @itemx -gvms@var{level}
5196 Request debugging information and also use @var{level} to specify how
5197 much information.  The default level is 2.
5199 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5200 @option{-g}.
5202 Level 1 produces minimal information, enough for making backtraces in
5203 parts of the program that you don't plan to debug.  This includes
5204 descriptions of functions and external variables, but no information
5205 about local variables and no line numbers.
5207 Level 3 includes extra information, such as all the macro definitions
5208 present in the program.  Some debuggers support macro expansion when
5209 you use @option{-g3}.
5211 @option{-gdwarf-2} does not accept a concatenated debug level, because
5212 GCC used to support an option @option{-gdwarf} that meant to generate
5213 debug information in version 1 of the DWARF format (which is very
5214 different from version 2), and it would have been too confusing.  That
5215 debug format is long obsolete, but the option cannot be changed now.
5216 Instead use an additional @option{-g@var{level}} option to change the
5217 debug level for DWARF.
5219 @item -gtoggle
5220 @opindex gtoggle
5221 Turn off generation of debug info, if leaving out this option
5222 generates it, or turn it on at level 2 otherwise.  The position of this
5223 argument in the command line does not matter; it takes effect after all
5224 other options are processed, and it does so only once, no matter how
5225 many times it is given.  This is mainly intended to be used with
5226 @option{-fcompare-debug}.
5228 @item -fsanitize=address
5229 Enable AddressSanitizer, a fast memory error detector.
5230 Memory access instructions will be instrumented to detect
5231 out-of-bounds and use-after-free bugs.
5232 See @uref{http://code.google.com/p/address-sanitizer/} for more details.
5234 @item -fsanitize=thread
5235 Enable ThreadSanitizer, a fast data race detector.
5236 Memory access instructions will be instrumented to detect
5237 data race bugs.
5238 See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for more details.
5240 @item -fsanitize=undefined
5241 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector
5242 Various computations will be instrumented to detect undefined behavior
5243 at runtime, e.g.@: division by zero or various overflows.
5244 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5245 @option{-fsanitize=undefined} gives a diagnostic message.
5246 This currently works only for the C family of languages.
5248 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5249 @opindex fdump-final-insns
5250 Dump the final internal representation (RTL) to @var{file}.  If the
5251 optional argument is omitted (or if @var{file} is @code{.}), the name
5252 of the dump file is determined by appending @code{.gkd} to the
5253 compilation output file name.
5255 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5256 @opindex fcompare-debug
5257 @opindex fno-compare-debug
5258 If no error occurs during compilation, run the compiler a second time,
5259 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5260 passed to the second compilation.  Dump the final internal
5261 representation in both compilations, and print an error if they differ.
5263 If the equal sign is omitted, the default @option{-gtoggle} is used.
5265 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5266 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5267 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5268 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5269 is used.
5271 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5272 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5273 of the final representation and the second compilation, preventing even
5274 @env{GCC_COMPARE_DEBUG} from taking effect.
5276 To verify full coverage during @option{-fcompare-debug} testing, set
5277 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5278 which GCC rejects as an invalid option in any actual compilation
5279 (rather than preprocessing, assembly or linking).  To get just a
5280 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5281 not overridden} will do.
5283 @item -fcompare-debug-second
5284 @opindex fcompare-debug-second
5285 This option is implicitly passed to the compiler for the second
5286 compilation requested by @option{-fcompare-debug}, along with options to
5287 silence warnings, and omitting other options that would cause
5288 side-effect compiler outputs to files or to the standard output.  Dump
5289 files and preserved temporary files are renamed so as to contain the
5290 @code{.gk} additional extension during the second compilation, to avoid
5291 overwriting those generated by the first.
5293 When this option is passed to the compiler driver, it causes the
5294 @emph{first} compilation to be skipped, which makes it useful for little
5295 other than debugging the compiler proper.
5297 @item -feliminate-dwarf2-dups
5298 @opindex feliminate-dwarf2-dups
5299 Compress DWARF 2 debugging information by eliminating duplicated
5300 information about each symbol.  This option only makes sense when
5301 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5303 @item -femit-struct-debug-baseonly
5304 Emit debug information for struct-like types
5305 only when the base name of the compilation source file
5306 matches the base name of file in which the struct is defined.
5308 This option substantially reduces the size of debugging information,
5309 but at significant potential loss in type information to the debugger.
5310 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5311 See @option{-femit-struct-debug-detailed} for more detailed control.
5313 This option works only with DWARF 2.
5315 @item -femit-struct-debug-reduced
5316 Emit debug information for struct-like types
5317 only when the base name of the compilation source file
5318 matches the base name of file in which the type is defined,
5319 unless the struct is a template or defined in a system header.
5321 This option significantly reduces the size of debugging information,
5322 with some potential loss in type information to the debugger.
5323 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5324 See @option{-femit-struct-debug-detailed} for more detailed control.
5326 This option works only with DWARF 2.
5328 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5329 Specify the struct-like types
5330 for which the compiler generates debug information.
5331 The intent is to reduce duplicate struct debug information
5332 between different object files within the same program.
5334 This option is a detailed version of
5335 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5336 which serves for most needs.
5338 A specification has the syntax@*
5339 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5341 The optional first word limits the specification to
5342 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5343 A struct type is used directly when it is the type of a variable, member.
5344 Indirect uses arise through pointers to structs.
5345 That is, when use of an incomplete struct is valid, the use is indirect.
5346 An example is
5347 @samp{struct one direct; struct two * indirect;}.
5349 The optional second word limits the specification to
5350 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5351 Generic structs are a bit complicated to explain.
5352 For C++, these are non-explicit specializations of template classes,
5353 or non-template classes within the above.
5354 Other programming languages have generics,
5355 but @option{-femit-struct-debug-detailed} does not yet implement them.
5357 The third word specifies the source files for those
5358 structs for which the compiler should emit debug information.
5359 The values @samp{none} and @samp{any} have the normal meaning.
5360 The value @samp{base} means that
5361 the base of name of the file in which the type declaration appears
5362 must match the base of the name of the main compilation file.
5363 In practice, this means that when compiling @file{foo.c}, debug information
5364 is generated for types declared in that file and @file{foo.h},
5365 but not other header files.
5366 The value @samp{sys} means those types satisfying @samp{base}
5367 or declared in system or compiler headers.
5369 You may need to experiment to determine the best settings for your application.
5371 The default is @option{-femit-struct-debug-detailed=all}.
5373 This option works only with DWARF 2.
5375 @item -fno-merge-debug-strings
5376 @opindex fmerge-debug-strings
5377 @opindex fno-merge-debug-strings
5378 Direct the linker to not merge together strings in the debugging
5379 information that are identical in different object files.  Merging is
5380 not supported by all assemblers or linkers.  Merging decreases the size
5381 of the debug information in the output file at the cost of increasing
5382 link processing time.  Merging is enabled by default.
5384 @item -fdebug-prefix-map=@var{old}=@var{new}
5385 @opindex fdebug-prefix-map
5386 When compiling files in directory @file{@var{old}}, record debugging
5387 information describing them as in @file{@var{new}} instead.
5389 @item -fno-dwarf2-cfi-asm
5390 @opindex fdwarf2-cfi-asm
5391 @opindex fno-dwarf2-cfi-asm
5392 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5393 instead of using GAS @code{.cfi_*} directives.
5395 @cindex @command{prof}
5396 @item -p
5397 @opindex p
5398 Generate extra code to write profile information suitable for the
5399 analysis program @command{prof}.  You must use this option when compiling
5400 the source files you want data about, and you must also use it when
5401 linking.
5403 @cindex @command{gprof}
5404 @item -pg
5405 @opindex pg
5406 Generate extra code to write profile information suitable for the
5407 analysis program @command{gprof}.  You must use this option when compiling
5408 the source files you want data about, and you must also use it when
5409 linking.
5411 @item -Q
5412 @opindex Q
5413 Makes the compiler print out each function name as it is compiled, and
5414 print some statistics about each pass when it finishes.
5416 @item -ftime-report
5417 @opindex ftime-report
5418 Makes the compiler print some statistics about the time consumed by each
5419 pass when it finishes.
5421 @item -fmem-report
5422 @opindex fmem-report
5423 Makes the compiler print some statistics about permanent memory
5424 allocation when it finishes.
5426 @item -fmem-report-wpa
5427 @opindex fmem-report-wpa
5428 Makes the compiler print some statistics about permanent memory
5429 allocation for the WPA phase only.
5431 @item -fpre-ipa-mem-report
5432 @opindex fpre-ipa-mem-report
5433 @item -fpost-ipa-mem-report
5434 @opindex fpost-ipa-mem-report
5435 Makes the compiler print some statistics about permanent memory
5436 allocation before or after interprocedural optimization.
5438 @item -fprofile-report
5439 @opindex fprofile-report
5440 Makes the compiler print some statistics about consistency of the
5441 (estimated) profile and effect of individual passes.
5443 @item -fstack-usage
5444 @opindex fstack-usage
5445 Makes the compiler output stack usage information for the program, on a
5446 per-function basis.  The filename for the dump is made by appending
5447 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5448 the output file, if explicitly specified and it is not an executable,
5449 otherwise it is the basename of the source file.  An entry is made up
5450 of three fields:
5452 @itemize
5453 @item
5454 The name of the function.
5455 @item
5456 A number of bytes.
5457 @item
5458 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5459 @end itemize
5461 The qualifier @code{static} means that the function manipulates the stack
5462 statically: a fixed number of bytes are allocated for the frame on function
5463 entry and released on function exit; no stack adjustments are otherwise made
5464 in the function.  The second field is this fixed number of bytes.
5466 The qualifier @code{dynamic} means that the function manipulates the stack
5467 dynamically: in addition to the static allocation described above, stack
5468 adjustments are made in the body of the function, for example to push/pop
5469 arguments around function calls.  If the qualifier @code{bounded} is also
5470 present, the amount of these adjustments is bounded at compile time and
5471 the second field is an upper bound of the total amount of stack used by
5472 the function.  If it is not present, the amount of these adjustments is
5473 not bounded at compile time and the second field only represents the
5474 bounded part.
5476 @item -fprofile-arcs
5477 @opindex fprofile-arcs
5478 Add code so that program flow @dfn{arcs} are instrumented.  During
5479 execution the program records how many times each branch and call is
5480 executed and how many times it is taken or returns.  When the compiled
5481 program exits it saves this data to a file called
5482 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5483 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5484 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5485 @var{auxname} is generated from the name of the output file, if
5486 explicitly specified and it is not the final executable, otherwise it is
5487 the basename of the source file.  In both cases any suffix is removed
5488 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5489 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5490 @xref{Cross-profiling}.
5492 @cindex @command{gcov}
5493 @item --coverage
5494 @opindex coverage
5496 This option is used to compile and link code instrumented for coverage
5497 analysis.  The option is a synonym for @option{-fprofile-arcs}
5498 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5499 linking).  See the documentation for those options for more details.
5501 @itemize
5503 @item
5504 Compile the source files with @option{-fprofile-arcs} plus optimization
5505 and code generation options.  For test coverage analysis, use the
5506 additional @option{-ftest-coverage} option.  You do not need to profile
5507 every source file in a program.
5509 @item
5510 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5511 (the latter implies the former).
5513 @item
5514 Run the program on a representative workload to generate the arc profile
5515 information.  This may be repeated any number of times.  You can run
5516 concurrent instances of your program, and provided that the file system
5517 supports locking, the data files will be correctly updated.  Also
5518 @code{fork} calls are detected and correctly handled (double counting
5519 will not happen).
5521 @item
5522 For profile-directed optimizations, compile the source files again with
5523 the same optimization and code generation options plus
5524 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5525 Control Optimization}).
5527 @item
5528 For test coverage analysis, use @command{gcov} to produce human readable
5529 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5530 @command{gcov} documentation for further information.
5532 @end itemize
5534 With @option{-fprofile-arcs}, for each function of your program GCC
5535 creates a program flow graph, then finds a spanning tree for the graph.
5536 Only arcs that are not on the spanning tree have to be instrumented: the
5537 compiler adds code to count the number of times that these arcs are
5538 executed.  When an arc is the only exit or only entrance to a block, the
5539 instrumentation code can be added to the block; otherwise, a new basic
5540 block must be created to hold the instrumentation code.
5542 @need 2000
5543 @item -ftest-coverage
5544 @opindex ftest-coverage
5545 Produce a notes file that the @command{gcov} code-coverage utility
5546 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5547 show program coverage.  Each source file's note file is called
5548 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5549 above for a description of @var{auxname} and instructions on how to
5550 generate test coverage data.  Coverage data matches the source files
5551 more closely if you do not optimize.
5553 @item -fdbg-cnt-list
5554 @opindex fdbg-cnt-list
5555 Print the name and the counter upper bound for all debug counters.
5558 @item -fdbg-cnt=@var{counter-value-list}
5559 @opindex fdbg-cnt
5560 Set the internal debug counter upper bound.  @var{counter-value-list}
5561 is a comma-separated list of @var{name}:@var{value} pairs
5562 which sets the upper bound of each debug counter @var{name} to @var{value}.
5563 All debug counters have the initial upper bound of @code{UINT_MAX};
5564 thus @code{dbg_cnt()} returns true always unless the upper bound
5565 is set by this option.
5566 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5567 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5569 @item -fenable-@var{kind}-@var{pass}
5570 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5571 @opindex fdisable-
5572 @opindex fenable-
5574 This is a set of options that are used to explicitly disable/enable
5575 optimization passes.  These options are intended for use for debugging GCC.
5576 Compiler users should use regular options for enabling/disabling
5577 passes instead.
5579 @table @gcctabopt
5581 @item -fdisable-ipa-@var{pass}
5582 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5583 statically invoked in the compiler multiple times, the pass name should be
5584 appended with a sequential number starting from 1.
5586 @item -fdisable-rtl-@var{pass}
5587 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5588 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5589 statically invoked in the compiler multiple times, the pass name should be
5590 appended with a sequential number starting from 1.  @var{range-list} is a 
5591 comma-separated list of function ranges or assembler names.  Each range is a number
5592 pair separated by a colon.  The range is inclusive in both ends.  If the range
5593 is trivial, the number pair can be simplified as a single number.  If the
5594 function's call graph node's @var{uid} falls within one of the specified ranges,
5595 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5596 function header of a dump file, and the pass names can be dumped by using
5597 option @option{-fdump-passes}.
5599 @item -fdisable-tree-@var{pass}
5600 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5601 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5602 option arguments.
5604 @item -fenable-ipa-@var{pass}
5605 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5606 statically invoked in the compiler multiple times, the pass name should be
5607 appended with a sequential number starting from 1.
5609 @item -fenable-rtl-@var{pass}
5610 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5611 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5612 description and examples.
5614 @item -fenable-tree-@var{pass}
5615 @itemx -fenable-tree-@var{pass}=@var{range-list}
5616 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5617 of option arguments.
5619 @end table
5621 Here are some examples showing uses of these options.
5623 @smallexample
5625 # disable ccp1 for all functions
5626    -fdisable-tree-ccp1
5627 # disable complete unroll for function whose cgraph node uid is 1
5628    -fenable-tree-cunroll=1
5629 # disable gcse2 for functions at the following ranges [1,1],
5630 # [300,400], and [400,1000]
5631 # disable gcse2 for functions foo and foo2
5632    -fdisable-rtl-gcse2=foo,foo2
5633 # disable early inlining
5634    -fdisable-tree-einline
5635 # disable ipa inlining
5636    -fdisable-ipa-inline
5637 # enable tree full unroll
5638    -fenable-tree-unroll
5640 @end smallexample
5642 @item -d@var{letters}
5643 @itemx -fdump-rtl-@var{pass}
5644 @itemx -fdump-rtl-@var{pass}=@var{filename}
5645 @opindex d
5646 Says to make debugging dumps during compilation at times specified by
5647 @var{letters}.  This is used for debugging the RTL-based passes of the
5648 compiler.  The file names for most of the dumps are made by appending
5649 a pass number and a word to the @var{dumpname}, and the files are
5650 created in the directory of the output file. In case of
5651 @option{=@var{filename}} option, the dump is output on the given file
5652 instead of the pass numbered dump files. Note that the pass number is
5653 computed statically as passes get registered into the pass manager.
5654 Thus the numbering is not related to the dynamic order of execution of
5655 passes.  In particular, a pass installed by a plugin could have a
5656 number over 200 even if it executed quite early.  @var{dumpname} is
5657 generated from the name of the output file, if explicitly specified
5658 and it is not an executable, otherwise it is the basename of the
5659 source file. These switches may have different effects when
5660 @option{-E} is used for preprocessing.
5662 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5663 @option{-d} option @var{letters}.  Here are the possible
5664 letters for use in @var{pass} and @var{letters}, and their meanings:
5666 @table @gcctabopt
5668 @item -fdump-rtl-alignments
5669 @opindex fdump-rtl-alignments
5670 Dump after branch alignments have been computed.
5672 @item -fdump-rtl-asmcons
5673 @opindex fdump-rtl-asmcons
5674 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5676 @item -fdump-rtl-auto_inc_dec
5677 @opindex fdump-rtl-auto_inc_dec
5678 Dump after auto-inc-dec discovery.  This pass is only run on
5679 architectures that have auto inc or auto dec instructions.
5681 @item -fdump-rtl-barriers
5682 @opindex fdump-rtl-barriers
5683 Dump after cleaning up the barrier instructions.
5685 @item -fdump-rtl-bbpart
5686 @opindex fdump-rtl-bbpart
5687 Dump after partitioning hot and cold basic blocks.
5689 @item -fdump-rtl-bbro
5690 @opindex fdump-rtl-bbro
5691 Dump after block reordering.
5693 @item -fdump-rtl-btl1
5694 @itemx -fdump-rtl-btl2
5695 @opindex fdump-rtl-btl2
5696 @opindex fdump-rtl-btl2
5697 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5698 after the two branch
5699 target load optimization passes.
5701 @item -fdump-rtl-bypass
5702 @opindex fdump-rtl-bypass
5703 Dump after jump bypassing and control flow optimizations.
5705 @item -fdump-rtl-combine
5706 @opindex fdump-rtl-combine
5707 Dump after the RTL instruction combination pass.
5709 @item -fdump-rtl-compgotos
5710 @opindex fdump-rtl-compgotos
5711 Dump after duplicating the computed gotos.
5713 @item -fdump-rtl-ce1
5714 @itemx -fdump-rtl-ce2
5715 @itemx -fdump-rtl-ce3
5716 @opindex fdump-rtl-ce1
5717 @opindex fdump-rtl-ce2
5718 @opindex fdump-rtl-ce3
5719 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5720 @option{-fdump-rtl-ce3} enable dumping after the three
5721 if conversion passes.
5723 @item -fdump-rtl-cprop_hardreg
5724 @opindex fdump-rtl-cprop_hardreg
5725 Dump after hard register copy propagation.
5727 @item -fdump-rtl-csa
5728 @opindex fdump-rtl-csa
5729 Dump after combining stack adjustments.
5731 @item -fdump-rtl-cse1
5732 @itemx -fdump-rtl-cse2
5733 @opindex fdump-rtl-cse1
5734 @opindex fdump-rtl-cse2
5735 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5736 the two common subexpression elimination passes.
5738 @item -fdump-rtl-dce
5739 @opindex fdump-rtl-dce
5740 Dump after the standalone dead code elimination passes.
5742 @item -fdump-rtl-dbr
5743 @opindex fdump-rtl-dbr
5744 Dump after delayed branch scheduling.
5746 @item -fdump-rtl-dce1
5747 @itemx -fdump-rtl-dce2
5748 @opindex fdump-rtl-dce1
5749 @opindex fdump-rtl-dce2
5750 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5751 the two dead store elimination passes.
5753 @item -fdump-rtl-eh
5754 @opindex fdump-rtl-eh
5755 Dump after finalization of EH handling code.
5757 @item -fdump-rtl-eh_ranges
5758 @opindex fdump-rtl-eh_ranges
5759 Dump after conversion of EH handling range regions.
5761 @item -fdump-rtl-expand
5762 @opindex fdump-rtl-expand
5763 Dump after RTL generation.
5765 @item -fdump-rtl-fwprop1
5766 @itemx -fdump-rtl-fwprop2
5767 @opindex fdump-rtl-fwprop1
5768 @opindex fdump-rtl-fwprop2
5769 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5770 dumping after the two forward propagation passes.
5772 @item -fdump-rtl-gcse1
5773 @itemx -fdump-rtl-gcse2
5774 @opindex fdump-rtl-gcse1
5775 @opindex fdump-rtl-gcse2
5776 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5777 after global common subexpression elimination.
5779 @item -fdump-rtl-init-regs
5780 @opindex fdump-rtl-init-regs
5781 Dump after the initialization of the registers.
5783 @item -fdump-rtl-initvals
5784 @opindex fdump-rtl-initvals
5785 Dump after the computation of the initial value sets.
5787 @item -fdump-rtl-into_cfglayout
5788 @opindex fdump-rtl-into_cfglayout
5789 Dump after converting to cfglayout mode.
5791 @item -fdump-rtl-ira
5792 @opindex fdump-rtl-ira
5793 Dump after iterated register allocation.
5795 @item -fdump-rtl-jump
5796 @opindex fdump-rtl-jump
5797 Dump after the second jump optimization.
5799 @item -fdump-rtl-loop2
5800 @opindex fdump-rtl-loop2
5801 @option{-fdump-rtl-loop2} enables dumping after the rtl
5802 loop optimization passes.
5804 @item -fdump-rtl-mach
5805 @opindex fdump-rtl-mach
5806 Dump after performing the machine dependent reorganization pass, if that
5807 pass exists.
5809 @item -fdump-rtl-mode_sw
5810 @opindex fdump-rtl-mode_sw
5811 Dump after removing redundant mode switches.
5813 @item -fdump-rtl-rnreg
5814 @opindex fdump-rtl-rnreg
5815 Dump after register renumbering.
5817 @item -fdump-rtl-outof_cfglayout
5818 @opindex fdump-rtl-outof_cfglayout
5819 Dump after converting from cfglayout mode.
5821 @item -fdump-rtl-peephole2
5822 @opindex fdump-rtl-peephole2
5823 Dump after the peephole pass.
5825 @item -fdump-rtl-postreload
5826 @opindex fdump-rtl-postreload
5827 Dump after post-reload optimizations.
5829 @item -fdump-rtl-pro_and_epilogue
5830 @opindex fdump-rtl-pro_and_epilogue
5831 Dump after generating the function prologues and epilogues.
5833 @item -fdump-rtl-regmove
5834 @opindex fdump-rtl-regmove
5835 Dump after the register move pass.
5837 @item -fdump-rtl-sched1
5838 @itemx -fdump-rtl-sched2
5839 @opindex fdump-rtl-sched1
5840 @opindex fdump-rtl-sched2
5841 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5842 after the basic block scheduling passes.
5844 @item -fdump-rtl-see
5845 @opindex fdump-rtl-see
5846 Dump after sign extension elimination.
5848 @item -fdump-rtl-seqabstr
5849 @opindex fdump-rtl-seqabstr
5850 Dump after common sequence discovery.
5852 @item -fdump-rtl-shorten
5853 @opindex fdump-rtl-shorten
5854 Dump after shortening branches.
5856 @item -fdump-rtl-sibling
5857 @opindex fdump-rtl-sibling
5858 Dump after sibling call optimizations.
5860 @item -fdump-rtl-split1
5861 @itemx -fdump-rtl-split2
5862 @itemx -fdump-rtl-split3
5863 @itemx -fdump-rtl-split4
5864 @itemx -fdump-rtl-split5
5865 @opindex fdump-rtl-split1
5866 @opindex fdump-rtl-split2
5867 @opindex fdump-rtl-split3
5868 @opindex fdump-rtl-split4
5869 @opindex fdump-rtl-split5
5870 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5871 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5872 @option{-fdump-rtl-split5} enable dumping after five rounds of
5873 instruction splitting.
5875 @item -fdump-rtl-sms
5876 @opindex fdump-rtl-sms
5877 Dump after modulo scheduling.  This pass is only run on some
5878 architectures.
5880 @item -fdump-rtl-stack
5881 @opindex fdump-rtl-stack
5882 Dump after conversion from GCC's ``flat register file'' registers to the
5883 x87's stack-like registers.  This pass is only run on x86 variants.
5885 @item -fdump-rtl-subreg1
5886 @itemx -fdump-rtl-subreg2
5887 @opindex fdump-rtl-subreg1
5888 @opindex fdump-rtl-subreg2
5889 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5890 the two subreg expansion passes.
5892 @item -fdump-rtl-unshare
5893 @opindex fdump-rtl-unshare
5894 Dump after all rtl has been unshared.
5896 @item -fdump-rtl-vartrack
5897 @opindex fdump-rtl-vartrack
5898 Dump after variable tracking.
5900 @item -fdump-rtl-vregs
5901 @opindex fdump-rtl-vregs
5902 Dump after converting virtual registers to hard registers.
5904 @item -fdump-rtl-web
5905 @opindex fdump-rtl-web
5906 Dump after live range splitting.
5908 @item -fdump-rtl-regclass
5909 @itemx -fdump-rtl-subregs_of_mode_init
5910 @itemx -fdump-rtl-subregs_of_mode_finish
5911 @itemx -fdump-rtl-dfinit
5912 @itemx -fdump-rtl-dfinish
5913 @opindex fdump-rtl-regclass
5914 @opindex fdump-rtl-subregs_of_mode_init
5915 @opindex fdump-rtl-subregs_of_mode_finish
5916 @opindex fdump-rtl-dfinit
5917 @opindex fdump-rtl-dfinish
5918 These dumps are defined but always produce empty files.
5920 @item -da
5921 @itemx -fdump-rtl-all
5922 @opindex da
5923 @opindex fdump-rtl-all
5924 Produce all the dumps listed above.
5926 @item -dA
5927 @opindex dA
5928 Annotate the assembler output with miscellaneous debugging information.
5930 @item -dD
5931 @opindex dD
5932 Dump all macro definitions, at the end of preprocessing, in addition to
5933 normal output.
5935 @item -dH
5936 @opindex dH
5937 Produce a core dump whenever an error occurs.
5939 @item -dp
5940 @opindex dp
5941 Annotate the assembler output with a comment indicating which
5942 pattern and alternative is used.  The length of each instruction is
5943 also printed.
5945 @item -dP
5946 @opindex dP
5947 Dump the RTL in the assembler output as a comment before each instruction.
5948 Also turns on @option{-dp} annotation.
5950 @item -dx
5951 @opindex dx
5952 Just generate RTL for a function instead of compiling it.  Usually used
5953 with @option{-fdump-rtl-expand}.
5954 @end table
5956 @item -fdump-noaddr
5957 @opindex fdump-noaddr
5958 When doing debugging dumps, suppress address output.  This makes it more
5959 feasible to use diff on debugging dumps for compiler invocations with
5960 different compiler binaries and/or different
5961 text / bss / data / heap / stack / dso start locations.
5963 @item -fdump-unnumbered
5964 @opindex fdump-unnumbered
5965 When doing debugging dumps, suppress instruction numbers and address output.
5966 This makes it more feasible to use diff on debugging dumps for compiler
5967 invocations with different options, in particular with and without
5968 @option{-g}.
5970 @item -fdump-unnumbered-links
5971 @opindex fdump-unnumbered-links
5972 When doing debugging dumps (see @option{-d} option above), suppress
5973 instruction numbers for the links to the previous and next instructions
5974 in a sequence.
5976 @item -fdump-translation-unit @r{(C++ only)}
5977 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5978 @opindex fdump-translation-unit
5979 Dump a representation of the tree structure for the entire translation
5980 unit to a file.  The file name is made by appending @file{.tu} to the
5981 source file name, and the file is created in the same directory as the
5982 output file.  If the @samp{-@var{options}} form is used, @var{options}
5983 controls the details of the dump as described for the
5984 @option{-fdump-tree} options.
5986 @item -fdump-class-hierarchy @r{(C++ only)}
5987 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5988 @opindex fdump-class-hierarchy
5989 Dump a representation of each class's hierarchy and virtual function
5990 table layout to a file.  The file name is made by appending
5991 @file{.class} to the source file name, and the file is created in the
5992 same directory as the output file.  If the @samp{-@var{options}} form
5993 is used, @var{options} controls the details of the dump as described
5994 for the @option{-fdump-tree} options.
5996 @item -fdump-ipa-@var{switch}
5997 @opindex fdump-ipa
5998 Control the dumping at various stages of inter-procedural analysis
5999 language tree to a file.  The file name is generated by appending a
6000 switch specific suffix to the source file name, and the file is created
6001 in the same directory as the output file.  The following dumps are
6002 possible:
6004 @table @samp
6005 @item all
6006 Enables all inter-procedural analysis dumps.
6008 @item cgraph
6009 Dumps information about call-graph optimization, unused function removal,
6010 and inlining decisions.
6012 @item inline
6013 Dump after function inlining.
6015 @end table
6017 @item -fdump-passes
6018 @opindex fdump-passes
6019 Dump the list of optimization passes that are turned on and off by
6020 the current command-line options.
6022 @item -fdump-statistics-@var{option}
6023 @opindex fdump-statistics
6024 Enable and control dumping of pass statistics in a separate file.  The
6025 file name is generated by appending a suffix ending in
6026 @samp{.statistics} to the source file name, and the file is created in
6027 the same directory as the output file.  If the @samp{-@var{option}}
6028 form is used, @samp{-stats} causes counters to be summed over the
6029 whole compilation unit while @samp{-details} dumps every event as
6030 the passes generate them.  The default with no option is to sum
6031 counters for each function compiled.
6033 @item -fdump-tree-@var{switch}
6034 @itemx -fdump-tree-@var{switch}-@var{options}
6035 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6036 @opindex fdump-tree
6037 Control the dumping at various stages of processing the intermediate
6038 language tree to a file.  The file name is generated by appending a
6039 switch-specific suffix to the source file name, and the file is
6040 created in the same directory as the output file. In case of
6041 @option{=@var{filename}} option, the dump is output on the given file
6042 instead of the auto named dump files.  If the @samp{-@var{options}}
6043 form is used, @var{options} is a list of @samp{-} separated options
6044 which control the details of the dump.  Not all options are applicable
6045 to all dumps; those that are not meaningful are ignored.  The
6046 following options are available
6048 @table @samp
6049 @item address
6050 Print the address of each node.  Usually this is not meaningful as it
6051 changes according to the environment and source file.  Its primary use
6052 is for tying up a dump file with a debug environment.
6053 @item asmname
6054 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6055 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6056 use working backward from mangled names in the assembly file.
6057 @item slim
6058 When dumping front-end intermediate representations, inhibit dumping
6059 of members of a scope or body of a function merely because that scope
6060 has been reached.  Only dump such items when they are directly reachable
6061 by some other path.
6063 When dumping pretty-printed trees, this option inhibits dumping the
6064 bodies of control structures.
6066 When dumping RTL, print the RTL in slim (condensed) form instead of
6067 the default LISP-like representation.
6068 @item raw
6069 Print a raw representation of the tree.  By default, trees are
6070 pretty-printed into a C-like representation.
6071 @item details
6072 Enable more detailed dumps (not honored by every dump option). Also
6073 include information from the optimization passes.
6074 @item stats
6075 Enable dumping various statistics about the pass (not honored by every dump
6076 option).
6077 @item blocks
6078 Enable showing basic block boundaries (disabled in raw dumps).
6079 @item graph
6080 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6081 dump a representation of the control flow graph suitable for viewing with
6082 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6083 the file is pretty-printed as a subgraph, so that GraphViz can render them
6084 all in a single plot.
6086 This option currently only works for RTL dumps, and the RTL is always
6087 dumped in slim form.
6088 @item vops
6089 Enable showing virtual operands for every statement.
6090 @item lineno
6091 Enable showing line numbers for statements.
6092 @item uid
6093 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6094 @item verbose
6095 Enable showing the tree dump for each statement.
6096 @item eh
6097 Enable showing the EH region number holding each statement.
6098 @item scev
6099 Enable showing scalar evolution analysis details.
6100 @item optimized
6101 Enable showing optimization information (only available in certain
6102 passes).
6103 @item missed
6104 Enable showing missed optimization information (only available in certain
6105 passes).
6106 @item notes
6107 Enable other detailed optimization information (only available in
6108 certain passes).
6109 @item =@var{filename}
6110 Instead of an auto named dump file, output into the given file
6111 name. The file names @file{stdout} and @file{stderr} are treated
6112 specially and are considered already open standard streams. For
6113 example,
6115 @smallexample
6116 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6117      -fdump-tree-pre=stderr file.c
6118 @end smallexample
6120 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6121 output on to @file{stderr}. If two conflicting dump filenames are
6122 given for the same pass, then the latter option overrides the earlier
6123 one.
6125 @item all
6126 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6127 and @option{lineno}.
6129 @item optall
6130 Turn on all optimization options, i.e., @option{optimized},
6131 @option{missed}, and @option{note}.
6132 @end table
6134 The following tree dumps are possible:
6135 @table @samp
6137 @item original
6138 @opindex fdump-tree-original
6139 Dump before any tree based optimization, to @file{@var{file}.original}.
6141 @item optimized
6142 @opindex fdump-tree-optimized
6143 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6145 @item gimple
6146 @opindex fdump-tree-gimple
6147 Dump each function before and after the gimplification pass to a file.  The
6148 file name is made by appending @file{.gimple} to the source file name.
6150 @item cfg
6151 @opindex fdump-tree-cfg
6152 Dump the control flow graph of each function to a file.  The file name is
6153 made by appending @file{.cfg} to the source file name.
6155 @item ch
6156 @opindex fdump-tree-ch
6157 Dump each function after copying loop headers.  The file name is made by
6158 appending @file{.ch} to the source file name.
6160 @item ssa
6161 @opindex fdump-tree-ssa
6162 Dump SSA related information to a file.  The file name is made by appending
6163 @file{.ssa} to the source file name.
6165 @item alias
6166 @opindex fdump-tree-alias
6167 Dump aliasing information for each function.  The file name is made by
6168 appending @file{.alias} to the source file name.
6170 @item ccp
6171 @opindex fdump-tree-ccp
6172 Dump each function after CCP@.  The file name is made by appending
6173 @file{.ccp} to the source file name.
6175 @item storeccp
6176 @opindex fdump-tree-storeccp
6177 Dump each function after STORE-CCP@.  The file name is made by appending
6178 @file{.storeccp} to the source file name.
6180 @item pre
6181 @opindex fdump-tree-pre
6182 Dump trees after partial redundancy elimination.  The file name is made
6183 by appending @file{.pre} to the source file name.
6185 @item fre
6186 @opindex fdump-tree-fre
6187 Dump trees after full redundancy elimination.  The file name is made
6188 by appending @file{.fre} to the source file name.
6190 @item copyprop
6191 @opindex fdump-tree-copyprop
6192 Dump trees after copy propagation.  The file name is made
6193 by appending @file{.copyprop} to the source file name.
6195 @item store_copyprop
6196 @opindex fdump-tree-store_copyprop
6197 Dump trees after store copy-propagation.  The file name is made
6198 by appending @file{.store_copyprop} to the source file name.
6200 @item dce
6201 @opindex fdump-tree-dce
6202 Dump each function after dead code elimination.  The file name is made by
6203 appending @file{.dce} to the source file name.
6205 @item mudflap
6206 @opindex fdump-tree-mudflap
6207 Dump each function after adding mudflap instrumentation.  The file name is
6208 made by appending @file{.mudflap} to the source file name.
6210 @item sra
6211 @opindex fdump-tree-sra
6212 Dump each function after performing scalar replacement of aggregates.  The
6213 file name is made by appending @file{.sra} to the source file name.
6215 @item sink
6216 @opindex fdump-tree-sink
6217 Dump each function after performing code sinking.  The file name is made
6218 by appending @file{.sink} to the source file name.
6220 @item dom
6221 @opindex fdump-tree-dom
6222 Dump each function after applying dominator tree optimizations.  The file
6223 name is made by appending @file{.dom} to the source file name.
6225 @item dse
6226 @opindex fdump-tree-dse
6227 Dump each function after applying dead store elimination.  The file
6228 name is made by appending @file{.dse} to the source file name.
6230 @item phiopt
6231 @opindex fdump-tree-phiopt
6232 Dump each function after optimizing PHI nodes into straightline code.  The file
6233 name is made by appending @file{.phiopt} to the source file name.
6235 @item forwprop
6236 @opindex fdump-tree-forwprop
6237 Dump each function after forward propagating single use variables.  The file
6238 name is made by appending @file{.forwprop} to the source file name.
6240 @item copyrename
6241 @opindex fdump-tree-copyrename
6242 Dump each function after applying the copy rename optimization.  The file
6243 name is made by appending @file{.copyrename} to the source file name.
6245 @item nrv
6246 @opindex fdump-tree-nrv
6247 Dump each function after applying the named return value optimization on
6248 generic trees.  The file name is made by appending @file{.nrv} to the source
6249 file name.
6251 @item vect
6252 @opindex fdump-tree-vect
6253 Dump each function after applying vectorization of loops.  The file name is
6254 made by appending @file{.vect} to the source file name.
6256 @item slp
6257 @opindex fdump-tree-slp
6258 Dump each function after applying vectorization of basic blocks.  The file name
6259 is made by appending @file{.slp} to the source file name.
6261 @item vrp
6262 @opindex fdump-tree-vrp
6263 Dump each function after Value Range Propagation (VRP).  The file name
6264 is made by appending @file{.vrp} to the source file name.
6266 @item all
6267 @opindex fdump-tree-all
6268 Enable all the available tree dumps with the flags provided in this option.
6269 @end table
6271 @item -fopt-info
6272 @itemx -fopt-info-@var{options}
6273 @itemx -fopt-info-@var{options}=@var{filename}
6274 @opindex fopt-info
6275 Controls optimization dumps from various optimization passes. If the
6276 @samp{-@var{options}} form is used, @var{options} is a list of
6277 @samp{-} separated options to select the dump details and
6278 optimizations.  If @var{options} is not specified, it defaults to
6279 @option{optimized} for details and @option{optall} for optimization
6280 groups. If the @var{filename} is not specified, it defaults to
6281 @file{stderr}. Note that the output @var{filename} will be overwritten
6282 in case of multiple translation units. If a combined output from
6283 multiple translation units is desired, @file{stderr} should be used
6284 instead.
6286 The options can be divided into two groups, 1) options describing the
6287 verbosity of the dump, and 2) options describing which optimizations
6288 should be included. The options from both the groups can be freely
6289 mixed as they are non-overlapping. However, in case of any conflicts,
6290 the latter options override the earlier options on the command
6291 line. Though multiple -fopt-info options are accepted, only one of
6292 them can have @option{=filename}. If other filenames are provided then
6293 all but the first one are ignored.
6295 The dump verbosity has the following options
6297 @table @samp
6298 @item optimized
6299 Print information when an optimization is successfully applied. It is
6300 up to a pass to decide which information is relevant. For example, the
6301 vectorizer passes print the source location of loops which got
6302 successfully vectorized.
6303 @item missed
6304 Print information about missed optimizations. Individual passes
6305 control which information to include in the output. For example,
6307 @smallexample
6308 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6309 @end smallexample
6311 will print information about missed optimization opportunities from
6312 vectorization passes on stderr.
6313 @item note
6314 Print verbose information about optimizations, such as certain
6315 transformations, more detailed messages about decisions etc.
6316 @item all
6317 Print detailed optimization information. This includes
6318 @var{optimized}, @var{missed}, and @var{note}.
6319 @end table
6321 The second set of options describes a group of optimizations and may
6322 include one or more of the following.
6324 @table @samp
6325 @item ipa
6326 Enable dumps from all interprocedural optimizations.
6327 @item loop
6328 Enable dumps from all loop optimizations.
6329 @item inline
6330 Enable dumps from all inlining optimizations.
6331 @item vec
6332 Enable dumps from all vectorization optimizations.
6333 @item optall
6334 Enable dumps from all optimizations. This is a superset of
6335 the optimization groups listed above.
6336 @end table
6338 For example,
6339 @smallexample
6340 gcc -O3 -fopt-info-missed=missed.all
6341 @end smallexample
6343 outputs missed optimization report from all the passes into
6344 @file{missed.all}.
6346 As another example,
6347 @smallexample
6348 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6349 @end smallexample
6351 will output information about missed optimizations as well as
6352 optimized locations from all the inlining passes into
6353 @file{inline.txt}.
6355 If the @var{filename} is provided, then the dumps from all the
6356 applicable optimizations are concatenated into the @file{filename}.
6357 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6358 omitted, it defaults to @option{all-optall}, which means dump all
6359 available optimization info from all the passes. In the following
6360 example, all optimization info is output on to @file{stderr}.
6362 @smallexample
6363 gcc -O3 -fopt-info
6364 @end smallexample
6366 Note that @option{-fopt-info-vec-missed} behaves the same as
6367 @option{-fopt-info-missed-vec}.
6369 As another example, consider
6371 @smallexample
6372 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6373 @end smallexample
6375 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6376 in conflict since only one output file is allowed. In this case, only
6377 the first option takes effect and the subsequent options are
6378 ignored. Thus only the @file{vec.miss} is produced which cotaints
6379 dumps from the vectorizer about missed opportunities.
6381 @item -ftree-vectorizer-verbose=@var{n}
6382 @opindex ftree-vectorizer-verbose
6383 This option is deprecated and is implemented in terms of
6384 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6385 instead, where @var{kind} is one of the valid opt-info options. It
6386 prints additional optimization information.  For @var{n}=0 no
6387 diagnostic information is reported.  If @var{n}=1 the vectorizer
6388 reports each loop that got vectorized, and the total number of loops
6389 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6390 which could not be vectorized and the reasons for those. For any
6391 higher verbosity levels all the analysis and transformation
6392 information from the vectorizer is reported.
6394 Note that the information output by @option{-ftree-vectorizer-verbose}
6395 option is sent to @file{stderr}. If the equivalent form
6396 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6397 output is sent into @var{filename} instead.
6399 @item -frandom-seed=@var{string}
6400 @opindex frandom-seed
6401 This option provides a seed that GCC uses in place of
6402 random numbers in generating certain symbol names
6403 that have to be different in every compiled file.  It is also used to
6404 place unique stamps in coverage data files and the object files that
6405 produce them.  You can use the @option{-frandom-seed} option to produce
6406 reproducibly identical object files.
6408 The @var{string} should be different for every file you compile.
6410 @item -fsched-verbose=@var{n}
6411 @opindex fsched-verbose
6412 On targets that use instruction scheduling, this option controls the
6413 amount of debugging output the scheduler prints.  This information is
6414 written to standard error, unless @option{-fdump-rtl-sched1} or
6415 @option{-fdump-rtl-sched2} is specified, in which case it is output
6416 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6417 respectively.  However for @var{n} greater than nine, the output is
6418 always printed to standard error.
6420 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6421 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6422 For @var{n} greater than one, it also output basic block probabilities,
6423 detailed ready list information and unit/insn info.  For @var{n} greater
6424 than two, it includes RTL at abort point, control-flow and regions info.
6425 And for @var{n} over four, @option{-fsched-verbose} also includes
6426 dependence info.
6428 @item -save-temps
6429 @itemx -save-temps=cwd
6430 @opindex save-temps
6431 Store the usual ``temporary'' intermediate files permanently; place them
6432 in the current directory and name them based on the source file.  Thus,
6433 compiling @file{foo.c} with @option{-c -save-temps} produces files
6434 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6435 preprocessed @file{foo.i} output file even though the compiler now
6436 normally uses an integrated preprocessor.
6438 When used in combination with the @option{-x} command-line option,
6439 @option{-save-temps} is sensible enough to avoid over writing an
6440 input source file with the same extension as an intermediate file.
6441 The corresponding intermediate file may be obtained by renaming the
6442 source file before using @option{-save-temps}.
6444 If you invoke GCC in parallel, compiling several different source
6445 files that share a common base name in different subdirectories or the
6446 same source file compiled for multiple output destinations, it is
6447 likely that the different parallel compilers will interfere with each
6448 other, and overwrite the temporary files.  For instance:
6450 @smallexample
6451 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6452 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6453 @end smallexample
6455 may result in @file{foo.i} and @file{foo.o} being written to
6456 simultaneously by both compilers.
6458 @item -save-temps=obj
6459 @opindex save-temps=obj
6460 Store the usual ``temporary'' intermediate files permanently.  If the
6461 @option{-o} option is used, the temporary files are based on the
6462 object file.  If the @option{-o} option is not used, the
6463 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6465 For example:
6467 @smallexample
6468 gcc -save-temps=obj -c foo.c
6469 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6470 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6471 @end smallexample
6473 @noindent
6474 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6475 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6476 @file{dir2/yfoobar.o}.
6478 @item -time@r{[}=@var{file}@r{]}
6479 @opindex time
6480 Report the CPU time taken by each subprocess in the compilation
6481 sequence.  For C source files, this is the compiler proper and assembler
6482 (plus the linker if linking is done).
6484 Without the specification of an output file, the output looks like this:
6486 @smallexample
6487 # cc1 0.12 0.01
6488 # as 0.00 0.01
6489 @end smallexample
6491 The first number on each line is the ``user time'', that is time spent
6492 executing the program itself.  The second number is ``system time'',
6493 time spent executing operating system routines on behalf of the program.
6494 Both numbers are in seconds.
6496 With the specification of an output file, the output is appended to the
6497 named file, and it looks like this:
6499 @smallexample
6500 0.12 0.01 cc1 @var{options}
6501 0.00 0.01 as @var{options}
6502 @end smallexample
6504 The ``user time'' and the ``system time'' are moved before the program
6505 name, and the options passed to the program are displayed, so that one
6506 can later tell what file was being compiled, and with which options.
6508 @item -fvar-tracking
6509 @opindex fvar-tracking
6510 Run variable tracking pass.  It computes where variables are stored at each
6511 position in code.  Better debugging information is then generated
6512 (if the debugging information format supports this information).
6514 It is enabled by default when compiling with optimization (@option{-Os},
6515 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6516 the debug info format supports it.
6518 @item -fvar-tracking-assignments
6519 @opindex fvar-tracking-assignments
6520 @opindex fno-var-tracking-assignments
6521 Annotate assignments to user variables early in the compilation and
6522 attempt to carry the annotations over throughout the compilation all the
6523 way to the end, in an attempt to improve debug information while
6524 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6526 It can be enabled even if var-tracking is disabled, in which case
6527 annotations are created and maintained, but discarded at the end.
6529 @item -fvar-tracking-assignments-toggle
6530 @opindex fvar-tracking-assignments-toggle
6531 @opindex fno-var-tracking-assignments-toggle
6532 Toggle @option{-fvar-tracking-assignments}, in the same way that
6533 @option{-gtoggle} toggles @option{-g}.
6535 @item -print-file-name=@var{library}
6536 @opindex print-file-name
6537 Print the full absolute name of the library file @var{library} that
6538 would be used when linking---and don't do anything else.  With this
6539 option, GCC does not compile or link anything; it just prints the
6540 file name.
6542 @item -print-multi-directory
6543 @opindex print-multi-directory
6544 Print the directory name corresponding to the multilib selected by any
6545 other switches present in the command line.  This directory is supposed
6546 to exist in @env{GCC_EXEC_PREFIX}.
6548 @item -print-multi-lib
6549 @opindex print-multi-lib
6550 Print the mapping from multilib directory names to compiler switches
6551 that enable them.  The directory name is separated from the switches by
6552 @samp{;}, and each switch starts with an @samp{@@} instead of the
6553 @samp{-}, without spaces between multiple switches.  This is supposed to
6554 ease shell processing.
6556 @item -print-multi-os-directory
6557 @opindex print-multi-os-directory
6558 Print the path to OS libraries for the selected
6559 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6560 present in the @file{lib} subdirectory and no multilibs are used, this is
6561 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6562 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6563 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6564 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6566 @item -print-multiarch
6567 @opindex print-multiarch
6568 Print the path to OS libraries for the selected multiarch,
6569 relative to some @file{lib} subdirectory.
6571 @item -print-prog-name=@var{program}
6572 @opindex print-prog-name
6573 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6575 @item -print-libgcc-file-name
6576 @opindex print-libgcc-file-name
6577 Same as @option{-print-file-name=libgcc.a}.
6579 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6580 but you do want to link with @file{libgcc.a}.  You can do:
6582 @smallexample
6583 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6584 @end smallexample
6586 @item -print-search-dirs
6587 @opindex print-search-dirs
6588 Print the name of the configured installation directory and a list of
6589 program and library directories @command{gcc} searches---and don't do anything else.
6591 This is useful when @command{gcc} prints the error message
6592 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6593 To resolve this you either need to put @file{cpp0} and the other compiler
6594 components where @command{gcc} expects to find them, or you can set the environment
6595 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6596 Don't forget the trailing @samp{/}.
6597 @xref{Environment Variables}.
6599 @item -print-sysroot
6600 @opindex print-sysroot
6601 Print the target sysroot directory that is used during
6602 compilation.  This is the target sysroot specified either at configure
6603 time or using the @option{--sysroot} option, possibly with an extra
6604 suffix that depends on compilation options.  If no target sysroot is
6605 specified, the option prints nothing.
6607 @item -print-sysroot-headers-suffix
6608 @opindex print-sysroot-headers-suffix
6609 Print the suffix added to the target sysroot when searching for
6610 headers, or give an error if the compiler is not configured with such
6611 a suffix---and don't do anything else.
6613 @item -dumpmachine
6614 @opindex dumpmachine
6615 Print the compiler's target machine (for example,
6616 @samp{i686-pc-linux-gnu})---and don't do anything else.
6618 @item -dumpversion
6619 @opindex dumpversion
6620 Print the compiler version (for example, @samp{3.0})---and don't do
6621 anything else.
6623 @item -dumpspecs
6624 @opindex dumpspecs
6625 Print the compiler's built-in specs---and don't do anything else.  (This
6626 is used when GCC itself is being built.)  @xref{Spec Files}.
6628 @item -fno-eliminate-unused-debug-types
6629 @opindex feliminate-unused-debug-types
6630 @opindex fno-eliminate-unused-debug-types
6631 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6632 output for types that are nowhere used in the source file being compiled.
6633 Sometimes it is useful to have GCC emit debugging
6634 information for all types declared in a compilation
6635 unit, regardless of whether or not they are actually used
6636 in that compilation unit, for example 
6637 if, in the debugger, you want to cast a value to a type that is
6638 not actually used in your program (but is declared).  More often,
6639 however, this results in a significant amount of wasted space.
6640 @end table
6642 @node Optimize Options
6643 @section Options That Control Optimization
6644 @cindex optimize options
6645 @cindex options, optimization
6647 These options control various sorts of optimizations.
6649 Without any optimization option, the compiler's goal is to reduce the
6650 cost of compilation and to make debugging produce the expected
6651 results.  Statements are independent: if you stop the program with a
6652 breakpoint between statements, you can then assign a new value to any
6653 variable or change the program counter to any other statement in the
6654 function and get exactly the results you expect from the source
6655 code.
6657 Turning on optimization flags makes the compiler attempt to improve
6658 the performance and/or code size at the expense of compilation time
6659 and possibly the ability to debug the program.
6661 The compiler performs optimization based on the knowledge it has of the
6662 program.  Compiling multiple files at once to a single output file mode allows
6663 the compiler to use information gained from all of the files when compiling
6664 each of them.
6666 Not all optimizations are controlled directly by a flag.  Only
6667 optimizations that have a flag are listed in this section.
6669 Most optimizations are only enabled if an @option{-O} level is set on
6670 the command line.  Otherwise they are disabled, even if individual
6671 optimization flags are specified.
6673 Depending on the target and how GCC was configured, a slightly different
6674 set of optimizations may be enabled at each @option{-O} level than
6675 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6676 to find out the exact set of optimizations that are enabled at each level.
6677 @xref{Overall Options}, for examples.
6679 @table @gcctabopt
6680 @item -O
6681 @itemx -O1
6682 @opindex O
6683 @opindex O1
6684 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6685 more memory for a large function.
6687 With @option{-O}, the compiler tries to reduce code size and execution
6688 time, without performing any optimizations that take a great deal of
6689 compilation time.
6691 @option{-O} turns on the following optimization flags:
6692 @gccoptlist{
6693 -fauto-inc-dec @gol
6694 -fcompare-elim @gol
6695 -fcprop-registers @gol
6696 -fdce @gol
6697 -fdefer-pop @gol
6698 -fdelayed-branch @gol
6699 -fdse @gol
6700 -fguess-branch-probability @gol
6701 -fif-conversion2 @gol
6702 -fif-conversion @gol
6703 -fipa-pure-const @gol
6704 -fipa-profile @gol
6705 -fipa-reference @gol
6706 -fmerge-constants
6707 -fsplit-wide-types @gol
6708 -ftree-bit-ccp @gol
6709 -ftree-builtin-call-dce @gol
6710 -ftree-ccp @gol
6711 -ftree-ch @gol
6712 -ftree-copyrename @gol
6713 -ftree-dce @gol
6714 -ftree-dominator-opts @gol
6715 -ftree-dse @gol
6716 -ftree-forwprop @gol
6717 -ftree-fre @gol
6718 -ftree-phiprop @gol
6719 -ftree-slsr @gol
6720 -ftree-sra @gol
6721 -ftree-pta @gol
6722 -ftree-ter @gol
6723 -funit-at-a-time}
6725 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6726 where doing so does not interfere with debugging.
6728 @item -O2
6729 @opindex O2
6730 Optimize even more.  GCC performs nearly all supported optimizations
6731 that do not involve a space-speed tradeoff.
6732 As compared to @option{-O}, this option increases both compilation time
6733 and the performance of the generated code.
6735 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6736 also turns on the following optimization flags:
6737 @gccoptlist{-fthread-jumps @gol
6738 -falign-functions  -falign-jumps @gol
6739 -falign-loops  -falign-labels @gol
6740 -fcaller-saves @gol
6741 -fcrossjumping @gol
6742 -fcse-follow-jumps  -fcse-skip-blocks @gol
6743 -fdelete-null-pointer-checks @gol
6744 -fdevirtualize -fdevirtualize-speculatively @gol
6745 -fexpensive-optimizations @gol
6746 -fgcse  -fgcse-lm  @gol
6747 -fhoist-adjacent-loads @gol
6748 -finline-small-functions @gol
6749 -findirect-inlining @gol
6750 -fipa-sra @gol
6751 -foptimize-sibling-calls @gol
6752 -fpartial-inlining @gol
6753 -fpeephole2 @gol
6754 -fregmove @gol
6755 -freorder-blocks  -freorder-functions @gol
6756 -frerun-cse-after-loop  @gol
6757 -fsched-interblock  -fsched-spec @gol
6758 -fschedule-insns  -fschedule-insns2 @gol
6759 -fstrict-aliasing -fstrict-overflow @gol
6760 -ftree-switch-conversion -ftree-tail-merge @gol
6761 -ftree-pre @gol
6762 -ftree-vrp}
6764 Please note the warning under @option{-fgcse} about
6765 invoking @option{-O2} on programs that use computed gotos.
6767 @item -O3
6768 @opindex O3
6769 Optimize yet more.  @option{-O3} turns on all optimizations specified
6770 by @option{-O2} and also turns on the @option{-finline-functions},
6771 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6772 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
6773 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
6774 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6776 @item -O0
6777 @opindex O0
6778 Reduce compilation time and make debugging produce the expected
6779 results.  This is the default.
6781 @item -Os
6782 @opindex Os
6783 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6784 do not typically increase code size.  It also performs further
6785 optimizations designed to reduce code size.
6787 @option{-Os} disables the following optimization flags:
6788 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6789 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6790 -fprefetch-loop-arrays}
6792 @item -Ofast
6793 @opindex Ofast
6794 Disregard strict standards compliance.  @option{-Ofast} enables all
6795 @option{-O3} optimizations.  It also enables optimizations that are not
6796 valid for all standard-compliant programs.
6797 It turns on @option{-ffast-math} and the Fortran-specific
6798 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6800 @item -Og
6801 @opindex Og
6802 Optimize debugging experience.  @option{-Og} enables optimizations
6803 that do not interfere with debugging. It should be the optimization
6804 level of choice for the standard edit-compile-debug cycle, offering
6805 a reasonable level of optimization while maintaining fast compilation
6806 and a good debugging experience.
6808 If you use multiple @option{-O} options, with or without level numbers,
6809 the last such option is the one that is effective.
6810 @end table
6812 Options of the form @option{-f@var{flag}} specify machine-independent
6813 flags.  Most flags have both positive and negative forms; the negative
6814 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6815 below, only one of the forms is listed---the one you typically 
6816 use.  You can figure out the other form by either removing @samp{no-}
6817 or adding it.
6819 The following options control specific optimizations.  They are either
6820 activated by @option{-O} options or are related to ones that are.  You
6821 can use the following flags in the rare cases when ``fine-tuning'' of
6822 optimizations to be performed is desired.
6824 @table @gcctabopt
6825 @item -fno-default-inline
6826 @opindex fno-default-inline
6827 Do not make member functions inline by default merely because they are
6828 defined inside the class scope (C++ only).  Otherwise, when you specify
6829 @w{@option{-O}}, member functions defined inside class scope are compiled
6830 inline by default; i.e., you don't need to add @samp{inline} in front of
6831 the member function name.
6833 @item -fno-defer-pop
6834 @opindex fno-defer-pop
6835 Always pop the arguments to each function call as soon as that function
6836 returns.  For machines that must pop arguments after a function call,
6837 the compiler normally lets arguments accumulate on the stack for several
6838 function calls and pops them all at once.
6840 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6842 @item -fforward-propagate
6843 @opindex fforward-propagate
6844 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6845 instructions and checks if the result can be simplified.  If loop unrolling
6846 is active, two passes are performed and the second is scheduled after
6847 loop unrolling.
6849 This option is enabled by default at optimization levels @option{-O},
6850 @option{-O2}, @option{-O3}, @option{-Os}.
6852 @item -ffp-contract=@var{style}
6853 @opindex ffp-contract
6854 @option{-ffp-contract=off} disables floating-point expression contraction.
6855 @option{-ffp-contract=fast} enables floating-point expression contraction
6856 such as forming of fused multiply-add operations if the target has
6857 native support for them.
6858 @option{-ffp-contract=on} enables floating-point expression contraction
6859 if allowed by the language standard.  This is currently not implemented
6860 and treated equal to @option{-ffp-contract=off}.
6862 The default is @option{-ffp-contract=fast}.
6864 @item -fomit-frame-pointer
6865 @opindex fomit-frame-pointer
6866 Don't keep the frame pointer in a register for functions that
6867 don't need one.  This avoids the instructions to save, set up and
6868 restore frame pointers; it also makes an extra register available
6869 in many functions.  @strong{It also makes debugging impossible on
6870 some machines.}
6872 On some machines, such as the VAX, this flag has no effect, because
6873 the standard calling sequence automatically handles the frame pointer
6874 and nothing is saved by pretending it doesn't exist.  The
6875 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6876 whether a target machine supports this flag.  @xref{Registers,,Register
6877 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6879 Starting with GCC version 4.6, the default setting (when not optimizing for
6880 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6881 @option{-fomit-frame-pointer}.  The default can be reverted to
6882 @option{-fno-omit-frame-pointer} by configuring GCC with the
6883 @option{--enable-frame-pointer} configure option.
6885 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6887 @item -foptimize-sibling-calls
6888 @opindex foptimize-sibling-calls
6889 Optimize sibling and tail recursive calls.
6891 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6893 @item -fno-inline
6894 @opindex fno-inline
6895 Do not expand any functions inline apart from those marked with
6896 the @code{always_inline} attribute.  This is the default when not
6897 optimizing.
6899 Single functions can be exempted from inlining by marking them
6900 with the @code{noinline} attribute.
6902 @item -finline-small-functions
6903 @opindex finline-small-functions
6904 Integrate functions into their callers when their body is smaller than expected
6905 function call code (so overall size of program gets smaller).  The compiler
6906 heuristically decides which functions are simple enough to be worth integrating
6907 in this way.  This inlining applies to all functions, even those not declared
6908 inline.
6910 Enabled at level @option{-O2}.
6912 @item -findirect-inlining
6913 @opindex findirect-inlining
6914 Inline also indirect calls that are discovered to be known at compile
6915 time thanks to previous inlining.  This option has any effect only
6916 when inlining itself is turned on by the @option{-finline-functions}
6917 or @option{-finline-small-functions} options.
6919 Enabled at level @option{-O2}.
6921 @item -finline-functions
6922 @opindex finline-functions
6923 Consider all functions for inlining, even if they are not declared inline.
6924 The compiler heuristically decides which functions are worth integrating
6925 in this way.
6927 If all calls to a given function are integrated, and the function is
6928 declared @code{static}, then the function is normally not output as
6929 assembler code in its own right.
6931 Enabled at level @option{-O3}.
6933 @item -finline-functions-called-once
6934 @opindex finline-functions-called-once
6935 Consider all @code{static} functions called once for inlining into their
6936 caller even if they are not marked @code{inline}.  If a call to a given
6937 function is integrated, then the function is not output as assembler code
6938 in its own right.
6940 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6942 @item -fearly-inlining
6943 @opindex fearly-inlining
6944 Inline functions marked by @code{always_inline} and functions whose body seems
6945 smaller than the function call overhead early before doing
6946 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6947 makes profiling significantly cheaper and usually inlining faster on programs
6948 having large chains of nested wrapper functions.
6950 Enabled by default.
6952 @item -fipa-sra
6953 @opindex fipa-sra
6954 Perform interprocedural scalar replacement of aggregates, removal of
6955 unused parameters and replacement of parameters passed by reference
6956 by parameters passed by value.
6958 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6960 @item -finline-limit=@var{n}
6961 @opindex finline-limit
6962 By default, GCC limits the size of functions that can be inlined.  This flag
6963 allows coarse control of this limit.  @var{n} is the size of functions that
6964 can be inlined in number of pseudo instructions.
6966 Inlining is actually controlled by a number of parameters, which may be
6967 specified individually by using @option{--param @var{name}=@var{value}}.
6968 The @option{-finline-limit=@var{n}} option sets some of these parameters
6969 as follows:
6971 @table @gcctabopt
6972 @item max-inline-insns-single
6973 is set to @var{n}/2.
6974 @item max-inline-insns-auto
6975 is set to @var{n}/2.
6976 @end table
6978 See below for a documentation of the individual
6979 parameters controlling inlining and for the defaults of these parameters.
6981 @emph{Note:} there may be no value to @option{-finline-limit} that results
6982 in default behavior.
6984 @emph{Note:} pseudo instruction represents, in this particular context, an
6985 abstract measurement of function's size.  In no way does it represent a count
6986 of assembly instructions and as such its exact meaning might change from one
6987 release to an another.
6989 @item -fno-keep-inline-dllexport
6990 @opindex -fno-keep-inline-dllexport
6991 This is a more fine-grained version of @option{-fkeep-inline-functions},
6992 which applies only to functions that are declared using the @code{dllexport}
6993 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6994 Functions}.)
6996 @item -fkeep-inline-functions
6997 @opindex fkeep-inline-functions
6998 In C, emit @code{static} functions that are declared @code{inline}
6999 into the object file, even if the function has been inlined into all
7000 of its callers.  This switch does not affect functions using the
7001 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7002 inline functions into the object file.
7004 @item -fkeep-static-consts
7005 @opindex fkeep-static-consts
7006 Emit variables declared @code{static const} when optimization isn't turned
7007 on, even if the variables aren't referenced.
7009 GCC enables this option by default.  If you want to force the compiler to
7010 check if a variable is referenced, regardless of whether or not
7011 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7013 @item -fmerge-constants
7014 @opindex fmerge-constants
7015 Attempt to merge identical constants (string constants and floating-point
7016 constants) across compilation units.
7018 This option is the default for optimized compilation if the assembler and
7019 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7020 behavior.
7022 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7024 @item -fmerge-all-constants
7025 @opindex fmerge-all-constants
7026 Attempt to merge identical constants and identical variables.
7028 This option implies @option{-fmerge-constants}.  In addition to
7029 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7030 arrays or initialized constant variables with integral or floating-point
7031 types.  Languages like C or C++ require each variable, including multiple
7032 instances of the same variable in recursive calls, to have distinct locations,
7033 so using this option results in non-conforming
7034 behavior.
7036 @item -fmodulo-sched
7037 @opindex fmodulo-sched
7038 Perform swing modulo scheduling immediately before the first scheduling
7039 pass.  This pass looks at innermost loops and reorders their
7040 instructions by overlapping different iterations.
7042 @item -fmodulo-sched-allow-regmoves
7043 @opindex fmodulo-sched-allow-regmoves
7044 Perform more aggressive SMS-based modulo scheduling with register moves
7045 allowed.  By setting this flag certain anti-dependences edges are
7046 deleted, which triggers the generation of reg-moves based on the
7047 life-range analysis.  This option is effective only with
7048 @option{-fmodulo-sched} enabled.
7050 @item -fno-branch-count-reg
7051 @opindex fno-branch-count-reg
7052 Do not use ``decrement and branch'' instructions on a count register,
7053 but instead generate a sequence of instructions that decrement a
7054 register, compare it against zero, then branch based upon the result.
7055 This option is only meaningful on architectures that support such
7056 instructions, which include x86, PowerPC, IA-64 and S/390.
7058 The default is @option{-fbranch-count-reg}.
7060 @item -fno-function-cse
7061 @opindex fno-function-cse
7062 Do not put function addresses in registers; make each instruction that
7063 calls a constant function contain the function's address explicitly.
7065 This option results in less efficient code, but some strange hacks
7066 that alter the assembler output may be confused by the optimizations
7067 performed when this option is not used.
7069 The default is @option{-ffunction-cse}
7071 @item -fno-zero-initialized-in-bss
7072 @opindex fno-zero-initialized-in-bss
7073 If the target supports a BSS section, GCC by default puts variables that
7074 are initialized to zero into BSS@.  This can save space in the resulting
7075 code.
7077 This option turns off this behavior because some programs explicitly
7078 rely on variables going to the data section---e.g., so that the
7079 resulting executable can find the beginning of that section and/or make
7080 assumptions based on that.
7082 The default is @option{-fzero-initialized-in-bss}.
7084 @item -fmudflap -fmudflapth -fmudflapir
7085 @opindex fmudflap
7086 @opindex fmudflapth
7087 @opindex fmudflapir
7088 @cindex bounds checking
7089 @cindex mudflap
7090 For front-ends that support it (C and C++), instrument all risky
7091 pointer/array dereferencing operations, some standard library
7092 string/heap functions, and some other associated constructs with
7093 range/validity tests.  Modules so instrumented should be immune to
7094 buffer overflows, invalid heap use, and some other classes of C/C++
7095 programming errors.  The instrumentation relies on a separate runtime
7096 library (@file{libmudflap}), which is linked into a program if
7097 @option{-fmudflap} is given at link time.  Run-time behavior of the
7098 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
7099 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
7100 for its options.
7102 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
7103 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
7104 addition to @option{-fmudflap} or @option{-fmudflapth}, if
7105 instrumentation should ignore pointer reads.  This produces less
7106 instrumentation (and therefore faster execution) and still provides
7107 some protection against outright memory corrupting writes, but allows
7108 erroneously read data to propagate within a program.
7110 @item -fthread-jumps
7111 @opindex fthread-jumps
7112 Perform optimizations that check to see if a jump branches to a
7113 location where another comparison subsumed by the first is found.  If
7114 so, the first branch is redirected to either the destination of the
7115 second branch or a point immediately following it, depending on whether
7116 the condition is known to be true or false.
7118 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7120 @item -fsplit-wide-types
7121 @opindex fsplit-wide-types
7122 When using a type that occupies multiple registers, such as @code{long
7123 long} on a 32-bit system, split the registers apart and allocate them
7124 independently.  This normally generates better code for those types,
7125 but may make debugging more difficult.
7127 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7128 @option{-Os}.
7130 @item -fcse-follow-jumps
7131 @opindex fcse-follow-jumps
7132 In common subexpression elimination (CSE), scan through jump instructions
7133 when the target of the jump is not reached by any other path.  For
7134 example, when CSE encounters an @code{if} statement with an
7135 @code{else} clause, CSE follows the jump when the condition
7136 tested is false.
7138 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7140 @item -fcse-skip-blocks
7141 @opindex fcse-skip-blocks
7142 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7143 follow jumps that conditionally skip over blocks.  When CSE
7144 encounters a simple @code{if} statement with no else clause,
7145 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7146 body of the @code{if}.
7148 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7150 @item -frerun-cse-after-loop
7151 @opindex frerun-cse-after-loop
7152 Re-run common subexpression elimination after loop optimizations are
7153 performed.
7155 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7157 @item -fgcse
7158 @opindex fgcse
7159 Perform a global common subexpression elimination pass.
7160 This pass also performs global constant and copy propagation.
7162 @emph{Note:} When compiling a program using computed gotos, a GCC
7163 extension, you may get better run-time performance if you disable
7164 the global common subexpression elimination pass by adding
7165 @option{-fno-gcse} to the command line.
7167 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7169 @item -fgcse-lm
7170 @opindex fgcse-lm
7171 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7172 attempts to move loads that are only killed by stores into themselves.  This
7173 allows a loop containing a load/store sequence to be changed to a load outside
7174 the loop, and a copy/store within the loop.
7176 Enabled by default when @option{-fgcse} is enabled.
7178 @item -fgcse-sm
7179 @opindex fgcse-sm
7180 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7181 global common subexpression elimination.  This pass attempts to move
7182 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7183 loops containing a load/store sequence can be changed to a load before
7184 the loop and a store after the loop.
7186 Not enabled at any optimization level.
7188 @item -fgcse-las
7189 @opindex fgcse-las
7190 When @option{-fgcse-las} is enabled, the global common subexpression
7191 elimination pass eliminates redundant loads that come after stores to the
7192 same memory location (both partial and full redundancies).
7194 Not enabled at any optimization level.
7196 @item -fgcse-after-reload
7197 @opindex fgcse-after-reload
7198 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7199 pass is performed after reload.  The purpose of this pass is to clean up
7200 redundant spilling.
7202 @item -faggressive-loop-optimizations
7203 @opindex faggressive-loop-optimizations
7204 This option tells the loop optimizer to use language constraints to
7205 derive bounds for the number of iterations of a loop.  This assumes that
7206 loop code does not invoke undefined behavior by for example causing signed
7207 integer overflows or out-of-bound array accesses.  The bounds for the
7208 number of iterations of a loop are used to guide loop unrolling and peeling
7209 and loop exit test optimizations.
7210 This option is enabled by default.
7212 @item -funsafe-loop-optimizations
7213 @opindex funsafe-loop-optimizations
7214 This option tells the loop optimizer to assume that loop indices do not
7215 overflow, and that loops with nontrivial exit condition are not
7216 infinite.  This enables a wider range of loop optimizations even if
7217 the loop optimizer itself cannot prove that these assumptions are valid.
7218 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7219 if it finds this kind of loop.
7221 @item -fcrossjumping
7222 @opindex fcrossjumping
7223 Perform cross-jumping transformation.
7224 This transformation unifies equivalent code and saves code size.  The
7225 resulting code may or may not perform better than without cross-jumping.
7227 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7229 @item -fauto-inc-dec
7230 @opindex fauto-inc-dec
7231 Combine increments or decrements of addresses with memory accesses.
7232 This pass is always skipped on architectures that do not have
7233 instructions to support this.  Enabled by default at @option{-O} and
7234 higher on architectures that support this.
7236 @item -fdce
7237 @opindex fdce
7238 Perform dead code elimination (DCE) on RTL@.
7239 Enabled by default at @option{-O} and higher.
7241 @item -fdse
7242 @opindex fdse
7243 Perform dead store elimination (DSE) on RTL@.
7244 Enabled by default at @option{-O} and higher.
7246 @item -fif-conversion
7247 @opindex fif-conversion
7248 Attempt to transform conditional jumps into branch-less equivalents.  This
7249 includes use of conditional moves, min, max, set flags and abs instructions, and
7250 some tricks doable by standard arithmetics.  The use of conditional execution
7251 on chips where it is available is controlled by @code{if-conversion2}.
7253 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7255 @item -fif-conversion2
7256 @opindex fif-conversion2
7257 Use conditional execution (where available) to transform conditional jumps into
7258 branch-less equivalents.
7260 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7262 @item -fdelete-null-pointer-checks
7263 @opindex fdelete-null-pointer-checks
7264 Assume that programs cannot safely dereference null pointers, and that
7265 no code or data element resides there.  This enables simple constant
7266 folding optimizations at all optimization levels.  In addition, other
7267 optimization passes in GCC use this flag to control global dataflow
7268 analyses that eliminate useless checks for null pointers; these assume
7269 that if a pointer is checked after it has already been dereferenced,
7270 it cannot be null.
7272 Note however that in some environments this assumption is not true.
7273 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7274 for programs that depend on that behavior.
7276 Some targets, especially embedded ones, disable this option at all levels.
7277 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7278 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7279 are enabled independently at different optimization levels.
7281 @item -fdevirtualize
7282 @opindex fdevirtualize
7283 Attempt to convert calls to virtual functions to direct calls.  This
7284 is done both within a procedure and interprocedurally as part of
7285 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7286 propagation (@option{-fipa-cp}).
7287 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7289 @item -fdevirtualize-speculatively
7290 @opindex fdevirtualize-speculatively
7291 Attempt to convert calls to virtual functions to speculative direct calls.
7292 Based on the analysis of the type inheritance graph, determine for a given call
7293 the set of likely targets. If the set is small, preferably of size 1, change
7294 the call into an conditional deciding on direct and indirect call.  The
7295 speculative calls enable more optimizations, such as inlining.  When they seem
7296 useless after further optimization, they are converted back into original form.
7298 @item -fexpensive-optimizations
7299 @opindex fexpensive-optimizations
7300 Perform a number of minor optimizations that are relatively expensive.
7302 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7304 @item -free
7305 @opindex free
7306 Attempt to remove redundant extension instructions.  This is especially
7307 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7308 registers after writing to their lower 32-bit half.
7310 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7312 @item -foptimize-register-move
7313 @itemx -fregmove
7314 @opindex foptimize-register-move
7315 @opindex fregmove
7316 Attempt to reassign register numbers in move instructions and as
7317 operands of other simple instructions in order to maximize the amount of
7318 register tying.  This is especially helpful on machines with two-operand
7319 instructions.
7321 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7322 optimization.
7324 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7326 @item -fira-algorithm=@var{algorithm}
7327 Use the specified coloring algorithm for the integrated register
7328 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7329 specifies Chow's priority coloring, or @samp{CB}, which specifies
7330 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7331 for all architectures, but for those targets that do support it, it is
7332 the default because it generates better code.
7334 @item -fira-region=@var{region}
7335 Use specified regions for the integrated register allocator.  The
7336 @var{region} argument should be one of the following:
7338 @table @samp
7340 @item all
7341 Use all loops as register allocation regions.
7342 This can give the best results for machines with a small and/or
7343 irregular register set.
7345 @item mixed
7346 Use all loops except for loops with small register pressure 
7347 as the regions.  This value usually gives
7348 the best results in most cases and for most architectures,
7349 and is enabled by default when compiling with optimization for speed
7350 (@option{-O}, @option{-O2}, @dots{}).
7352 @item one
7353 Use all functions as a single region.  
7354 This typically results in the smallest code size, and is enabled by default for
7355 @option{-Os} or @option{-O0}.
7357 @end table
7359 @item -fira-hoist-pressure
7360 @opindex fira-hoist-pressure
7361 Use IRA to evaluate register pressure in the code hoisting pass for
7362 decisions to hoist expressions.  This option usually results in smaller
7363 code, but it can slow the compiler down.
7365 This option is enabled at level @option{-Os} for all targets.
7367 @item -fira-loop-pressure
7368 @opindex fira-loop-pressure
7369 Use IRA to evaluate register pressure in loops for decisions to move
7370 loop invariants.  This option usually results in generation
7371 of faster and smaller code on machines with large register files (>= 32
7372 registers), but it can slow the compiler down.
7374 This option is enabled at level @option{-O3} for some targets.
7376 @item -fno-ira-share-save-slots
7377 @opindex fno-ira-share-save-slots
7378 Disable sharing of stack slots used for saving call-used hard
7379 registers living through a call.  Each hard register gets a
7380 separate stack slot, and as a result function stack frames are
7381 larger.
7383 @item -fno-ira-share-spill-slots
7384 @opindex fno-ira-share-spill-slots
7385 Disable sharing of stack slots allocated for pseudo-registers.  Each
7386 pseudo-register that does not get a hard register gets a separate
7387 stack slot, and as a result function stack frames are larger.
7389 @item -fira-verbose=@var{n}
7390 @opindex fira-verbose
7391 Control the verbosity of the dump file for the integrated register allocator.
7392 The default value is 5.  If the value @var{n} is greater or equal to 10,
7393 the dump output is sent to stderr using the same format as @var{n} minus 10.
7395 @item -fdelayed-branch
7396 @opindex fdelayed-branch
7397 If supported for the target machine, attempt to reorder instructions
7398 to exploit instruction slots available after delayed branch
7399 instructions.
7401 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7403 @item -fschedule-insns
7404 @opindex fschedule-insns
7405 If supported for the target machine, attempt to reorder instructions to
7406 eliminate execution stalls due to required data being unavailable.  This
7407 helps machines that have slow floating point or memory load instructions
7408 by allowing other instructions to be issued until the result of the load
7409 or floating-point instruction is required.
7411 Enabled at levels @option{-O2}, @option{-O3}.
7413 @item -fschedule-insns2
7414 @opindex fschedule-insns2
7415 Similar to @option{-fschedule-insns}, but requests an additional pass of
7416 instruction scheduling after register allocation has been done.  This is
7417 especially useful on machines with a relatively small number of
7418 registers and where memory load instructions take more than one cycle.
7420 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7422 @item -fno-sched-interblock
7423 @opindex fno-sched-interblock
7424 Don't schedule instructions across basic blocks.  This is normally
7425 enabled by default when scheduling before register allocation, i.e.@:
7426 with @option{-fschedule-insns} or at @option{-O2} or higher.
7428 @item -fno-sched-spec
7429 @opindex fno-sched-spec
7430 Don't allow speculative motion of non-load instructions.  This is normally
7431 enabled by default when scheduling before register allocation, i.e.@:
7432 with @option{-fschedule-insns} or at @option{-O2} or higher.
7434 @item -fsched-pressure
7435 @opindex fsched-pressure
7436 Enable register pressure sensitive insn scheduling before register
7437 allocation.  This only makes sense when scheduling before register
7438 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7439 @option{-O2} or higher.  Usage of this option can improve the
7440 generated code and decrease its size by preventing register pressure
7441 increase above the number of available hard registers and subsequent
7442 spills in register allocation.
7444 @item -fsched-spec-load
7445 @opindex fsched-spec-load
7446 Allow speculative motion of some load instructions.  This only makes
7447 sense when scheduling before register allocation, i.e.@: with
7448 @option{-fschedule-insns} or at @option{-O2} or higher.
7450 @item -fsched-spec-load-dangerous
7451 @opindex fsched-spec-load-dangerous
7452 Allow speculative motion of more load instructions.  This only makes
7453 sense when scheduling before register allocation, i.e.@: with
7454 @option{-fschedule-insns} or at @option{-O2} or higher.
7456 @item -fsched-stalled-insns
7457 @itemx -fsched-stalled-insns=@var{n}
7458 @opindex fsched-stalled-insns
7459 Define how many insns (if any) can be moved prematurely from the queue
7460 of stalled insns into the ready list during the second scheduling pass.
7461 @option{-fno-sched-stalled-insns} means that no insns are moved
7462 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7463 on how many queued insns can be moved prematurely.
7464 @option{-fsched-stalled-insns} without a value is equivalent to
7465 @option{-fsched-stalled-insns=1}.
7467 @item -fsched-stalled-insns-dep
7468 @itemx -fsched-stalled-insns-dep=@var{n}
7469 @opindex fsched-stalled-insns-dep
7470 Define how many insn groups (cycles) are examined for a dependency
7471 on a stalled insn that is a candidate for premature removal from the queue
7472 of stalled insns.  This has an effect only during the second scheduling pass,
7473 and only if @option{-fsched-stalled-insns} is used.
7474 @option{-fno-sched-stalled-insns-dep} is equivalent to
7475 @option{-fsched-stalled-insns-dep=0}.
7476 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7477 @option{-fsched-stalled-insns-dep=1}.
7479 @item -fsched2-use-superblocks
7480 @opindex fsched2-use-superblocks
7481 When scheduling after register allocation, use superblock scheduling.
7482 This allows motion across basic block boundaries,
7483 resulting in faster schedules.  This option is experimental, as not all machine
7484 descriptions used by GCC model the CPU closely enough to avoid unreliable
7485 results from the algorithm.
7487 This only makes sense when scheduling after register allocation, i.e.@: with
7488 @option{-fschedule-insns2} or at @option{-O2} or higher.
7490 @item -fsched-group-heuristic
7491 @opindex fsched-group-heuristic
7492 Enable the group heuristic in the scheduler.  This heuristic favors
7493 the instruction that belongs to a schedule group.  This is enabled
7494 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7495 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7497 @item -fsched-critical-path-heuristic
7498 @opindex fsched-critical-path-heuristic
7499 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7500 instructions on the critical path.  This is enabled by default when
7501 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7502 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7504 @item -fsched-spec-insn-heuristic
7505 @opindex fsched-spec-insn-heuristic
7506 Enable the speculative instruction heuristic in the scheduler.  This
7507 heuristic favors speculative instructions with greater dependency weakness.
7508 This is enabled by default when scheduling is enabled, i.e.@:
7509 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7510 or at @option{-O2} or higher.
7512 @item -fsched-rank-heuristic
7513 @opindex fsched-rank-heuristic
7514 Enable the rank heuristic in the scheduler.  This heuristic favors
7515 the instruction belonging to a basic block with greater size or frequency.
7516 This is enabled by default when scheduling is enabled, i.e.@:
7517 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7518 at @option{-O2} or higher.
7520 @item -fsched-last-insn-heuristic
7521 @opindex fsched-last-insn-heuristic
7522 Enable the last-instruction heuristic in the scheduler.  This heuristic
7523 favors the instruction that is less dependent on the last instruction
7524 scheduled.  This is enabled by default when scheduling is enabled,
7525 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7526 at @option{-O2} or higher.
7528 @item -fsched-dep-count-heuristic
7529 @opindex fsched-dep-count-heuristic
7530 Enable the dependent-count heuristic in the scheduler.  This heuristic
7531 favors the instruction that has more instructions depending on it.
7532 This is enabled by default when scheduling is enabled, i.e.@:
7533 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7534 at @option{-O2} or higher.
7536 @item -freschedule-modulo-scheduled-loops
7537 @opindex freschedule-modulo-scheduled-loops
7538 Modulo scheduling is performed before traditional scheduling.  If a loop
7539 is modulo scheduled, later scheduling passes may change its schedule.  
7540 Use this option to control that behavior.
7542 @item -fselective-scheduling
7543 @opindex fselective-scheduling
7544 Schedule instructions using selective scheduling algorithm.  Selective
7545 scheduling runs instead of the first scheduler pass.
7547 @item -fselective-scheduling2
7548 @opindex fselective-scheduling2
7549 Schedule instructions using selective scheduling algorithm.  Selective
7550 scheduling runs instead of the second scheduler pass.
7552 @item -fsel-sched-pipelining
7553 @opindex fsel-sched-pipelining
7554 Enable software pipelining of innermost loops during selective scheduling.
7555 This option has no effect unless one of @option{-fselective-scheduling} or
7556 @option{-fselective-scheduling2} is turned on.
7558 @item -fsel-sched-pipelining-outer-loops
7559 @opindex fsel-sched-pipelining-outer-loops
7560 When pipelining loops during selective scheduling, also pipeline outer loops.
7561 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7563 @item -fshrink-wrap
7564 @opindex fshrink-wrap
7565 Emit function prologues only before parts of the function that need it,
7566 rather than at the top of the function.  This flag is enabled by default at
7567 @option{-O} and higher.
7569 @item -fcaller-saves
7570 @opindex fcaller-saves
7571 Enable allocation of values to registers that are clobbered by
7572 function calls, by emitting extra instructions to save and restore the
7573 registers around such calls.  Such allocation is done only when it
7574 seems to result in better code.
7576 This option is always enabled by default on certain machines, usually
7577 those which have no call-preserved registers to use instead.
7579 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7581 @item -fcombine-stack-adjustments
7582 @opindex fcombine-stack-adjustments
7583 Tracks stack adjustments (pushes and pops) and stack memory references
7584 and then tries to find ways to combine them.
7586 Enabled by default at @option{-O1} and higher.
7588 @item -fconserve-stack
7589 @opindex fconserve-stack
7590 Attempt to minimize stack usage.  The compiler attempts to use less
7591 stack space, even if that makes the program slower.  This option
7592 implies setting the @option{large-stack-frame} parameter to 100
7593 and the @option{large-stack-frame-growth} parameter to 400.
7595 @item -ftree-reassoc
7596 @opindex ftree-reassoc
7597 Perform reassociation on trees.  This flag is enabled by default
7598 at @option{-O} and higher.
7600 @item -ftree-pre
7601 @opindex ftree-pre
7602 Perform partial redundancy elimination (PRE) on trees.  This flag is
7603 enabled by default at @option{-O2} and @option{-O3}.
7605 @item -ftree-partial-pre
7606 @opindex ftree-partial-pre
7607 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7608 enabled by default at @option{-O3}.
7610 @item -ftree-forwprop
7611 @opindex ftree-forwprop
7612 Perform forward propagation on trees.  This flag is enabled by default
7613 at @option{-O} and higher.
7615 @item -ftree-fre
7616 @opindex ftree-fre
7617 Perform full redundancy elimination (FRE) on trees.  The difference
7618 between FRE and PRE is that FRE only considers expressions
7619 that are computed on all paths leading to the redundant computation.
7620 This analysis is faster than PRE, though it exposes fewer redundancies.
7621 This flag is enabled by default at @option{-O} and higher.
7623 @item -ftree-phiprop
7624 @opindex ftree-phiprop
7625 Perform hoisting of loads from conditional pointers on trees.  This
7626 pass is enabled by default at @option{-O} and higher.
7628 @item -fhoist-adjacent-loads
7629 @opindex hoist-adjacent-loads
7630 Speculatively hoist loads from both branches of an if-then-else if the
7631 loads are from adjacent locations in the same structure and the target
7632 architecture has a conditional move instruction.  This flag is enabled
7633 by default at @option{-O2} and higher.
7635 @item -ftree-copy-prop
7636 @opindex ftree-copy-prop
7637 Perform copy propagation on trees.  This pass eliminates unnecessary
7638 copy operations.  This flag is enabled by default at @option{-O} and
7639 higher.
7641 @item -fipa-pure-const
7642 @opindex fipa-pure-const
7643 Discover which functions are pure or constant.
7644 Enabled by default at @option{-O} and higher.
7646 @item -fipa-reference
7647 @opindex fipa-reference
7648 Discover which static variables do not escape the
7649 compilation unit.
7650 Enabled by default at @option{-O} and higher.
7652 @item -fipa-pta
7653 @opindex fipa-pta
7654 Perform interprocedural pointer analysis and interprocedural modification
7655 and reference analysis.  This option can cause excessive memory and
7656 compile-time usage on large compilation units.  It is not enabled by
7657 default at any optimization level.
7659 @item -fipa-profile
7660 @opindex fipa-profile
7661 Perform interprocedural profile propagation.  The functions called only from
7662 cold functions are marked as cold. Also functions executed once (such as
7663 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7664 functions and loop less parts of functions executed once are then optimized for
7665 size.
7666 Enabled by default at @option{-O} and higher.
7668 @item -fipa-cp
7669 @opindex fipa-cp
7670 Perform interprocedural constant propagation.
7671 This optimization analyzes the program to determine when values passed
7672 to functions are constants and then optimizes accordingly.
7673 This optimization can substantially increase performance
7674 if the application has constants passed to functions.
7675 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7677 @item -fipa-cp-clone
7678 @opindex fipa-cp-clone
7679 Perform function cloning to make interprocedural constant propagation stronger.
7680 When enabled, interprocedural constant propagation performs function cloning
7681 when externally visible function can be called with constant arguments.
7682 Because this optimization can create multiple copies of functions,
7683 it may significantly increase code size
7684 (see @option{--param ipcp-unit-growth=@var{value}}).
7685 This flag is enabled by default at @option{-O3}.
7687 @item -ftree-sink
7688 @opindex ftree-sink
7689 Perform forward store motion  on trees.  This flag is
7690 enabled by default at @option{-O} and higher.
7692 @item -ftree-bit-ccp
7693 @opindex ftree-bit-ccp
7694 Perform sparse conditional bit constant propagation on trees and propagate
7695 pointer alignment information.
7696 This pass only operates on local scalar variables and is enabled by default
7697 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7699 @item -ftree-ccp
7700 @opindex ftree-ccp
7701 Perform sparse conditional constant propagation (CCP) on trees.  This
7702 pass only operates on local scalar variables and is enabled by default
7703 at @option{-O} and higher.
7705 @item -ftree-switch-conversion
7706 Perform conversion of simple initializations in a switch to
7707 initializations from a scalar array.  This flag is enabled by default
7708 at @option{-O2} and higher.
7710 @item -ftree-tail-merge
7711 Look for identical code sequences.  When found, replace one with a jump to the
7712 other.  This optimization is known as tail merging or cross jumping.  This flag
7713 is enabled by default at @option{-O2} and higher.  The compilation time
7714 in this pass can
7715 be limited using @option{max-tail-merge-comparisons} parameter and
7716 @option{max-tail-merge-iterations} parameter.
7718 @item -ftree-dce
7719 @opindex ftree-dce
7720 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7721 default at @option{-O} and higher.
7723 @item -ftree-builtin-call-dce
7724 @opindex ftree-builtin-call-dce
7725 Perform conditional dead code elimination (DCE) for calls to built-in functions
7726 that may set @code{errno} but are otherwise side-effect free.  This flag is
7727 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7728 specified.
7730 @item -ftree-dominator-opts
7731 @opindex ftree-dominator-opts
7732 Perform a variety of simple scalar cleanups (constant/copy
7733 propagation, redundancy elimination, range propagation and expression
7734 simplification) based on a dominator tree traversal.  This also
7735 performs jump threading (to reduce jumps to jumps). This flag is
7736 enabled by default at @option{-O} and higher.
7738 @item -ftree-dse
7739 @opindex ftree-dse
7740 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7741 a memory location that is later overwritten by another store without
7742 any intervening loads.  In this case the earlier store can be deleted.  This
7743 flag is enabled by default at @option{-O} and higher.
7745 @item -ftree-ch
7746 @opindex ftree-ch
7747 Perform loop header copying on trees.  This is beneficial since it increases
7748 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7749 is enabled by default at @option{-O} and higher.  It is not enabled
7750 for @option{-Os}, since it usually increases code size.
7752 @item -ftree-loop-optimize
7753 @opindex ftree-loop-optimize
7754 Perform loop optimizations on trees.  This flag is enabled by default
7755 at @option{-O} and higher.
7757 @item -ftree-loop-linear
7758 @opindex ftree-loop-linear
7759 Perform loop interchange transformations on tree.  Same as
7760 @option{-floop-interchange}.  To use this code transformation, GCC has
7761 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7762 enable the Graphite loop transformation infrastructure.
7764 @item -floop-interchange
7765 @opindex floop-interchange
7766 Perform loop interchange transformations on loops.  Interchanging two
7767 nested loops switches the inner and outer loops.  For example, given a
7768 loop like:
7769 @smallexample
7770 DO J = 1, M
7771   DO I = 1, N
7772     A(J, I) = A(J, I) * C
7773   ENDDO
7774 ENDDO
7775 @end smallexample
7776 loop interchange transforms the loop as if it were written:
7777 @smallexample
7778 DO I = 1, N
7779   DO J = 1, M
7780     A(J, I) = A(J, I) * C
7781   ENDDO
7782 ENDDO
7783 @end smallexample
7784 which can be beneficial when @code{N} is larger than the caches,
7785 because in Fortran, the elements of an array are stored in memory
7786 contiguously by column, and the original loop iterates over rows,
7787 potentially creating at each access a cache miss.  This optimization
7788 applies to all the languages supported by GCC and is not limited to
7789 Fortran.  To use this code transformation, GCC has to be configured
7790 with @option{--with-ppl} and @option{--with-cloog} to enable the
7791 Graphite loop transformation infrastructure.
7793 @item -floop-strip-mine
7794 @opindex floop-strip-mine
7795 Perform loop strip mining transformations on loops.  Strip mining
7796 splits a loop into two nested loops.  The outer loop has strides
7797 equal to the strip size and the inner loop has strides of the
7798 original loop within a strip.  The strip length can be changed
7799 using the @option{loop-block-tile-size} parameter.  For example,
7800 given a loop like:
7801 @smallexample
7802 DO I = 1, N
7803   A(I) = A(I) + C
7804 ENDDO
7805 @end smallexample
7806 loop strip mining transforms the loop as if it were written:
7807 @smallexample
7808 DO II = 1, N, 51
7809   DO I = II, min (II + 50, N)
7810     A(I) = A(I) + C
7811   ENDDO
7812 ENDDO
7813 @end smallexample
7814 This optimization applies to all the languages supported by GCC and is
7815 not limited to Fortran.  To use this code transformation, GCC has to
7816 be configured with @option{--with-ppl} and @option{--with-cloog} to
7817 enable the Graphite loop transformation infrastructure.
7819 @item -floop-block
7820 @opindex floop-block
7821 Perform loop blocking transformations on loops.  Blocking strip mines
7822 each loop in the loop nest such that the memory accesses of the
7823 element loops fit inside caches.  The strip length can be changed
7824 using the @option{loop-block-tile-size} parameter.  For example, given
7825 a loop like:
7826 @smallexample
7827 DO I = 1, N
7828   DO J = 1, M
7829     A(J, I) = B(I) + C(J)
7830   ENDDO
7831 ENDDO
7832 @end smallexample
7833 loop blocking transforms the loop as if it were written:
7834 @smallexample
7835 DO II = 1, N, 51
7836   DO JJ = 1, M, 51
7837     DO I = II, min (II + 50, N)
7838       DO J = JJ, min (JJ + 50, M)
7839         A(J, I) = B(I) + C(J)
7840       ENDDO
7841     ENDDO
7842   ENDDO
7843 ENDDO
7844 @end smallexample
7845 which can be beneficial when @code{M} is larger than the caches,
7846 because the innermost loop iterates over a smaller amount of data
7847 which can be kept in the caches.  This optimization applies to all the
7848 languages supported by GCC and is not limited to Fortran.  To use this
7849 code transformation, GCC has to be configured with @option{--with-ppl}
7850 and @option{--with-cloog} to enable the Graphite loop transformation
7851 infrastructure.
7853 @item -fgraphite-identity
7854 @opindex fgraphite-identity
7855 Enable the identity transformation for graphite.  For every SCoP we generate
7856 the polyhedral representation and transform it back to gimple.  Using
7857 @option{-fgraphite-identity} we can check the costs or benefits of the
7858 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7859 are also performed by the code generator CLooG, like index splitting and
7860 dead code elimination in loops.
7862 @item -floop-nest-optimize
7863 @opindex floop-nest-optimize
7864 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7865 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7866 structure optimized for data-locality and parallelism.  This option
7867 is experimental.
7869 @item -floop-parallelize-all
7870 @opindex floop-parallelize-all
7871 Use the Graphite data dependence analysis to identify loops that can
7872 be parallelized.  Parallelize all the loops that can be analyzed to
7873 not contain loop carried dependences without checking that it is
7874 profitable to parallelize the loops.
7876 @item -fcheck-data-deps
7877 @opindex fcheck-data-deps
7878 Compare the results of several data dependence analyzers.  This option
7879 is used for debugging the data dependence analyzers.
7881 @item -ftree-loop-if-convert
7882 Attempt to transform conditional jumps in the innermost loops to
7883 branch-less equivalents.  The intent is to remove control-flow from
7884 the innermost loops in order to improve the ability of the
7885 vectorization pass to handle these loops.  This is enabled by default
7886 if vectorization is enabled.
7888 @item -ftree-loop-if-convert-stores
7889 Attempt to also if-convert conditional jumps containing memory writes.
7890 This transformation can be unsafe for multi-threaded programs as it
7891 transforms conditional memory writes into unconditional memory writes.
7892 For example,
7893 @smallexample
7894 for (i = 0; i < N; i++)
7895   if (cond)
7896     A[i] = expr;
7897 @end smallexample
7898 is transformed to
7899 @smallexample
7900 for (i = 0; i < N; i++)
7901   A[i] = cond ? expr : A[i];
7902 @end smallexample
7903 potentially producing data races.
7905 @item -ftree-loop-distribution
7906 Perform loop distribution.  This flag can improve cache performance on
7907 big loop bodies and allow further loop optimizations, like
7908 parallelization or vectorization, to take place.  For example, the loop
7909 @smallexample
7910 DO I = 1, N
7911   A(I) = B(I) + C
7912   D(I) = E(I) * F
7913 ENDDO
7914 @end smallexample
7915 is transformed to
7916 @smallexample
7917 DO I = 1, N
7918    A(I) = B(I) + C
7919 ENDDO
7920 DO I = 1, N
7921    D(I) = E(I) * F
7922 ENDDO
7923 @end smallexample
7925 @item -ftree-loop-distribute-patterns
7926 Perform loop distribution of patterns that can be code generated with
7927 calls to a library.  This flag is enabled by default at @option{-O3}.
7929 This pass distributes the initialization loops and generates a call to
7930 memset zero.  For example, the loop
7931 @smallexample
7932 DO I = 1, N
7933   A(I) = 0
7934   B(I) = A(I) + I
7935 ENDDO
7936 @end smallexample
7937 is transformed to
7938 @smallexample
7939 DO I = 1, N
7940    A(I) = 0
7941 ENDDO
7942 DO I = 1, N
7943    B(I) = A(I) + I
7944 ENDDO
7945 @end smallexample
7946 and the initialization loop is transformed into a call to memset zero.
7948 @item -ftree-loop-im
7949 @opindex ftree-loop-im
7950 Perform loop invariant motion on trees.  This pass moves only invariants that
7951 are hard to handle at RTL level (function calls, operations that expand to
7952 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7953 operands of conditions that are invariant out of the loop, so that we can use
7954 just trivial invariantness analysis in loop unswitching.  The pass also includes
7955 store motion.
7957 @item -ftree-loop-ivcanon
7958 @opindex ftree-loop-ivcanon
7959 Create a canonical counter for number of iterations in loops for which
7960 determining number of iterations requires complicated analysis.  Later
7961 optimizations then may determine the number easily.  Useful especially
7962 in connection with unrolling.
7964 @item -fivopts
7965 @opindex fivopts
7966 Perform induction variable optimizations (strength reduction, induction
7967 variable merging and induction variable elimination) on trees.
7969 @item -ftree-parallelize-loops=n
7970 @opindex ftree-parallelize-loops
7971 Parallelize loops, i.e., split their iteration space to run in n threads.
7972 This is only possible for loops whose iterations are independent
7973 and can be arbitrarily reordered.  The optimization is only
7974 profitable on multiprocessor machines, for loops that are CPU-intensive,
7975 rather than constrained e.g.@: by memory bandwidth.  This option
7976 implies @option{-pthread}, and thus is only supported on targets
7977 that have support for @option{-pthread}.
7979 @item -ftree-pta
7980 @opindex ftree-pta
7981 Perform function-local points-to analysis on trees.  This flag is
7982 enabled by default at @option{-O} and higher.
7984 @item -ftree-sra
7985 @opindex ftree-sra
7986 Perform scalar replacement of aggregates.  This pass replaces structure
7987 references with scalars to prevent committing structures to memory too
7988 early.  This flag is enabled by default at @option{-O} and higher.
7990 @item -ftree-copyrename
7991 @opindex ftree-copyrename
7992 Perform copy renaming on trees.  This pass attempts to rename compiler
7993 temporaries to other variables at copy locations, usually resulting in
7994 variable names which more closely resemble the original variables.  This flag
7995 is enabled by default at @option{-O} and higher.
7997 @item -ftree-coalesce-inlined-vars
7998 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7999 combine small user-defined variables too, but only if they were inlined
8000 from other functions.  It is a more limited form of
8001 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8002 inlined variables, but it will keep variables of the inlined-into
8003 function apart from each other, such that they are more likely to
8004 contain the expected values in a debugging session.  This was the
8005 default in GCC versions older than 4.7.
8007 @item -ftree-coalesce-vars
8008 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8009 combine small user-defined variables too, instead of just compiler
8010 temporaries.  This may severely limit the ability to debug an optimized
8011 program compiled with @option{-fno-var-tracking-assignments}.  In the
8012 negated form, this flag prevents SSA coalescing of user variables,
8013 including inlined ones.  This option is enabled by default.
8015 @item -ftree-ter
8016 @opindex ftree-ter
8017 Perform temporary expression replacement during the SSA->normal phase.  Single
8018 use/single def temporaries are replaced at their use location with their
8019 defining expression.  This results in non-GIMPLE code, but gives the expanders
8020 much more complex trees to work on resulting in better RTL generation.  This is
8021 enabled by default at @option{-O} and higher.
8023 @item -ftree-slsr
8024 @opindex ftree-slsr
8025 Perform straight-line strength reduction on trees.  This recognizes related
8026 expressions involving multiplications and replaces them by less expensive
8027 calculations when possible.  This is enabled by default at @option{-O} and
8028 higher.
8030 @item -ftree-vectorize
8031 @opindex ftree-vectorize
8032 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8033 and @option{-ftree-slp-vectorize} if not explicitly specified.
8035 @item -ftree-loop-vectorize
8036 @opindex ftree-loop-vectorize
8037 Perform loop vectorization on trees. This flag is enabled by default at
8038 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8040 @item -ftree-slp-vectorize
8041 @opindex ftree-slp-vectorize
8042 Perform basic block vectorization on trees. This flag is enabled by default at
8043 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8045 @item -fvect-cost-model=@var{model}
8046 @opindex fvect-cost-model
8047 Alter the cost model used for vectorization.  The @var{model} argument
8048 should be one of @code{unlimited}, @code{dynamic} or @code{cheap}.
8049 With the @code{unlimited} model the vectorized code-path is assumed
8050 to be profitable while with the @code{dynamic} model a runtime check
8051 will guard the vectorized code-path to enable it only for iteration
8052 counts that will likely execute faster than when executing the original
8053 scalar loop.  The @code{cheap} model will disable vectorization of
8054 loops where doing so would be cost prohibitive for example due to
8055 required runtime checks for data dependence or alignment but otherwise
8056 is equal to the @code{dynamic} model.
8057 The default cost model depends on other optimization flags and is
8058 either @code{dynamic} or @code{cheap}.
8060 @item -ftree-vrp
8061 @opindex ftree-vrp
8062 Perform Value Range Propagation on trees.  This is similar to the
8063 constant propagation pass, but instead of values, ranges of values are
8064 propagated.  This allows the optimizers to remove unnecessary range
8065 checks like array bound checks and null pointer checks.  This is
8066 enabled by default at @option{-O2} and higher.  Null pointer check
8067 elimination is only done if @option{-fdelete-null-pointer-checks} is
8068 enabled.
8070 @item -ftracer
8071 @opindex ftracer
8072 Perform tail duplication to enlarge superblock size.  This transformation
8073 simplifies the control flow of the function allowing other optimizations to do
8074 a better job.
8076 @item -funroll-loops
8077 @opindex funroll-loops
8078 Unroll loops whose number of iterations can be determined at compile
8079 time or upon entry to the loop.  @option{-funroll-loops} implies
8080 @option{-frerun-cse-after-loop}.  This option makes code larger,
8081 and may or may not make it run faster.
8083 @item -funroll-all-loops
8084 @opindex funroll-all-loops
8085 Unroll all loops, even if their number of iterations is uncertain when
8086 the loop is entered.  This usually makes programs run more slowly.
8087 @option{-funroll-all-loops} implies the same options as
8088 @option{-funroll-loops},
8090 @item -fsplit-ivs-in-unroller
8091 @opindex fsplit-ivs-in-unroller
8092 Enables expression of values of induction variables in later iterations
8093 of the unrolled loop using the value in the first iteration.  This breaks
8094 long dependency chains, thus improving efficiency of the scheduling passes.
8096 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8097 same effect.  However, that is not reliable in cases where the loop body
8098 is more complicated than a single basic block.  It also does not work at all
8099 on some architectures due to restrictions in the CSE pass.
8101 This optimization is enabled by default.
8103 @item -fvariable-expansion-in-unroller
8104 @opindex fvariable-expansion-in-unroller
8105 With this option, the compiler creates multiple copies of some
8106 local variables when unrolling a loop, which can result in superior code.
8108 @item -fpartial-inlining
8109 @opindex fpartial-inlining
8110 Inline parts of functions.  This option has any effect only
8111 when inlining itself is turned on by the @option{-finline-functions}
8112 or @option{-finline-small-functions} options.
8114 Enabled at level @option{-O2}.
8116 @item -fpredictive-commoning
8117 @opindex fpredictive-commoning
8118 Perform predictive commoning optimization, i.e., reusing computations
8119 (especially memory loads and stores) performed in previous
8120 iterations of loops.
8122 This option is enabled at level @option{-O3}.
8124 @item -fprefetch-loop-arrays
8125 @opindex fprefetch-loop-arrays
8126 If supported by the target machine, generate instructions to prefetch
8127 memory to improve the performance of loops that access large arrays.
8129 This option may generate better or worse code; results are highly
8130 dependent on the structure of loops within the source code.
8132 Disabled at level @option{-Os}.
8134 @item -fno-peephole
8135 @itemx -fno-peephole2
8136 @opindex fno-peephole
8137 @opindex fno-peephole2
8138 Disable any machine-specific peephole optimizations.  The difference
8139 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8140 are implemented in the compiler; some targets use one, some use the
8141 other, a few use both.
8143 @option{-fpeephole} is enabled by default.
8144 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8146 @item -fno-guess-branch-probability
8147 @opindex fno-guess-branch-probability
8148 Do not guess branch probabilities using heuristics.
8150 GCC uses heuristics to guess branch probabilities if they are
8151 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8152 heuristics are based on the control flow graph.  If some branch probabilities
8153 are specified by @samp{__builtin_expect}, then the heuristics are
8154 used to guess branch probabilities for the rest of the control flow graph,
8155 taking the @samp{__builtin_expect} info into account.  The interactions
8156 between the heuristics and @samp{__builtin_expect} can be complex, and in
8157 some cases, it may be useful to disable the heuristics so that the effects
8158 of @samp{__builtin_expect} are easier to understand.
8160 The default is @option{-fguess-branch-probability} at levels
8161 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8163 @item -freorder-blocks
8164 @opindex freorder-blocks
8165 Reorder basic blocks in the compiled function in order to reduce number of
8166 taken branches and improve code locality.
8168 Enabled at levels @option{-O2}, @option{-O3}.
8170 @item -freorder-blocks-and-partition
8171 @opindex freorder-blocks-and-partition
8172 In addition to reordering basic blocks in the compiled function, in order
8173 to reduce number of taken branches, partitions hot and cold basic blocks
8174 into separate sections of the assembly and .o files, to improve
8175 paging and cache locality performance.
8177 This optimization is automatically turned off in the presence of
8178 exception handling, for linkonce sections, for functions with a user-defined
8179 section attribute and on any architecture that does not support named
8180 sections.
8182 @item -freorder-functions
8183 @opindex freorder-functions
8184 Reorder functions in the object file in order to
8185 improve code locality.  This is implemented by using special
8186 subsections @code{.text.hot} for most frequently executed functions and
8187 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8188 the linker so object file format must support named sections and linker must
8189 place them in a reasonable way.
8191 Also profile feedback must be available to make this option effective.  See
8192 @option{-fprofile-arcs} for details.
8194 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8196 @item -fstrict-aliasing
8197 @opindex fstrict-aliasing
8198 Allow the compiler to assume the strictest aliasing rules applicable to
8199 the language being compiled.  For C (and C++), this activates
8200 optimizations based on the type of expressions.  In particular, an
8201 object of one type is assumed never to reside at the same address as an
8202 object of a different type, unless the types are almost the same.  For
8203 example, an @code{unsigned int} can alias an @code{int}, but not a
8204 @code{void*} or a @code{double}.  A character type may alias any other
8205 type.
8207 @anchor{Type-punning}Pay special attention to code like this:
8208 @smallexample
8209 union a_union @{
8210   int i;
8211   double d;
8214 int f() @{
8215   union a_union t;
8216   t.d = 3.0;
8217   return t.i;
8219 @end smallexample
8220 The practice of reading from a different union member than the one most
8221 recently written to (called ``type-punning'') is common.  Even with
8222 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8223 is accessed through the union type.  So, the code above works as
8224 expected.  @xref{Structures unions enumerations and bit-fields
8225 implementation}.  However, this code might not:
8226 @smallexample
8227 int f() @{
8228   union a_union t;
8229   int* ip;
8230   t.d = 3.0;
8231   ip = &t.i;
8232   return *ip;
8234 @end smallexample
8236 Similarly, access by taking the address, casting the resulting pointer
8237 and dereferencing the result has undefined behavior, even if the cast
8238 uses a union type, e.g.:
8239 @smallexample
8240 int f() @{
8241   double d = 3.0;
8242   return ((union a_union *) &d)->i;
8244 @end smallexample
8246 The @option{-fstrict-aliasing} option is enabled at levels
8247 @option{-O2}, @option{-O3}, @option{-Os}.
8249 @item -fstrict-overflow
8250 @opindex fstrict-overflow
8251 Allow the compiler to assume strict signed overflow rules, depending
8252 on the language being compiled.  For C (and C++) this means that
8253 overflow when doing arithmetic with signed numbers is undefined, which
8254 means that the compiler may assume that it does not happen.  This
8255 permits various optimizations.  For example, the compiler assumes
8256 that an expression like @code{i + 10 > i} is always true for
8257 signed @code{i}.  This assumption is only valid if signed overflow is
8258 undefined, as the expression is false if @code{i + 10} overflows when
8259 using twos complement arithmetic.  When this option is in effect any
8260 attempt to determine whether an operation on signed numbers 
8261 overflows must be written carefully to not actually involve overflow.
8263 This option also allows the compiler to assume strict pointer
8264 semantics: given a pointer to an object, if adding an offset to that
8265 pointer does not produce a pointer to the same object, the addition is
8266 undefined.  This permits the compiler to conclude that @code{p + u >
8267 p} is always true for a pointer @code{p} and unsigned integer
8268 @code{u}.  This assumption is only valid because pointer wraparound is
8269 undefined, as the expression is false if @code{p + u} overflows using
8270 twos complement arithmetic.
8272 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8273 that integer signed overflow is fully defined: it wraps.  When
8274 @option{-fwrapv} is used, there is no difference between
8275 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8276 integers.  With @option{-fwrapv} certain types of overflow are
8277 permitted.  For example, if the compiler gets an overflow when doing
8278 arithmetic on constants, the overflowed value can still be used with
8279 @option{-fwrapv}, but not otherwise.
8281 The @option{-fstrict-overflow} option is enabled at levels
8282 @option{-O2}, @option{-O3}, @option{-Os}.
8284 @item -falign-functions
8285 @itemx -falign-functions=@var{n}
8286 @opindex falign-functions
8287 Align the start of functions to the next power-of-two greater than
8288 @var{n}, skipping up to @var{n} bytes.  For instance,
8289 @option{-falign-functions=32} aligns functions to the next 32-byte
8290 boundary, but @option{-falign-functions=24} aligns to the next
8291 32-byte boundary only if this can be done by skipping 23 bytes or less.
8293 @option{-fno-align-functions} and @option{-falign-functions=1} are
8294 equivalent and mean that functions are not aligned.
8296 Some assemblers only support this flag when @var{n} is a power of two;
8297 in that case, it is rounded up.
8299 If @var{n} is not specified or is zero, use a machine-dependent default.
8301 Enabled at levels @option{-O2}, @option{-O3}.
8303 @item -falign-labels
8304 @itemx -falign-labels=@var{n}
8305 @opindex falign-labels
8306 Align all branch targets to a power-of-two boundary, skipping up to
8307 @var{n} bytes like @option{-falign-functions}.  This option can easily
8308 make code slower, because it must insert dummy operations for when the
8309 branch target is reached in the usual flow of the code.
8311 @option{-fno-align-labels} and @option{-falign-labels=1} are
8312 equivalent and mean that labels are not aligned.
8314 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8315 are greater than this value, then their values are used instead.
8317 If @var{n} is not specified or is zero, use a machine-dependent default
8318 which is very likely to be @samp{1}, meaning no alignment.
8320 Enabled at levels @option{-O2}, @option{-O3}.
8322 @item -falign-loops
8323 @itemx -falign-loops=@var{n}
8324 @opindex falign-loops
8325 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8326 like @option{-falign-functions}.  If the loops are
8327 executed many times, this makes up for any execution of the dummy
8328 operations.
8330 @option{-fno-align-loops} and @option{-falign-loops=1} are
8331 equivalent and mean that loops are not aligned.
8333 If @var{n} is not specified or is zero, use a machine-dependent default.
8335 Enabled at levels @option{-O2}, @option{-O3}.
8337 @item -falign-jumps
8338 @itemx -falign-jumps=@var{n}
8339 @opindex falign-jumps
8340 Align branch targets to a power-of-two boundary, for branch targets
8341 where the targets can only be reached by jumping, skipping up to @var{n}
8342 bytes like @option{-falign-functions}.  In this case, no dummy operations
8343 need be executed.
8345 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8346 equivalent and mean that loops are not aligned.
8348 If @var{n} is not specified or is zero, use a machine-dependent default.
8350 Enabled at levels @option{-O2}, @option{-O3}.
8352 @item -funit-at-a-time
8353 @opindex funit-at-a-time
8354 This option is left for compatibility reasons. @option{-funit-at-a-time}
8355 has no effect, while @option{-fno-unit-at-a-time} implies
8356 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8358 Enabled by default.
8360 @item -fno-toplevel-reorder
8361 @opindex fno-toplevel-reorder
8362 Do not reorder top-level functions, variables, and @code{asm}
8363 statements.  Output them in the same order that they appear in the
8364 input file.  When this option is used, unreferenced static variables
8365 are not removed.  This option is intended to support existing code
8366 that relies on a particular ordering.  For new code, it is better to
8367 use attributes.
8369 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8370 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8371 targets.
8373 @item -fweb
8374 @opindex fweb
8375 Constructs webs as commonly used for register allocation purposes and assign
8376 each web individual pseudo register.  This allows the register allocation pass
8377 to operate on pseudos directly, but also strengthens several other optimization
8378 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8379 however, make debugging impossible, since variables no longer stay in a
8380 ``home register''.
8382 Enabled by default with @option{-funroll-loops}.
8384 @item -fwhole-program
8385 @opindex fwhole-program
8386 Assume that the current compilation unit represents the whole program being
8387 compiled.  All public functions and variables with the exception of @code{main}
8388 and those merged by attribute @code{externally_visible} become static functions
8389 and in effect are optimized more aggressively by interprocedural optimizers.
8391 This option should not be used in combination with @code{-flto}.
8392 Instead relying on a linker plugin should provide safer and more precise
8393 information.
8395 @item -flto[=@var{n}]
8396 @opindex flto
8397 This option runs the standard link-time optimizer.  When invoked
8398 with source code, it generates GIMPLE (one of GCC's internal
8399 representations) and writes it to special ELF sections in the object
8400 file.  When the object files are linked together, all the function
8401 bodies are read from these ELF sections and instantiated as if they
8402 had been part of the same translation unit.
8404 To use the link-time optimizer, @option{-flto} needs to be specified at
8405 compile time and during the final link.  For example:
8407 @smallexample
8408 gcc -c -O2 -flto foo.c
8409 gcc -c -O2 -flto bar.c
8410 gcc -o myprog -flto -O2 foo.o bar.o
8411 @end smallexample
8413 The first two invocations to GCC save a bytecode representation
8414 of GIMPLE into special ELF sections inside @file{foo.o} and
8415 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8416 @file{foo.o} and @file{bar.o}, merges the two files into a single
8417 internal image, and compiles the result as usual.  Since both
8418 @file{foo.o} and @file{bar.o} are merged into a single image, this
8419 causes all the interprocedural analyses and optimizations in GCC to
8420 work across the two files as if they were a single one.  This means,
8421 for example, that the inliner is able to inline functions in
8422 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8424 Another (simpler) way to enable link-time optimization is:
8426 @smallexample
8427 gcc -o myprog -flto -O2 foo.c bar.c
8428 @end smallexample
8430 The above generates bytecode for @file{foo.c} and @file{bar.c},
8431 merges them together into a single GIMPLE representation and optimizes
8432 them as usual to produce @file{myprog}.
8434 The only important thing to keep in mind is that to enable link-time
8435 optimizations the @option{-flto} flag needs to be passed to both the
8436 compile and the link commands.
8438 To make whole program optimization effective, it is necessary to make
8439 certain whole program assumptions.  The compiler needs to know
8440 what functions and variables can be accessed by libraries and runtime
8441 outside of the link-time optimized unit.  When supported by the linker,
8442 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8443 to the compiler about used and externally visible symbols.  When
8444 the linker plugin is not available, @option{-fwhole-program} should be
8445 used to allow the compiler to make these assumptions, which leads
8446 to more aggressive optimization decisions.
8448 Note that when a file is compiled with @option{-flto}, the generated
8449 object file is larger than a regular object file because it 
8450 contains GIMPLE bytecodes and the usual final code.  This means that
8451 object files with LTO information can be linked as normal object
8452 files; if @option{-flto} is not passed to the linker, no
8453 interprocedural optimizations are applied.
8455 Additionally, the optimization flags used to compile individual files
8456 are not necessarily related to those used at link time.  For instance,
8458 @smallexample
8459 gcc -c -O0 -flto foo.c
8460 gcc -c -O0 -flto bar.c
8461 gcc -o myprog -flto -O3 foo.o bar.o
8462 @end smallexample
8464 This produces individual object files with unoptimized assembler
8465 code, but the resulting binary @file{myprog} is optimized at
8466 @option{-O3}.  If, instead, the final binary is generated without
8467 @option{-flto}, then @file{myprog} is not optimized.
8469 When producing the final binary with @option{-flto}, GCC only
8470 applies link-time optimizations to those files that contain bytecode.
8471 Therefore, you can mix and match object files and libraries with
8472 GIMPLE bytecodes and final object code.  GCC automatically selects
8473 which files to optimize in LTO mode and which files to link without
8474 further processing.
8476 There are some code generation flags preserved by GCC when
8477 generating bytecodes, as they need to be used during the final link
8478 stage.  Currently, the following options are saved into the GIMPLE
8479 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8480 @option{-m} target flags.
8482 At link time, these options are read in and reapplied.  Note that the
8483 current implementation makes no attempt to recognize conflicting
8484 values for these options.  If different files have conflicting option
8485 values (e.g., one file is compiled with @option{-fPIC} and another
8486 isn't), the compiler simply uses the last value read from the
8487 bytecode files.  It is recommended, then, that you compile all the files
8488 participating in the same link with the same options.
8490 If LTO encounters objects with C linkage declared with incompatible
8491 types in separate translation units to be linked together (undefined
8492 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8493 issued.  The behavior is still undefined at run time.
8495 Another feature of LTO is that it is possible to apply interprocedural
8496 optimizations on files written in different languages.  This requires
8497 support in the language front end.  Currently, the C, C++ and
8498 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8499 something like this should work:
8501 @smallexample
8502 gcc -c -flto foo.c
8503 g++ -c -flto bar.cc
8504 gfortran -c -flto baz.f90
8505 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8506 @end smallexample
8508 Notice that the final link is done with @command{g++} to get the C++
8509 runtime libraries and @option{-lgfortran} is added to get the Fortran
8510 runtime libraries.  In general, when mixing languages in LTO mode, you
8511 should use the same link command options as when mixing languages in a
8512 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8513 all the compile and link commands.
8515 If object files containing GIMPLE bytecode are stored in a library archive, say
8516 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8517 are using a linker with plugin support.  To enable this feature, use
8518 the flag @option{-fuse-linker-plugin} at link time:
8520 @smallexample
8521 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8522 @end smallexample
8524 With the linker plugin enabled, the linker extracts the needed
8525 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8526 to make them part of the aggregated GIMPLE image to be optimized.
8528 If you are not using a linker with plugin support and/or do not
8529 enable the linker plugin, then the objects inside @file{libfoo.a}
8530 are extracted and linked as usual, but they do not participate
8531 in the LTO optimization process.
8533 Link-time optimizations do not require the presence of the whole program to
8534 operate.  If the program does not require any symbols to be exported, it is
8535 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8536 the interprocedural optimizers to use more aggressive assumptions which may
8537 lead to improved optimization opportunities.
8538 Use of @option{-fwhole-program} is not needed when linker plugin is
8539 active (see @option{-fuse-linker-plugin}).
8541 The current implementation of LTO makes no
8542 attempt to generate bytecode that is portable between different
8543 types of hosts.  The bytecode files are versioned and there is a
8544 strict version check, so bytecode files generated in one version of
8545 GCC will not work with an older/newer version of GCC@.
8547 Link-time optimization does not work well with generation of debugging
8548 information.  Combining @option{-flto} with
8549 @option{-g} is currently experimental and expected to produce wrong
8550 results.
8552 If you specify the optional @var{n}, the optimization and code
8553 generation done at link time is executed in parallel using @var{n}
8554 parallel jobs by utilizing an installed @command{make} program.  The
8555 environment variable @env{MAKE} may be used to override the program
8556 used.  The default value for @var{n} is 1.
8558 You can also specify @option{-flto=jobserver} to use GNU make's
8559 job server mode to determine the number of parallel jobs. This
8560 is useful when the Makefile calling GCC is already executing in parallel.
8561 You must prepend a @samp{+} to the command recipe in the parent Makefile
8562 for this to work.  This option likely only works if @env{MAKE} is
8563 GNU make.
8565 This option is disabled by default.
8567 @item -flto-partition=@var{alg}
8568 @opindex flto-partition
8569 Specify the partitioning algorithm used by the link-time optimizer.
8570 The value is either @code{1to1} to specify a partitioning mirroring
8571 the original source files or @code{balanced} to specify partitioning
8572 into equally sized chunks (whenever possible) or @code{max} to create
8573 new partition for every symbol where possible.  Specifying @code{none}
8574 as an algorithm disables partitioning and streaming completely. 
8575 The default value is @code{balanced}. While @code{1to1} can be used
8576 as an workaround for various code ordering issues, the @code{max}
8577 partitioning is intended for internal testing only.
8579 @item -flto-compression-level=@var{n}
8580 This option specifies the level of compression used for intermediate
8581 language written to LTO object files, and is only meaningful in
8582 conjunction with LTO mode (@option{-flto}).  Valid
8583 values are 0 (no compression) to 9 (maximum compression).  Values
8584 outside this range are clamped to either 0 or 9.  If the option is not
8585 given, a default balanced compression setting is used.
8587 @item -flto-report
8588 Prints a report with internal details on the workings of the link-time
8589 optimizer.  The contents of this report vary from version to version.
8590 It is meant to be useful to GCC developers when processing object
8591 files in LTO mode (via @option{-flto}).
8593 Disabled by default.
8595 @item -flto-report-wpa
8596 Like @option{-flto-report}, but only print for the WPA phase of Link
8597 Time Optimization.
8599 @item -fuse-linker-plugin
8600 Enables the use of a linker plugin during link-time optimization.  This
8601 option relies on plugin support in the linker, which is available in gold
8602 or in GNU ld 2.21 or newer.
8604 This option enables the extraction of object files with GIMPLE bytecode out
8605 of library archives. This improves the quality of optimization by exposing
8606 more code to the link-time optimizer.  This information specifies what
8607 symbols can be accessed externally (by non-LTO object or during dynamic
8608 linking).  Resulting code quality improvements on binaries (and shared
8609 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8610 See @option{-flto} for a description of the effect of this flag and how to
8611 use it.
8613 This option is enabled by default when LTO support in GCC is enabled
8614 and GCC was configured for use with
8615 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8617 @item -ffat-lto-objects
8618 @opindex ffat-lto-objects
8619 Fat LTO objects are object files that contain both the intermediate language
8620 and the object code. This makes them usable for both LTO linking and normal
8621 linking. This option is effective only when compiling with @option{-flto}
8622 and is ignored at link time.
8624 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8625 requires the complete toolchain to be aware of LTO. It requires a linker with
8626 linker plugin support for basic functionality.  Additionally,
8627 @command{nm}, @command{ar} and @command{ranlib}
8628 need to support linker plugins to allow a full-featured build environment
8629 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8630 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8631 to these tools. With non fat LTO makefiles need to be modified to use them.
8633 The default is @option{-ffat-lto-objects} but this default is intended to
8634 change in future releases when linker plugin enabled environments become more
8635 common.
8637 @item -fcompare-elim
8638 @opindex fcompare-elim
8639 After register allocation and post-register allocation instruction splitting,
8640 identify arithmetic instructions that compute processor flags similar to a
8641 comparison operation based on that arithmetic.  If possible, eliminate the
8642 explicit comparison operation.
8644 This pass only applies to certain targets that cannot explicitly represent
8645 the comparison operation before register allocation is complete.
8647 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8649 @item -fuse-ld=bfd
8650 Use the @command{bfd} linker instead of the default linker.
8652 @item -fuse-ld=gold
8653 Use the @command{gold} linker instead of the default linker.
8655 @item -fcprop-registers
8656 @opindex fcprop-registers
8657 After register allocation and post-register allocation instruction splitting,
8658 perform a copy-propagation pass to try to reduce scheduling dependencies
8659 and occasionally eliminate the copy.
8661 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8663 @item -fprofile-correction
8664 @opindex fprofile-correction
8665 Profiles collected using an instrumented binary for multi-threaded programs may
8666 be inconsistent due to missed counter updates. When this option is specified,
8667 GCC uses heuristics to correct or smooth out such inconsistencies. By
8668 default, GCC emits an error message when an inconsistent profile is detected.
8670 @item -fprofile-dir=@var{path}
8671 @opindex fprofile-dir
8673 Set the directory to search for the profile data files in to @var{path}.
8674 This option affects only the profile data generated by
8675 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8676 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8677 and its related options.  Both absolute and relative paths can be used.
8678 By default, GCC uses the current directory as @var{path}, thus the
8679 profile data file appears in the same directory as the object file.
8681 @item -fprofile-generate
8682 @itemx -fprofile-generate=@var{path}
8683 @opindex fprofile-generate
8685 Enable options usually used for instrumenting application to produce
8686 profile useful for later recompilation with profile feedback based
8687 optimization.  You must use @option{-fprofile-generate} both when
8688 compiling and when linking your program.
8690 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8692 If @var{path} is specified, GCC looks at the @var{path} to find
8693 the profile feedback data files. See @option{-fprofile-dir}.
8695 @item -fprofile-use
8696 @itemx -fprofile-use=@var{path}
8697 @opindex fprofile-use
8698 Enable profile feedback directed optimizations, and optimizations
8699 generally profitable only with profile feedback available.
8701 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8702 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8703 @code{ftree-loop-distribute-patterns}
8705 By default, GCC emits an error message if the feedback profiles do not
8706 match the source code.  This error can be turned into a warning by using
8707 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8708 code.
8710 If @var{path} is specified, GCC looks at the @var{path} to find
8711 the profile feedback data files. See @option{-fprofile-dir}.
8712 @end table
8714 The following options control compiler behavior regarding floating-point 
8715 arithmetic.  These options trade off between speed and
8716 correctness.  All must be specifically enabled.
8718 @table @gcctabopt
8719 @item -ffloat-store
8720 @opindex ffloat-store
8721 Do not store floating-point variables in registers, and inhibit other
8722 options that might change whether a floating-point value is taken from a
8723 register or memory.
8725 @cindex floating-point precision
8726 This option prevents undesirable excess precision on machines such as
8727 the 68000 where the floating registers (of the 68881) keep more
8728 precision than a @code{double} is supposed to have.  Similarly for the
8729 x86 architecture.  For most programs, the excess precision does only
8730 good, but a few programs rely on the precise definition of IEEE floating
8731 point.  Use @option{-ffloat-store} for such programs, after modifying
8732 them to store all pertinent intermediate computations into variables.
8734 @item -fexcess-precision=@var{style}
8735 @opindex fexcess-precision
8736 This option allows further control over excess precision on machines
8737 where floating-point registers have more precision than the IEEE
8738 @code{float} and @code{double} types and the processor does not
8739 support operations rounding to those types.  By default,
8740 @option{-fexcess-precision=fast} is in effect; this means that
8741 operations are carried out in the precision of the registers and that
8742 it is unpredictable when rounding to the types specified in the source
8743 code takes place.  When compiling C, if
8744 @option{-fexcess-precision=standard} is specified then excess
8745 precision follows the rules specified in ISO C99; in particular,
8746 both casts and assignments cause values to be rounded to their
8747 semantic types (whereas @option{-ffloat-store} only affects
8748 assignments).  This option is enabled by default for C if a strict
8749 conformance option such as @option{-std=c99} is used.
8751 @opindex mfpmath
8752 @option{-fexcess-precision=standard} is not implemented for languages
8753 other than C, and has no effect if
8754 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8755 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8756 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8757 semantics apply without excess precision, and in the latter, rounding
8758 is unpredictable.
8760 @item -ffast-math
8761 @opindex ffast-math
8762 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8763 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8764 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8766 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8768 This option is not turned on by any @option{-O} option besides
8769 @option{-Ofast} since it can result in incorrect output for programs
8770 that depend on an exact implementation of IEEE or ISO rules/specifications
8771 for math functions. It may, however, yield faster code for programs
8772 that do not require the guarantees of these specifications.
8774 @item -fno-math-errno
8775 @opindex fno-math-errno
8776 Do not set @code{errno} after calling math functions that are executed
8777 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8778 IEEE exceptions for math error handling may want to use this flag
8779 for speed while maintaining IEEE arithmetic compatibility.
8781 This option is not turned on by any @option{-O} option since
8782 it can result in incorrect output for programs that depend on
8783 an exact implementation of IEEE or ISO rules/specifications for
8784 math functions. It may, however, yield faster code for programs
8785 that do not require the guarantees of these specifications.
8787 The default is @option{-fmath-errno}.
8789 On Darwin systems, the math library never sets @code{errno}.  There is
8790 therefore no reason for the compiler to consider the possibility that
8791 it might, and @option{-fno-math-errno} is the default.
8793 @item -funsafe-math-optimizations
8794 @opindex funsafe-math-optimizations
8796 Allow optimizations for floating-point arithmetic that (a) assume
8797 that arguments and results are valid and (b) may violate IEEE or
8798 ANSI standards.  When used at link-time, it may include libraries
8799 or startup files that change the default FPU control word or other
8800 similar optimizations.
8802 This option is not turned on by any @option{-O} option since
8803 it can result in incorrect output for programs that depend on
8804 an exact implementation of IEEE or ISO rules/specifications for
8805 math functions. It may, however, yield faster code for programs
8806 that do not require the guarantees of these specifications.
8807 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8808 @option{-fassociative-math} and @option{-freciprocal-math}.
8810 The default is @option{-fno-unsafe-math-optimizations}.
8812 @item -fassociative-math
8813 @opindex fassociative-math
8815 Allow re-association of operands in series of floating-point operations.
8816 This violates the ISO C and C++ language standard by possibly changing
8817 computation result.  NOTE: re-ordering may change the sign of zero as
8818 well as ignore NaNs and inhibit or create underflow or overflow (and
8819 thus cannot be used on code that relies on rounding behavior like
8820 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8821 and thus may not be used when ordered comparisons are required.
8822 This option requires that both @option{-fno-signed-zeros} and
8823 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8824 much sense with @option{-frounding-math}. For Fortran the option
8825 is automatically enabled when both @option{-fno-signed-zeros} and
8826 @option{-fno-trapping-math} are in effect.
8828 The default is @option{-fno-associative-math}.
8830 @item -freciprocal-math
8831 @opindex freciprocal-math
8833 Allow the reciprocal of a value to be used instead of dividing by
8834 the value if this enables optimizations.  For example @code{x / y}
8835 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8836 is subject to common subexpression elimination.  Note that this loses
8837 precision and increases the number of flops operating on the value.
8839 The default is @option{-fno-reciprocal-math}.
8841 @item -ffinite-math-only
8842 @opindex ffinite-math-only
8843 Allow optimizations for floating-point arithmetic that assume
8844 that arguments and results are not NaNs or +-Infs.
8846 This option is not turned on by any @option{-O} option since
8847 it can result in incorrect output for programs that depend on
8848 an exact implementation of IEEE or ISO rules/specifications for
8849 math functions. It may, however, yield faster code for programs
8850 that do not require the guarantees of these specifications.
8852 The default is @option{-fno-finite-math-only}.
8854 @item -fno-signed-zeros
8855 @opindex fno-signed-zeros
8856 Allow optimizations for floating-point arithmetic that ignore the
8857 signedness of zero.  IEEE arithmetic specifies the behavior of
8858 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8859 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8860 This option implies that the sign of a zero result isn't significant.
8862 The default is @option{-fsigned-zeros}.
8864 @item -fno-trapping-math
8865 @opindex fno-trapping-math
8866 Compile code assuming that floating-point operations cannot generate
8867 user-visible traps.  These traps include division by zero, overflow,
8868 underflow, inexact result and invalid operation.  This option requires
8869 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8870 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8872 This option should never be turned on by any @option{-O} option since
8873 it can result in incorrect output for programs that depend on
8874 an exact implementation of IEEE or ISO rules/specifications for
8875 math functions.
8877 The default is @option{-ftrapping-math}.
8879 @item -frounding-math
8880 @opindex frounding-math
8881 Disable transformations and optimizations that assume default floating-point
8882 rounding behavior.  This is round-to-zero for all floating point
8883 to integer conversions, and round-to-nearest for all other arithmetic
8884 truncations.  This option should be specified for programs that change
8885 the FP rounding mode dynamically, or that may be executed with a
8886 non-default rounding mode.  This option disables constant folding of
8887 floating-point expressions at compile time (which may be affected by
8888 rounding mode) and arithmetic transformations that are unsafe in the
8889 presence of sign-dependent rounding modes.
8891 The default is @option{-fno-rounding-math}.
8893 This option is experimental and does not currently guarantee to
8894 disable all GCC optimizations that are affected by rounding mode.
8895 Future versions of GCC may provide finer control of this setting
8896 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8897 will be used to specify the default state for @code{FENV_ACCESS}.
8899 @item -fsignaling-nans
8900 @opindex fsignaling-nans
8901 Compile code assuming that IEEE signaling NaNs may generate user-visible
8902 traps during floating-point operations.  Setting this option disables
8903 optimizations that may change the number of exceptions visible with
8904 signaling NaNs.  This option implies @option{-ftrapping-math}.
8906 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8907 be defined.
8909 The default is @option{-fno-signaling-nans}.
8911 This option is experimental and does not currently guarantee to
8912 disable all GCC optimizations that affect signaling NaN behavior.
8914 @item -fsingle-precision-constant
8915 @opindex fsingle-precision-constant
8916 Treat floating-point constants as single precision instead of
8917 implicitly converting them to double-precision constants.
8919 @item -fcx-limited-range
8920 @opindex fcx-limited-range
8921 When enabled, this option states that a range reduction step is not
8922 needed when performing complex division.  Also, there is no checking
8923 whether the result of a complex multiplication or division is @code{NaN
8924 + I*NaN}, with an attempt to rescue the situation in that case.  The
8925 default is @option{-fno-cx-limited-range}, but is enabled by
8926 @option{-ffast-math}.
8928 This option controls the default setting of the ISO C99
8929 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8930 all languages.
8932 @item -fcx-fortran-rules
8933 @opindex fcx-fortran-rules
8934 Complex multiplication and division follow Fortran rules.  Range
8935 reduction is done as part of complex division, but there is no checking
8936 whether the result of a complex multiplication or division is @code{NaN
8937 + I*NaN}, with an attempt to rescue the situation in that case.
8939 The default is @option{-fno-cx-fortran-rules}.
8941 @end table
8943 The following options control optimizations that may improve
8944 performance, but are not enabled by any @option{-O} options.  This
8945 section includes experimental options that may produce broken code.
8947 @table @gcctabopt
8948 @item -fbranch-probabilities
8949 @opindex fbranch-probabilities
8950 After running a program compiled with @option{-fprofile-arcs}
8951 (@pxref{Debugging Options,, Options for Debugging Your Program or
8952 @command{gcc}}), you can compile it a second time using
8953 @option{-fbranch-probabilities}, to improve optimizations based on
8954 the number of times each branch was taken.  When a program
8955 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8956 counts to a file called @file{@var{sourcename}.gcda} for each source
8957 file.  The information in this data file is very dependent on the
8958 structure of the generated code, so you must use the same source code
8959 and the same optimization options for both compilations.
8961 With @option{-fbranch-probabilities}, GCC puts a
8962 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8963 These can be used to improve optimization.  Currently, they are only
8964 used in one place: in @file{reorg.c}, instead of guessing which path a
8965 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8966 exactly determine which path is taken more often.
8968 @item -fprofile-values
8969 @opindex fprofile-values
8970 If combined with @option{-fprofile-arcs}, it adds code so that some
8971 data about values of expressions in the program is gathered.
8973 With @option{-fbranch-probabilities}, it reads back the data gathered
8974 from profiling values of expressions for usage in optimizations.
8976 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8978 @item -fvpt
8979 @opindex fvpt
8980 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8981 to add code to gather information about values of expressions.
8983 With @option{-fbranch-probabilities}, it reads back the data gathered
8984 and actually performs the optimizations based on them.
8985 Currently the optimizations include specialization of division operations
8986 using the knowledge about the value of the denominator.
8988 @item -frename-registers
8989 @opindex frename-registers
8990 Attempt to avoid false dependencies in scheduled code by making use
8991 of registers left over after register allocation.  This optimization
8992 most benefits processors with lots of registers.  Depending on the
8993 debug information format adopted by the target, however, it can
8994 make debugging impossible, since variables no longer stay in
8995 a ``home register''.
8997 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8999 @item -ftracer
9000 @opindex ftracer
9001 Perform tail duplication to enlarge superblock size.  This transformation
9002 simplifies the control flow of the function allowing other optimizations to do
9003 a better job.
9005 Enabled with @option{-fprofile-use}.
9007 @item -funroll-loops
9008 @opindex funroll-loops
9009 Unroll loops whose number of iterations can be determined at compile time or
9010 upon entry to the loop.  @option{-funroll-loops} implies
9011 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9012 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9013 a small constant number of iterations).  This option makes code larger, and may
9014 or may not make it run faster.
9016 Enabled with @option{-fprofile-use}.
9018 @item -funroll-all-loops
9019 @opindex funroll-all-loops
9020 Unroll all loops, even if their number of iterations is uncertain when
9021 the loop is entered.  This usually makes programs run more slowly.
9022 @option{-funroll-all-loops} implies the same options as
9023 @option{-funroll-loops}.
9025 @item -fpeel-loops
9026 @opindex fpeel-loops
9027 Peels loops for which there is enough information that they do not
9028 roll much (from profile feedback).  It also turns on complete loop peeling
9029 (i.e.@: complete removal of loops with small constant number of iterations).
9031 Enabled with @option{-fprofile-use}.
9033 @item -fmove-loop-invariants
9034 @opindex fmove-loop-invariants
9035 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9036 at level @option{-O1}
9038 @item -funswitch-loops
9039 @opindex funswitch-loops
9040 Move branches with loop invariant conditions out of the loop, with duplicates
9041 of the loop on both branches (modified according to result of the condition).
9043 @item -ffunction-sections
9044 @itemx -fdata-sections
9045 @opindex ffunction-sections
9046 @opindex fdata-sections
9047 Place each function or data item into its own section in the output
9048 file if the target supports arbitrary sections.  The name of the
9049 function or the name of the data item determines the section's name
9050 in the output file.
9052 Use these options on systems where the linker can perform optimizations
9053 to improve locality of reference in the instruction space.  Most systems
9054 using the ELF object format and SPARC processors running Solaris 2 have
9055 linkers with such optimizations.  AIX may have these optimizations in
9056 the future.
9058 Only use these options when there are significant benefits from doing
9059 so.  When you specify these options, the assembler and linker
9060 create larger object and executable files and are also slower.
9061 You cannot use @code{gprof} on all systems if you
9062 specify this option, and you may have problems with debugging if
9063 you specify both this option and @option{-g}.
9065 @item -fbranch-target-load-optimize
9066 @opindex fbranch-target-load-optimize
9067 Perform branch target register load optimization before prologue / epilogue
9068 threading.
9069 The use of target registers can typically be exposed only during reload,
9070 thus hoisting loads out of loops and doing inter-block scheduling needs
9071 a separate optimization pass.
9073 @item -fbranch-target-load-optimize2
9074 @opindex fbranch-target-load-optimize2
9075 Perform branch target register load optimization after prologue / epilogue
9076 threading.
9078 @item -fbtr-bb-exclusive
9079 @opindex fbtr-bb-exclusive
9080 When performing branch target register load optimization, don't reuse
9081 branch target registers within any basic block.
9083 @item -fstack-protector
9084 @opindex fstack-protector
9085 Emit extra code to check for buffer overflows, such as stack smashing
9086 attacks.  This is done by adding a guard variable to functions with
9087 vulnerable objects.  This includes functions that call @code{alloca}, and
9088 functions with buffers larger than 8 bytes.  The guards are initialized
9089 when a function is entered and then checked when the function exits.
9090 If a guard check fails, an error message is printed and the program exits.
9092 @item -fstack-protector-all
9093 @opindex fstack-protector-all
9094 Like @option{-fstack-protector} except that all functions are protected.
9096 @item -fstack-protector-strong
9097 @opindex fstack-protector-strong
9098 Like @option{-fstack-protector} but includes additional functions to
9099 be protected --- those that have local array definitions, or have
9100 references to local frame addresses.
9102 @item -fsection-anchors
9103 @opindex fsection-anchors
9104 Try to reduce the number of symbolic address calculations by using
9105 shared ``anchor'' symbols to address nearby objects.  This transformation
9106 can help to reduce the number of GOT entries and GOT accesses on some
9107 targets.
9109 For example, the implementation of the following function @code{foo}:
9111 @smallexample
9112 static int a, b, c;
9113 int foo (void) @{ return a + b + c; @}
9114 @end smallexample
9116 @noindent
9117 usually calculates the addresses of all three variables, but if you
9118 compile it with @option{-fsection-anchors}, it accesses the variables
9119 from a common anchor point instead.  The effect is similar to the
9120 following pseudocode (which isn't valid C):
9122 @smallexample
9123 int foo (void)
9125   register int *xr = &x;
9126   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9128 @end smallexample
9130 Not all targets support this option.
9132 @item --param @var{name}=@var{value}
9133 @opindex param
9134 In some places, GCC uses various constants to control the amount of
9135 optimization that is done.  For example, GCC does not inline functions
9136 that contain more than a certain number of instructions.  You can
9137 control some of these constants on the command line using the
9138 @option{--param} option.
9140 The names of specific parameters, and the meaning of the values, are
9141 tied to the internals of the compiler, and are subject to change
9142 without notice in future releases.
9144 In each case, the @var{value} is an integer.  The allowable choices for
9145 @var{name} are:
9147 @table @gcctabopt
9148 @item predictable-branch-outcome
9149 When branch is predicted to be taken with probability lower than this threshold
9150 (in percent), then it is considered well predictable. The default is 10.
9152 @item max-crossjump-edges
9153 The maximum number of incoming edges to consider for cross-jumping.
9154 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9155 the number of edges incoming to each block.  Increasing values mean
9156 more aggressive optimization, making the compilation time increase with
9157 probably small improvement in executable size.
9159 @item min-crossjump-insns
9160 The minimum number of instructions that must be matched at the end
9161 of two blocks before cross-jumping is performed on them.  This
9162 value is ignored in the case where all instructions in the block being
9163 cross-jumped from are matched.  The default value is 5.
9165 @item max-grow-copy-bb-insns
9166 The maximum code size expansion factor when copying basic blocks
9167 instead of jumping.  The expansion is relative to a jump instruction.
9168 The default value is 8.
9170 @item max-goto-duplication-insns
9171 The maximum number of instructions to duplicate to a block that jumps
9172 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9173 passes, GCC factors computed gotos early in the compilation process,
9174 and unfactors them as late as possible.  Only computed jumps at the
9175 end of a basic blocks with no more than max-goto-duplication-insns are
9176 unfactored.  The default value is 8.
9178 @item max-delay-slot-insn-search
9179 The maximum number of instructions to consider when looking for an
9180 instruction to fill a delay slot.  If more than this arbitrary number of
9181 instructions are searched, the time savings from filling the delay slot
9182 are minimal, so stop searching.  Increasing values mean more
9183 aggressive optimization, making the compilation time increase with probably
9184 small improvement in execution time.
9186 @item max-delay-slot-live-search
9187 When trying to fill delay slots, the maximum number of instructions to
9188 consider when searching for a block with valid live register
9189 information.  Increasing this arbitrarily chosen value means more
9190 aggressive optimization, increasing the compilation time.  This parameter
9191 should be removed when the delay slot code is rewritten to maintain the
9192 control-flow graph.
9194 @item max-gcse-memory
9195 The approximate maximum amount of memory that can be allocated in
9196 order to perform the global common subexpression elimination
9197 optimization.  If more memory than specified is required, the
9198 optimization is not done.
9200 @item max-gcse-insertion-ratio
9201 If the ratio of expression insertions to deletions is larger than this value
9202 for any expression, then RTL PRE inserts or removes the expression and thus
9203 leaves partially redundant computations in the instruction stream.  The default value is 20.
9205 @item max-pending-list-length
9206 The maximum number of pending dependencies scheduling allows
9207 before flushing the current state and starting over.  Large functions
9208 with few branches or calls can create excessively large lists which
9209 needlessly consume memory and resources.
9211 @item max-modulo-backtrack-attempts
9212 The maximum number of backtrack attempts the scheduler should make
9213 when modulo scheduling a loop.  Larger values can exponentially increase
9214 compilation time.
9216 @item max-inline-insns-single
9217 Several parameters control the tree inliner used in GCC@.
9218 This number sets the maximum number of instructions (counted in GCC's
9219 internal representation) in a single function that the tree inliner
9220 considers for inlining.  This only affects functions declared
9221 inline and methods implemented in a class declaration (C++).
9222 The default value is 400.
9224 @item max-inline-insns-auto
9225 When you use @option{-finline-functions} (included in @option{-O3}),
9226 a lot of functions that would otherwise not be considered for inlining
9227 by the compiler are investigated.  To those functions, a different
9228 (more restrictive) limit compared to functions declared inline can
9229 be applied.
9230 The default value is 40.
9232 @item inline-min-speedup
9233 When estimated performance improvement of caller + callee runtime exceeds this
9234 threshold (in precent), the function can be inlined regardless the limit on
9235 @option{--param max-inline-insns-single} and @option{--param
9236 max-inline-insns-auto}.
9238 @item large-function-insns
9239 The limit specifying really large functions.  For functions larger than this
9240 limit after inlining, inlining is constrained by
9241 @option{--param large-function-growth}.  This parameter is useful primarily
9242 to avoid extreme compilation time caused by non-linear algorithms used by the
9243 back end.
9244 The default value is 2700.
9246 @item large-function-growth
9247 Specifies maximal growth of large function caused by inlining in percents.
9248 The default value is 100 which limits large function growth to 2.0 times
9249 the original size.
9251 @item large-unit-insns
9252 The limit specifying large translation unit.  Growth caused by inlining of
9253 units larger than this limit is limited by @option{--param inline-unit-growth}.
9254 For small units this might be too tight.
9255 For example, consider a unit consisting of function A
9256 that is inline and B that just calls A three times.  If B is small relative to
9257 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9258 large units consisting of small inlineable functions, however, the overall unit
9259 growth limit is needed to avoid exponential explosion of code size.  Thus for
9260 smaller units, the size is increased to @option{--param large-unit-insns}
9261 before applying @option{--param inline-unit-growth}.  The default is 10000.
9263 @item inline-unit-growth
9264 Specifies maximal overall growth of the compilation unit caused by inlining.
9265 The default value is 30 which limits unit growth to 1.3 times the original
9266 size.
9268 @item ipcp-unit-growth
9269 Specifies maximal overall growth of the compilation unit caused by
9270 interprocedural constant propagation.  The default value is 10 which limits
9271 unit growth to 1.1 times the original size.
9273 @item large-stack-frame
9274 The limit specifying large stack frames.  While inlining the algorithm is trying
9275 to not grow past this limit too much.  The default value is 256 bytes.
9277 @item large-stack-frame-growth
9278 Specifies maximal growth of large stack frames caused by inlining in percents.
9279 The default value is 1000 which limits large stack frame growth to 11 times
9280 the original size.
9282 @item max-inline-insns-recursive
9283 @itemx max-inline-insns-recursive-auto
9284 Specifies the maximum number of instructions an out-of-line copy of a
9285 self-recursive inline
9286 function can grow into by performing recursive inlining.
9288 For functions declared inline, @option{--param max-inline-insns-recursive} is
9289 taken into account.  For functions not declared inline, recursive inlining
9290 happens only when @option{-finline-functions} (included in @option{-O3}) is
9291 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9292 default value is 450.
9294 @item max-inline-recursive-depth
9295 @itemx max-inline-recursive-depth-auto
9296 Specifies the maximum recursion depth used for recursive inlining.
9298 For functions declared inline, @option{--param max-inline-recursive-depth} is
9299 taken into account.  For functions not declared inline, recursive inlining
9300 happens only when @option{-finline-functions} (included in @option{-O3}) is
9301 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9302 default value is 8.
9304 @item min-inline-recursive-probability
9305 Recursive inlining is profitable only for function having deep recursion
9306 in average and can hurt for function having little recursion depth by
9307 increasing the prologue size or complexity of function body to other
9308 optimizers.
9310 When profile feedback is available (see @option{-fprofile-generate}) the actual
9311 recursion depth can be guessed from probability that function recurses via a
9312 given call expression.  This parameter limits inlining only to call expressions
9313 whose probability exceeds the given threshold (in percents).
9314 The default value is 10.
9316 @item early-inlining-insns
9317 Specify growth that the early inliner can make.  In effect it increases
9318 the amount of inlining for code having a large abstraction penalty.
9319 The default value is 10.
9321 @item max-early-inliner-iterations
9322 @itemx max-early-inliner-iterations
9323 Limit of iterations of the early inliner.  This basically bounds
9324 the number of nested indirect calls the early inliner can resolve.
9325 Deeper chains are still handled by late inlining.
9327 @item comdat-sharing-probability
9328 @itemx comdat-sharing-probability
9329 Probability (in percent) that C++ inline function with comdat visibility
9330 are shared across multiple compilation units.  The default value is 20.
9332 @item min-vect-loop-bound
9333 The minimum number of iterations under which loops are not vectorized
9334 when @option{-ftree-vectorize} is used.  The number of iterations after
9335 vectorization needs to be greater than the value specified by this option
9336 to allow vectorization.  The default value is 0.
9338 @item gcse-cost-distance-ratio
9339 Scaling factor in calculation of maximum distance an expression
9340 can be moved by GCSE optimizations.  This is currently supported only in the
9341 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9342 is with simple expressions, i.e., the expressions that have cost
9343 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9344 hoisting of simple expressions.  The default value is 10.
9346 @item gcse-unrestricted-cost
9347 Cost, roughly measured as the cost of a single typical machine
9348 instruction, at which GCSE optimizations do not constrain
9349 the distance an expression can travel.  This is currently
9350 supported only in the code hoisting pass.  The lesser the cost,
9351 the more aggressive code hoisting is.  Specifying 0 
9352 allows all expressions to travel unrestricted distances.
9353 The default value is 3.
9355 @item max-hoist-depth
9356 The depth of search in the dominator tree for expressions to hoist.
9357 This is used to avoid quadratic behavior in hoisting algorithm.
9358 The value of 0 does not limit on the search, but may slow down compilation
9359 of huge functions.  The default value is 30.
9361 @item max-tail-merge-comparisons
9362 The maximum amount of similar bbs to compare a bb with.  This is used to
9363 avoid quadratic behavior in tree tail merging.  The default value is 10.
9365 @item max-tail-merge-iterations
9366 The maximum amount of iterations of the pass over the function.  This is used to
9367 limit compilation time in tree tail merging.  The default value is 2.
9369 @item max-unrolled-insns
9370 The maximum number of instructions that a loop may have to be unrolled.
9371 If a loop is unrolled, this parameter also determines how many times
9372 the loop code is unrolled.
9374 @item max-average-unrolled-insns
9375 The maximum number of instructions biased by probabilities of their execution
9376 that a loop may have to be unrolled.  If a loop is unrolled,
9377 this parameter also determines how many times the loop code is unrolled.
9379 @item max-unroll-times
9380 The maximum number of unrollings of a single loop.
9382 @item max-peeled-insns
9383 The maximum number of instructions that a loop may have to be peeled.
9384 If a loop is peeled, this parameter also determines how many times
9385 the loop code is peeled.
9387 @item max-peel-times
9388 The maximum number of peelings of a single loop.
9390 @item max-peel-branches
9391 The maximum number of branches on the hot path through the peeled sequence.
9393 @item max-completely-peeled-insns
9394 The maximum number of insns of a completely peeled loop.
9396 @item max-completely-peel-times
9397 The maximum number of iterations of a loop to be suitable for complete peeling.
9399 @item max-completely-peel-loop-nest-depth
9400 The maximum depth of a loop nest suitable for complete peeling.
9402 @item max-unswitch-insns
9403 The maximum number of insns of an unswitched loop.
9405 @item max-unswitch-level
9406 The maximum number of branches unswitched in a single loop.
9408 @item lim-expensive
9409 The minimum cost of an expensive expression in the loop invariant motion.
9411 @item iv-consider-all-candidates-bound
9412 Bound on number of candidates for induction variables, below which
9413 all candidates are considered for each use in induction variable
9414 optimizations.  If there are more candidates than this,
9415 only the most relevant ones are considered to avoid quadratic time complexity.
9417 @item iv-max-considered-uses
9418 The induction variable optimizations give up on loops that contain more
9419 induction variable uses.
9421 @item iv-always-prune-cand-set-bound
9422 If the number of candidates in the set is smaller than this value,
9423 always try to remove unnecessary ivs from the set
9424 when adding a new one.
9426 @item scev-max-expr-size
9427 Bound on size of expressions used in the scalar evolutions analyzer.
9428 Large expressions slow the analyzer.
9430 @item scev-max-expr-complexity
9431 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9432 Complex expressions slow the analyzer.
9434 @item omega-max-vars
9435 The maximum number of variables in an Omega constraint system.
9436 The default value is 128.
9438 @item omega-max-geqs
9439 The maximum number of inequalities in an Omega constraint system.
9440 The default value is 256.
9442 @item omega-max-eqs
9443 The maximum number of equalities in an Omega constraint system.
9444 The default value is 128.
9446 @item omega-max-wild-cards
9447 The maximum number of wildcard variables that the Omega solver is
9448 able to insert.  The default value is 18.
9450 @item omega-hash-table-size
9451 The size of the hash table in the Omega solver.  The default value is
9452 550.
9454 @item omega-max-keys
9455 The maximal number of keys used by the Omega solver.  The default
9456 value is 500.
9458 @item omega-eliminate-redundant-constraints
9459 When set to 1, use expensive methods to eliminate all redundant
9460 constraints.  The default value is 0.
9462 @item vect-max-version-for-alignment-checks
9463 The maximum number of run-time checks that can be performed when
9464 doing loop versioning for alignment in the vectorizer. 
9466 @item vect-max-version-for-alias-checks
9467 The maximum number of run-time checks that can be performed when
9468 doing loop versioning for alias in the vectorizer. 
9470 @item vect-max-peeling-for-alignment
9471 The maximum number of loop peels to enhance access alignment
9472 for vectorizer. Value -1 means 'no limit'.
9474 @item max-iterations-to-track
9475 The maximum number of iterations of a loop the brute-force algorithm
9476 for analysis of the number of iterations of the loop tries to evaluate.
9478 @item hot-bb-count-ws-permille
9479 A basic block profile count is considered hot if it contributes to 
9480 the given permillage (i.e. 0...1000) of the entire profiled execution.
9482 @item hot-bb-frequency-fraction
9483 Select fraction of the entry block frequency of executions of basic block in
9484 function given basic block needs to have to be considered hot.
9486 @item max-predicted-iterations
9487 The maximum number of loop iterations we predict statically.  This is useful
9488 in cases where a function contains a single loop with known bound and
9489 another loop with unknown bound.
9490 The known number of iterations is predicted correctly, while
9491 the unknown number of iterations average to roughly 10.  This means that the
9492 loop without bounds appears artificially cold relative to the other one.
9494 @item align-threshold
9496 Select fraction of the maximal frequency of executions of a basic block in
9497 a function to align the basic block.
9499 @item align-loop-iterations
9501 A loop expected to iterate at least the selected number of iterations is
9502 aligned.
9504 @item tracer-dynamic-coverage
9505 @itemx tracer-dynamic-coverage-feedback
9507 This value is used to limit superblock formation once the given percentage of
9508 executed instructions is covered.  This limits unnecessary code size
9509 expansion.
9511 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9512 feedback is available.  The real profiles (as opposed to statically estimated
9513 ones) are much less balanced allowing the threshold to be larger value.
9515 @item tracer-max-code-growth
9516 Stop tail duplication once code growth has reached given percentage.  This is
9517 a rather artificial limit, as most of the duplicates are eliminated later in
9518 cross jumping, so it may be set to much higher values than is the desired code
9519 growth.
9521 @item tracer-min-branch-ratio
9523 Stop reverse growth when the reverse probability of best edge is less than this
9524 threshold (in percent).
9526 @item tracer-min-branch-ratio
9527 @itemx tracer-min-branch-ratio-feedback
9529 Stop forward growth if the best edge has probability lower than this
9530 threshold.
9532 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9533 compilation for profile feedback and one for compilation without.  The value
9534 for compilation with profile feedback needs to be more conservative (higher) in
9535 order to make tracer effective.
9537 @item max-cse-path-length
9539 The maximum number of basic blocks on path that CSE considers.
9540 The default is 10.
9542 @item max-cse-insns
9543 The maximum number of instructions CSE processes before flushing.
9544 The default is 1000.
9546 @item ggc-min-expand
9548 GCC uses a garbage collector to manage its own memory allocation.  This
9549 parameter specifies the minimum percentage by which the garbage
9550 collector's heap should be allowed to expand between collections.
9551 Tuning this may improve compilation speed; it has no effect on code
9552 generation.
9554 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9555 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9556 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9557 GCC is not able to calculate RAM on a particular platform, the lower
9558 bound of 30% is used.  Setting this parameter and
9559 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9560 every opportunity.  This is extremely slow, but can be useful for
9561 debugging.
9563 @item ggc-min-heapsize
9565 Minimum size of the garbage collector's heap before it begins bothering
9566 to collect garbage.  The first collection occurs after the heap expands
9567 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9568 tuning this may improve compilation speed, and has no effect on code
9569 generation.
9571 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9572 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9573 with a lower bound of 4096 (four megabytes) and an upper bound of
9574 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9575 particular platform, the lower bound is used.  Setting this parameter
9576 very large effectively disables garbage collection.  Setting this
9577 parameter and @option{ggc-min-expand} to zero causes a full collection
9578 to occur at every opportunity.
9580 @item max-reload-search-insns
9581 The maximum number of instruction reload should look backward for equivalent
9582 register.  Increasing values mean more aggressive optimization, making the
9583 compilation time increase with probably slightly better performance.
9584 The default value is 100.
9586 @item max-cselib-memory-locations
9587 The maximum number of memory locations cselib should take into account.
9588 Increasing values mean more aggressive optimization, making the compilation time
9589 increase with probably slightly better performance.  The default value is 500.
9591 @item reorder-blocks-duplicate
9592 @itemx reorder-blocks-duplicate-feedback
9594 Used by the basic block reordering pass to decide whether to use unconditional
9595 branch or duplicate the code on its destination.  Code is duplicated when its
9596 estimated size is smaller than this value multiplied by the estimated size of
9597 unconditional jump in the hot spots of the program.
9599 The @option{reorder-block-duplicate-feedback} is used only when profile
9600 feedback is available.  It may be set to higher values than
9601 @option{reorder-block-duplicate} since information about the hot spots is more
9602 accurate.
9604 @item max-sched-ready-insns
9605 The maximum number of instructions ready to be issued the scheduler should
9606 consider at any given time during the first scheduling pass.  Increasing
9607 values mean more thorough searches, making the compilation time increase
9608 with probably little benefit.  The default value is 100.
9610 @item max-sched-region-blocks
9611 The maximum number of blocks in a region to be considered for
9612 interblock scheduling.  The default value is 10.
9614 @item max-pipeline-region-blocks
9615 The maximum number of blocks in a region to be considered for
9616 pipelining in the selective scheduler.  The default value is 15.
9618 @item max-sched-region-insns
9619 The maximum number of insns in a region to be considered for
9620 interblock scheduling.  The default value is 100.
9622 @item max-pipeline-region-insns
9623 The maximum number of insns in a region to be considered for
9624 pipelining in the selective scheduler.  The default value is 200.
9626 @item min-spec-prob
9627 The minimum probability (in percents) of reaching a source block
9628 for interblock speculative scheduling.  The default value is 40.
9630 @item max-sched-extend-regions-iters
9631 The maximum number of iterations through CFG to extend regions.
9632 A value of 0 (the default) disables region extensions.
9634 @item max-sched-insn-conflict-delay
9635 The maximum conflict delay for an insn to be considered for speculative motion.
9636 The default value is 3.
9638 @item sched-spec-prob-cutoff
9639 The minimal probability of speculation success (in percents), so that
9640 speculative insns are scheduled.
9641 The default value is 40.
9643 @item sched-spec-state-edge-prob-cutoff
9644 The minimum probability an edge must have for the scheduler to save its
9645 state across it.
9646 The default value is 10.
9648 @item sched-mem-true-dep-cost
9649 Minimal distance (in CPU cycles) between store and load targeting same
9650 memory locations.  The default value is 1.
9652 @item selsched-max-lookahead
9653 The maximum size of the lookahead window of selective scheduling.  It is a
9654 depth of search for available instructions.
9655 The default value is 50.
9657 @item selsched-max-sched-times
9658 The maximum number of times that an instruction is scheduled during
9659 selective scheduling.  This is the limit on the number of iterations
9660 through which the instruction may be pipelined.  The default value is 2.
9662 @item selsched-max-insns-to-rename
9663 The maximum number of best instructions in the ready list that are considered
9664 for renaming in the selective scheduler.  The default value is 2.
9666 @item sms-min-sc
9667 The minimum value of stage count that swing modulo scheduler
9668 generates.  The default value is 2.
9670 @item max-last-value-rtl
9671 The maximum size measured as number of RTLs that can be recorded in an expression
9672 in combiner for a pseudo register as last known value of that register.  The default
9673 is 10000.
9675 @item integer-share-limit
9676 Small integer constants can use a shared data structure, reducing the
9677 compiler's memory usage and increasing its speed.  This sets the maximum
9678 value of a shared integer constant.  The default value is 256.
9680 @item ssp-buffer-size
9681 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9682 protection when @option{-fstack-protection} is used.
9684 @item max-jump-thread-duplication-stmts
9685 Maximum number of statements allowed in a block that needs to be
9686 duplicated when threading jumps.
9688 @item max-fields-for-field-sensitive
9689 Maximum number of fields in a structure treated in
9690 a field sensitive manner during pointer analysis.  The default is zero
9691 for @option{-O0} and @option{-O1},
9692 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9694 @item prefetch-latency
9695 Estimate on average number of instructions that are executed before
9696 prefetch finishes.  The distance prefetched ahead is proportional
9697 to this constant.  Increasing this number may also lead to less
9698 streams being prefetched (see @option{simultaneous-prefetches}).
9700 @item simultaneous-prefetches
9701 Maximum number of prefetches that can run at the same time.
9703 @item l1-cache-line-size
9704 The size of cache line in L1 cache, in bytes.
9706 @item l1-cache-size
9707 The size of L1 cache, in kilobytes.
9709 @item l2-cache-size
9710 The size of L2 cache, in kilobytes.
9712 @item min-insn-to-prefetch-ratio
9713 The minimum ratio between the number of instructions and the
9714 number of prefetches to enable prefetching in a loop.
9716 @item prefetch-min-insn-to-mem-ratio
9717 The minimum ratio between the number of instructions and the
9718 number of memory references to enable prefetching in a loop.
9720 @item use-canonical-types
9721 Whether the compiler should use the ``canonical'' type system.  By
9722 default, this should always be 1, which uses a more efficient internal
9723 mechanism for comparing types in C++ and Objective-C++.  However, if
9724 bugs in the canonical type system are causing compilation failures,
9725 set this value to 0 to disable canonical types.
9727 @item switch-conversion-max-branch-ratio
9728 Switch initialization conversion refuses to create arrays that are
9729 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9730 branches in the switch.
9732 @item max-partial-antic-length
9733 Maximum length of the partial antic set computed during the tree
9734 partial redundancy elimination optimization (@option{-ftree-pre}) when
9735 optimizing at @option{-O3} and above.  For some sorts of source code
9736 the enhanced partial redundancy elimination optimization can run away,
9737 consuming all of the memory available on the host machine.  This
9738 parameter sets a limit on the length of the sets that are computed,
9739 which prevents the runaway behavior.  Setting a value of 0 for
9740 this parameter allows an unlimited set length.
9742 @item sccvn-max-scc-size
9743 Maximum size of a strongly connected component (SCC) during SCCVN
9744 processing.  If this limit is hit, SCCVN processing for the whole
9745 function is not done and optimizations depending on it are
9746 disabled.  The default maximum SCC size is 10000.
9748 @item sccvn-max-alias-queries-per-access
9749 Maximum number of alias-oracle queries we perform when looking for
9750 redundancies for loads and stores.  If this limit is hit the search
9751 is aborted and the load or store is not considered redundant.  The
9752 number of queries is algorithmically limited to the number of
9753 stores on all paths from the load to the function entry.
9754 The default maxmimum number of queries is 1000.
9756 @item ira-max-loops-num
9757 IRA uses regional register allocation by default.  If a function
9758 contains more loops than the number given by this parameter, only at most
9759 the given number of the most frequently-executed loops form regions
9760 for regional register allocation.  The default value of the
9761 parameter is 100.
9763 @item ira-max-conflict-table-size 
9764 Although IRA uses a sophisticated algorithm to compress the conflict
9765 table, the table can still require excessive amounts of memory for
9766 huge functions.  If the conflict table for a function could be more
9767 than the size in MB given by this parameter, the register allocator
9768 instead uses a faster, simpler, and lower-quality
9769 algorithm that does not require building a pseudo-register conflict table.  
9770 The default value of the parameter is 2000.
9772 @item ira-loop-reserved-regs
9773 IRA can be used to evaluate more accurate register pressure in loops
9774 for decisions to move loop invariants (see @option{-O3}).  The number
9775 of available registers reserved for some other purposes is given
9776 by this parameter.  The default value of the parameter is 2, which is
9777 the minimal number of registers needed by typical instructions.
9778 This value is the best found from numerous experiments.
9780 @item loop-invariant-max-bbs-in-loop
9781 Loop invariant motion can be very expensive, both in compilation time and
9782 in amount of needed compile-time memory, with very large loops.  Loops
9783 with more basic blocks than this parameter won't have loop invariant
9784 motion optimization performed on them.  The default value of the
9785 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9787 @item loop-max-datarefs-for-datadeps
9788 Building data dapendencies is expensive for very large loops.  This
9789 parameter limits the number of data references in loops that are
9790 considered for data dependence analysis.  These large loops are no
9791 handled by the optimizations using loop data dependencies.
9792 The default value is 1000.
9794 @item max-vartrack-size
9795 Sets a maximum number of hash table slots to use during variable
9796 tracking dataflow analysis of any function.  If this limit is exceeded
9797 with variable tracking at assignments enabled, analysis for that
9798 function is retried without it, after removing all debug insns from
9799 the function.  If the limit is exceeded even without debug insns, var
9800 tracking analysis is completely disabled for the function.  Setting
9801 the parameter to zero makes it unlimited.
9803 @item max-vartrack-expr-depth
9804 Sets a maximum number of recursion levels when attempting to map
9805 variable names or debug temporaries to value expressions.  This trades
9806 compilation time for more complete debug information.  If this is set too
9807 low, value expressions that are available and could be represented in
9808 debug information may end up not being used; setting this higher may
9809 enable the compiler to find more complex debug expressions, but compile
9810 time and memory use may grow.  The default is 12.
9812 @item min-nondebug-insn-uid
9813 Use uids starting at this parameter for nondebug insns.  The range below
9814 the parameter is reserved exclusively for debug insns created by
9815 @option{-fvar-tracking-assignments}, but debug insns may get
9816 (non-overlapping) uids above it if the reserved range is exhausted.
9818 @item ipa-sra-ptr-growth-factor
9819 IPA-SRA replaces a pointer to an aggregate with one or more new
9820 parameters only when their cumulative size is less or equal to
9821 @option{ipa-sra-ptr-growth-factor} times the size of the original
9822 pointer parameter.
9824 @item tm-max-aggregate-size
9825 When making copies of thread-local variables in a transaction, this
9826 parameter specifies the size in bytes after which variables are
9827 saved with the logging functions as opposed to save/restore code
9828 sequence pairs.  This option only applies when using
9829 @option{-fgnu-tm}.
9831 @item graphite-max-nb-scop-params
9832 To avoid exponential effects in the Graphite loop transforms, the
9833 number of parameters in a Static Control Part (SCoP) is bounded.  The
9834 default value is 10 parameters.  A variable whose value is unknown at
9835 compilation time and defined outside a SCoP is a parameter of the SCoP.
9837 @item graphite-max-bbs-per-function
9838 To avoid exponential effects in the detection of SCoPs, the size of
9839 the functions analyzed by Graphite is bounded.  The default value is
9840 100 basic blocks.
9842 @item loop-block-tile-size
9843 Loop blocking or strip mining transforms, enabled with
9844 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9845 loop in the loop nest by a given number of iterations.  The strip
9846 length can be changed using the @option{loop-block-tile-size}
9847 parameter.  The default value is 51 iterations.
9849 @item ipa-cp-value-list-size
9850 IPA-CP attempts to track all possible values and types passed to a function's
9851 parameter in order to propagate them and perform devirtualization.
9852 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9853 stores per one formal parameter of a function.
9855 @item lto-partitions
9856 Specify desired number of partitions produced during WHOPR compilation.
9857 The number of partitions should exceed the number of CPUs used for compilation.
9858 The default value is 32.
9860 @item lto-minpartition
9861 Size of minimal partition for WHOPR (in estimated instructions).
9862 This prevents expenses of splitting very small programs into too many
9863 partitions.
9865 @item cxx-max-namespaces-for-diagnostic-help
9866 The maximum number of namespaces to consult for suggestions when C++
9867 name lookup fails for an identifier.  The default is 1000.
9869 @item sink-frequency-threshold
9870 The maximum relative execution frequency (in percents) of the target block
9871 relative to a statement's original block to allow statement sinking of a
9872 statement.  Larger numbers result in more aggressive statement sinking.
9873 The default value is 75.  A small positive adjustment is applied for
9874 statements with memory operands as those are even more profitable so sink.
9876 @item max-stores-to-sink
9877 The maximum number of conditional stores paires that can be sunk.  Set to 0
9878 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9879 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9881 @item allow-load-data-races
9882 Allow optimizers to introduce new data races on loads.
9883 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9884 unless implicitly set by the @option{-fmemory-model=} option.
9886 @item allow-store-data-races
9887 Allow optimizers to introduce new data races on stores.
9888 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9889 unless implicitly set by the @option{-fmemory-model=} option.
9891 @item allow-packed-load-data-races
9892 Allow optimizers to introduce new data races on packed data loads.
9893 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9894 unless implicitly set by the @option{-fmemory-model=} option.
9896 @item allow-packed-store-data-races
9897 Allow optimizers to introduce new data races on packed data stores.
9898 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9899 unless implicitly set by the @option{-fmemory-model=} option.
9901 @item case-values-threshold
9902 The smallest number of different values for which it is best to use a
9903 jump-table instead of a tree of conditional branches.  If the value is
9904 0, use the default for the machine.  The default is 0.
9906 @item tree-reassoc-width
9907 Set the maximum number of instructions executed in parallel in
9908 reassociated tree. This parameter overrides target dependent
9909 heuristics used by default if has non zero value.
9911 @item sched-pressure-algorithm
9912 Choose between the two available implementations of
9913 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9914 and is the more likely to prevent instructions from being reordered.
9915 Algorithm 2 was designed to be a compromise between the relatively
9916 conservative approach taken by algorithm 1 and the rather aggressive
9917 approach taken by the default scheduler.  It relies more heavily on
9918 having a regular register file and accurate register pressure classes.
9919 See @file{haifa-sched.c} in the GCC sources for more details.
9921 The default choice depends on the target.
9923 @item max-slsr-cand-scan
9924 Set the maximum number of existing candidates that will be considered when
9925 seeking a basis for a new straight-line strength reduction candidate.
9927 @end table
9928 @end table
9930 @node Preprocessor Options
9931 @section Options Controlling the Preprocessor
9932 @cindex preprocessor options
9933 @cindex options, preprocessor
9935 These options control the C preprocessor, which is run on each C source
9936 file before actual compilation.
9938 If you use the @option{-E} option, nothing is done except preprocessing.
9939 Some of these options make sense only together with @option{-E} because
9940 they cause the preprocessor output to be unsuitable for actual
9941 compilation.
9943 @table @gcctabopt
9944 @item -Wp,@var{option}
9945 @opindex Wp
9946 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9947 and pass @var{option} directly through to the preprocessor.  If
9948 @var{option} contains commas, it is split into multiple options at the
9949 commas.  However, many options are modified, translated or interpreted
9950 by the compiler driver before being passed to the preprocessor, and
9951 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9952 interface is undocumented and subject to change, so whenever possible
9953 you should avoid using @option{-Wp} and let the driver handle the
9954 options instead.
9956 @item -Xpreprocessor @var{option}
9957 @opindex Xpreprocessor
9958 Pass @var{option} as an option to the preprocessor.  You can use this to
9959 supply system-specific preprocessor options that GCC does not 
9960 recognize.
9962 If you want to pass an option that takes an argument, you must use
9963 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9965 @item -no-integrated-cpp
9966 @opindex no-integrated-cpp
9967 Perform preprocessing as a separate pass before compilation.
9968 By default, GCC performs preprocessing as an integrated part of
9969 input tokenization and parsing.
9970 If this option is provided, the appropriate language front end
9971 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9972 and Objective-C, respectively) is instead invoked twice,
9973 once for preprocessing only and once for actual compilation
9974 of the preprocessed input.
9975 This option may be useful in conjunction with the @option{-B} or
9976 @option{-wrapper} options to specify an alternate preprocessor or
9977 perform additional processing of the program source between
9978 normal preprocessing and compilation.
9979 @end table
9981 @include cppopts.texi
9983 @node Assembler Options
9984 @section Passing Options to the Assembler
9986 @c prevent bad page break with this line
9987 You can pass options to the assembler.
9989 @table @gcctabopt
9990 @item -Wa,@var{option}
9991 @opindex Wa
9992 Pass @var{option} as an option to the assembler.  If @var{option}
9993 contains commas, it is split into multiple options at the commas.
9995 @item -Xassembler @var{option}
9996 @opindex Xassembler
9997 Pass @var{option} as an option to the assembler.  You can use this to
9998 supply system-specific assembler options that GCC does not
9999 recognize.
10001 If you want to pass an option that takes an argument, you must use
10002 @option{-Xassembler} twice, once for the option and once for the argument.
10004 @end table
10006 @node Link Options
10007 @section Options for Linking
10008 @cindex link options
10009 @cindex options, linking
10011 These options come into play when the compiler links object files into
10012 an executable output file.  They are meaningless if the compiler is
10013 not doing a link step.
10015 @table @gcctabopt
10016 @cindex file names
10017 @item @var{object-file-name}
10018 A file name that does not end in a special recognized suffix is
10019 considered to name an object file or library.  (Object files are
10020 distinguished from libraries by the linker according to the file
10021 contents.)  If linking is done, these object files are used as input
10022 to the linker.
10024 @item -c
10025 @itemx -S
10026 @itemx -E
10027 @opindex c
10028 @opindex S
10029 @opindex E
10030 If any of these options is used, then the linker is not run, and
10031 object file names should not be used as arguments.  @xref{Overall
10032 Options}.
10034 @cindex Libraries
10035 @item -l@var{library}
10036 @itemx -l @var{library}
10037 @opindex l
10038 Search the library named @var{library} when linking.  (The second
10039 alternative with the library as a separate argument is only for
10040 POSIX compliance and is not recommended.)
10042 It makes a difference where in the command you write this option; the
10043 linker searches and processes libraries and object files in the order they
10044 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10045 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10046 to functions in @samp{z}, those functions may not be loaded.
10048 The linker searches a standard list of directories for the library,
10049 which is actually a file named @file{lib@var{library}.a}.  The linker
10050 then uses this file as if it had been specified precisely by name.
10052 The directories searched include several standard system directories
10053 plus any that you specify with @option{-L}.
10055 Normally the files found this way are library files---archive files
10056 whose members are object files.  The linker handles an archive file by
10057 scanning through it for members which define symbols that have so far
10058 been referenced but not defined.  But if the file that is found is an
10059 ordinary object file, it is linked in the usual fashion.  The only
10060 difference between using an @option{-l} option and specifying a file name
10061 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10062 and searches several directories.
10064 @item -lobjc
10065 @opindex lobjc
10066 You need this special case of the @option{-l} option in order to
10067 link an Objective-C or Objective-C++ program.
10069 @item -nostartfiles
10070 @opindex nostartfiles
10071 Do not use the standard system startup files when linking.
10072 The standard system libraries are used normally, unless @option{-nostdlib}
10073 or @option{-nodefaultlibs} is used.
10075 @item -nodefaultlibs
10076 @opindex nodefaultlibs
10077 Do not use the standard system libraries when linking.
10078 Only the libraries you specify are passed to the linker, and options
10079 specifying linkage of the system libraries, such as @code{-static-libgcc}
10080 or @code{-shared-libgcc}, are ignored.  
10081 The standard startup files are used normally, unless @option{-nostartfiles}
10082 is used.  
10084 The compiler may generate calls to @code{memcmp},
10085 @code{memset}, @code{memcpy} and @code{memmove}.
10086 These entries are usually resolved by entries in
10087 libc.  These entry points should be supplied through some other
10088 mechanism when this option is specified.
10090 @item -nostdlib
10091 @opindex nostdlib
10092 Do not use the standard system startup files or libraries when linking.
10093 No startup files and only the libraries you specify are passed to
10094 the linker, and options specifying linkage of the system libraries, such as
10095 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10097 The compiler may generate calls to @code{memcmp}, @code{memset},
10098 @code{memcpy} and @code{memmove}.
10099 These entries are usually resolved by entries in
10100 libc.  These entry points should be supplied through some other
10101 mechanism when this option is specified.
10103 @cindex @option{-lgcc}, use with @option{-nostdlib}
10104 @cindex @option{-nostdlib} and unresolved references
10105 @cindex unresolved references and @option{-nostdlib}
10106 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10107 @cindex @option{-nodefaultlibs} and unresolved references
10108 @cindex unresolved references and @option{-nodefaultlibs}
10109 One of the standard libraries bypassed by @option{-nostdlib} and
10110 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10111 which GCC uses to overcome shortcomings of particular machines, or special
10112 needs for some languages.
10113 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10114 Collection (GCC) Internals},
10115 for more discussion of @file{libgcc.a}.)
10116 In most cases, you need @file{libgcc.a} even when you want to avoid
10117 other standard libraries.  In other words, when you specify @option{-nostdlib}
10118 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10119 This ensures that you have no unresolved references to internal GCC
10120 library subroutines.
10121 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10122 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10123 GNU Compiler Collection (GCC) Internals}.)
10125 @item -pie
10126 @opindex pie
10127 Produce a position independent executable on targets that support it.
10128 For predictable results, you must also specify the same set of options
10129 used for compilation (@option{-fpie}, @option{-fPIE},
10130 or model suboptions) when you specify this linker option.
10132 @item -rdynamic
10133 @opindex rdynamic
10134 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10135 that support it. This instructs the linker to add all symbols, not
10136 only used ones, to the dynamic symbol table. This option is needed
10137 for some uses of @code{dlopen} or to allow obtaining backtraces
10138 from within a program.
10140 @item -s
10141 @opindex s
10142 Remove all symbol table and relocation information from the executable.
10144 @item -static
10145 @opindex static
10146 On systems that support dynamic linking, this prevents linking with the shared
10147 libraries.  On other systems, this option has no effect.
10149 @item -shared
10150 @opindex shared
10151 Produce a shared object which can then be linked with other objects to
10152 form an executable.  Not all systems support this option.  For predictable
10153 results, you must also specify the same set of options used for compilation
10154 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10155 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10156 needs to build supplementary stub code for constructors to work.  On
10157 multi-libbed systems, @samp{gcc -shared} must select the correct support
10158 libraries to link against.  Failing to supply the correct flags may lead
10159 to subtle defects.  Supplying them in cases where they are not necessary
10160 is innocuous.}
10162 @item -shared-libgcc
10163 @itemx -static-libgcc
10164 @opindex shared-libgcc
10165 @opindex static-libgcc
10166 On systems that provide @file{libgcc} as a shared library, these options
10167 force the use of either the shared or static version, respectively.
10168 If no shared version of @file{libgcc} was built when the compiler was
10169 configured, these options have no effect.
10171 There are several situations in which an application should use the
10172 shared @file{libgcc} instead of the static version.  The most common
10173 of these is when the application wishes to throw and catch exceptions
10174 across different shared libraries.  In that case, each of the libraries
10175 as well as the application itself should use the shared @file{libgcc}.
10177 Therefore, the G++ and GCJ drivers automatically add
10178 @option{-shared-libgcc} whenever you build a shared library or a main
10179 executable, because C++ and Java programs typically use exceptions, so
10180 this is the right thing to do.
10182 If, instead, you use the GCC driver to create shared libraries, you may
10183 find that they are not always linked with the shared @file{libgcc}.
10184 If GCC finds, at its configuration time, that you have a non-GNU linker
10185 or a GNU linker that does not support option @option{--eh-frame-hdr},
10186 it links the shared version of @file{libgcc} into shared libraries
10187 by default.  Otherwise, it takes advantage of the linker and optimizes
10188 away the linking with the shared version of @file{libgcc}, linking with
10189 the static version of libgcc by default.  This allows exceptions to
10190 propagate through such shared libraries, without incurring relocation
10191 costs at library load time.
10193 However, if a library or main executable is supposed to throw or catch
10194 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10195 for the languages used in the program, or using the option
10196 @option{-shared-libgcc}, such that it is linked with the shared
10197 @file{libgcc}.
10199 @item -static-libasan
10200 When the @option{-fsanitize=address} option is used to link a program,
10201 the GCC driver automatically links against @option{libasan}.  If
10202 @file{libasan} is available as a shared library, and the @option{-static}
10203 option is not used, then this links against the shared version of
10204 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10205 driver to link @file{libasan} statically, without necessarily linking
10206 other libraries statically.
10208 @item -static-libtsan
10209 When the @option{-fsanitize=thread} option is used to link a program,
10210 the GCC driver automatically links against @option{libtsan}.  If
10211 @file{libtsan} is available as a shared library, and the @option{-static}
10212 option is not used, then this links against the shared version of
10213 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10214 driver to link @file{libtsan} statically, without necessarily linking
10215 other libraries statically.
10217 @item -static-libubsan
10218 When the @option{-fsanitize=undefined} option is used to link a program,
10219 the GCC driver automatically links against @option{libubsan}.  If
10220 @file{libubsan} is available as a shared library, and the @option{-static}
10221 option is not used, then this links against the shared version of
10222 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10223 driver to link @file{libubsan} statically, without necessarily linking
10224 other libraries statically.
10226 @item -static-libstdc++
10227 When the @command{g++} program is used to link a C++ program, it
10228 normally automatically links against @option{libstdc++}.  If
10229 @file{libstdc++} is available as a shared library, and the
10230 @option{-static} option is not used, then this links against the
10231 shared version of @file{libstdc++}.  That is normally fine.  However, it
10232 is sometimes useful to freeze the version of @file{libstdc++} used by
10233 the program without going all the way to a fully static link.  The
10234 @option{-static-libstdc++} option directs the @command{g++} driver to
10235 link @file{libstdc++} statically, without necessarily linking other
10236 libraries statically.
10238 @item -symbolic
10239 @opindex symbolic
10240 Bind references to global symbols when building a shared object.  Warn
10241 about any unresolved references (unless overridden by the link editor
10242 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10243 this option.
10245 @item -T @var{script}
10246 @opindex T
10247 @cindex linker script
10248 Use @var{script} as the linker script.  This option is supported by most
10249 systems using the GNU linker.  On some targets, such as bare-board
10250 targets without an operating system, the @option{-T} option may be required
10251 when linking to avoid references to undefined symbols.
10253 @item -Xlinker @var{option}
10254 @opindex Xlinker
10255 Pass @var{option} as an option to the linker.  You can use this to
10256 supply system-specific linker options that GCC does not recognize.
10258 If you want to pass an option that takes a separate argument, you must use
10259 @option{-Xlinker} twice, once for the option and once for the argument.
10260 For example, to pass @option{-assert definitions}, you must write
10261 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10262 @option{-Xlinker "-assert definitions"}, because this passes the entire
10263 string as a single argument, which is not what the linker expects.
10265 When using the GNU linker, it is usually more convenient to pass
10266 arguments to linker options using the @option{@var{option}=@var{value}}
10267 syntax than as separate arguments.  For example, you can specify
10268 @option{-Xlinker -Map=output.map} rather than
10269 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10270 this syntax for command-line options.
10272 @item -Wl,@var{option}
10273 @opindex Wl
10274 Pass @var{option} as an option to the linker.  If @var{option} contains
10275 commas, it is split into multiple options at the commas.  You can use this
10276 syntax to pass an argument to the option.
10277 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10278 linker.  When using the GNU linker, you can also get the same effect with
10279 @option{-Wl,-Map=output.map}.
10281 @item -u @var{symbol}
10282 @opindex u
10283 Pretend the symbol @var{symbol} is undefined, to force linking of
10284 library modules to define it.  You can use @option{-u} multiple times with
10285 different symbols to force loading of additional library modules.
10286 @end table
10288 @node Directory Options
10289 @section Options for Directory Search
10290 @cindex directory options
10291 @cindex options, directory search
10292 @cindex search path
10294 These options specify directories to search for header files, for
10295 libraries and for parts of the compiler:
10297 @table @gcctabopt
10298 @item -I@var{dir}
10299 @opindex I
10300 Add the directory @var{dir} to the head of the list of directories to be
10301 searched for header files.  This can be used to override a system header
10302 file, substituting your own version, since these directories are
10303 searched before the system header file directories.  However, you should
10304 not use this option to add directories that contain vendor-supplied
10305 system header files (use @option{-isystem} for that).  If you use more than
10306 one @option{-I} option, the directories are scanned in left-to-right
10307 order; the standard system directories come after.
10309 If a standard system include directory, or a directory specified with
10310 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10311 option is ignored.  The directory is still searched but as a
10312 system directory at its normal position in the system include chain.
10313 This is to ensure that GCC's procedure to fix buggy system headers and
10314 the ordering for the @code{include_next} directive are not inadvertently changed.
10315 If you really need to change the search order for system directories,
10316 use the @option{-nostdinc} and/or @option{-isystem} options.
10318 @item -iplugindir=@var{dir}
10319 Set the directory to search for plugins that are passed
10320 by @option{-fplugin=@var{name}} instead of
10321 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10322 to be used by the user, but only passed by the driver.
10324 @item -iquote@var{dir}
10325 @opindex iquote
10326 Add the directory @var{dir} to the head of the list of directories to
10327 be searched for header files only for the case of @samp{#include
10328 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10329 otherwise just like @option{-I}.
10331 @item -L@var{dir}
10332 @opindex L
10333 Add directory @var{dir} to the list of directories to be searched
10334 for @option{-l}.
10336 @item -B@var{prefix}
10337 @opindex B
10338 This option specifies where to find the executables, libraries,
10339 include files, and data files of the compiler itself.
10341 The compiler driver program runs one or more of the subprograms
10342 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10343 @var{prefix} as a prefix for each program it tries to run, both with and
10344 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10346 For each subprogram to be run, the compiler driver first tries the
10347 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10348 is not specified, the driver tries two standard prefixes, 
10349 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10350 those results in a file name that is found, the unmodified program
10351 name is searched for using the directories specified in your
10352 @env{PATH} environment variable.
10354 The compiler checks to see if the path provided by the @option{-B}
10355 refers to a directory, and if necessary it adds a directory
10356 separator character at the end of the path.
10358 @option{-B} prefixes that effectively specify directory names also apply
10359 to libraries in the linker, because the compiler translates these
10360 options into @option{-L} options for the linker.  They also apply to
10361 includes files in the preprocessor, because the compiler translates these
10362 options into @option{-isystem} options for the preprocessor.  In this case,
10363 the compiler appends @samp{include} to the prefix.
10365 The runtime support file @file{libgcc.a} can also be searched for using
10366 the @option{-B} prefix, if needed.  If it is not found there, the two
10367 standard prefixes above are tried, and that is all.  The file is left
10368 out of the link if it is not found by those means.
10370 Another way to specify a prefix much like the @option{-B} prefix is to use
10371 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10372 Variables}.
10374 As a special kludge, if the path provided by @option{-B} is
10375 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10376 9, then it is replaced by @file{[dir/]include}.  This is to help
10377 with boot-strapping the compiler.
10379 @item -specs=@var{file}
10380 @opindex specs
10381 Process @var{file} after the compiler reads in the standard @file{specs}
10382 file, in order to override the defaults which the @command{gcc} driver
10383 program uses when determining what switches to pass to @command{cc1},
10384 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10385 @option{-specs=@var{file}} can be specified on the command line, and they
10386 are processed in order, from left to right.
10388 @item --sysroot=@var{dir}
10389 @opindex sysroot
10390 Use @var{dir} as the logical root directory for headers and libraries.
10391 For example, if the compiler normally searches for headers in
10392 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10393 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10395 If you use both this option and the @option{-isysroot} option, then
10396 the @option{--sysroot} option applies to libraries, but the
10397 @option{-isysroot} option applies to header files.
10399 The GNU linker (beginning with version 2.16) has the necessary support
10400 for this option.  If your linker does not support this option, the
10401 header file aspect of @option{--sysroot} still works, but the
10402 library aspect does not.
10404 @item --no-sysroot-suffix
10405 @opindex no-sysroot-suffix
10406 For some targets, a suffix is added to the root directory specified
10407 with @option{--sysroot}, depending on the other options used, so that
10408 headers may for example be found in
10409 @file{@var{dir}/@var{suffix}/usr/include} instead of
10410 @file{@var{dir}/usr/include}.  This option disables the addition of
10411 such a suffix.
10413 @item -I-
10414 @opindex I-
10415 This option has been deprecated.  Please use @option{-iquote} instead for
10416 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10417 Any directories you specify with @option{-I} options before the @option{-I-}
10418 option are searched only for the case of @samp{#include "@var{file}"};
10419 they are not searched for @samp{#include <@var{file}>}.
10421 If additional directories are specified with @option{-I} options after
10422 the @option{-I-}, these directories are searched for all @samp{#include}
10423 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10424 this way.)
10426 In addition, the @option{-I-} option inhibits the use of the current
10427 directory (where the current input file came from) as the first search
10428 directory for @samp{#include "@var{file}"}.  There is no way to
10429 override this effect of @option{-I-}.  With @option{-I.} you can specify
10430 searching the directory that is current when the compiler is
10431 invoked.  That is not exactly the same as what the preprocessor does
10432 by default, but it is often satisfactory.
10434 @option{-I-} does not inhibit the use of the standard system directories
10435 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10436 independent.
10437 @end table
10439 @c man end
10441 @node Spec Files
10442 @section Specifying subprocesses and the switches to pass to them
10443 @cindex Spec Files
10445 @command{gcc} is a driver program.  It performs its job by invoking a
10446 sequence of other programs to do the work of compiling, assembling and
10447 linking.  GCC interprets its command-line parameters and uses these to
10448 deduce which programs it should invoke, and which command-line options
10449 it ought to place on their command lines.  This behavior is controlled
10450 by @dfn{spec strings}.  In most cases there is one spec string for each
10451 program that GCC can invoke, but a few programs have multiple spec
10452 strings to control their behavior.  The spec strings built into GCC can
10453 be overridden by using the @option{-specs=} command-line switch to specify
10454 a spec file.
10456 @dfn{Spec files} are plaintext files that are used to construct spec
10457 strings.  They consist of a sequence of directives separated by blank
10458 lines.  The type of directive is determined by the first non-whitespace
10459 character on the line, which can be one of the following:
10461 @table @code
10462 @item %@var{command}
10463 Issues a @var{command} to the spec file processor.  The commands that can
10464 appear here are:
10466 @table @code
10467 @item %include <@var{file}>
10468 @cindex @code{%include}
10469 Search for @var{file} and insert its text at the current point in the
10470 specs file.
10472 @item %include_noerr <@var{file}>
10473 @cindex @code{%include_noerr}
10474 Just like @samp{%include}, but do not generate an error message if the include
10475 file cannot be found.
10477 @item %rename @var{old_name} @var{new_name}
10478 @cindex @code{%rename}
10479 Rename the spec string @var{old_name} to @var{new_name}.
10481 @end table
10483 @item *[@var{spec_name}]:
10484 This tells the compiler to create, override or delete the named spec
10485 string.  All lines after this directive up to the next directive or
10486 blank line are considered to be the text for the spec string.  If this
10487 results in an empty string then the spec is deleted.  (Or, if the
10488 spec did not exist, then nothing happens.)  Otherwise, if the spec
10489 does not currently exist a new spec is created.  If the spec does
10490 exist then its contents are overridden by the text of this
10491 directive, unless the first character of that text is the @samp{+}
10492 character, in which case the text is appended to the spec.
10494 @item [@var{suffix}]:
10495 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10496 and up to the next directive or blank line are considered to make up the
10497 spec string for the indicated suffix.  When the compiler encounters an
10498 input file with the named suffix, it processes the spec string in
10499 order to work out how to compile that file.  For example:
10501 @smallexample
10502 .ZZ:
10503 z-compile -input %i
10504 @end smallexample
10506 This says that any input file whose name ends in @samp{.ZZ} should be
10507 passed to the program @samp{z-compile}, which should be invoked with the
10508 command-line switch @option{-input} and with the result of performing the
10509 @samp{%i} substitution.  (See below.)
10511 As an alternative to providing a spec string, the text following a
10512 suffix directive can be one of the following:
10514 @table @code
10515 @item @@@var{language}
10516 This says that the suffix is an alias for a known @var{language}.  This is
10517 similar to using the @option{-x} command-line switch to GCC to specify a
10518 language explicitly.  For example:
10520 @smallexample
10521 .ZZ:
10522 @@c++
10523 @end smallexample
10525 Says that .ZZ files are, in fact, C++ source files.
10527 @item #@var{name}
10528 This causes an error messages saying:
10530 @smallexample
10531 @var{name} compiler not installed on this system.
10532 @end smallexample
10533 @end table
10535 GCC already has an extensive list of suffixes built into it.
10536 This directive adds an entry to the end of the list of suffixes, but
10537 since the list is searched from the end backwards, it is effectively
10538 possible to override earlier entries using this technique.
10540 @end table
10542 GCC has the following spec strings built into it.  Spec files can
10543 override these strings or create their own.  Note that individual
10544 targets can also add their own spec strings to this list.
10546 @smallexample
10547 asm          Options to pass to the assembler
10548 asm_final    Options to pass to the assembler post-processor
10549 cpp          Options to pass to the C preprocessor
10550 cc1          Options to pass to the C compiler
10551 cc1plus      Options to pass to the C++ compiler
10552 endfile      Object files to include at the end of the link
10553 link         Options to pass to the linker
10554 lib          Libraries to include on the command line to the linker
10555 libgcc       Decides which GCC support library to pass to the linker
10556 linker       Sets the name of the linker
10557 predefines   Defines to be passed to the C preprocessor
10558 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10559              by default
10560 startfile    Object files to include at the start of the link
10561 @end smallexample
10563 Here is a small example of a spec file:
10565 @smallexample
10566 %rename lib                 old_lib
10568 *lib:
10569 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10570 @end smallexample
10572 This example renames the spec called @samp{lib} to @samp{old_lib} and
10573 then overrides the previous definition of @samp{lib} with a new one.
10574 The new definition adds in some extra command-line options before
10575 including the text of the old definition.
10577 @dfn{Spec strings} are a list of command-line options to be passed to their
10578 corresponding program.  In addition, the spec strings can contain
10579 @samp{%}-prefixed sequences to substitute variable text or to
10580 conditionally insert text into the command line.  Using these constructs
10581 it is possible to generate quite complex command lines.
10583 Here is a table of all defined @samp{%}-sequences for spec
10584 strings.  Note that spaces are not generated automatically around the
10585 results of expanding these sequences.  Therefore you can concatenate them
10586 together or combine them with constant text in a single argument.
10588 @table @code
10589 @item %%
10590 Substitute one @samp{%} into the program name or argument.
10592 @item %i
10593 Substitute the name of the input file being processed.
10595 @item %b
10596 Substitute the basename of the input file being processed.
10597 This is the substring up to (and not including) the last period
10598 and not including the directory.
10600 @item %B
10601 This is the same as @samp{%b}, but include the file suffix (text after
10602 the last period).
10604 @item %d
10605 Marks the argument containing or following the @samp{%d} as a
10606 temporary file name, so that that file is deleted if GCC exits
10607 successfully.  Unlike @samp{%g}, this contributes no text to the
10608 argument.
10610 @item %g@var{suffix}
10611 Substitute a file name that has suffix @var{suffix} and is chosen
10612 once per compilation, and mark the argument in the same way as
10613 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10614 name is now chosen in a way that is hard to predict even when previously
10615 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10616 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10617 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10618 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10619 was simply substituted with a file name chosen once per compilation,
10620 without regard to any appended suffix (which was therefore treated
10621 just like ordinary text), making such attacks more likely to succeed.
10623 @item %u@var{suffix}
10624 Like @samp{%g}, but generates a new temporary file name
10625 each time it appears instead of once per compilation.
10627 @item %U@var{suffix}
10628 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10629 new one if there is no such last file name.  In the absence of any
10630 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10631 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10632 involves the generation of two distinct file names, one
10633 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10634 simply substituted with a file name chosen for the previous @samp{%u},
10635 without regard to any appended suffix.
10637 @item %j@var{suffix}
10638 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10639 writable, and if @option{-save-temps} is not used; 
10640 otherwise, substitute the name
10641 of a temporary file, just like @samp{%u}.  This temporary file is not
10642 meant for communication between processes, but rather as a junk
10643 disposal mechanism.
10645 @item %|@var{suffix}
10646 @itemx %m@var{suffix}
10647 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10648 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10649 all.  These are the two most common ways to instruct a program that it
10650 should read from standard input or write to standard output.  If you
10651 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10652 construct: see for example @file{f/lang-specs.h}.
10654 @item %.@var{SUFFIX}
10655 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10656 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10657 terminated by the next space or %.
10659 @item %w
10660 Marks the argument containing or following the @samp{%w} as the
10661 designated output file of this compilation.  This puts the argument
10662 into the sequence of arguments that @samp{%o} substitutes.
10664 @item %o
10665 Substitutes the names of all the output files, with spaces
10666 automatically placed around them.  You should write spaces
10667 around the @samp{%o} as well or the results are undefined.
10668 @samp{%o} is for use in the specs for running the linker.
10669 Input files whose names have no recognized suffix are not compiled
10670 at all, but they are included among the output files, so they are
10671 linked.
10673 @item %O
10674 Substitutes the suffix for object files.  Note that this is
10675 handled specially when it immediately follows @samp{%g, %u, or %U},
10676 because of the need for those to form complete file names.  The
10677 handling is such that @samp{%O} is treated exactly as if it had already
10678 been substituted, except that @samp{%g, %u, and %U} do not currently
10679 support additional @var{suffix} characters following @samp{%O} as they do
10680 following, for example, @samp{.o}.
10682 @item %p
10683 Substitutes the standard macro predefinitions for the
10684 current target machine.  Use this when running @code{cpp}.
10686 @item %P
10687 Like @samp{%p}, but puts @samp{__} before and after the name of each
10688 predefined macro, except for macros that start with @samp{__} or with
10689 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10692 @item %I
10693 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10694 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10695 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10696 and @option{-imultilib} as necessary.
10698 @item %s
10699 Current argument is the name of a library or startup file of some sort.
10700 Search for that file in a standard list of directories and substitute
10701 the full name found.  The current working directory is included in the
10702 list of directories scanned.
10704 @item %T
10705 Current argument is the name of a linker script.  Search for that file
10706 in the current list of directories to scan for libraries. If the file
10707 is located insert a @option{--script} option into the command line
10708 followed by the full path name found.  If the file is not found then
10709 generate an error message.  Note: the current working directory is not
10710 searched.
10712 @item %e@var{str}
10713 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10714 Use this when inconsistent options are detected.
10716 @item %(@var{name})
10717 Substitute the contents of spec string @var{name} at this point.
10719 @item %x@{@var{option}@}
10720 Accumulate an option for @samp{%X}.
10722 @item %X
10723 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10724 spec string.
10726 @item %Y
10727 Output the accumulated assembler options specified by @option{-Wa}.
10729 @item %Z
10730 Output the accumulated preprocessor options specified by @option{-Wp}.
10732 @item %a
10733 Process the @code{asm} spec.  This is used to compute the
10734 switches to be passed to the assembler.
10736 @item %A
10737 Process the @code{asm_final} spec.  This is a spec string for
10738 passing switches to an assembler post-processor, if such a program is
10739 needed.
10741 @item %l
10742 Process the @code{link} spec.  This is the spec for computing the
10743 command line passed to the linker.  Typically it makes use of the
10744 @samp{%L %G %S %D and %E} sequences.
10746 @item %D
10747 Dump out a @option{-L} option for each directory that GCC believes might
10748 contain startup files.  If the target supports multilibs then the
10749 current multilib directory is prepended to each of these paths.
10751 @item %L
10752 Process the @code{lib} spec.  This is a spec string for deciding which
10753 libraries are included on the command line to the linker.
10755 @item %G
10756 Process the @code{libgcc} spec.  This is a spec string for deciding
10757 which GCC support library is included on the command line to the linker.
10759 @item %S
10760 Process the @code{startfile} spec.  This is a spec for deciding which
10761 object files are the first ones passed to the linker.  Typically
10762 this might be a file named @file{crt0.o}.
10764 @item %E
10765 Process the @code{endfile} spec.  This is a spec string that specifies
10766 the last object files that are passed to the linker.
10768 @item %C
10769 Process the @code{cpp} spec.  This is used to construct the arguments
10770 to be passed to the C preprocessor.
10772 @item %1
10773 Process the @code{cc1} spec.  This is used to construct the options to be
10774 passed to the actual C compiler (@samp{cc1}).
10776 @item %2
10777 Process the @code{cc1plus} spec.  This is used to construct the options to be
10778 passed to the actual C++ compiler (@samp{cc1plus}).
10780 @item %*
10781 Substitute the variable part of a matched option.  See below.
10782 Note that each comma in the substituted string is replaced by
10783 a single space.
10785 @item %<@code{S}
10786 Remove all occurrences of @code{-S} from the command line.  Note---this
10787 command is position dependent.  @samp{%} commands in the spec string
10788 before this one see @code{-S}, @samp{%} commands in the spec string
10789 after this one do not.
10791 @item %:@var{function}(@var{args})
10792 Call the named function @var{function}, passing it @var{args}.
10793 @var{args} is first processed as a nested spec string, then split
10794 into an argument vector in the usual fashion.  The function returns
10795 a string which is processed as if it had appeared literally as part
10796 of the current spec.
10798 The following built-in spec functions are provided:
10800 @table @code
10801 @item @code{getenv}
10802 The @code{getenv} spec function takes two arguments: an environment
10803 variable name and a string.  If the environment variable is not
10804 defined, a fatal error is issued.  Otherwise, the return value is the
10805 value of the environment variable concatenated with the string.  For
10806 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10808 @smallexample
10809 %:getenv(TOPDIR /include)
10810 @end smallexample
10812 expands to @file{/path/to/top/include}.
10814 @item @code{if-exists}
10815 The @code{if-exists} spec function takes one argument, an absolute
10816 pathname to a file.  If the file exists, @code{if-exists} returns the
10817 pathname.  Here is a small example of its usage:
10819 @smallexample
10820 *startfile:
10821 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10822 @end smallexample
10824 @item @code{if-exists-else}
10825 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10826 spec function, except that it takes two arguments.  The first argument is
10827 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10828 returns the pathname.  If it does not exist, it returns the second argument.
10829 This way, @code{if-exists-else} can be used to select one file or another,
10830 based on the existence of the first.  Here is a small example of its usage:
10832 @smallexample
10833 *startfile:
10834 crt0%O%s %:if-exists(crti%O%s) \
10835 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10836 @end smallexample
10838 @item @code{replace-outfile}
10839 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10840 first argument in the outfiles array and replaces it with the second argument.  Here
10841 is a small example of its usage:
10843 @smallexample
10844 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10845 @end smallexample
10847 @item @code{remove-outfile}
10848 The @code{remove-outfile} spec function takes one argument.  It looks for the
10849 first argument in the outfiles array and removes it.  Here is a small example
10850 its usage:
10852 @smallexample
10853 %:remove-outfile(-lm)
10854 @end smallexample
10856 @item @code{pass-through-libs}
10857 The @code{pass-through-libs} spec function takes any number of arguments.  It
10858 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10859 assumes are the names of linker input library archive files) and returns a
10860 result containing all the found arguments each prepended by
10861 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10862 intended to be passed to the LTO linker plugin.
10864 @smallexample
10865 %:pass-through-libs(%G %L %G)
10866 @end smallexample
10868 @item @code{print-asm-header}
10869 The @code{print-asm-header} function takes no arguments and simply
10870 prints a banner like:
10872 @smallexample
10873 Assembler options
10874 =================
10876 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10877 @end smallexample
10879 It is used to separate compiler options from assembler options
10880 in the @option{--target-help} output.
10881 @end table
10883 @item %@{@code{S}@}
10884 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10885 If that switch is not specified, this substitutes nothing.  Note that
10886 the leading dash is omitted when specifying this option, and it is
10887 automatically inserted if the substitution is performed.  Thus the spec
10888 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10889 and outputs the command-line option @option{-foo}.
10891 @item %W@{@code{S}@}
10892 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10893 deleted on failure.
10895 @item %@{@code{S}*@}
10896 Substitutes all the switches specified to GCC whose names start
10897 with @code{-S}, but which also take an argument.  This is used for
10898 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10899 GCC considers @option{-o foo} as being
10900 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10901 text, including the space.  Thus two arguments are generated.
10903 @item %@{@code{S}*&@code{T}*@}
10904 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10905 (the order of @code{S} and @code{T} in the spec is not significant).
10906 There can be any number of ampersand-separated variables; for each the
10907 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10909 @item %@{@code{S}:@code{X}@}
10910 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10912 @item %@{!@code{S}:@code{X}@}
10913 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10915 @item %@{@code{S}*:@code{X}@}
10916 Substitutes @code{X} if one or more switches whose names start with
10917 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10918 once, no matter how many such switches appeared.  However, if @code{%*}
10919 appears somewhere in @code{X}, then @code{X} is substituted once
10920 for each matching switch, with the @code{%*} replaced by the part of
10921 that switch matching the @code{*}.
10923 @item %@{.@code{S}:@code{X}@}
10924 Substitutes @code{X}, if processing a file with suffix @code{S}.
10926 @item %@{!.@code{S}:@code{X}@}
10927 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10929 @item %@{,@code{S}:@code{X}@}
10930 Substitutes @code{X}, if processing a file for language @code{S}.
10932 @item %@{!,@code{S}:@code{X}@}
10933 Substitutes @code{X}, if not processing a file for language @code{S}.
10935 @item %@{@code{S}|@code{P}:@code{X}@}
10936 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10937 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10938 @code{*} sequences as well, although they have a stronger binding than
10939 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10940 alternatives must be starred, and only the first matching alternative
10941 is substituted.
10943 For example, a spec string like this:
10945 @smallexample
10946 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10947 @end smallexample
10949 @noindent
10950 outputs the following command-line options from the following input
10951 command-line options:
10953 @smallexample
10954 fred.c        -foo -baz
10955 jim.d         -bar -boggle
10956 -d fred.c     -foo -baz -boggle
10957 -d jim.d      -bar -baz -boggle
10958 @end smallexample
10960 @item %@{S:X; T:Y; :D@}
10962 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10963 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10964 be as many clauses as you need.  This may be combined with @code{.},
10965 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10968 @end table
10970 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10971 construct may contain other nested @samp{%} constructs or spaces, or
10972 even newlines.  They are processed as usual, as described above.
10973 Trailing white space in @code{X} is ignored.  White space may also
10974 appear anywhere on the left side of the colon in these constructs,
10975 except between @code{.} or @code{*} and the corresponding word.
10977 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10978 handled specifically in these constructs.  If another value of
10979 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10980 @option{-W} switch is found later in the command line, the earlier
10981 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10982 just one letter, which passes all matching options.
10984 The character @samp{|} at the beginning of the predicate text is used to
10985 indicate that a command should be piped to the following command, but
10986 only if @option{-pipe} is specified.
10988 It is built into GCC which switches take arguments and which do not.
10989 (You might think it would be useful to generalize this to allow each
10990 compiler's spec to say which switches take arguments.  But this cannot
10991 be done in a consistent fashion.  GCC cannot even decide which input
10992 files have been specified without knowing which switches take arguments,
10993 and it must know which input files to compile in order to tell which
10994 compilers to run).
10996 GCC also knows implicitly that arguments starting in @option{-l} are to be
10997 treated as compiler output files, and passed to the linker in their
10998 proper position among the other output files.
11000 @c man begin OPTIONS
11002 @node Target Options
11003 @section Specifying Target Machine and Compiler Version
11004 @cindex target options
11005 @cindex cross compiling
11006 @cindex specifying machine version
11007 @cindex specifying compiler version and target machine
11008 @cindex compiler version, specifying
11009 @cindex target machine, specifying
11011 The usual way to run GCC is to run the executable called @command{gcc}, or
11012 @command{@var{machine}-gcc} when cross-compiling, or
11013 @command{@var{machine}-gcc-@var{version}} to run a version other than the
11014 one that was installed last.
11016 @node Submodel Options
11017 @section Hardware Models and Configurations
11018 @cindex submodel options
11019 @cindex specifying hardware config
11020 @cindex hardware models and configurations, specifying
11021 @cindex machine dependent options
11023 Each target machine types can have its own
11024 special options, starting with @samp{-m}, to choose among various
11025 hardware models or configurations---for example, 68010 vs 68020,
11026 floating coprocessor or none.  A single installed version of the
11027 compiler can compile for any model or configuration, according to the
11028 options specified.
11030 Some configurations of the compiler also support additional special
11031 options, usually for compatibility with other compilers on the same
11032 platform.
11034 @c This list is ordered alphanumerically by subsection name.
11035 @c It should be the same order and spelling as these options are listed
11036 @c in Machine Dependent Options
11038 @menu
11039 * AArch64 Options::
11040 * Adapteva Epiphany Options::
11041 * ARC Options::
11042 * ARM Options::
11043 * AVR Options::
11044 * Blackfin Options::
11045 * C6X Options::
11046 * CRIS Options::
11047 * CR16 Options::
11048 * Darwin Options::
11049 * DEC Alpha Options::
11050 * FR30 Options::
11051 * FRV Options::
11052 * GNU/Linux Options::
11053 * H8/300 Options::
11054 * HPPA Options::
11055 * i386 and x86-64 Options::
11056 * i386 and x86-64 Windows Options::
11057 * IA-64 Options::
11058 * LM32 Options::
11059 * M32C Options::
11060 * M32R/D Options::
11061 * M680x0 Options::
11062 * MCore Options::
11063 * MeP Options::
11064 * MicroBlaze Options::
11065 * MIPS Options::
11066 * MMIX Options::
11067 * MN10300 Options::
11068 * Moxie Options::
11069 * MSP430 Options::
11070 * PDP-11 Options::
11071 * picoChip Options::
11072 * PowerPC Options::
11073 * RL78 Options::
11074 * RS/6000 and PowerPC Options::
11075 * RX Options::
11076 * S/390 and zSeries Options::
11077 * Score Options::
11078 * SH Options::
11079 * Solaris 2 Options::
11080 * SPARC Options::
11081 * SPU Options::
11082 * System V Options::
11083 * TILE-Gx Options::
11084 * TILEPro Options::
11085 * V850 Options::
11086 * VAX Options::
11087 * VMS Options::
11088 * VxWorks Options::
11089 * x86-64 Options::
11090 * Xstormy16 Options::
11091 * Xtensa Options::
11092 * zSeries Options::
11093 @end menu
11095 @node AArch64 Options
11096 @subsection AArch64 Options
11097 @cindex AArch64 Options
11099 These options are defined for AArch64 implementations:
11101 @table @gcctabopt
11103 @item -mabi=@var{name}
11104 @opindex mabi
11105 Generate code for the specified data model.  Permissible values
11106 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11107 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11108 but long int and pointer are 64-bit.
11110 The default depends on the specific target configuration.  Note that
11111 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11112 entire program with the same ABI, and link with a compatible set of libraries.
11114 @item -mbig-endian
11115 @opindex mbig-endian
11116 Generate big-endian code.  This is the default when GCC is configured for an
11117 @samp{aarch64_be-*-*} target.
11119 @item -mgeneral-regs-only
11120 @opindex mgeneral-regs-only
11121 Generate code which uses only the general registers.
11123 @item -mlittle-endian
11124 @opindex mlittle-endian
11125 Generate little-endian code.  This is the default when GCC is configured for an
11126 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11128 @item -mcmodel=tiny
11129 @opindex mcmodel=tiny
11130 Generate code for the tiny code model.  The program and its statically defined
11131 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11132 be statically or dynamically linked.  This model is not fully implemented and
11133 mostly treated as @samp{small}.
11135 @item -mcmodel=small
11136 @opindex mcmodel=small
11137 Generate code for the small code model.  The program and its statically defined
11138 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11139 be statically or dynamically linked.  This is the default code model.
11141 @item -mcmodel=large
11142 @opindex mcmodel=large
11143 Generate code for the large code model.  This makes no assumptions about
11144 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11145 statically linked only.
11147 @item -mstrict-align
11148 @opindex mstrict-align
11149 Do not assume that unaligned memory references will be handled by the system.
11151 @item -momit-leaf-frame-pointer
11152 @itemx -mno-omit-leaf-frame-pointer
11153 @opindex momit-leaf-frame-pointer
11154 @opindex mno-omit-leaf-frame-pointer
11155 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11156 default.
11158 @item -mtls-dialect=desc
11159 @opindex mtls-dialect=desc
11160 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11161 of TLS variables.  This is the default.
11163 @item -mtls-dialect=traditional
11164 @opindex mtls-dialect=traditional
11165 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11166 of TLS variables.
11168 @item -march=@var{name}
11169 @opindex march
11170 Specify the name of the target architecture, optionally suffixed by one or
11171 more feature modifiers.  This option has the form
11172 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11173 only value for @var{arch} is @samp{armv8-a}.  The possible values for
11174 @var{feature} are documented in the sub-section below.
11176 Where conflicting feature modifiers are specified, the right-most feature is
11177 used.
11179 GCC uses this name to determine what kind of instructions it can emit when
11180 generating assembly code.  This option can be used in conjunction with or
11181 instead of the @option{-mcpu=} option.
11183 @item -mcpu=@var{name}
11184 @opindex mcpu
11185 Specify the name of the target processor, optionally suffixed by one or more
11186 feature modifiers.  This option has the form
11187 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11188 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
11189 possible values for @var{feature} are documented in the sub-section
11190 below.
11192 Where conflicting feature modifiers are specified, the right-most feature is
11193 used.
11195 GCC uses this name to determine what kind of instructions it can emit when
11196 generating assembly code.
11198 @item -mtune=@var{name}
11199 @opindex mtune
11200 Specify the name of the processor to tune the performance for.  The code will
11201 be tuned as if the target processor were of the type specified in this option,
11202 but still using instructions compatible with the target processor specified
11203 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
11204 modifiers.
11206 @end table
11208 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11209 @cindex @option{-march} feature modifiers
11210 @cindex @option{-mcpu} feature modifiers
11211 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11212 the following:
11214 @table @samp
11215 @item crc
11216 Enable CRC extension.
11217 @item crypto
11218 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11219 @item fp
11220 Enable floating-point instructions.
11221 @item simd
11222 Enable Advanced SIMD instructions.  This implies floating-point instructions
11223 are enabled.  This is the default for all current possible values for options
11224 @option{-march} and @option{-mcpu=}.
11225 @end table
11227 @node Adapteva Epiphany Options
11228 @subsection Adapteva Epiphany Options
11230 These @samp{-m} options are defined for Adapteva Epiphany:
11232 @table @gcctabopt
11233 @item -mhalf-reg-file
11234 @opindex mhalf-reg-file
11235 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11236 That allows code to run on hardware variants that lack these registers.
11238 @item -mprefer-short-insn-regs
11239 @opindex mprefer-short-insn-regs
11240 Preferrentially allocate registers that allow short instruction generation.
11241 This can result in increased instruction count, so this may either reduce or
11242 increase overall code size.
11244 @item -mbranch-cost=@var{num}
11245 @opindex mbranch-cost
11246 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11247 This cost is only a heuristic and is not guaranteed to produce
11248 consistent results across releases.
11250 @item -mcmove
11251 @opindex mcmove
11252 Enable the generation of conditional moves.
11254 @item -mnops=@var{num}
11255 @opindex mnops
11256 Emit @var{num} NOPs before every other generated instruction.
11258 @item -mno-soft-cmpsf
11259 @opindex mno-soft-cmpsf
11260 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11261 and test the flags.  This is faster than a software comparison, but can
11262 get incorrect results in the presence of NaNs, or when two different small
11263 numbers are compared such that their difference is calculated as zero.
11264 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11265 software comparisons.
11267 @item -mstack-offset=@var{num}
11268 @opindex mstack-offset
11269 Set the offset between the top of the stack and the stack pointer.
11270 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11271 can be used by leaf functions without stack allocation.
11272 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11273 Note also that this option changes the ABI; compiling a program with a
11274 different stack offset than the libraries have been compiled with
11275 generally does not work.
11276 This option can be useful if you want to evaluate if a different stack
11277 offset would give you better code, but to actually use a different stack
11278 offset to build working programs, it is recommended to configure the
11279 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11281 @item -mno-round-nearest
11282 @opindex mno-round-nearest
11283 Make the scheduler assume that the rounding mode has been set to
11284 truncating.  The default is @option{-mround-nearest}.
11286 @item -mlong-calls
11287 @opindex mlong-calls
11288 If not otherwise specified by an attribute, assume all calls might be beyond
11289 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11290 function address into a register before performing a (otherwise direct) call.
11291 This is the default.
11293 @item -mshort-calls
11294 @opindex short-calls
11295 If not otherwise specified by an attribute, assume all direct calls are
11296 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11297 for direct calls.  The default is @option{-mlong-calls}.
11299 @item -msmall16
11300 @opindex msmall16
11301 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11302 apply to function addresses for which @option{-mlong-calls} semantics
11303 are in effect.
11305 @item -mfp-mode=@var{mode}
11306 @opindex mfp-mode
11307 Set the prevailing mode of the floating-point unit.
11308 This determines the floating-point mode that is provided and expected
11309 at function call and return time.  Making this mode match the mode you
11310 predominantly need at function start can make your programs smaller and
11311 faster by avoiding unnecessary mode switches.
11313 @var{mode} can be set to one the following values:
11315 @table @samp
11316 @item caller
11317 Any mode at function entry is valid, and retained or restored when
11318 the function returns, and when it calls other functions.
11319 This mode is useful for compiling libraries or other compilation units
11320 you might want to incorporate into different programs with different
11321 prevailing FPU modes, and the convenience of being able to use a single
11322 object file outweighs the size and speed overhead for any extra
11323 mode switching that might be needed, compared with what would be needed
11324 with a more specific choice of prevailing FPU mode.
11326 @item truncate
11327 This is the mode used for floating-point calculations with
11328 truncating (i.e.@: round towards zero) rounding mode.  That includes
11329 conversion from floating point to integer.
11331 @item round-nearest
11332 This is the mode used for floating-point calculations with
11333 round-to-nearest-or-even rounding mode.
11335 @item int
11336 This is the mode used to perform integer calculations in the FPU, e.g.@:
11337 integer multiply, or integer multiply-and-accumulate.
11338 @end table
11340 The default is @option{-mfp-mode=caller}
11342 @item -mnosplit-lohi
11343 @itemx -mno-postinc
11344 @itemx -mno-postmodify
11345 @opindex mnosplit-lohi
11346 @opindex mno-postinc
11347 @opindex mno-postmodify
11348 Code generation tweaks that disable, respectively, splitting of 32-bit
11349 loads, generation of post-increment addresses, and generation of
11350 post-modify addresses.  The defaults are @option{msplit-lohi},
11351 @option{-mpost-inc}, and @option{-mpost-modify}.
11353 @item -mnovect-double
11354 @opindex mno-vect-double
11355 Change the preferred SIMD mode to SImode.  The default is
11356 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11358 @item -max-vect-align=@var{num}
11359 @opindex max-vect-align
11360 The maximum alignment for SIMD vector mode types.
11361 @var{num} may be 4 or 8.  The default is 8.
11362 Note that this is an ABI change, even though many library function
11363 interfaces are unaffected if they don't use SIMD vector modes
11364 in places that affect size and/or alignment of relevant types.
11366 @item -msplit-vecmove-early
11367 @opindex msplit-vecmove-early
11368 Split vector moves into single word moves before reload.  In theory this
11369 can give better register allocation, but so far the reverse seems to be
11370 generally the case.
11372 @item -m1reg-@var{reg}
11373 @opindex m1reg-
11374 Specify a register to hold the constant @minus{}1, which makes loading small negative
11375 constants and certain bitmasks faster.
11376 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11377 which specify use of that register as a fixed register,
11378 and @samp{none}, which means that no register is used for this
11379 purpose.  The default is @option{-m1reg-none}.
11381 @end table
11383 @node ARC Options
11384 @subsection ARC Options
11385 @cindex ARC options
11387 The following options control the architecture variant for which code
11388 is being compiled:
11390 @c architecture variants
11391 @table @gcctabopt
11393 @item -mbarrel-shifter
11394 @opindex mbarrel-shifter
11395 Generate instructions supported by barrel shifter.  This is the default
11396 unless @samp{-mcpu=ARC601} is in effect.
11398 @item -mcpu=@var{cpu}
11399 @opindex mcpu
11400 Set architecture type, register usage, and instruction scheduling
11401 parameters for @var{cpu}.  There are also shortcut alias options
11402 available for backward compatibility and convenience.  Supported
11403 values for @var{cpu} are
11405 @table @samp
11406 @opindex mA6
11407 @opindex mARC600
11408 @item ARC600
11409 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
11411 @item ARC601
11412 @opindex mARC601
11413 Compile for ARC601.  Alias: @option{-mARC601}.
11415 @item ARC700
11416 @opindex mA7
11417 @opindex mARC700
11418 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
11419 This is the default when configured with @samp{--with-cpu=arc700}@.
11420 @end table
11422 @item -mdpfp
11423 @opindex mdpfp
11424 @itemx -mdpfp-compact
11425 @opindex mdpfp-compact
11426 FPX: Generate Double Precision FPX instructions, tuned for the compact
11427 implementation.
11429 @item -mdpfp-fast
11430 @opindex mdpfp-fast
11431 FPX: Generate Double Precision FPX instructions, tuned for the fast
11432 implementation.
11434 @item -mno-dpfp-lrsr
11435 @opindex mno-dpfp-lrsr
11436 Disable LR and SR instructions from using FPX extension aux registers.
11438 @item -mea
11439 @opindex mea
11440 Generate Extended arithmetic instructions.  Currently only
11441 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
11442 supported.  This is always enabled for @samp{-mcpu=ARC700}.
11444 @item -mno-mpy
11445 @opindex mno-mpy
11446 Do not generate mpy instructions for ARC700.
11448 @item -mmul32x16
11449 @opindex mmul32x16
11450 Generate 32x16 bit multiply and mac instructions.
11452 @item -mmul64
11453 @opindex mmul64
11454 Generate mul64 and mulu64 instructions.  Only valid for @samp{-mcpu=ARC600}.
11456 @item -mnorm
11457 @opindex mnorm
11458 Generate norm instruction.  This is the default if @samp{-mcpu=ARC700}
11459 is in effect.
11461 @item -mspfp
11462 @opindex mspfp
11463 @itemx -mspfp-compact
11464 @opindex mspfp-compact
11465 FPX: Generate Single Precision FPX instructions, tuned for the compact
11466 implementation.
11468 @item -mspfp-fast
11469 @opindex mspfp-fast
11470 FPX: Generate Single Precision FPX instructions, tuned for the fast
11471 implementation.
11473 @item -msimd
11474 @opindex msimd
11475 Enable generation of ARC SIMD instructions via target-specific
11476 builtins.  Only valid for @samp{-mcpu=ARC700}.
11478 @item -msoft-float
11479 @opindex msoft-float
11480 This option ignored; it is provided for compatibility purposes only.
11481 Software floating point code is emitted by default, and this default
11482 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
11483 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
11484 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
11486 @item -mswap
11487 @opindex mswap
11488 Generate swap instructions.
11490 @end table
11492 The following options are passed through to the assembler, and also
11493 define preprocessor macro symbols.
11495 @c Flags used by the assembler, but for which we define preprocessor
11496 @c macro symbols as well.
11497 @table @gcctabopt
11498 @item -mdsp-packa
11499 @opindex mdsp-packa
11500 Passed down to the assembler to enable the DSP Pack A extensions.
11501 Also sets the preprocessor symbol @code{__Xdsp_packa}.
11503 @item -mdvbf
11504 @opindex mdvbf
11505 Passed down to the assembler to enable the dual viterbi butterfly
11506 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
11508 @c ARC700 4.10 extension instruction
11509 @item -mlock
11510 @opindex mlock
11511 Passed down to the assembler to enable the Locked Load/Store
11512 Conditional extension.  Also sets the preprocessor symbol
11513 @code{__Xlock}.
11515 @item -mmac-d16
11516 @opindex mmac-d16
11517 Passed down to the assembler.  Also sets the preprocessor symbol
11518 @code{__Xxmac_d16}.
11520 @item -mmac-24
11521 @opindex mmac-24
11522 Passed down to the assembler.  Also sets the preprocessor symbol
11523 @code{__Xxmac_24}.
11525 @c ARC700 4.10 extension instruction
11526 @item -mrtsc
11527 @opindex mrtsc
11528 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
11529 extension instruction.  Also sets the preprocessor symbol
11530 @code{__Xrtsc}.
11532 @c ARC700 4.10 extension instruction
11533 @item -mswape
11534 @opindex mswape
11535 Passed down to the assembler to enable the swap byte ordering
11536 extension instruction.  Also sets the preprocessor symbol
11537 @code{__Xswape}.
11539 @item -mtelephony
11540 @opindex mtelephony
11541 Passed down to the assembler to enable dual and single operand
11542 instructions for telephony.  Also sets the preprocessor symbol
11543 @code{__Xtelephony}.
11545 @item -mxy
11546 @opindex mxy
11547 Passed down to the assembler to enable the XY Memory extension.  Also
11548 sets the preprocessor symbol @code{__Xxy}.
11550 @end table
11552 The following options control how the assembly code is annotated:
11554 @c Assembly annotation options
11555 @table @gcctabopt
11556 @item -misize
11557 @opindex misize
11558 Annotate assembler instructions with estimated addresses.
11560 @item -mannotate-align
11561 @opindex mannotate-align
11562 Explain what alignment considerations lead to the decision to make an
11563 instruction short or long.
11565 @end table
11567 The following options are passed through to the linker:
11569 @c options passed through to the linker
11570 @table @gcctabopt
11571 @item -marclinux
11572 @opindex marclinux
11573 Passed through to the linker, to specify use of the @code{arclinux} emulation.
11574 This option is enabled by default in tool chains built for
11575 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
11576 when profiling is not requested.
11578 @item -marclinux_prof
11579 @opindex marclinux_prof
11580 Passed through to the linker, to specify use of the
11581 @code{arclinux_prof} emulation.  This option is enabled by default in
11582 tool chains built for @w{@code{arc-linux-uclibc}} and
11583 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
11585 @end table
11587 The following options control the semantics of generated code:
11589 @c semantically relevant code generation options
11590 @table @gcctabopt
11591 @item -mepilogue-cfi
11592 @opindex mepilogue-cfi
11593 Enable generation of call frame information for epilogues.
11595 @item -mno-epilogue-cfi
11596 @opindex mno-epilogue-cfi
11597 Disable generation of call frame information for epilogues.
11599 @item -mlong-calls
11600 @opindex mlong-calls
11601 Generate call insns as register indirect calls, thus providing access
11602 to the full 32-bit address range.
11604 @item -mmedium-calls
11605 @opindex mmedium-calls
11606 Don't use less than 25 bit addressing range for calls, which is the
11607 offset available for an unconditional branch-and-link
11608 instruction.  Conditional execution of function calls is suppressed, to
11609 allow use of the 25-bit range, rather than the 21-bit range with
11610 conditional branch-and-link.  This is the default for tool chains built
11611 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
11613 @item -mno-sdata
11614 @opindex mno-sdata
11615 Do not generate sdata references.  This is the default for tool chains
11616 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
11617 targets.
11619 @item -mucb-mcount
11620 @opindex mucb-mcount
11621 Instrument with mcount calls as used in UCB code.  I.e. do the
11622 counting in the callee, not the caller.  By default ARC instrumentation
11623 counts in the caller.
11625 @item -mvolatile-cache
11626 @opindex mvolatile-cache
11627 Use ordinarily cached memory accesses for volatile references.  This is the
11628 default.
11630 @item -mno-volatile-cache
11631 @opindex mno-volatile-cache
11632 Enable cache bypass for volatile references.
11634 @end table
11636 The following options fine tune code generation:
11637 @c code generation tuning options
11638 @table @gcctabopt
11639 @item -malign-call
11640 @opindex malign-call
11641 Do alignment optimizations for call instructions.
11643 @item -mauto-modify-reg
11644 @opindex mauto-modify-reg
11645 Enable the use of pre/post modify with register displacement.
11647 @item -mbbit-peephole
11648 @opindex mbbit-peephole
11649 Enable bbit peephole2.
11651 @item -mno-brcc
11652 @opindex mno-brcc
11653 This option disables a target-specific pass in @file{arc_reorg} to
11654 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
11655 generation driven by the combiner pass.
11657 @item -mcase-vector-pcrel
11658 @opindex mcase-vector-pcrel
11659 Use pc-relative switch case tables - this enables case table shortening.
11660 This is the default for @option{-Os}.
11662 @item -mcompact-casesi
11663 @opindex mcompact-casesi
11664 Enable compact casesi pattern.
11665 This is the default for @option{-Os}.
11667 @item -mno-cond-exec
11668 @opindex mno-cond-exec
11669 Disable ARCompact specific pass to generate conditional execution instructions.
11670 Due to delay slot scheduling and interactions between operand numbers,
11671 literal sizes, instruction lengths, and the support for conditional execution,
11672 the target-independent pass to generate conditional execution is often lacking,
11673 so the ARC port has kept a special pass around that tries to find more
11674 conditional execution generating opportunities after register allocation,
11675 branch shortening, and delay slot scheduling have been done.  This pass
11676 generally, but not always, improves performance and code size, at the cost of
11677 extra compilation time, which is why there is an option to switch it off.
11678 If you have a problem with call instructions exceeding their allowable
11679 offset range because they are conditionalized, you should consider using
11680 @option{-mmedium-calls} instead.
11682 @item -mearly-cbranchsi
11683 @opindex mearly-cbranchsi
11684 Enable pre-reload use of the cbranchsi pattern.
11686 @item -mexpand-adddi
11687 @opindex mexpand-adddi
11688 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
11689 @code{add.f}, @code{adc} etc.
11691 @item -mindexed-loads
11692 @opindex mindexed-loads
11693 Enable the use of indexed loads.  This can be problematic because some
11694 optimizers will then assume the that indexed stores exist, which is not
11695 the case.
11697 @item -mlra
11698 @opindex mlra
11699 Enable Local Register Allocation.  This is still experimental for ARC,
11700 so by default the compiler uses standard reload
11701 (i.e. @samp{-mno-lra}).
11703 @item -mlra-priority-none
11704 @opindex mlra-priority-none
11705 Don't indicate any priority for target registers.
11707 @item -mlra-priority-compact
11708 @opindex mlra-priority-compact
11709 Indicate target register priority for r0..r3 / r12..r15.
11711 @item -mlra-priority-noncompact
11712 @opindex mlra-priority-noncompact
11713 Reduce target regsiter priority for r0..r3 / r12..r15.
11715 @item -mno-millicode
11716 @opindex mno-millicode
11717 When optimizing for size (using @option{-Os}), prologues and epilogues
11718 that have to save or restore a large number of registers are often
11719 shortened by using call to a special function in libgcc; this is
11720 referred to as a @emph{millicode} call.  As these calls can pose
11721 performance issues, and/or cause linking issues when linking in a
11722 nonstandard way, this option is provided to turn off millicode call
11723 generation.
11725 @item -mmixed-code
11726 @opindex mmixed-code
11727 Tweak register allocation to help 16-bit instruction generation.
11728 This generally has the effect of decreasing the average instruction size
11729 while increasing the instruction count.
11731 @item -mq-class
11732 @opindex mq-class
11733 Enable 'q' instruction alternatives.
11734 This is the default for @option{-Os}.
11736 @item -mRcq
11737 @opindex mRcq
11738 Enable Rcq constraint handling - most short code generation depends on this.
11739 This is the default.
11741 @item -mRcw
11742 @opindex mRcw
11743 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
11744 This is the default.
11746 @item -msize-level=@var{level}
11747 @ opindex msize-level
11748 Fine-tune size optimization with regards to instruction lengths and alignment.
11749 The recognized values for @var{level} are:
11750 @table @samp
11751 @item 0
11752 No size optimization.  This level is deprecated and treated like @samp{1}.
11754 @item 1
11755 Short instructions are used opportunistically.
11757 @item 2
11758 In addition, alignment of loops and of code after barriers are dropped.
11760 @item 3
11761 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
11763 @end table
11765 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
11766 the behavior when this is not set is equivalent to level @samp{1}.
11768 @item -mtune=@var{cpu}
11769 @opindex mtune
11770 Set instruction scheduling parameters for @var{cpu}, overriding any implied
11771 by @option{-mcpu=}.
11773 Supported values for @var{cpu} are
11775 @table @samp
11776 @item ARC600
11777 Tune for ARC600 cpu.
11779 @item ARC601
11780 Tune for ARC601 cpu.
11782 @item ARC700
11783 Tune for ARC700 cpu with standard multiplier block.
11785 @item ARC700-xmac
11786 Tune for ARC700 cpu with XMAC block.
11788 @item ARC725D
11789 Tune for ARC725D cpu.
11791 @item ARC750D
11792 Tune for ARC750D cpu.
11794 @end table
11796 @item -mmultcost=@var{num}
11797 @opindex mmultcost
11798 Cost to assume for a multiply instruction, with @samp{4} being equal to a
11799 normal instruction.
11801 @item -munalign-prob-threshold=@var{probability}
11802 @opindex munalign-prob-threshold
11803 Set probability threshold for unaligning branches.
11804 When tuning for @samp{ARC700} and optimizing for speed, branches without
11805 filled delay slot are preferably emitted unaligned and long, unless
11806 profiling indicates that the probability for the branch to be taken
11807 is below @var{probability}.  @xref{Cross-profiling}.
11808 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
11810 @end table
11812 The following options are maintained for backward compatibility, but
11813 are now deprecated and will be removed in a future release:
11815 @c Deprecated options
11816 @table @gcctabopt
11818 @item -margonaut
11819 @opindex margonaut
11820 Obsolete FPX.
11822 @item -mbig-endian
11823 @opindex mbig-endian
11824 @itemx -EB
11825 @opindex EB
11826 Compile code for big endian targets.  Use of these options is now
11827 deprecated.  Users wanting big-endian code, should use the
11828 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
11829 building the tool chain, for which big-endian is the default.
11831 @item -mlittle-endian
11832 @opindex mlittle-endian
11833 @itemx -EL
11834 @opindex EL
11835 Compile code for little endian targets.  Use of these options is now
11836 deprecated.  Users wanting little-endian code should use the
11837 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
11838 building the tool chain, for which little-endian is the default.
11840 @item -mbarrel_shifter
11841 @opindex mbarrel_shifter
11842 Replaced by @samp{-mbarrel-shifter}
11844 @item -mdpfp_compact
11845 @opindex mdpfp_compact
11846 Replaced by @samp{-mdpfp-compact}
11848 @item -mdpfp_fast
11849 @opindex mdpfp_fast
11850 Replaced by @samp{-mdpfp-fast}
11852 @item -mdsp_packa
11853 @opindex mdsp_packa
11854 Replaced by @samp{-mdsp-packa}
11856 @item -mEA
11857 @opindex mEA
11858 Replaced by @samp{-mea}
11860 @item -mmac_24
11861 @opindex mmac_24
11862 Replaced by @samp{-mmac-24}
11864 @item -mmac_d16
11865 @opindex mmac_d16
11866 Replaced by @samp{-mmac-d16}
11868 @item -mspfp_compact
11869 @opindex mspfp_compact
11870 Replaced by @samp{-mspfp-compact}
11872 @item -mspfp_fast
11873 @opindex mspfp_fast
11874 Replaced by @samp{-mspfp-fast}
11876 @item -mtune=@var{cpu}
11877 @opindex mtune
11878 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
11879 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
11880 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
11882 @item -multcost=@var{num}
11883 @opindex multcost
11884 Replaced by @samp{-mmultcost}.
11886 @end table
11888 @node ARM Options
11889 @subsection ARM Options
11890 @cindex ARM options
11892 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11893 architectures:
11895 @table @gcctabopt
11896 @item -mabi=@var{name}
11897 @opindex mabi
11898 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11899 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11901 @item -mapcs-frame
11902 @opindex mapcs-frame
11903 Generate a stack frame that is compliant with the ARM Procedure Call
11904 Standard for all functions, even if this is not strictly necessary for
11905 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11906 with this option causes the stack frames not to be generated for
11907 leaf functions.  The default is @option{-mno-apcs-frame}.
11909 @item -mapcs
11910 @opindex mapcs
11911 This is a synonym for @option{-mapcs-frame}.
11913 @ignore
11914 @c not currently implemented
11915 @item -mapcs-stack-check
11916 @opindex mapcs-stack-check
11917 Generate code to check the amount of stack space available upon entry to
11918 every function (that actually uses some stack space).  If there is
11919 insufficient space available then either the function
11920 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11921 called, depending upon the amount of stack space required.  The runtime
11922 system is required to provide these functions.  The default is
11923 @option{-mno-apcs-stack-check}, since this produces smaller code.
11925 @c not currently implemented
11926 @item -mapcs-float
11927 @opindex mapcs-float
11928 Pass floating-point arguments using the floating-point registers.  This is
11929 one of the variants of the APCS@.  This option is recommended if the
11930 target hardware has a floating-point unit or if a lot of floating-point
11931 arithmetic is going to be performed by the code.  The default is
11932 @option{-mno-apcs-float}, since the size of integer-only code is 
11933 slightly increased if @option{-mapcs-float} is used.
11935 @c not currently implemented
11936 @item -mapcs-reentrant
11937 @opindex mapcs-reentrant
11938 Generate reentrant, position-independent code.  The default is
11939 @option{-mno-apcs-reentrant}.
11940 @end ignore
11942 @item -mthumb-interwork
11943 @opindex mthumb-interwork
11944 Generate code that supports calling between the ARM and Thumb
11945 instruction sets.  Without this option, on pre-v5 architectures, the
11946 two instruction sets cannot be reliably used inside one program.  The
11947 default is @option{-mno-thumb-interwork}, since slightly larger code
11948 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11949 configurations this option is meaningless.
11951 @item -mno-sched-prolog
11952 @opindex mno-sched-prolog
11953 Prevent the reordering of instructions in the function prologue, or the
11954 merging of those instruction with the instructions in the function's
11955 body.  This means that all functions start with a recognizable set
11956 of instructions (or in fact one of a choice from a small set of
11957 different function prologues), and this information can be used to
11958 locate the start of functions inside an executable piece of code.  The
11959 default is @option{-msched-prolog}.
11961 @item -mfloat-abi=@var{name}
11962 @opindex mfloat-abi
11963 Specifies which floating-point ABI to use.  Permissible values
11964 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11966 Specifying @samp{soft} causes GCC to generate output containing
11967 library calls for floating-point operations.
11968 @samp{softfp} allows the generation of code using hardware floating-point
11969 instructions, but still uses the soft-float calling conventions.
11970 @samp{hard} allows generation of floating-point instructions
11971 and uses FPU-specific calling conventions.
11973 The default depends on the specific target configuration.  Note that
11974 the hard-float and soft-float ABIs are not link-compatible; you must
11975 compile your entire program with the same ABI, and link with a
11976 compatible set of libraries.
11978 @item -mlittle-endian
11979 @opindex mlittle-endian
11980 Generate code for a processor running in little-endian mode.  This is
11981 the default for all standard configurations.
11983 @item -mbig-endian
11984 @opindex mbig-endian
11985 Generate code for a processor running in big-endian mode; the default is
11986 to compile code for a little-endian processor.
11988 @item -mwords-little-endian
11989 @opindex mwords-little-endian
11990 This option only applies when generating code for big-endian processors.
11991 Generate code for a little-endian word order but a big-endian byte
11992 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11993 option should only be used if you require compatibility with code for
11994 big-endian ARM processors generated by versions of the compiler prior to
11995 2.8.  This option is now deprecated.
11997 @item -mcpu=@var{name}
11998 @opindex mcpu
11999 This specifies the name of the target ARM processor.  GCC uses this name
12000 to determine what kind of instructions it can emit when generating
12001 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
12002 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
12003 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
12004 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
12005 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
12006 @samp{arm720},
12007 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
12008 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
12009 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
12010 @samp{strongarm1110},
12011 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
12012 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
12013 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
12014 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
12015 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
12016 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
12017 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
12018 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
12019 @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-r4}, @samp{cortex-r4f},
12020 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
12021 @samp{cortex-m1},
12022 @samp{cortex-m0},
12023 @samp{cortex-m0plus},
12024 @samp{marvell-pj4},
12025 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
12026 @samp{fa526}, @samp{fa626},
12027 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
12030 @option{-mcpu=generic-@var{arch}} is also permissible, and is
12031 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
12032 See @option{-mtune} for more information.
12034 @option{-mcpu=native} causes the compiler to auto-detect the CPU
12035 of the build computer.  At present, this feature is only supported on
12036 Linux, and not all architectures are recognized.  If the auto-detect is
12037 unsuccessful the option has no effect.
12039 @item -mtune=@var{name}
12040 @opindex mtune
12041 This option is very similar to the @option{-mcpu=} option, except that
12042 instead of specifying the actual target processor type, and hence
12043 restricting which instructions can be used, it specifies that GCC should
12044 tune the performance of the code as if the target were of the type
12045 specified in this option, but still choosing the instructions it
12046 generates based on the CPU specified by a @option{-mcpu=} option.
12047 For some ARM implementations better performance can be obtained by using
12048 this option.
12050 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
12051 performance for a blend of processors within architecture @var{arch}.
12052 The aim is to generate code that run well on the current most popular
12053 processors, balancing between optimizations that benefit some CPUs in the
12054 range, and avoiding performance pitfalls of other CPUs.  The effects of
12055 this option may change in future GCC versions as CPU models come and go.
12057 @option{-mtune=native} causes the compiler to auto-detect the CPU
12058 of the build computer.  At present, this feature is only supported on
12059 Linux, and not all architectures are recognized.  If the auto-detect is
12060 unsuccessful the option has no effect.
12062 @item -march=@var{name}
12063 @opindex march
12064 This specifies the name of the target ARM architecture.  GCC uses this
12065 name to determine what kind of instructions it can emit when generating
12066 assembly code.  This option can be used in conjunction with or instead
12067 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
12068 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
12069 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
12070 @samp{armv6}, @samp{armv6j},
12071 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
12072 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
12073 @samp{armv8-a},
12074 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
12076 @option{-march=native} causes the compiler to auto-detect the architecture
12077 of the build computer.  At present, this feature is only supported on
12078 Linux, and not all architectures are recognized.  If the auto-detect is
12079 unsuccessful the option has no effect.
12081 @item -mfpu=@var{name}
12082 @opindex mfpu
12083 This specifies what floating-point hardware (or hardware emulation) is
12084 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
12085 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
12086 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
12087 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
12088 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
12090 If @option{-msoft-float} is specified this specifies the format of
12091 floating-point values.
12093 If the selected floating-point hardware includes the NEON extension
12094 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
12095 operations are not generated by GCC's auto-vectorization pass unless
12096 @option{-funsafe-math-optimizations} is also specified.  This is
12097 because NEON hardware does not fully implement the IEEE 754 standard for
12098 floating-point arithmetic (in particular denormal values are treated as
12099 zero), so the use of NEON instructions may lead to a loss of precision.
12101 @item -mfp16-format=@var{name}
12102 @opindex mfp16-format
12103 Specify the format of the @code{__fp16} half-precision floating-point type.
12104 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
12105 the default is @samp{none}, in which case the @code{__fp16} type is not
12106 defined.  @xref{Half-Precision}, for more information.
12108 @item -mstructure-size-boundary=@var{n}
12109 @opindex mstructure-size-boundary
12110 The sizes of all structures and unions are rounded up to a multiple
12111 of the number of bits set by this option.  Permissible values are 8, 32
12112 and 64.  The default value varies for different toolchains.  For the COFF
12113 targeted toolchain the default value is 8.  A value of 64 is only allowed
12114 if the underlying ABI supports it.
12116 Specifying a larger number can produce faster, more efficient code, but
12117 can also increase the size of the program.  Different values are potentially
12118 incompatible.  Code compiled with one value cannot necessarily expect to
12119 work with code or libraries compiled with another value, if they exchange
12120 information using structures or unions.
12122 @item -mabort-on-noreturn
12123 @opindex mabort-on-noreturn
12124 Generate a call to the function @code{abort} at the end of a
12125 @code{noreturn} function.  It is executed if the function tries to
12126 return.
12128 @item -mlong-calls
12129 @itemx -mno-long-calls
12130 @opindex mlong-calls
12131 @opindex mno-long-calls
12132 Tells the compiler to perform function calls by first loading the
12133 address of the function into a register and then performing a subroutine
12134 call on this register.  This switch is needed if the target function
12135 lies outside of the 64-megabyte addressing range of the offset-based
12136 version of subroutine call instruction.
12138 Even if this switch is enabled, not all function calls are turned
12139 into long calls.  The heuristic is that static functions, functions
12140 that have the @samp{short-call} attribute, functions that are inside
12141 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
12142 definitions have already been compiled within the current compilation
12143 unit are not turned into long calls.  The exceptions to this rule are
12144 that weak function definitions, functions with the @samp{long-call}
12145 attribute or the @samp{section} attribute, and functions that are within
12146 the scope of a @samp{#pragma long_calls} directive are always
12147 turned into long calls.
12149 This feature is not enabled by default.  Specifying
12150 @option{-mno-long-calls} restores the default behavior, as does
12151 placing the function calls within the scope of a @samp{#pragma
12152 long_calls_off} directive.  Note these switches have no effect on how
12153 the compiler generates code to handle function calls via function
12154 pointers.
12156 @item -msingle-pic-base
12157 @opindex msingle-pic-base
12158 Treat the register used for PIC addressing as read-only, rather than
12159 loading it in the prologue for each function.  The runtime system is
12160 responsible for initializing this register with an appropriate value
12161 before execution begins.
12163 @item -mpic-register=@var{reg}
12164 @opindex mpic-register
12165 Specify the register to be used for PIC addressing.  The default is R10
12166 unless stack-checking is enabled, when R9 is used.
12168 @item -mpoke-function-name
12169 @opindex mpoke-function-name
12170 Write the name of each function into the text section, directly
12171 preceding the function prologue.  The generated code is similar to this:
12173 @smallexample
12174      t0
12175          .ascii "arm_poke_function_name", 0
12176          .align
12177      t1
12178          .word 0xff000000 + (t1 - t0)
12179      arm_poke_function_name
12180          mov     ip, sp
12181          stmfd   sp!, @{fp, ip, lr, pc@}
12182          sub     fp, ip, #4
12183 @end smallexample
12185 When performing a stack backtrace, code can inspect the value of
12186 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
12187 location @code{pc - 12} and the top 8 bits are set, then we know that
12188 there is a function name embedded immediately preceding this location
12189 and has length @code{((pc[-3]) & 0xff000000)}.
12191 @item -mthumb
12192 @itemx -marm
12193 @opindex marm
12194 @opindex mthumb
12196 Select between generating code that executes in ARM and Thumb
12197 states.  The default for most configurations is to generate code
12198 that executes in ARM state, but the default can be changed by
12199 configuring GCC with the @option{--with-mode=}@var{state}
12200 configure option.
12202 @item -mtpcs-frame
12203 @opindex mtpcs-frame
12204 Generate a stack frame that is compliant with the Thumb Procedure Call
12205 Standard for all non-leaf functions.  (A leaf function is one that does
12206 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
12208 @item -mtpcs-leaf-frame
12209 @opindex mtpcs-leaf-frame
12210 Generate a stack frame that is compliant with the Thumb Procedure Call
12211 Standard for all leaf functions.  (A leaf function is one that does
12212 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
12214 @item -mcallee-super-interworking
12215 @opindex mcallee-super-interworking
12216 Gives all externally visible functions in the file being compiled an ARM
12217 instruction set header which switches to Thumb mode before executing the
12218 rest of the function.  This allows these functions to be called from
12219 non-interworking code.  This option is not valid in AAPCS configurations
12220 because interworking is enabled by default.
12222 @item -mcaller-super-interworking
12223 @opindex mcaller-super-interworking
12224 Allows calls via function pointers (including virtual functions) to
12225 execute correctly regardless of whether the target code has been
12226 compiled for interworking or not.  There is a small overhead in the cost
12227 of executing a function pointer if this option is enabled.  This option
12228 is not valid in AAPCS configurations because interworking is enabled
12229 by default.
12231 @item -mtp=@var{name}
12232 @opindex mtp
12233 Specify the access model for the thread local storage pointer.  The valid
12234 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
12235 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
12236 (supported in the arm6k architecture), and @option{auto}, which uses the
12237 best available method for the selected processor.  The default setting is
12238 @option{auto}.
12240 @item -mtls-dialect=@var{dialect}
12241 @opindex mtls-dialect
12242 Specify the dialect to use for accessing thread local storage.  Two
12243 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
12244 @samp{gnu} dialect selects the original GNU scheme for supporting
12245 local and global dynamic TLS models.  The @samp{gnu2} dialect
12246 selects the GNU descriptor scheme, which provides better performance
12247 for shared libraries.  The GNU descriptor scheme is compatible with
12248 the original scheme, but does require new assembler, linker and
12249 library support.  Initial and local exec TLS models are unaffected by
12250 this option and always use the original scheme.
12252 @item -mword-relocations
12253 @opindex mword-relocations
12254 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
12255 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
12256 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
12257 is specified.
12259 @item -mfix-cortex-m3-ldrd
12260 @opindex mfix-cortex-m3-ldrd
12261 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
12262 with overlapping destination and base registers are used.  This option avoids
12263 generating these instructions.  This option is enabled by default when
12264 @option{-mcpu=cortex-m3} is specified.
12266 @item -munaligned-access
12267 @itemx -mno-unaligned-access
12268 @opindex munaligned-access
12269 @opindex mno-unaligned-access
12270 Enables (or disables) reading and writing of 16- and 32- bit values
12271 from addresses that are not 16- or 32- bit aligned.  By default
12272 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
12273 architectures, and enabled for all other architectures.  If unaligned
12274 access is not enabled then words in packed data structures will be
12275 accessed a byte at a time.
12277 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
12278 generated object file to either true or false, depending upon the
12279 setting of this option.  If unaligned access is enabled then the
12280 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
12281 defined.
12283 @item -mneon-for-64bits
12284 @opindex mneon-for-64bits
12285 Enables using Neon to handle scalar 64-bits operations. This is
12286 disabled by default since the cost of moving data from core registers
12287 to Neon is high.
12289 @item -mrestrict-it
12290 @opindex mrestrict-it
12291 Restricts generation of IT blocks to conform to the rules of ARMv8.
12292 IT blocks can only contain a single 16-bit instruction from a select
12293 set of instructions. This option is on by default for ARMv8 Thumb mode.
12294 @end table
12296 @node AVR Options
12297 @subsection AVR Options
12298 @cindex AVR Options
12300 These options are defined for AVR implementations:
12302 @table @gcctabopt
12303 @item -mmcu=@var{mcu}
12304 @opindex mmcu
12305 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
12307 The default for this option is@tie{}@code{avr2}.
12309 GCC supports the following AVR devices and ISAs:
12311 @include avr-mmcu.texi
12313 @item -maccumulate-args
12314 @opindex maccumulate-args
12315 Accumulate outgoing function arguments and acquire/release the needed
12316 stack space for outgoing function arguments once in function
12317 prologue/epilogue.  Without this option, outgoing arguments are pushed
12318 before calling a function and popped afterwards.
12320 Popping the arguments after the function call can be expensive on
12321 AVR so that accumulating the stack space might lead to smaller
12322 executables because arguments need not to be removed from the
12323 stack after such a function call.
12325 This option can lead to reduced code size for functions that perform
12326 several calls to functions that get their arguments on the stack like
12327 calls to printf-like functions.
12329 @item -mbranch-cost=@var{cost}
12330 @opindex mbranch-cost
12331 Set the branch costs for conditional branch instructions to
12332 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
12333 integers. The default branch cost is 0.
12335 @item -mcall-prologues
12336 @opindex mcall-prologues
12337 Functions prologues/epilogues are expanded as calls to appropriate
12338 subroutines.  Code size is smaller.
12340 @item -mint8
12341 @opindex mint8
12342 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
12343 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
12344 and @code{long long} is 4 bytes.  Please note that this option does not
12345 conform to the C standards, but it results in smaller code
12346 size.
12348 @item -mno-interrupts
12349 @opindex mno-interrupts
12350 Generated code is not compatible with hardware interrupts.
12351 Code size is smaller.
12353 @item -mrelax
12354 @opindex mrelax
12355 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
12356 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
12357 Setting @code{-mrelax} just adds the @code{--relax} option to the
12358 linker command line when the linker is called.
12360 Jump relaxing is performed by the linker because jump offsets are not
12361 known before code is located. Therefore, the assembler code generated by the
12362 compiler is the same, but the instructions in the executable may
12363 differ from instructions in the assembler code.
12365 Relaxing must be turned on if linker stubs are needed, see the
12366 section on @code{EIND} and linker stubs below.
12368 @item -msp8
12369 @opindex msp8
12370 Treat the stack pointer register as an 8-bit register,
12371 i.e.@: assume the high byte of the stack pointer is zero.
12372 In general, you don't need to set this option by hand.
12374 This option is used internally by the compiler to select and
12375 build multilibs for architectures @code{avr2} and @code{avr25}.
12376 These architectures mix devices with and without @code{SPH}.
12377 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
12378 the compiler driver will add or remove this option from the compiler
12379 proper's command line, because the compiler then knows if the device
12380 or architecture has an 8-bit stack pointer and thus no @code{SPH}
12381 register or not.
12383 @item -mstrict-X
12384 @opindex mstrict-X
12385 Use address register @code{X} in a way proposed by the hardware.  This means
12386 that @code{X} is only used in indirect, post-increment or
12387 pre-decrement addressing.
12389 Without this option, the @code{X} register may be used in the same way
12390 as @code{Y} or @code{Z} which then is emulated by additional
12391 instructions.  
12392 For example, loading a value with @code{X+const} addressing with a
12393 small non-negative @code{const < 64} to a register @var{Rn} is
12394 performed as
12396 @example
12397 adiw r26, const   ; X += const
12398 ld   @var{Rn}, X        ; @var{Rn} = *X
12399 sbiw r26, const   ; X -= const
12400 @end example
12402 @item -mtiny-stack
12403 @opindex mtiny-stack
12404 Only change the lower 8@tie{}bits of the stack pointer.
12406 @item -Waddr-space-convert
12407 @opindex Waddr-space-convert
12408 Warn about conversions between address spaces in the case where the
12409 resulting address space is not contained in the incoming address space.
12410 @end table
12412 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
12413 @cindex @code{EIND}
12414 Pointers in the implementation are 16@tie{}bits wide.
12415 The address of a function or label is represented as word address so
12416 that indirect jumps and calls can target any code address in the
12417 range of 64@tie{}Ki words.
12419 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
12420 bytes of program memory space, there is a special function register called
12421 @code{EIND} that serves as most significant part of the target address
12422 when @code{EICALL} or @code{EIJMP} instructions are used.
12424 Indirect jumps and calls on these devices are handled as follows by
12425 the compiler and are subject to some limitations:
12427 @itemize @bullet
12429 @item
12430 The compiler never sets @code{EIND}.
12432 @item
12433 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
12434 instructions or might read @code{EIND} directly in order to emulate an
12435 indirect call/jump by means of a @code{RET} instruction.
12437 @item
12438 The compiler assumes that @code{EIND} never changes during the startup
12439 code or during the application. In particular, @code{EIND} is not
12440 saved/restored in function or interrupt service routine
12441 prologue/epilogue.
12443 @item
12444 For indirect calls to functions and computed goto, the linker
12445 generates @emph{stubs}. Stubs are jump pads sometimes also called
12446 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
12447 The stub contains a direct jump to the desired address.
12449 @item
12450 Linker relaxation must be turned on so that the linker will generate
12451 the stubs correctly an all situaltion. See the compiler option
12452 @code{-mrelax} and the linler option @code{--relax}.
12453 There are corner cases where the linker is supposed to generate stubs
12454 but aborts without relaxation and without a helpful error message.
12456 @item
12457 The default linker script is arranged for code with @code{EIND = 0}.
12458 If code is supposed to work for a setup with @code{EIND != 0}, a custom
12459 linker script has to be used in order to place the sections whose
12460 name start with @code{.trampolines} into the segment where @code{EIND}
12461 points to.
12463 @item
12464 The startup code from libgcc never sets @code{EIND}.
12465 Notice that startup code is a blend of code from libgcc and AVR-LibC.
12466 For the impact of AVR-LibC on @code{EIND}, see the
12467 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
12469 @item
12470 It is legitimate for user-specific startup code to set up @code{EIND}
12471 early, for example by means of initialization code located in
12472 section @code{.init3}. Such code runs prior to general startup code
12473 that initializes RAM and calls constructors, but after the bit
12474 of startup code from AVR-LibC that sets @code{EIND} to the segment
12475 where the vector table is located.
12476 @example
12477 #include <avr/io.h>
12479 static void
12480 __attribute__((section(".init3"),naked,used,no_instrument_function))
12481 init3_set_eind (void)
12483   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
12484                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
12486 @end example
12488 @noindent
12489 The @code{__trampolines_start} symbol is defined in the linker script.
12491 @item
12492 Stubs are generated automatically by the linker if
12493 the following two conditions are met:
12494 @itemize @minus
12496 @item The address of a label is taken by means of the @code{gs} modifier
12497 (short for @emph{generate stubs}) like so:
12498 @example
12499 LDI r24, lo8(gs(@var{func}))
12500 LDI r25, hi8(gs(@var{func}))
12501 @end example
12502 @item The final location of that label is in a code segment
12503 @emph{outside} the segment where the stubs are located.
12504 @end itemize
12506 @item
12507 The compiler emits such @code{gs} modifiers for code labels in the
12508 following situations:
12509 @itemize @minus
12510 @item Taking address of a function or code label.
12511 @item Computed goto.
12512 @item If prologue-save function is used, see @option{-mcall-prologues}
12513 command-line option.
12514 @item Switch/case dispatch tables. If you do not want such dispatch
12515 tables you can specify the @option{-fno-jump-tables} command-line option.
12516 @item C and C++ constructors/destructors called during startup/shutdown.
12517 @item If the tools hit a @code{gs()} modifier explained above.
12518 @end itemize
12520 @item
12521 Jumping to non-symbolic addresses like so is @emph{not} supported:
12523 @example
12524 int main (void)
12526     /* Call function at word address 0x2 */
12527     return ((int(*)(void)) 0x2)();
12529 @end example
12531 Instead, a stub has to be set up, i.e.@: the function has to be called
12532 through a symbol (@code{func_4} in the example):
12534 @example
12535 int main (void)
12537     extern int func_4 (void);
12539     /* Call function at byte address 0x4 */
12540     return func_4();
12542 @end example
12544 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
12545 Alternatively, @code{func_4} can be defined in the linker script.
12546 @end itemize
12548 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
12549 @cindex @code{RAMPD}
12550 @cindex @code{RAMPX}
12551 @cindex @code{RAMPY}
12552 @cindex @code{RAMPZ}
12553 Some AVR devices support memories larger than the 64@tie{}KiB range
12554 that can be accessed with 16-bit pointers.  To access memory locations
12555 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
12556 register is used as high part of the address:
12557 The @code{X}, @code{Y}, @code{Z} address register is concatenated
12558 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
12559 register, respectively, to get a wide address. Similarly,
12560 @code{RAMPD} is used together with direct addressing.
12562 @itemize
12563 @item
12564 The startup code initializes the @code{RAMP} special function
12565 registers with zero.
12567 @item
12568 If a @ref{AVR Named Address Spaces,named address space} other than
12569 generic or @code{__flash} is used, then @code{RAMPZ} is set
12570 as needed before the operation.
12572 @item
12573 If the device supports RAM larger than 64@tie{}KiB and the compiler
12574 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
12575 is reset to zero after the operation.
12577 @item
12578 If the device comes with a specific @code{RAMP} register, the ISR
12579 prologue/epilogue saves/restores that SFR and initializes it with
12580 zero in case the ISR code might (implicitly) use it.
12582 @item
12583 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
12584 If you use inline assembler to read from locations outside the
12585 16-bit address range and change one of the @code{RAMP} registers,
12586 you must reset it to zero after the access.
12588 @end itemize
12590 @subsubsection AVR Built-in Macros
12592 GCC defines several built-in macros so that the user code can test
12593 for the presence or absence of features.  Almost any of the following
12594 built-in macros are deduced from device capabilities and thus
12595 triggered by the @code{-mmcu=} command-line option.
12597 For even more AVR-specific built-in macros see
12598 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
12600 @table @code
12602 @item __AVR_ARCH__
12603 Build-in macro that resolves to a decimal number that identifies the
12604 architecture and depends on the @code{-mmcu=@var{mcu}} option.
12605 Possible values are:
12607 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
12608 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
12609 @code{105}, @code{106}, @code{107}
12611 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
12612 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
12613 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
12614 @code{avrxmega6}, @code{avrxmega7}, respectively.
12615 If @var{mcu} specifies a device, this built-in macro is set
12616 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
12617 defined to @code{4}.
12619 @item __AVR_@var{Device}__
12620 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
12621 the device's name. For example, @code{-mmcu=atmega8} defines the
12622 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
12623 @code{__AVR_ATtiny261A__}, etc.
12625 The built-in macros' names follow
12626 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
12627 the device name as from the AVR user manual. The difference between
12628 @var{Device} in the built-in macro and @var{device} in
12629 @code{-mmcu=@var{device}} is that the latter is always lowercase.
12631 If @var{device} is not a device but only a core architecture like
12632 @code{avr51}, this macro will not be defined.
12634 @item __AVR_XMEGA__
12635 The device / architecture belongs to the XMEGA family of devices.
12637 @item __AVR_HAVE_ELPM__
12638 The device has the the @code{ELPM} instruction.
12640 @item __AVR_HAVE_ELPMX__
12641 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
12642 R@var{n},Z+} instructions.
12644 @item __AVR_HAVE_MOVW__
12645 The device has the @code{MOVW} instruction to perform 16-bit
12646 register-register moves.
12648 @item __AVR_HAVE_LPMX__
12649 The device has the @code{LPM R@var{n},Z} and
12650 @code{LPM R@var{n},Z+} instructions.
12652 @item __AVR_HAVE_MUL__
12653 The device has a hardware multiplier. 
12655 @item __AVR_HAVE_JMP_CALL__
12656 The device has the @code{JMP} and @code{CALL} instructions.
12657 This is the case for devices with at least 16@tie{}KiB of program
12658 memory.
12660 @item __AVR_HAVE_EIJMP_EICALL__
12661 @itemx __AVR_3_BYTE_PC__
12662 The device has the @code{EIJMP} and @code{EICALL} instructions.
12663 This is the case for devices with more than 128@tie{}KiB of program memory.
12664 This also means that the program counter
12665 (PC) is 3@tie{}bytes wide.
12667 @item __AVR_2_BYTE_PC__
12668 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
12669 with up to 128@tie{}KiB of program memory.
12671 @item __AVR_HAVE_8BIT_SP__
12672 @itemx __AVR_HAVE_16BIT_SP__
12673 The stack pointer (SP) register is treated as 8-bit respectively
12674 16-bit register by the compiler.
12675 The definition of these macros is affected by @code{-mtiny-stack}.
12677 @item __AVR_HAVE_SPH__
12678 @itemx __AVR_SP8__
12679 The device has the SPH (high part of stack pointer) special function
12680 register or has an 8-bit stack pointer, respectively.
12681 The definition of these macros is affected by @code{-mmcu=} and
12682 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
12683 by @code{-msp8}.
12685 @item __AVR_HAVE_RAMPD__
12686 @itemx __AVR_HAVE_RAMPX__
12687 @itemx __AVR_HAVE_RAMPY__
12688 @itemx __AVR_HAVE_RAMPZ__
12689 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
12690 @code{RAMPZ} special function register, respectively.
12692 @item __NO_INTERRUPTS__
12693 This macro reflects the @code{-mno-interrupts} command line option.
12695 @item __AVR_ERRATA_SKIP__
12696 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
12697 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
12698 instructions because of a hardware erratum.  Skip instructions are
12699 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
12700 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
12701 set.
12703 @item __AVR_SFR_OFFSET__=@var{offset}
12704 Instructions that can address I/O special function registers directly
12705 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
12706 address as if addressed by an instruction to access RAM like @code{LD}
12707 or @code{STS}. This offset depends on the device architecture and has
12708 to be subtracted from the RAM address in order to get the
12709 respective I/O@tie{}address.
12711 @item __WITH_AVRLIBC__
12712 The compiler is configured to be used together with AVR-Libc.
12713 See the @code{--with-avrlibc} configure option.
12715 @end table
12717 @node Blackfin Options
12718 @subsection Blackfin Options
12719 @cindex Blackfin Options
12721 @table @gcctabopt
12722 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
12723 @opindex mcpu=
12724 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
12725 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
12726 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
12727 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
12728 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
12729 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
12730 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
12731 @samp{bf561}, @samp{bf592}.
12733 The optional @var{sirevision} specifies the silicon revision of the target
12734 Blackfin processor.  Any workarounds available for the targeted silicon revision
12735 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
12736 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
12737 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
12738 hexadecimal digits representing the major and minor numbers in the silicon
12739 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
12740 is not defined.  If @var{sirevision} is @samp{any}, the
12741 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
12742 If this optional @var{sirevision} is not used, GCC assumes the latest known
12743 silicon revision of the targeted Blackfin processor.
12745 GCC defines a preprocessor macro for the specified @var{cpu}.
12746 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
12747 provided by libgloss to be linked in if @option{-msim} is not given.
12749 Without this option, @samp{bf532} is used as the processor by default.
12751 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
12752 only the preprocessor macro is defined.
12754 @item -msim
12755 @opindex msim
12756 Specifies that the program will be run on the simulator.  This causes
12757 the simulator BSP provided by libgloss to be linked in.  This option
12758 has effect only for @samp{bfin-elf} toolchain.
12759 Certain other options, such as @option{-mid-shared-library} and
12760 @option{-mfdpic}, imply @option{-msim}.
12762 @item -momit-leaf-frame-pointer
12763 @opindex momit-leaf-frame-pointer
12764 Don't keep the frame pointer in a register for leaf functions.  This
12765 avoids the instructions to save, set up and restore frame pointers and
12766 makes an extra register available in leaf functions.  The option
12767 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
12768 which might make debugging harder.
12770 @item -mspecld-anomaly
12771 @opindex mspecld-anomaly
12772 When enabled, the compiler ensures that the generated code does not
12773 contain speculative loads after jump instructions. If this option is used,
12774 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
12776 @item -mno-specld-anomaly
12777 @opindex mno-specld-anomaly
12778 Don't generate extra code to prevent speculative loads from occurring.
12780 @item -mcsync-anomaly
12781 @opindex mcsync-anomaly
12782 When enabled, the compiler ensures that the generated code does not
12783 contain CSYNC or SSYNC instructions too soon after conditional branches.
12784 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
12786 @item -mno-csync-anomaly
12787 @opindex mno-csync-anomaly
12788 Don't generate extra code to prevent CSYNC or SSYNC instructions from
12789 occurring too soon after a conditional branch.
12791 @item -mlow-64k
12792 @opindex mlow-64k
12793 When enabled, the compiler is free to take advantage of the knowledge that
12794 the entire program fits into the low 64k of memory.
12796 @item -mno-low-64k
12797 @opindex mno-low-64k
12798 Assume that the program is arbitrarily large.  This is the default.
12800 @item -mstack-check-l1
12801 @opindex mstack-check-l1
12802 Do stack checking using information placed into L1 scratchpad memory by the
12803 uClinux kernel.
12805 @item -mid-shared-library
12806 @opindex mid-shared-library
12807 Generate code that supports shared libraries via the library ID method.
12808 This allows for execute in place and shared libraries in an environment
12809 without virtual memory management.  This option implies @option{-fPIC}.
12810 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12812 @item -mno-id-shared-library
12813 @opindex mno-id-shared-library
12814 Generate code that doesn't assume ID-based shared libraries are being used.
12815 This is the default.
12817 @item -mleaf-id-shared-library
12818 @opindex mleaf-id-shared-library
12819 Generate code that supports shared libraries via the library ID method,
12820 but assumes that this library or executable won't link against any other
12821 ID shared libraries.  That allows the compiler to use faster code for jumps
12822 and calls.
12824 @item -mno-leaf-id-shared-library
12825 @opindex mno-leaf-id-shared-library
12826 Do not assume that the code being compiled won't link against any ID shared
12827 libraries.  Slower code is generated for jump and call insns.
12829 @item -mshared-library-id=n
12830 @opindex mshared-library-id
12831 Specifies the identification number of the ID-based shared library being
12832 compiled.  Specifying a value of 0 generates more compact code; specifying
12833 other values forces the allocation of that number to the current
12834 library but is no more space- or time-efficient than omitting this option.
12836 @item -msep-data
12837 @opindex msep-data
12838 Generate code that allows the data segment to be located in a different
12839 area of memory from the text segment.  This allows for execute in place in
12840 an environment without virtual memory management by eliminating relocations
12841 against the text section.
12843 @item -mno-sep-data
12844 @opindex mno-sep-data
12845 Generate code that assumes that the data segment follows the text segment.
12846 This is the default.
12848 @item -mlong-calls
12849 @itemx -mno-long-calls
12850 @opindex mlong-calls
12851 @opindex mno-long-calls
12852 Tells the compiler to perform function calls by first loading the
12853 address of the function into a register and then performing a subroutine
12854 call on this register.  This switch is needed if the target function
12855 lies outside of the 24-bit addressing range of the offset-based
12856 version of subroutine call instruction.
12858 This feature is not enabled by default.  Specifying
12859 @option{-mno-long-calls} restores the default behavior.  Note these
12860 switches have no effect on how the compiler generates code to handle
12861 function calls via function pointers.
12863 @item -mfast-fp
12864 @opindex mfast-fp
12865 Link with the fast floating-point library. This library relaxes some of
12866 the IEEE floating-point standard's rules for checking inputs against
12867 Not-a-Number (NAN), in the interest of performance.
12869 @item -minline-plt
12870 @opindex minline-plt
12871 Enable inlining of PLT entries in function calls to functions that are
12872 not known to bind locally.  It has no effect without @option{-mfdpic}.
12874 @item -mmulticore
12875 @opindex mmulticore
12876 Build a standalone application for multicore Blackfin processors. 
12877 This option causes proper start files and link scripts supporting 
12878 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12879 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12881 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12882 selects the one-application-per-core programming model.  Without
12883 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12884 programming model is used. In this model, the main function of Core B
12885 should be named as @code{coreb_main}.
12887 If this option is not used, the single-core application programming
12888 model is used.
12890 @item -mcorea
12891 @opindex mcorea
12892 Build a standalone application for Core A of BF561 when using
12893 the one-application-per-core programming model. Proper start files
12894 and link scripts are used to support Core A, and the macro
12895 @code{__BFIN_COREA} is defined.
12896 This option can only be used in conjunction with @option{-mmulticore}.
12898 @item -mcoreb
12899 @opindex mcoreb
12900 Build a standalone application for Core B of BF561 when using
12901 the one-application-per-core programming model. Proper start files
12902 and link scripts are used to support Core B, and the macro
12903 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12904 should be used instead of @code{main}. 
12905 This option can only be used in conjunction with @option{-mmulticore}.
12907 @item -msdram
12908 @opindex msdram
12909 Build a standalone application for SDRAM. Proper start files and
12910 link scripts are used to put the application into SDRAM, and the macro
12911 @code{__BFIN_SDRAM} is defined.
12912 The loader should initialize SDRAM before loading the application.
12914 @item -micplb
12915 @opindex micplb
12916 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12917 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12918 are enabled; for standalone applications the default is off.
12919 @end table
12921 @node C6X Options
12922 @subsection C6X Options
12923 @cindex C6X Options
12925 @table @gcctabopt
12926 @item -march=@var{name}
12927 @opindex march
12928 This specifies the name of the target architecture.  GCC uses this
12929 name to determine what kind of instructions it can emit when generating
12930 assembly code.  Permissible names are: @samp{c62x},
12931 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12933 @item -mbig-endian
12934 @opindex mbig-endian
12935 Generate code for a big-endian target.
12937 @item -mlittle-endian
12938 @opindex mlittle-endian
12939 Generate code for a little-endian target.  This is the default.
12941 @item -msim
12942 @opindex msim
12943 Choose startup files and linker script suitable for the simulator.
12945 @item -msdata=default
12946 @opindex msdata=default
12947 Put small global and static data in the @samp{.neardata} section,
12948 which is pointed to by register @code{B14}.  Put small uninitialized
12949 global and static data in the @samp{.bss} section, which is adjacent
12950 to the @samp{.neardata} section.  Put small read-only data into the
12951 @samp{.rodata} section.  The corresponding sections used for large
12952 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12954 @item -msdata=all
12955 @opindex msdata=all
12956 Put all data, not just small objects, into the sections reserved for
12957 small data, and use addressing relative to the @code{B14} register to
12958 access them.
12960 @item -msdata=none
12961 @opindex msdata=none
12962 Make no use of the sections reserved for small data, and use absolute
12963 addresses to access all data.  Put all initialized global and static
12964 data in the @samp{.fardata} section, and all uninitialized data in the
12965 @samp{.far} section.  Put all constant data into the @samp{.const}
12966 section.
12967 @end table
12969 @node CRIS Options
12970 @subsection CRIS Options
12971 @cindex CRIS Options
12973 These options are defined specifically for the CRIS ports.
12975 @table @gcctabopt
12976 @item -march=@var{architecture-type}
12977 @itemx -mcpu=@var{architecture-type}
12978 @opindex march
12979 @opindex mcpu
12980 Generate code for the specified architecture.  The choices for
12981 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12982 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12983 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12984 @samp{v10}.
12986 @item -mtune=@var{architecture-type}
12987 @opindex mtune
12988 Tune to @var{architecture-type} everything applicable about the generated
12989 code, except for the ABI and the set of available instructions.  The
12990 choices for @var{architecture-type} are the same as for
12991 @option{-march=@var{architecture-type}}.
12993 @item -mmax-stack-frame=@var{n}
12994 @opindex mmax-stack-frame
12995 Warn when the stack frame of a function exceeds @var{n} bytes.
12997 @item -metrax4
12998 @itemx -metrax100
12999 @opindex metrax4
13000 @opindex metrax100
13001 The options @option{-metrax4} and @option{-metrax100} are synonyms for
13002 @option{-march=v3} and @option{-march=v8} respectively.
13004 @item -mmul-bug-workaround
13005 @itemx -mno-mul-bug-workaround
13006 @opindex mmul-bug-workaround
13007 @opindex mno-mul-bug-workaround
13008 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
13009 models where it applies.  This option is active by default.
13011 @item -mpdebug
13012 @opindex mpdebug
13013 Enable CRIS-specific verbose debug-related information in the assembly
13014 code.  This option also has the effect of turning off the @samp{#NO_APP}
13015 formatted-code indicator to the assembler at the beginning of the
13016 assembly file.
13018 @item -mcc-init
13019 @opindex mcc-init
13020 Do not use condition-code results from previous instruction; always emit
13021 compare and test instructions before use of condition codes.
13023 @item -mno-side-effects
13024 @opindex mno-side-effects
13025 Do not emit instructions with side effects in addressing modes other than
13026 post-increment.
13028 @item -mstack-align
13029 @itemx -mno-stack-align
13030 @itemx -mdata-align
13031 @itemx -mno-data-align
13032 @itemx -mconst-align
13033 @itemx -mno-const-align
13034 @opindex mstack-align
13035 @opindex mno-stack-align
13036 @opindex mdata-align
13037 @opindex mno-data-align
13038 @opindex mconst-align
13039 @opindex mno-const-align
13040 These options (@samp{no-} options) arrange (eliminate arrangements) for the
13041 stack frame, individual data and constants to be aligned for the maximum
13042 single data access size for the chosen CPU model.  The default is to
13043 arrange for 32-bit alignment.  ABI details such as structure layout are
13044 not affected by these options.
13046 @item -m32-bit
13047 @itemx -m16-bit
13048 @itemx -m8-bit
13049 @opindex m32-bit
13050 @opindex m16-bit
13051 @opindex m8-bit
13052 Similar to the stack- data- and const-align options above, these options
13053 arrange for stack frame, writable data and constants to all be 32-bit,
13054 16-bit or 8-bit aligned.  The default is 32-bit alignment.
13056 @item -mno-prologue-epilogue
13057 @itemx -mprologue-epilogue
13058 @opindex mno-prologue-epilogue
13059 @opindex mprologue-epilogue
13060 With @option{-mno-prologue-epilogue}, the normal function prologue and
13061 epilogue which set up the stack frame are omitted and no return
13062 instructions or return sequences are generated in the code.  Use this
13063 option only together with visual inspection of the compiled code: no
13064 warnings or errors are generated when call-saved registers must be saved,
13065 or storage for local variables needs to be allocated.
13067 @item -mno-gotplt
13068 @itemx -mgotplt
13069 @opindex mno-gotplt
13070 @opindex mgotplt
13071 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
13072 instruction sequences that load addresses for functions from the PLT part
13073 of the GOT rather than (traditional on other architectures) calls to the
13074 PLT@.  The default is @option{-mgotplt}.
13076 @item -melf
13077 @opindex melf
13078 Legacy no-op option only recognized with the cris-axis-elf and
13079 cris-axis-linux-gnu targets.
13081 @item -mlinux
13082 @opindex mlinux
13083 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
13085 @item -sim
13086 @opindex sim
13087 This option, recognized for the cris-axis-elf, arranges
13088 to link with input-output functions from a simulator library.  Code,
13089 initialized data and zero-initialized data are allocated consecutively.
13091 @item -sim2
13092 @opindex sim2
13093 Like @option{-sim}, but pass linker options to locate initialized data at
13094 0x40000000 and zero-initialized data at 0x80000000.
13095 @end table
13097 @node CR16 Options
13098 @subsection CR16 Options
13099 @cindex CR16 Options
13101 These options are defined specifically for the CR16 ports.
13103 @table @gcctabopt
13105 @item -mmac
13106 @opindex mmac
13107 Enable the use of multiply-accumulate instructions. Disabled by default.
13109 @item -mcr16cplus
13110 @itemx -mcr16c
13111 @opindex mcr16cplus
13112 @opindex mcr16c
13113 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
13114 is default.
13116 @item -msim
13117 @opindex msim
13118 Links the library libsim.a which is in compatible with simulator. Applicable
13119 to ELF compiler only.
13121 @item -mint32
13122 @opindex mint32
13123 Choose integer type as 32-bit wide.
13125 @item -mbit-ops
13126 @opindex mbit-ops
13127 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
13129 @item -mdata-model=@var{model}
13130 @opindex mdata-model
13131 Choose a data model. The choices for @var{model} are @samp{near},
13132 @samp{far} or @samp{medium}. @samp{medium} is default.
13133 However, @samp{far} is not valid with @option{-mcr16c}, as the
13134 CR16C architecture does not support the far data model.
13135 @end table
13137 @node Darwin Options
13138 @subsection Darwin Options
13139 @cindex Darwin options
13141 These options are defined for all architectures running the Darwin operating
13142 system.
13144 FSF GCC on Darwin does not create ``fat'' object files; it creates
13145 an object file for the single architecture that GCC was built to
13146 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
13147 @option{-arch} options are used; it does so by running the compiler or
13148 linker multiple times and joining the results together with
13149 @file{lipo}.
13151 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
13152 @samp{i686}) is determined by the flags that specify the ISA
13153 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
13154 @option{-force_cpusubtype_ALL} option can be used to override this.
13156 The Darwin tools vary in their behavior when presented with an ISA
13157 mismatch.  The assembler, @file{as}, only permits instructions to
13158 be used that are valid for the subtype of the file it is generating,
13159 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
13160 The linker for shared libraries, @file{/usr/bin/libtool}, fails
13161 and prints an error if asked to create a shared library with a less
13162 restrictive subtype than its input files (for instance, trying to put
13163 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
13164 for executables, @command{ld}, quietly gives the executable the most
13165 restrictive subtype of any of its input files.
13167 @table @gcctabopt
13168 @item -F@var{dir}
13169 @opindex F
13170 Add the framework directory @var{dir} to the head of the list of
13171 directories to be searched for header files.  These directories are
13172 interleaved with those specified by @option{-I} options and are
13173 scanned in a left-to-right order.
13175 A framework directory is a directory with frameworks in it.  A
13176 framework is a directory with a @file{Headers} and/or
13177 @file{PrivateHeaders} directory contained directly in it that ends
13178 in @file{.framework}.  The name of a framework is the name of this
13179 directory excluding the @file{.framework}.  Headers associated with
13180 the framework are found in one of those two directories, with
13181 @file{Headers} being searched first.  A subframework is a framework
13182 directory that is in a framework's @file{Frameworks} directory.
13183 Includes of subframework headers can only appear in a header of a
13184 framework that contains the subframework, or in a sibling subframework
13185 header.  Two subframeworks are siblings if they occur in the same
13186 framework.  A subframework should not have the same name as a
13187 framework; a warning is issued if this is violated.  Currently a
13188 subframework cannot have subframeworks; in the future, the mechanism
13189 may be extended to support this.  The standard frameworks can be found
13190 in @file{/System/Library/Frameworks} and
13191 @file{/Library/Frameworks}.  An example include looks like
13192 @code{#include <Framework/header.h>}, where @file{Framework} denotes
13193 the name of the framework and @file{header.h} is found in the
13194 @file{PrivateHeaders} or @file{Headers} directory.
13196 @item -iframework@var{dir}
13197 @opindex iframework
13198 Like @option{-F} except the directory is a treated as a system
13199 directory.  The main difference between this @option{-iframework} and
13200 @option{-F} is that with @option{-iframework} the compiler does not
13201 warn about constructs contained within header files found via
13202 @var{dir}.  This option is valid only for the C family of languages.
13204 @item -gused
13205 @opindex gused
13206 Emit debugging information for symbols that are used.  For stabs
13207 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
13208 This is by default ON@.
13210 @item -gfull
13211 @opindex gfull
13212 Emit debugging information for all symbols and types.
13214 @item -mmacosx-version-min=@var{version}
13215 The earliest version of MacOS X that this executable will run on
13216 is @var{version}.  Typical values of @var{version} include @code{10.1},
13217 @code{10.2}, and @code{10.3.9}.
13219 If the compiler was built to use the system's headers by default,
13220 then the default for this option is the system version on which the
13221 compiler is running, otherwise the default is to make choices that
13222 are compatible with as many systems and code bases as possible.
13224 @item -mkernel
13225 @opindex mkernel
13226 Enable kernel development mode.  The @option{-mkernel} option sets
13227 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
13228 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
13229 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
13230 applicable.  This mode also sets @option{-mno-altivec},
13231 @option{-msoft-float}, @option{-fno-builtin} and
13232 @option{-mlong-branch} for PowerPC targets.
13234 @item -mone-byte-bool
13235 @opindex mone-byte-bool
13236 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
13237 By default @samp{sizeof(bool)} is @samp{4} when compiling for
13238 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
13239 option has no effect on x86.
13241 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
13242 to generate code that is not binary compatible with code generated
13243 without that switch.  Using this switch may require recompiling all
13244 other modules in a program, including system libraries.  Use this
13245 switch to conform to a non-default data model.
13247 @item -mfix-and-continue
13248 @itemx -ffix-and-continue
13249 @itemx -findirect-data
13250 @opindex mfix-and-continue
13251 @opindex ffix-and-continue
13252 @opindex findirect-data
13253 Generate code suitable for fast turnaround development, such as to
13254 allow GDB to dynamically load @code{.o} files into already-running
13255 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
13256 are provided for backwards compatibility.
13258 @item -all_load
13259 @opindex all_load
13260 Loads all members of static archive libraries.
13261 See man ld(1) for more information.
13263 @item -arch_errors_fatal
13264 @opindex arch_errors_fatal
13265 Cause the errors having to do with files that have the wrong architecture
13266 to be fatal.
13268 @item -bind_at_load
13269 @opindex bind_at_load
13270 Causes the output file to be marked such that the dynamic linker will
13271 bind all undefined references when the file is loaded or launched.
13273 @item -bundle
13274 @opindex bundle
13275 Produce a Mach-o bundle format file.
13276 See man ld(1) for more information.
13278 @item -bundle_loader @var{executable}
13279 @opindex bundle_loader
13280 This option specifies the @var{executable} that will load the build
13281 output file being linked.  See man ld(1) for more information.
13283 @item -dynamiclib
13284 @opindex dynamiclib
13285 When passed this option, GCC produces a dynamic library instead of
13286 an executable when linking, using the Darwin @file{libtool} command.
13288 @item -force_cpusubtype_ALL
13289 @opindex force_cpusubtype_ALL
13290 This causes GCC's output file to have the @var{ALL} subtype, instead of
13291 one controlled by the @option{-mcpu} or @option{-march} option.
13293 @item -allowable_client  @var{client_name}
13294 @itemx -client_name
13295 @itemx -compatibility_version
13296 @itemx -current_version
13297 @itemx -dead_strip
13298 @itemx -dependency-file
13299 @itemx -dylib_file
13300 @itemx -dylinker_install_name
13301 @itemx -dynamic
13302 @itemx -exported_symbols_list
13303 @itemx -filelist
13304 @need 800
13305 @itemx -flat_namespace
13306 @itemx -force_flat_namespace
13307 @itemx -headerpad_max_install_names
13308 @itemx -image_base
13309 @itemx -init
13310 @itemx -install_name
13311 @itemx -keep_private_externs
13312 @itemx -multi_module
13313 @itemx -multiply_defined
13314 @itemx -multiply_defined_unused
13315 @need 800
13316 @itemx -noall_load
13317 @itemx -no_dead_strip_inits_and_terms
13318 @itemx -nofixprebinding
13319 @itemx -nomultidefs
13320 @itemx -noprebind
13321 @itemx -noseglinkedit
13322 @itemx -pagezero_size
13323 @itemx -prebind
13324 @itemx -prebind_all_twolevel_modules
13325 @itemx -private_bundle
13326 @need 800
13327 @itemx -read_only_relocs
13328 @itemx -sectalign
13329 @itemx -sectobjectsymbols
13330 @itemx -whyload
13331 @itemx -seg1addr
13332 @itemx -sectcreate
13333 @itemx -sectobjectsymbols
13334 @itemx -sectorder
13335 @itemx -segaddr
13336 @itemx -segs_read_only_addr
13337 @need 800
13338 @itemx -segs_read_write_addr
13339 @itemx -seg_addr_table
13340 @itemx -seg_addr_table_filename
13341 @itemx -seglinkedit
13342 @itemx -segprot
13343 @itemx -segs_read_only_addr
13344 @itemx -segs_read_write_addr
13345 @itemx -single_module
13346 @itemx -static
13347 @itemx -sub_library
13348 @need 800
13349 @itemx -sub_umbrella
13350 @itemx -twolevel_namespace
13351 @itemx -umbrella
13352 @itemx -undefined
13353 @itemx -unexported_symbols_list
13354 @itemx -weak_reference_mismatches
13355 @itemx -whatsloaded
13356 @opindex allowable_client
13357 @opindex client_name
13358 @opindex compatibility_version
13359 @opindex current_version
13360 @opindex dead_strip
13361 @opindex dependency-file
13362 @opindex dylib_file
13363 @opindex dylinker_install_name
13364 @opindex dynamic
13365 @opindex exported_symbols_list
13366 @opindex filelist
13367 @opindex flat_namespace
13368 @opindex force_flat_namespace
13369 @opindex headerpad_max_install_names
13370 @opindex image_base
13371 @opindex init
13372 @opindex install_name
13373 @opindex keep_private_externs
13374 @opindex multi_module
13375 @opindex multiply_defined
13376 @opindex multiply_defined_unused
13377 @opindex noall_load
13378 @opindex no_dead_strip_inits_and_terms
13379 @opindex nofixprebinding
13380 @opindex nomultidefs
13381 @opindex noprebind
13382 @opindex noseglinkedit
13383 @opindex pagezero_size
13384 @opindex prebind
13385 @opindex prebind_all_twolevel_modules
13386 @opindex private_bundle
13387 @opindex read_only_relocs
13388 @opindex sectalign
13389 @opindex sectobjectsymbols
13390 @opindex whyload
13391 @opindex seg1addr
13392 @opindex sectcreate
13393 @opindex sectobjectsymbols
13394 @opindex sectorder
13395 @opindex segaddr
13396 @opindex segs_read_only_addr
13397 @opindex segs_read_write_addr
13398 @opindex seg_addr_table
13399 @opindex seg_addr_table_filename
13400 @opindex seglinkedit
13401 @opindex segprot
13402 @opindex segs_read_only_addr
13403 @opindex segs_read_write_addr
13404 @opindex single_module
13405 @opindex static
13406 @opindex sub_library
13407 @opindex sub_umbrella
13408 @opindex twolevel_namespace
13409 @opindex umbrella
13410 @opindex undefined
13411 @opindex unexported_symbols_list
13412 @opindex weak_reference_mismatches
13413 @opindex whatsloaded
13414 These options are passed to the Darwin linker.  The Darwin linker man page
13415 describes them in detail.
13416 @end table
13418 @node DEC Alpha Options
13419 @subsection DEC Alpha Options
13421 These @samp{-m} options are defined for the DEC Alpha implementations:
13423 @table @gcctabopt
13424 @item -mno-soft-float
13425 @itemx -msoft-float
13426 @opindex mno-soft-float
13427 @opindex msoft-float
13428 Use (do not use) the hardware floating-point instructions for
13429 floating-point operations.  When @option{-msoft-float} is specified,
13430 functions in @file{libgcc.a} are used to perform floating-point
13431 operations.  Unless they are replaced by routines that emulate the
13432 floating-point operations, or compiled in such a way as to call such
13433 emulations routines, these routines issue floating-point
13434 operations.   If you are compiling for an Alpha without floating-point
13435 operations, you must ensure that the library is built so as not to call
13436 them.
13438 Note that Alpha implementations without floating-point operations are
13439 required to have floating-point registers.
13441 @item -mfp-reg
13442 @itemx -mno-fp-regs
13443 @opindex mfp-reg
13444 @opindex mno-fp-regs
13445 Generate code that uses (does not use) the floating-point register set.
13446 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
13447 register set is not used, floating-point operands are passed in integer
13448 registers as if they were integers and floating-point results are passed
13449 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
13450 so any function with a floating-point argument or return value called by code
13451 compiled with @option{-mno-fp-regs} must also be compiled with that
13452 option.
13454 A typical use of this option is building a kernel that does not use,
13455 and hence need not save and restore, any floating-point registers.
13457 @item -mieee
13458 @opindex mieee
13459 The Alpha architecture implements floating-point hardware optimized for
13460 maximum performance.  It is mostly compliant with the IEEE floating-point
13461 standard.  However, for full compliance, software assistance is
13462 required.  This option generates code fully IEEE-compliant code
13463 @emph{except} that the @var{inexact-flag} is not maintained (see below).
13464 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
13465 defined during compilation.  The resulting code is less efficient but is
13466 able to correctly support denormalized numbers and exceptional IEEE
13467 values such as not-a-number and plus/minus infinity.  Other Alpha
13468 compilers call this option @option{-ieee_with_no_inexact}.
13470 @item -mieee-with-inexact
13471 @opindex mieee-with-inexact
13472 This is like @option{-mieee} except the generated code also maintains
13473 the IEEE @var{inexact-flag}.  Turning on this option causes the
13474 generated code to implement fully-compliant IEEE math.  In addition to
13475 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
13476 macro.  On some Alpha implementations the resulting code may execute
13477 significantly slower than the code generated by default.  Since there is
13478 very little code that depends on the @var{inexact-flag}, you should
13479 normally not specify this option.  Other Alpha compilers call this
13480 option @option{-ieee_with_inexact}.
13482 @item -mfp-trap-mode=@var{trap-mode}
13483 @opindex mfp-trap-mode
13484 This option controls what floating-point related traps are enabled.
13485 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
13486 The trap mode can be set to one of four values:
13488 @table @samp
13489 @item n
13490 This is the default (normal) setting.  The only traps that are enabled
13491 are the ones that cannot be disabled in software (e.g., division by zero
13492 trap).
13494 @item u
13495 In addition to the traps enabled by @samp{n}, underflow traps are enabled
13496 as well.
13498 @item su
13499 Like @samp{u}, but the instructions are marked to be safe for software
13500 completion (see Alpha architecture manual for details).
13502 @item sui
13503 Like @samp{su}, but inexact traps are enabled as well.
13504 @end table
13506 @item -mfp-rounding-mode=@var{rounding-mode}
13507 @opindex mfp-rounding-mode
13508 Selects the IEEE rounding mode.  Other Alpha compilers call this option
13509 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
13512 @table @samp
13513 @item n
13514 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
13515 the nearest machine number or towards the even machine number in case
13516 of a tie.
13518 @item m
13519 Round towards minus infinity.
13521 @item c
13522 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
13524 @item d
13525 Dynamic rounding mode.  A field in the floating-point control register
13526 (@var{fpcr}, see Alpha architecture reference manual) controls the
13527 rounding mode in effect.  The C library initializes this register for
13528 rounding towards plus infinity.  Thus, unless your program modifies the
13529 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
13530 @end table
13532 @item -mtrap-precision=@var{trap-precision}
13533 @opindex mtrap-precision
13534 In the Alpha architecture, floating-point traps are imprecise.  This
13535 means without software assistance it is impossible to recover from a
13536 floating trap and program execution normally needs to be terminated.
13537 GCC can generate code that can assist operating system trap handlers
13538 in determining the exact location that caused a floating-point trap.
13539 Depending on the requirements of an application, different levels of
13540 precisions can be selected:
13542 @table @samp
13543 @item p
13544 Program precision.  This option is the default and means a trap handler
13545 can only identify which program caused a floating-point exception.
13547 @item f
13548 Function precision.  The trap handler can determine the function that
13549 caused a floating-point exception.
13551 @item i
13552 Instruction precision.  The trap handler can determine the exact
13553 instruction that caused a floating-point exception.
13554 @end table
13556 Other Alpha compilers provide the equivalent options called
13557 @option{-scope_safe} and @option{-resumption_safe}.
13559 @item -mieee-conformant
13560 @opindex mieee-conformant
13561 This option marks the generated code as IEEE conformant.  You must not
13562 use this option unless you also specify @option{-mtrap-precision=i} and either
13563 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
13564 is to emit the line @samp{.eflag 48} in the function prologue of the
13565 generated assembly file.
13567 @item -mbuild-constants
13568 @opindex mbuild-constants
13569 Normally GCC examines a 32- or 64-bit integer constant to
13570 see if it can construct it from smaller constants in two or three
13571 instructions.  If it cannot, it outputs the constant as a literal and
13572 generates code to load it from the data segment at run time.
13574 Use this option to require GCC to construct @emph{all} integer constants
13575 using code, even if it takes more instructions (the maximum is six).
13577 You typically use this option to build a shared library dynamic
13578 loader.  Itself a shared library, it must relocate itself in memory
13579 before it can find the variables and constants in its own data segment.
13581 @item -mbwx
13582 @itemx -mno-bwx
13583 @itemx -mcix
13584 @itemx -mno-cix
13585 @itemx -mfix
13586 @itemx -mno-fix
13587 @itemx -mmax
13588 @itemx -mno-max
13589 @opindex mbwx
13590 @opindex mno-bwx
13591 @opindex mcix
13592 @opindex mno-cix
13593 @opindex mfix
13594 @opindex mno-fix
13595 @opindex mmax
13596 @opindex mno-max
13597 Indicate whether GCC should generate code to use the optional BWX,
13598 CIX, FIX and MAX instruction sets.  The default is to use the instruction
13599 sets supported by the CPU type specified via @option{-mcpu=} option or that
13600 of the CPU on which GCC was built if none is specified.
13602 @item -mfloat-vax
13603 @itemx -mfloat-ieee
13604 @opindex mfloat-vax
13605 @opindex mfloat-ieee
13606 Generate code that uses (does not use) VAX F and G floating-point
13607 arithmetic instead of IEEE single and double precision.
13609 @item -mexplicit-relocs
13610 @itemx -mno-explicit-relocs
13611 @opindex mexplicit-relocs
13612 @opindex mno-explicit-relocs
13613 Older Alpha assemblers provided no way to generate symbol relocations
13614 except via assembler macros.  Use of these macros does not allow
13615 optimal instruction scheduling.  GNU binutils as of version 2.12
13616 supports a new syntax that allows the compiler to explicitly mark
13617 which relocations should apply to which instructions.  This option
13618 is mostly useful for debugging, as GCC detects the capabilities of
13619 the assembler when it is built and sets the default accordingly.
13621 @item -msmall-data
13622 @itemx -mlarge-data
13623 @opindex msmall-data
13624 @opindex mlarge-data
13625 When @option{-mexplicit-relocs} is in effect, static data is
13626 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
13627 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
13628 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
13629 16-bit relocations off of the @code{$gp} register.  This limits the
13630 size of the small data area to 64KB, but allows the variables to be
13631 directly accessed via a single instruction.
13633 The default is @option{-mlarge-data}.  With this option the data area
13634 is limited to just below 2GB@.  Programs that require more than 2GB of
13635 data must use @code{malloc} or @code{mmap} to allocate the data in the
13636 heap instead of in the program's data segment.
13638 When generating code for shared libraries, @option{-fpic} implies
13639 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
13641 @item -msmall-text
13642 @itemx -mlarge-text
13643 @opindex msmall-text
13644 @opindex mlarge-text
13645 When @option{-msmall-text} is used, the compiler assumes that the
13646 code of the entire program (or shared library) fits in 4MB, and is
13647 thus reachable with a branch instruction.  When @option{-msmall-data}
13648 is used, the compiler can assume that all local symbols share the
13649 same @code{$gp} value, and thus reduce the number of instructions
13650 required for a function call from 4 to 1.
13652 The default is @option{-mlarge-text}.
13654 @item -mcpu=@var{cpu_type}
13655 @opindex mcpu
13656 Set the instruction set and instruction scheduling parameters for
13657 machine type @var{cpu_type}.  You can specify either the @samp{EV}
13658 style name or the corresponding chip number.  GCC supports scheduling
13659 parameters for the EV4, EV5 and EV6 family of processors and
13660 chooses the default values for the instruction set from the processor
13661 you specify.  If you do not specify a processor type, GCC defaults
13662 to the processor on which the compiler was built.
13664 Supported values for @var{cpu_type} are
13666 @table @samp
13667 @item ev4
13668 @itemx ev45
13669 @itemx 21064
13670 Schedules as an EV4 and has no instruction set extensions.
13672 @item ev5
13673 @itemx 21164
13674 Schedules as an EV5 and has no instruction set extensions.
13676 @item ev56
13677 @itemx 21164a
13678 Schedules as an EV5 and supports the BWX extension.
13680 @item pca56
13681 @itemx 21164pc
13682 @itemx 21164PC
13683 Schedules as an EV5 and supports the BWX and MAX extensions.
13685 @item ev6
13686 @itemx 21264
13687 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
13689 @item ev67
13690 @itemx 21264a
13691 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
13692 @end table
13694 Native toolchains also support the value @samp{native},
13695 which selects the best architecture option for the host processor.
13696 @option{-mcpu=native} has no effect if GCC does not recognize
13697 the processor.
13699 @item -mtune=@var{cpu_type}
13700 @opindex mtune
13701 Set only the instruction scheduling parameters for machine type
13702 @var{cpu_type}.  The instruction set is not changed.
13704 Native toolchains also support the value @samp{native},
13705 which selects the best architecture option for the host processor.
13706 @option{-mtune=native} has no effect if GCC does not recognize
13707 the processor.
13709 @item -mmemory-latency=@var{time}
13710 @opindex mmemory-latency
13711 Sets the latency the scheduler should assume for typical memory
13712 references as seen by the application.  This number is highly
13713 dependent on the memory access patterns used by the application
13714 and the size of the external cache on the machine.
13716 Valid options for @var{time} are
13718 @table @samp
13719 @item @var{number}
13720 A decimal number representing clock cycles.
13722 @item L1
13723 @itemx L2
13724 @itemx L3
13725 @itemx main
13726 The compiler contains estimates of the number of clock cycles for
13727 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
13728 (also called Dcache, Scache, and Bcache), as well as to main memory.
13729 Note that L3 is only valid for EV5.
13731 @end table
13732 @end table
13734 @node FR30 Options
13735 @subsection FR30 Options
13736 @cindex FR30 Options
13738 These options are defined specifically for the FR30 port.
13740 @table @gcctabopt
13742 @item -msmall-model
13743 @opindex msmall-model
13744 Use the small address space model.  This can produce smaller code, but
13745 it does assume that all symbolic values and addresses fit into a
13746 20-bit range.
13748 @item -mno-lsim
13749 @opindex mno-lsim
13750 Assume that runtime support has been provided and so there is no need
13751 to include the simulator library (@file{libsim.a}) on the linker
13752 command line.
13754 @end table
13756 @node FRV Options
13757 @subsection FRV Options
13758 @cindex FRV Options
13760 @table @gcctabopt
13761 @item -mgpr-32
13762 @opindex mgpr-32
13764 Only use the first 32 general-purpose registers.
13766 @item -mgpr-64
13767 @opindex mgpr-64
13769 Use all 64 general-purpose registers.
13771 @item -mfpr-32
13772 @opindex mfpr-32
13774 Use only the first 32 floating-point registers.
13776 @item -mfpr-64
13777 @opindex mfpr-64
13779 Use all 64 floating-point registers.
13781 @item -mhard-float
13782 @opindex mhard-float
13784 Use hardware instructions for floating-point operations.
13786 @item -msoft-float
13787 @opindex msoft-float
13789 Use library routines for floating-point operations.
13791 @item -malloc-cc
13792 @opindex malloc-cc
13794 Dynamically allocate condition code registers.
13796 @item -mfixed-cc
13797 @opindex mfixed-cc
13799 Do not try to dynamically allocate condition code registers, only
13800 use @code{icc0} and @code{fcc0}.
13802 @item -mdword
13803 @opindex mdword
13805 Change ABI to use double word insns.
13807 @item -mno-dword
13808 @opindex mno-dword
13810 Do not use double word instructions.
13812 @item -mdouble
13813 @opindex mdouble
13815 Use floating-point double instructions.
13817 @item -mno-double
13818 @opindex mno-double
13820 Do not use floating-point double instructions.
13822 @item -mmedia
13823 @opindex mmedia
13825 Use media instructions.
13827 @item -mno-media
13828 @opindex mno-media
13830 Do not use media instructions.
13832 @item -mmuladd
13833 @opindex mmuladd
13835 Use multiply and add/subtract instructions.
13837 @item -mno-muladd
13838 @opindex mno-muladd
13840 Do not use multiply and add/subtract instructions.
13842 @item -mfdpic
13843 @opindex mfdpic
13845 Select the FDPIC ABI, which uses function descriptors to represent
13846 pointers to functions.  Without any PIC/PIE-related options, it
13847 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
13848 assumes GOT entries and small data are within a 12-bit range from the
13849 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
13850 are computed with 32 bits.
13851 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13853 @item -minline-plt
13854 @opindex minline-plt
13856 Enable inlining of PLT entries in function calls to functions that are
13857 not known to bind locally.  It has no effect without @option{-mfdpic}.
13858 It's enabled by default if optimizing for speed and compiling for
13859 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13860 optimization option such as @option{-O3} or above is present in the
13861 command line.
13863 @item -mTLS
13864 @opindex mTLS
13866 Assume a large TLS segment when generating thread-local code.
13868 @item -mtls
13869 @opindex mtls
13871 Do not assume a large TLS segment when generating thread-local code.
13873 @item -mgprel-ro
13874 @opindex mgprel-ro
13876 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13877 that is known to be in read-only sections.  It's enabled by default,
13878 except for @option{-fpic} or @option{-fpie}: even though it may help
13879 make the global offset table smaller, it trades 1 instruction for 4.
13880 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13881 one of which may be shared by multiple symbols, and it avoids the need
13882 for a GOT entry for the referenced symbol, so it's more likely to be a
13883 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13885 @item -multilib-library-pic
13886 @opindex multilib-library-pic
13888 Link with the (library, not FD) pic libraries.  It's implied by
13889 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13890 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13891 it explicitly.
13893 @item -mlinked-fp
13894 @opindex mlinked-fp
13896 Follow the EABI requirement of always creating a frame pointer whenever
13897 a stack frame is allocated.  This option is enabled by default and can
13898 be disabled with @option{-mno-linked-fp}.
13900 @item -mlong-calls
13901 @opindex mlong-calls
13903 Use indirect addressing to call functions outside the current
13904 compilation unit.  This allows the functions to be placed anywhere
13905 within the 32-bit address space.
13907 @item -malign-labels
13908 @opindex malign-labels
13910 Try to align labels to an 8-byte boundary by inserting NOPs into the
13911 previous packet.  This option only has an effect when VLIW packing
13912 is enabled.  It doesn't create new packets; it merely adds NOPs to
13913 existing ones.
13915 @item -mlibrary-pic
13916 @opindex mlibrary-pic
13918 Generate position-independent EABI code.
13920 @item -macc-4
13921 @opindex macc-4
13923 Use only the first four media accumulator registers.
13925 @item -macc-8
13926 @opindex macc-8
13928 Use all eight media accumulator registers.
13930 @item -mpack
13931 @opindex mpack
13933 Pack VLIW instructions.
13935 @item -mno-pack
13936 @opindex mno-pack
13938 Do not pack VLIW instructions.
13940 @item -mno-eflags
13941 @opindex mno-eflags
13943 Do not mark ABI switches in e_flags.
13945 @item -mcond-move
13946 @opindex mcond-move
13948 Enable the use of conditional-move instructions (default).
13950 This switch is mainly for debugging the compiler and will likely be removed
13951 in a future version.
13953 @item -mno-cond-move
13954 @opindex mno-cond-move
13956 Disable the use of conditional-move instructions.
13958 This switch is mainly for debugging the compiler and will likely be removed
13959 in a future version.
13961 @item -mscc
13962 @opindex mscc
13964 Enable the use of conditional set instructions (default).
13966 This switch is mainly for debugging the compiler and will likely be removed
13967 in a future version.
13969 @item -mno-scc
13970 @opindex mno-scc
13972 Disable the use of conditional set instructions.
13974 This switch is mainly for debugging the compiler and will likely be removed
13975 in a future version.
13977 @item -mcond-exec
13978 @opindex mcond-exec
13980 Enable the use of conditional execution (default).
13982 This switch is mainly for debugging the compiler and will likely be removed
13983 in a future version.
13985 @item -mno-cond-exec
13986 @opindex mno-cond-exec
13988 Disable the use of conditional execution.
13990 This switch is mainly for debugging the compiler and will likely be removed
13991 in a future version.
13993 @item -mvliw-branch
13994 @opindex mvliw-branch
13996 Run a pass to pack branches into VLIW instructions (default).
13998 This switch is mainly for debugging the compiler and will likely be removed
13999 in a future version.
14001 @item -mno-vliw-branch
14002 @opindex mno-vliw-branch
14004 Do not run a pass to pack branches into VLIW instructions.
14006 This switch is mainly for debugging the compiler and will likely be removed
14007 in a future version.
14009 @item -mmulti-cond-exec
14010 @opindex mmulti-cond-exec
14012 Enable optimization of @code{&&} and @code{||} in conditional execution
14013 (default).
14015 This switch is mainly for debugging the compiler and will likely be removed
14016 in a future version.
14018 @item -mno-multi-cond-exec
14019 @opindex mno-multi-cond-exec
14021 Disable optimization of @code{&&} and @code{||} in conditional execution.
14023 This switch is mainly for debugging the compiler and will likely be removed
14024 in a future version.
14026 @item -mnested-cond-exec
14027 @opindex mnested-cond-exec
14029 Enable nested conditional execution optimizations (default).
14031 This switch is mainly for debugging the compiler and will likely be removed
14032 in a future version.
14034 @item -mno-nested-cond-exec
14035 @opindex mno-nested-cond-exec
14037 Disable nested conditional execution optimizations.
14039 This switch is mainly for debugging the compiler and will likely be removed
14040 in a future version.
14042 @item -moptimize-membar
14043 @opindex moptimize-membar
14045 This switch removes redundant @code{membar} instructions from the
14046 compiler-generated code.  It is enabled by default.
14048 @item -mno-optimize-membar
14049 @opindex mno-optimize-membar
14051 This switch disables the automatic removal of redundant @code{membar}
14052 instructions from the generated code.
14054 @item -mtomcat-stats
14055 @opindex mtomcat-stats
14057 Cause gas to print out tomcat statistics.
14059 @item -mcpu=@var{cpu}
14060 @opindex mcpu
14062 Select the processor type for which to generate code.  Possible values are
14063 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
14064 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
14066 @end table
14068 @node GNU/Linux Options
14069 @subsection GNU/Linux Options
14071 These @samp{-m} options are defined for GNU/Linux targets:
14073 @table @gcctabopt
14074 @item -mglibc
14075 @opindex mglibc
14076 Use the GNU C library.  This is the default except
14077 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
14079 @item -muclibc
14080 @opindex muclibc
14081 Use uClibc C library.  This is the default on
14082 @samp{*-*-linux-*uclibc*} targets.
14084 @item -mbionic
14085 @opindex mbionic
14086 Use Bionic C library.  This is the default on
14087 @samp{*-*-linux-*android*} targets.
14089 @item -mandroid
14090 @opindex mandroid
14091 Compile code compatible with Android platform.  This is the default on
14092 @samp{*-*-linux-*android*} targets.
14094 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
14095 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
14096 this option makes the GCC driver pass Android-specific options to the linker.
14097 Finally, this option causes the preprocessor macro @code{__ANDROID__}
14098 to be defined.
14100 @item -tno-android-cc
14101 @opindex tno-android-cc
14102 Disable compilation effects of @option{-mandroid}, i.e., do not enable
14103 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
14104 @option{-fno-rtti} by default.
14106 @item -tno-android-ld
14107 @opindex tno-android-ld
14108 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
14109 linking options to the linker.
14111 @end table
14113 @node H8/300 Options
14114 @subsection H8/300 Options
14116 These @samp{-m} options are defined for the H8/300 implementations:
14118 @table @gcctabopt
14119 @item -mrelax
14120 @opindex mrelax
14121 Shorten some address references at link time, when possible; uses the
14122 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
14123 ld, Using ld}, for a fuller description.
14125 @item -mh
14126 @opindex mh
14127 Generate code for the H8/300H@.
14129 @item -ms
14130 @opindex ms
14131 Generate code for the H8S@.
14133 @item -mn
14134 @opindex mn
14135 Generate code for the H8S and H8/300H in the normal mode.  This switch
14136 must be used either with @option{-mh} or @option{-ms}.
14138 @item -ms2600
14139 @opindex ms2600
14140 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
14142 @item -mexr
14143 @opindex mexr
14144 Extended registers are stored on stack before execution of function
14145 with monitor attribute. Default option is @option{-mexr}.
14146 This option is valid only for H8S targets.
14148 @item -mno-exr
14149 @opindex mno-exr
14150 Extended registers are not stored on stack before execution of function 
14151 with monitor attribute. Default option is @option{-mno-exr}. 
14152 This option is valid only for H8S targets.
14154 @item -mint32
14155 @opindex mint32
14156 Make @code{int} data 32 bits by default.
14158 @item -malign-300
14159 @opindex malign-300
14160 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
14161 The default for the H8/300H and H8S is to align longs and floats on
14162 4-byte boundaries.
14163 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
14164 This option has no effect on the H8/300.
14165 @end table
14167 @node HPPA Options
14168 @subsection HPPA Options
14169 @cindex HPPA Options
14171 These @samp{-m} options are defined for the HPPA family of computers:
14173 @table @gcctabopt
14174 @item -march=@var{architecture-type}
14175 @opindex march
14176 Generate code for the specified architecture.  The choices for
14177 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
14178 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
14179 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
14180 architecture option for your machine.  Code compiled for lower numbered
14181 architectures runs on higher numbered architectures, but not the
14182 other way around.
14184 @item -mpa-risc-1-0
14185 @itemx -mpa-risc-1-1
14186 @itemx -mpa-risc-2-0
14187 @opindex mpa-risc-1-0
14188 @opindex mpa-risc-1-1
14189 @opindex mpa-risc-2-0
14190 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
14192 @item -mjump-in-delay
14193 @opindex mjump-in-delay
14194 Fill delay slots of function calls with unconditional jump instructions
14195 by modifying the return pointer for the function call to be the target
14196 of the conditional jump.
14198 @item -mdisable-fpregs
14199 @opindex mdisable-fpregs
14200 Prevent floating-point registers from being used in any manner.  This is
14201 necessary for compiling kernels that perform lazy context switching of
14202 floating-point registers.  If you use this option and attempt to perform
14203 floating-point operations, the compiler aborts.
14205 @item -mdisable-indexing
14206 @opindex mdisable-indexing
14207 Prevent the compiler from using indexing address modes.  This avoids some
14208 rather obscure problems when compiling MIG generated code under MACH@.
14210 @item -mno-space-regs
14211 @opindex mno-space-regs
14212 Generate code that assumes the target has no space registers.  This allows
14213 GCC to generate faster indirect calls and use unscaled index address modes.
14215 Such code is suitable for level 0 PA systems and kernels.
14217 @item -mfast-indirect-calls
14218 @opindex mfast-indirect-calls
14219 Generate code that assumes calls never cross space boundaries.  This
14220 allows GCC to emit code that performs faster indirect calls.
14222 This option does not work in the presence of shared libraries or nested
14223 functions.
14225 @item -mfixed-range=@var{register-range}
14226 @opindex mfixed-range
14227 Generate code treating the given register range as fixed registers.
14228 A fixed register is one that the register allocator cannot use.  This is
14229 useful when compiling kernel code.  A register range is specified as
14230 two registers separated by a dash.  Multiple register ranges can be
14231 specified separated by a comma.
14233 @item -mlong-load-store
14234 @opindex mlong-load-store
14235 Generate 3-instruction load and store sequences as sometimes required by
14236 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
14237 the HP compilers.
14239 @item -mportable-runtime
14240 @opindex mportable-runtime
14241 Use the portable calling conventions proposed by HP for ELF systems.
14243 @item -mgas
14244 @opindex mgas
14245 Enable the use of assembler directives only GAS understands.
14247 @item -mschedule=@var{cpu-type}
14248 @opindex mschedule
14249 Schedule code according to the constraints for the machine type
14250 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
14251 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
14252 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
14253 proper scheduling option for your machine.  The default scheduling is
14254 @samp{8000}.
14256 @item -mlinker-opt
14257 @opindex mlinker-opt
14258 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
14259 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
14260 linkers in which they give bogus error messages when linking some programs.
14262 @item -msoft-float
14263 @opindex msoft-float
14264 Generate output containing library calls for floating point.
14265 @strong{Warning:} the requisite libraries are not available for all HPPA
14266 targets.  Normally the facilities of the machine's usual C compiler are
14267 used, but this cannot be done directly in cross-compilation.  You must make
14268 your own arrangements to provide suitable library functions for
14269 cross-compilation.
14271 @option{-msoft-float} changes the calling convention in the output file;
14272 therefore, it is only useful if you compile @emph{all} of a program with
14273 this option.  In particular, you need to compile @file{libgcc.a}, the
14274 library that comes with GCC, with @option{-msoft-float} in order for
14275 this to work.
14277 @item -msio
14278 @opindex msio
14279 Generate the predefine, @code{_SIO}, for server IO@.  The default is
14280 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
14281 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
14282 options are available under HP-UX and HI-UX@.
14284 @item -mgnu-ld
14285 @opindex mgnu-ld
14286 Use options specific to GNU @command{ld}.
14287 This passes @option{-shared} to @command{ld} when
14288 building a shared library.  It is the default when GCC is configured,
14289 explicitly or implicitly, with the GNU linker.  This option does not
14290 affect which @command{ld} is called; it only changes what parameters
14291 are passed to that @command{ld}.
14292 The @command{ld} that is called is determined by the
14293 @option{--with-ld} configure option, GCC's program search path, and
14294 finally by the user's @env{PATH}.  The linker used by GCC can be printed
14295 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
14296 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14298 @item -mhp-ld
14299 @opindex mhp-ld
14300 Use options specific to HP @command{ld}.
14301 This passes @option{-b} to @command{ld} when building
14302 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
14303 links.  It is the default when GCC is configured, explicitly or
14304 implicitly, with the HP linker.  This option does not affect
14305 which @command{ld} is called; it only changes what parameters are passed to that
14306 @command{ld}.
14307 The @command{ld} that is called is determined by the @option{--with-ld}
14308 configure option, GCC's program search path, and finally by the user's
14309 @env{PATH}.  The linker used by GCC can be printed using @samp{which
14310 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
14311 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14313 @item -mlong-calls
14314 @opindex mno-long-calls
14315 Generate code that uses long call sequences.  This ensures that a call
14316 is always able to reach linker generated stubs.  The default is to generate
14317 long calls only when the distance from the call site to the beginning
14318 of the function or translation unit, as the case may be, exceeds a
14319 predefined limit set by the branch type being used.  The limits for
14320 normal calls are 7,600,000 and 240,000 bytes, respectively for the
14321 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
14322 240,000 bytes.
14324 Distances are measured from the beginning of functions when using the
14325 @option{-ffunction-sections} option, or when using the @option{-mgas}
14326 and @option{-mno-portable-runtime} options together under HP-UX with
14327 the SOM linker.
14329 It is normally not desirable to use this option as it degrades
14330 performance.  However, it may be useful in large applications,
14331 particularly when partial linking is used to build the application.
14333 The types of long calls used depends on the capabilities of the
14334 assembler and linker, and the type of code being generated.  The
14335 impact on systems that support long absolute calls, and long pic
14336 symbol-difference or pc-relative calls should be relatively small.
14337 However, an indirect call is used on 32-bit ELF systems in pic code
14338 and it is quite long.
14340 @item -munix=@var{unix-std}
14341 @opindex march
14342 Generate compiler predefines and select a startfile for the specified
14343 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
14344 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
14345 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
14346 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
14347 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
14348 and later.
14350 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
14351 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
14352 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
14353 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
14354 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
14355 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
14357 It is @emph{important} to note that this option changes the interfaces
14358 for various library routines.  It also affects the operational behavior
14359 of the C library.  Thus, @emph{extreme} care is needed in using this
14360 option.
14362 Library code that is intended to operate with more than one UNIX
14363 standard must test, set and restore the variable @var{__xpg4_extended_mask}
14364 as appropriate.  Most GNU software doesn't provide this capability.
14366 @item -nolibdld
14367 @opindex nolibdld
14368 Suppress the generation of link options to search libdld.sl when the
14369 @option{-static} option is specified on HP-UX 10 and later.
14371 @item -static
14372 @opindex static
14373 The HP-UX implementation of setlocale in libc has a dependency on
14374 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
14375 when the @option{-static} option is specified, special link options
14376 are needed to resolve this dependency.
14378 On HP-UX 10 and later, the GCC driver adds the necessary options to
14379 link with libdld.sl when the @option{-static} option is specified.
14380 This causes the resulting binary to be dynamic.  On the 64-bit port,
14381 the linkers generate dynamic binaries by default in any case.  The
14382 @option{-nolibdld} option can be used to prevent the GCC driver from
14383 adding these link options.
14385 @item -threads
14386 @opindex threads
14387 Add support for multithreading with the @dfn{dce thread} library
14388 under HP-UX@.  This option sets flags for both the preprocessor and
14389 linker.
14390 @end table
14392 @node i386 and x86-64 Options
14393 @subsection Intel 386 and AMD x86-64 Options
14394 @cindex i386 Options
14395 @cindex x86-64 Options
14396 @cindex Intel 386 Options
14397 @cindex AMD x86-64 Options
14399 These @samp{-m} options are defined for the i386 and x86-64 family of
14400 computers:
14402 @table @gcctabopt
14404 @item -march=@var{cpu-type}
14405 @opindex march
14406 Generate instructions for the machine type @var{cpu-type}.  In contrast to
14407 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
14408 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
14409 to generate code that may not run at all on processors other than the one
14410 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
14411 @option{-mtune=@var{cpu-type}}.
14413 The choices for @var{cpu-type} are:
14415 @table @samp
14416 @item native
14417 This selects the CPU to generate code for at compilation time by determining
14418 the processor type of the compiling machine.  Using @option{-march=native}
14419 enables all instruction subsets supported by the local machine (hence
14420 the result might not run on different machines).  Using @option{-mtune=native}
14421 produces code optimized for the local machine under the constraints
14422 of the selected instruction set.  
14424 @item i386
14425 Original Intel i386 CPU@.
14427 @item i486
14428 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
14430 @item i586
14431 @itemx pentium
14432 Intel Pentium CPU with no MMX support.
14434 @item pentium-mmx
14435 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
14437 @item pentiumpro
14438 Intel Pentium Pro CPU@.
14440 @item i686
14441 When used with @option{-march}, the Pentium Pro
14442 instruction set is used, so the code runs on all i686 family chips.
14443 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
14445 @item pentium2
14446 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
14447 support.
14449 @item pentium3
14450 @itemx pentium3m
14451 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
14452 set support.
14454 @item pentium-m
14455 Intel Pentium M; low-power version of Intel Pentium III CPU
14456 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
14458 @item pentium4
14459 @itemx pentium4m
14460 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
14462 @item prescott
14463 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
14464 set support.
14466 @item nocona
14467 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
14468 SSE2 and SSE3 instruction set support.
14470 @item core2
14471 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
14472 instruction set support.
14474 @item corei7
14475 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
14476 and SSE4.2 instruction set support.
14478 @item corei7-avx
14479 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14480 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
14482 @item core-avx-i
14483 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14484 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
14485 set support.
14487 @item core-avx2
14488 Intel Core CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14489 SSE4.1, SSE4.2, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2
14490 and F16C instruction set support.
14492 @item atom
14493 Intel Atom CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
14494 instruction set support.
14496 @item slm
14497 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14498 SSE4.1 and SSE4.2 instruction set support.
14500 @item k6
14501 AMD K6 CPU with MMX instruction set support.
14503 @item k6-2
14504 @itemx k6-3
14505 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
14507 @item athlon
14508 @itemx athlon-tbird
14509 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
14510 support.
14512 @item athlon-4
14513 @itemx athlon-xp
14514 @itemx athlon-mp
14515 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
14516 instruction set support.
14518 @item k8
14519 @itemx opteron
14520 @itemx athlon64
14521 @itemx athlon-fx
14522 Processors based on the AMD K8 core with x86-64 instruction set support,
14523 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
14524 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
14525 instruction set extensions.)
14527 @item k8-sse3
14528 @itemx opteron-sse3
14529 @itemx athlon64-sse3
14530 Improved versions of AMD K8 cores with SSE3 instruction set support.
14532 @item amdfam10
14533 @itemx barcelona
14534 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
14535 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
14536 instruction set extensions.)
14538 @item bdver1
14539 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
14540 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
14541 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
14542 @item bdver2
14543 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14544 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
14545 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
14546 extensions.)
14547 @item bdver3
14548 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14549 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
14550 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
14551 extensions.
14553 @item btver1
14554 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
14555 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
14556 instruction set extensions.)
14558 @item btver2
14559 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
14560 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
14561 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
14563 @item winchip-c6
14564 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
14565 set support.
14567 @item winchip2
14568 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
14569 instruction set support.
14571 @item c3
14572 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
14573 implemented for this chip.)
14575 @item c3-2
14576 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
14577 (No scheduling is
14578 implemented for this chip.)
14580 @item geode
14581 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
14582 @end table
14584 @item -mtune=@var{cpu-type}
14585 @opindex mtune
14586 Tune to @var{cpu-type} everything applicable about the generated code, except
14587 for the ABI and the set of available instructions.  
14588 While picking a specific @var{cpu-type} schedules things appropriately
14589 for that particular chip, the compiler does not generate any code that
14590 cannot run on the default machine type unless you use a
14591 @option{-march=@var{cpu-type}} option.
14592 For example, if GCC is configured for i686-pc-linux-gnu
14593 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
14594 but still runs on i686 machines.
14596 The choices for @var{cpu-type} are the same as for @option{-march}.
14597 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
14599 @table @samp
14600 @item generic
14601 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
14602 If you know the CPU on which your code will run, then you should use
14603 the corresponding @option{-mtune} or @option{-march} option instead of
14604 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
14605 of your application will have, then you should use this option.
14607 As new processors are deployed in the marketplace, the behavior of this
14608 option will change.  Therefore, if you upgrade to a newer version of
14609 GCC, code generation controlled by this option will change to reflect
14610 the processors
14611 that are most common at the time that version of GCC is released.
14613 There is no @option{-march=generic} option because @option{-march}
14614 indicates the instruction set the compiler can use, and there is no
14615 generic instruction set applicable to all processors.  In contrast,
14616 @option{-mtune} indicates the processor (or, in this case, collection of
14617 processors) for which the code is optimized.
14618 @end table
14620 @item -mcpu=@var{cpu-type}
14621 @opindex mcpu
14622 A deprecated synonym for @option{-mtune}.
14624 @item -mfpmath=@var{unit}
14625 @opindex mfpmath
14626 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
14627 for @var{unit} are:
14629 @table @samp
14630 @item 387
14631 Use the standard 387 floating-point coprocessor present on the majority of chips and
14632 emulated otherwise.  Code compiled with this option runs almost everywhere.
14633 The temporary results are computed in 80-bit precision instead of the precision
14634 specified by the type, resulting in slightly different results compared to most
14635 of other chips.  See @option{-ffloat-store} for more detailed description.
14637 This is the default choice for i386 compiler.
14639 @item sse
14640 Use scalar floating-point instructions present in the SSE instruction set.
14641 This instruction set is supported by Pentium III and newer chips,
14642 and in the AMD line
14643 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
14644 instruction set supports only single-precision arithmetic, thus the double and
14645 extended-precision arithmetic are still done using 387.  A later version, present
14646 only in Pentium 4 and AMD x86-64 chips, supports double-precision
14647 arithmetic too.
14649 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
14650 or @option{-msse2} switches to enable SSE extensions and make this option
14651 effective.  For the x86-64 compiler, these extensions are enabled by default.
14653 The resulting code should be considerably faster in the majority of cases and avoid
14654 the numerical instability problems of 387 code, but may break some existing
14655 code that expects temporaries to be 80 bits.
14657 This is the default choice for the x86-64 compiler.
14659 @item sse,387
14660 @itemx sse+387
14661 @itemx both
14662 Attempt to utilize both instruction sets at once.  This effectively doubles the
14663 amount of available registers, and on chips with separate execution units for
14664 387 and SSE the execution resources too.  Use this option with care, as it is
14665 still experimental, because the GCC register allocator does not model separate
14666 functional units well, resulting in unstable performance.
14667 @end table
14669 @item -masm=@var{dialect}
14670 @opindex masm=@var{dialect}
14671 Output assembly instructions using selected @var{dialect}.  Supported
14672 choices are @samp{intel} or @samp{att} (the default).  Darwin does
14673 not support @samp{intel}.
14675 @item -mieee-fp
14676 @itemx -mno-ieee-fp
14677 @opindex mieee-fp
14678 @opindex mno-ieee-fp
14679 Control whether or not the compiler uses IEEE floating-point
14680 comparisons.  These correctly handle the case where the result of a
14681 comparison is unordered.
14683 @item -msoft-float
14684 @opindex msoft-float
14685 Generate output containing library calls for floating point.
14687 @strong{Warning:} the requisite libraries are not part of GCC@.
14688 Normally the facilities of the machine's usual C compiler are used, but
14689 this can't be done directly in cross-compilation.  You must make your
14690 own arrangements to provide suitable library functions for
14691 cross-compilation.
14693 On machines where a function returns floating-point results in the 80387
14694 register stack, some floating-point opcodes may be emitted even if
14695 @option{-msoft-float} is used.
14697 @item -mno-fp-ret-in-387
14698 @opindex mno-fp-ret-in-387
14699 Do not use the FPU registers for return values of functions.
14701 The usual calling convention has functions return values of types
14702 @code{float} and @code{double} in an FPU register, even if there
14703 is no FPU@.  The idea is that the operating system should emulate
14704 an FPU@.
14706 The option @option{-mno-fp-ret-in-387} causes such values to be returned
14707 in ordinary CPU registers instead.
14709 @item -mno-fancy-math-387
14710 @opindex mno-fancy-math-387
14711 Some 387 emulators do not support the @code{sin}, @code{cos} and
14712 @code{sqrt} instructions for the 387.  Specify this option to avoid
14713 generating those instructions.  This option is the default on FreeBSD,
14714 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
14715 indicates that the target CPU always has an FPU and so the
14716 instruction does not need emulation.  These
14717 instructions are not generated unless you also use the
14718 @option{-funsafe-math-optimizations} switch.
14720 @item -malign-double
14721 @itemx -mno-align-double
14722 @opindex malign-double
14723 @opindex mno-align-double
14724 Control whether GCC aligns @code{double}, @code{long double}, and
14725 @code{long long} variables on a two-word boundary or a one-word
14726 boundary.  Aligning @code{double} variables on a two-word boundary
14727 produces code that runs somewhat faster on a Pentium at the
14728 expense of more memory.
14730 On x86-64, @option{-malign-double} is enabled by default.
14732 @strong{Warning:} if you use the @option{-malign-double} switch,
14733 structures containing the above types are aligned differently than
14734 the published application binary interface specifications for the 386
14735 and are not binary compatible with structures in code compiled
14736 without that switch.
14738 @item -m96bit-long-double
14739 @itemx -m128bit-long-double
14740 @opindex m96bit-long-double
14741 @opindex m128bit-long-double
14742 These switches control the size of @code{long double} type.  The i386
14743 application binary interface specifies the size to be 96 bits,
14744 so @option{-m96bit-long-double} is the default in 32-bit mode.
14746 Modern architectures (Pentium and newer) prefer @code{long double}
14747 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
14748 conforming to the ABI, this is not possible.  So specifying
14749 @option{-m128bit-long-double} aligns @code{long double}
14750 to a 16-byte boundary by padding the @code{long double} with an additional
14751 32-bit zero.
14753 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
14754 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
14756 Notice that neither of these options enable any extra precision over the x87
14757 standard of 80 bits for a @code{long double}.
14759 @strong{Warning:} if you override the default value for your target ABI, this
14760 changes the size of 
14761 structures and arrays containing @code{long double} variables,
14762 as well as modifying the function calling convention for functions taking
14763 @code{long double}.  Hence they are not binary-compatible
14764 with code compiled without that switch.
14766 @item -mlong-double-64
14767 @itemx -mlong-double-80
14768 @opindex mlong-double-64
14769 @opindex mlong-double-80
14770 These switches control the size of @code{long double} type. A size
14771 of 64 bits makes the @code{long double} type equivalent to the @code{double}
14772 type. This is the default for Bionic C library.
14774 @strong{Warning:} if you override the default value for your target ABI, this
14775 changes the size of
14776 structures and arrays containing @code{long double} variables,
14777 as well as modifying the function calling convention for functions taking
14778 @code{long double}.  Hence they are not binary-compatible
14779 with code compiled without that switch.
14781 @item -mlarge-data-threshold=@var{threshold}
14782 @opindex mlarge-data-threshold
14783 When @option{-mcmodel=medium} is specified, data objects larger than
14784 @var{threshold} are placed in the large data section.  This value must be the
14785 same across all objects linked into the binary, and defaults to 65535.
14787 @item -mrtd
14788 @opindex mrtd
14789 Use a different function-calling convention, in which functions that
14790 take a fixed number of arguments return with the @code{ret @var{num}}
14791 instruction, which pops their arguments while returning.  This saves one
14792 instruction in the caller since there is no need to pop the arguments
14793 there.
14795 You can specify that an individual function is called with this calling
14796 sequence with the function attribute @samp{stdcall}.  You can also
14797 override the @option{-mrtd} option by using the function attribute
14798 @samp{cdecl}.  @xref{Function Attributes}.
14800 @strong{Warning:} this calling convention is incompatible with the one
14801 normally used on Unix, so you cannot use it if you need to call
14802 libraries compiled with the Unix compiler.
14804 Also, you must provide function prototypes for all functions that
14805 take variable numbers of arguments (including @code{printf});
14806 otherwise incorrect code is generated for calls to those
14807 functions.
14809 In addition, seriously incorrect code results if you call a
14810 function with too many arguments.  (Normally, extra arguments are
14811 harmlessly ignored.)
14813 @item -mregparm=@var{num}
14814 @opindex mregparm
14815 Control how many registers are used to pass integer arguments.  By
14816 default, no registers are used to pass arguments, and at most 3
14817 registers can be used.  You can control this behavior for a specific
14818 function by using the function attribute @samp{regparm}.
14819 @xref{Function Attributes}.
14821 @strong{Warning:} if you use this switch, and
14822 @var{num} is nonzero, then you must build all modules with the same
14823 value, including any libraries.  This includes the system libraries and
14824 startup modules.
14826 @item -msseregparm
14827 @opindex msseregparm
14828 Use SSE register passing conventions for float and double arguments
14829 and return values.  You can control this behavior for a specific
14830 function by using the function attribute @samp{sseregparm}.
14831 @xref{Function Attributes}.
14833 @strong{Warning:} if you use this switch then you must build all
14834 modules with the same value, including any libraries.  This includes
14835 the system libraries and startup modules.
14837 @item -mvect8-ret-in-mem
14838 @opindex mvect8-ret-in-mem
14839 Return 8-byte vectors in memory instead of MMX registers.  This is the
14840 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
14841 Studio compilers until version 12.  Later compiler versions (starting
14842 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
14843 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
14844 you need to remain compatible with existing code produced by those
14845 previous compiler versions or older versions of GCC@.
14847 @item -mpc32
14848 @itemx -mpc64
14849 @itemx -mpc80
14850 @opindex mpc32
14851 @opindex mpc64
14852 @opindex mpc80
14854 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
14855 is specified, the significands of results of floating-point operations are
14856 rounded to 24 bits (single precision); @option{-mpc64} rounds the
14857 significands of results of floating-point operations to 53 bits (double
14858 precision) and @option{-mpc80} rounds the significands of results of
14859 floating-point operations to 64 bits (extended double precision), which is
14860 the default.  When this option is used, floating-point operations in higher
14861 precisions are not available to the programmer without setting the FPU
14862 control word explicitly.
14864 Setting the rounding of floating-point operations to less than the default
14865 80 bits can speed some programs by 2% or more.  Note that some mathematical
14866 libraries assume that extended-precision (80-bit) floating-point operations
14867 are enabled by default; routines in such libraries could suffer significant
14868 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14869 when this option is used to set the precision to less than extended precision.
14871 @item -mstackrealign
14872 @opindex mstackrealign
14873 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14874 option generates an alternate prologue and epilogue that realigns the
14875 run-time stack if necessary.  This supports mixing legacy codes that keep
14876 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14877 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14878 applicable to individual functions.
14880 @item -mpreferred-stack-boundary=@var{num}
14881 @opindex mpreferred-stack-boundary
14882 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14883 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14884 the default is 4 (16 bytes or 128 bits).
14886 @strong{Warning:} When generating code for the x86-64 architecture with
14887 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14888 used to keep the stack boundary aligned to 8 byte boundary.  Since
14889 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14890 intended to be used in controlled environment where stack space is
14891 important limitation.  This option will lead to wrong code when functions
14892 compiled with 16 byte stack alignment (such as functions from a standard
14893 library) are called with misaligned stack.  In this case, SSE
14894 instructions may lead to misaligned memory access traps.  In addition,
14895 variable arguments will be handled incorrectly for 16 byte aligned
14896 objects (including x87 long double and __int128), leading to wrong
14897 results.  You must build all modules with
14898 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14899 includes the system libraries and startup modules.
14901 @item -mincoming-stack-boundary=@var{num}
14902 @opindex mincoming-stack-boundary
14903 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14904 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14905 the one specified by @option{-mpreferred-stack-boundary} is used.
14907 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14908 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14909 suffer significant run time performance penalties.  On Pentium III, the
14910 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14911 properly if it is not 16-byte aligned.
14913 To ensure proper alignment of this values on the stack, the stack boundary
14914 must be as aligned as that required by any value stored on the stack.
14915 Further, every function must be generated such that it keeps the stack
14916 aligned.  Thus calling a function compiled with a higher preferred
14917 stack boundary from a function compiled with a lower preferred stack
14918 boundary most likely misaligns the stack.  It is recommended that
14919 libraries that use callbacks always use the default setting.
14921 This extra alignment does consume extra stack space, and generally
14922 increases code size.  Code that is sensitive to stack space usage, such
14923 as embedded systems and operating system kernels, may want to reduce the
14924 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14926 @item -mmmx
14927 @itemx -mno-mmx
14928 @itemx -msse
14929 @itemx -mno-sse
14930 @itemx -msse2
14931 @itemx -mno-sse2
14932 @itemx -msse3
14933 @itemx -mno-sse3
14934 @itemx -mssse3
14935 @itemx -mno-ssse3
14936 @itemx -msse4.1
14937 @need 800
14938 @itemx -mno-sse4.1
14939 @itemx -msse4.2
14940 @itemx -mno-sse4.2
14941 @itemx -msse4
14942 @itemx -mno-sse4
14943 @itemx -mavx
14944 @itemx -mno-avx
14945 @itemx -mavx2
14946 @itemx -mno-avx2
14947 @itemx -mavx512f
14948 @itemx -mno-avx512f
14949 @need 800
14950 @itemx -mavx512pf
14951 @itemx -mno-avx512pf
14952 @itemx -mavx512er
14953 @itemx -mno-avx512er
14954 @itemx -mavx512cd
14955 @itemx -mno-avx512cd
14956 @itemx -maes
14957 @itemx -mno-aes
14958 @itemx -mpclmul
14959 @itemx -mno-pclmul
14960 @need 800
14961 @itemx -mfsgsbase
14962 @itemx -mno-fsgsbase
14963 @itemx -mrdrnd
14964 @itemx -mno-rdrnd
14965 @itemx -mf16c
14966 @itemx -mno-f16c
14967 @itemx -mfma
14968 @itemx -mno-fma
14969 @itemx -msse4a
14970 @itemx -mno-sse4a
14971 @itemx -mfma4
14972 @itemx -mno-fma4
14973 @need 800
14974 @itemx -mxop
14975 @itemx -mno-xop
14976 @itemx -mlwp
14977 @itemx -mno-lwp
14978 @itemx -m3dnow
14979 @itemx -mno-3dnow
14980 @itemx -mpopcnt
14981 @itemx -mno-popcnt
14982 @itemx -mabm
14983 @itemx -mno-abm
14984 @itemx -mbmi
14985 @itemx -mbmi2
14986 @itemx -mno-bmi
14987 @itemx -mno-bmi2
14988 @itemx -mlzcnt
14989 @itemx -mno-lzcnt
14990 @itemx -mfxsr
14991 @itemx -mxsave
14992 @itemx -mxsaveopt
14993 @itemx -mrtm
14994 @itemx -mtbm
14995 @itemx -mno-tbm
14996 @opindex mmmx
14997 @opindex mno-mmx
14998 @opindex msse
14999 @opindex mno-sse
15000 @opindex m3dnow
15001 @opindex mno-3dnow
15002 These switches enable or disable the use of instructions in the MMX, SSE,
15003 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
15004 AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2,
15005 FXSR, XSAVE, XSAVEOPT, LZCNT, RTM or 3DNow!@:
15006 extended instruction sets.
15007 These extensions are also available as built-in functions: see
15008 @ref{X86 Built-in Functions}, for details of the functions enabled and
15009 disabled by these switches.
15011 To generate SSE/SSE2 instructions automatically from floating-point
15012 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
15014 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
15015 generates new AVX instructions or AVX equivalence for all SSEx instructions
15016 when needed.
15018 These options enable GCC to use these extended instructions in
15019 generated code, even without @option{-mfpmath=sse}.  Applications that
15020 perform run-time CPU detection must compile separate files for each
15021 supported architecture, using the appropriate flags.  In particular,
15022 the file containing the CPU detection code should be compiled without
15023 these options.
15025 @item -mdump-tune-features
15026 @opindex mdump-tune-features
15027 This option instructs GCC to dump the names of the x86 performance 
15028 tuning features and default settings. The names can be used in 
15029 @option{-mtune-ctrl=@var{feature-list}}.
15031 @item -mtune-ctrl=@var{feature-list}
15032 @opindex mtune-ctrl=@var{feature-list}
15033 This option is used to do fine grain control of x86 code generation features.
15034 @var{feature-list} is a comma separated list of @var{feature} names. See also
15035 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
15036 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
15037 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
15038 developers. Using it may lead to code paths not covered by testing and can
15039 potentially result in compiler ICEs or runtime errors.
15041 @item -mno-default
15042 @opindex mno-default
15043 This option instructs GCC to turn off all tunable features. See also 
15044 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
15046 @item -mcld
15047 @opindex mcld
15048 This option instructs GCC to emit a @code{cld} instruction in the prologue
15049 of functions that use string instructions.  String instructions depend on
15050 the DF flag to select between autoincrement or autodecrement mode.  While the
15051 ABI specifies the DF flag to be cleared on function entry, some operating
15052 systems violate this specification by not clearing the DF flag in their
15053 exception dispatchers.  The exception handler can be invoked with the DF flag
15054 set, which leads to wrong direction mode when string instructions are used.
15055 This option can be enabled by default on 32-bit x86 targets by configuring
15056 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
15057 instructions can be suppressed with the @option{-mno-cld} compiler option
15058 in this case.
15060 @item -mvzeroupper
15061 @opindex mvzeroupper
15062 This option instructs GCC to emit a @code{vzeroupper} instruction
15063 before a transfer of control flow out of the function to minimize
15064 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
15065 intrinsics.
15067 @item -mprefer-avx128
15068 @opindex mprefer-avx128
15069 This option instructs GCC to use 128-bit AVX instructions instead of
15070 256-bit AVX instructions in the auto-vectorizer.
15072 @item -mcx16
15073 @opindex mcx16
15074 This option enables GCC to generate @code{CMPXCHG16B} instructions.
15075 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
15076 (or oword) data types.  
15077 This is useful for high-resolution counters that can be updated
15078 by multiple processors (or cores).  This instruction is generated as part of
15079 atomic built-in functions: see @ref{__sync Builtins} or
15080 @ref{__atomic Builtins} for details.
15082 @item -msahf
15083 @opindex msahf
15084 This option enables generation of @code{SAHF} instructions in 64-bit code.
15085 Early Intel Pentium 4 CPUs with Intel 64 support,
15086 prior to the introduction of Pentium 4 G1 step in December 2005,
15087 lacked the @code{LAHF} and @code{SAHF} instructions
15088 which were supported by AMD64.
15089 These are load and store instructions, respectively, for certain status flags.
15090 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
15091 @code{drem}, and @code{remainder} built-in functions;
15092 see @ref{Other Builtins} for details.
15094 @item -mmovbe
15095 @opindex mmovbe
15096 This option enables use of the @code{movbe} instruction to implement
15097 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
15099 @item -mcrc32
15100 @opindex mcrc32
15101 This option enables built-in functions @code{__builtin_ia32_crc32qi},
15102 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
15103 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
15105 @item -mrecip
15106 @opindex mrecip
15107 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
15108 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
15109 with an additional Newton-Raphson step
15110 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
15111 (and their vectorized
15112 variants) for single-precision floating-point arguments.  These instructions
15113 are generated only when @option{-funsafe-math-optimizations} is enabled
15114 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
15115 Note that while the throughput of the sequence is higher than the throughput
15116 of the non-reciprocal instruction, the precision of the sequence can be
15117 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
15119 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
15120 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
15121 combination), and doesn't need @option{-mrecip}.
15123 Also note that GCC emits the above sequence with additional Newton-Raphson step
15124 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
15125 already with @option{-ffast-math} (or the above option combination), and
15126 doesn't need @option{-mrecip}.
15128 @item -mrecip=@var{opt}
15129 @opindex mrecip=opt
15130 This option controls which reciprocal estimate instructions
15131 may be used.  @var{opt} is a comma-separated list of options, which may
15132 be preceded by a @samp{!} to invert the option:
15134 @table @samp
15135 @item all
15136 Enable all estimate instructions.
15138 @item default
15139 Enable the default instructions, equivalent to @option{-mrecip}.
15141 @item none
15142 Disable all estimate instructions, equivalent to @option{-mno-recip}.
15144 @item div
15145 Enable the approximation for scalar division.
15147 @item vec-div
15148 Enable the approximation for vectorized division.
15150 @item sqrt
15151 Enable the approximation for scalar square root.
15153 @item vec-sqrt
15154 Enable the approximation for vectorized square root.
15155 @end table
15157 So, for example, @option{-mrecip=all,!sqrt} enables
15158 all of the reciprocal approximations, except for square root.
15160 @item -mveclibabi=@var{type}
15161 @opindex mveclibabi
15162 Specifies the ABI type to use for vectorizing intrinsics using an
15163 external library.  Supported values for @var{type} are @samp{svml} 
15164 for the Intel short
15165 vector math library and @samp{acml} for the AMD math core library.
15166 To use this option, both @option{-ftree-vectorize} and
15167 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
15168 ABI-compatible library must be specified at link time.
15170 GCC currently emits calls to @code{vmldExp2},
15171 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
15172 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
15173 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
15174 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
15175 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
15176 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
15177 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
15178 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
15179 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
15180 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
15181 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
15182 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
15183 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
15184 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
15185 when @option{-mveclibabi=acml} is used.  
15187 @item -mabi=@var{name}
15188 @opindex mabi
15189 Generate code for the specified calling convention.  Permissible values
15190 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
15191 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
15192 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
15193 You can control this behavior for a specific function by
15194 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
15195 @xref{Function Attributes}.
15197 @item -mtls-dialect=@var{type}
15198 @opindex mtls-dialect
15199 Generate code to access thread-local storage using the @samp{gnu} or
15200 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
15201 @samp{gnu2} is more efficient, but it may add compile- and run-time
15202 requirements that cannot be satisfied on all systems.
15204 @item -mpush-args
15205 @itemx -mno-push-args
15206 @opindex mpush-args
15207 @opindex mno-push-args
15208 Use PUSH operations to store outgoing parameters.  This method is shorter
15209 and usually equally fast as method using SUB/MOV operations and is enabled
15210 by default.  In some cases disabling it may improve performance because of
15211 improved scheduling and reduced dependencies.
15213 @item -maccumulate-outgoing-args
15214 @opindex maccumulate-outgoing-args
15215 If enabled, the maximum amount of space required for outgoing arguments is
15216 computed in the function prologue.  This is faster on most modern CPUs
15217 because of reduced dependencies, improved scheduling and reduced stack usage
15218 when the preferred stack boundary is not equal to 2.  The drawback is a notable
15219 increase in code size.  This switch implies @option{-mno-push-args}.
15221 @item -mthreads
15222 @opindex mthreads
15223 Support thread-safe exception handling on MinGW.  Programs that rely
15224 on thread-safe exception handling must compile and link all code with the
15225 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
15226 @code{-D_MT}; when linking, it links in a special thread helper library
15227 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
15229 @item -mno-align-stringops
15230 @opindex mno-align-stringops
15231 Do not align the destination of inlined string operations.  This switch reduces
15232 code size and improves performance in case the destination is already aligned,
15233 but GCC doesn't know about it.
15235 @item -minline-all-stringops
15236 @opindex minline-all-stringops
15237 By default GCC inlines string operations only when the destination is 
15238 known to be aligned to least a 4-byte boundary.  
15239 This enables more inlining and increases code
15240 size, but may improve performance of code that depends on fast
15241 @code{memcpy}, @code{strlen},
15242 and @code{memset} for short lengths.
15244 @item -minline-stringops-dynamically
15245 @opindex minline-stringops-dynamically
15246 For string operations of unknown size, use run-time checks with
15247 inline code for small blocks and a library call for large blocks.
15249 @item -mstringop-strategy=@var{alg}
15250 @opindex mstringop-strategy=@var{alg}
15251 Override the internal decision heuristic for the particular algorithm to use
15252 for inlining string operations.  The allowed values for @var{alg} are:
15254 @table @samp
15255 @item rep_byte
15256 @itemx rep_4byte
15257 @itemx rep_8byte
15258 Expand using i386 @code{rep} prefix of the specified size.
15260 @item byte_loop
15261 @itemx loop
15262 @itemx unrolled_loop
15263 Expand into an inline loop.
15265 @item libcall
15266 Always use a library call.
15267 @end table
15269 @item -mmemcpy-strategy=@var{strategy}
15270 @opindex mmemcpy-strategy=@var{strategy}
15271 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
15272 should be inlined and what inline algorithm to use when the expected size
15273 of the copy operation is known. @var{strategy} 
15274 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
15275 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
15276 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
15277 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
15278 in the list must be specified in increasing order.  The minimal byte size for 
15279 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
15280 preceding range.
15282 @item -mmemset-strategy=@var{strategy}
15283 @opindex mmemset-strategy=@var{strategy}
15284 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
15285 @code{__builtin_memset} expansion.
15287 @item -momit-leaf-frame-pointer
15288 @opindex momit-leaf-frame-pointer
15289 Don't keep the frame pointer in a register for leaf functions.  This
15290 avoids the instructions to save, set up, and restore frame pointers and
15291 makes an extra register available in leaf functions.  The option
15292 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
15293 which might make debugging harder.
15295 @item -mtls-direct-seg-refs
15296 @itemx -mno-tls-direct-seg-refs
15297 @opindex mtls-direct-seg-refs
15298 Controls whether TLS variables may be accessed with offsets from the
15299 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
15300 or whether the thread base pointer must be added.  Whether or not this
15301 is valid depends on the operating system, and whether it maps the
15302 segment to cover the entire TLS area.
15304 For systems that use the GNU C Library, the default is on.
15306 @item -msse2avx
15307 @itemx -mno-sse2avx
15308 @opindex msse2avx
15309 Specify that the assembler should encode SSE instructions with VEX
15310 prefix.  The option @option{-mavx} turns this on by default.
15312 @item -mfentry
15313 @itemx -mno-fentry
15314 @opindex mfentry
15315 If profiling is active (@option{-pg}), put the profiling
15316 counter call before the prologue.
15317 Note: On x86 architectures the attribute @code{ms_hook_prologue}
15318 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
15320 @item -m8bit-idiv
15321 @itemx -mno-8bit-idiv
15322 @opindex 8bit-idiv
15323 On some processors, like Intel Atom, 8-bit unsigned integer divide is
15324 much faster than 32-bit/64-bit integer divide.  This option generates a
15325 run-time check.  If both dividend and divisor are within range of 0
15326 to 255, 8-bit unsigned integer divide is used instead of
15327 32-bit/64-bit integer divide.
15329 @item -mavx256-split-unaligned-load
15330 @itemx -mavx256-split-unaligned-store
15331 @opindex avx256-split-unaligned-load
15332 @opindex avx256-split-unaligned-store
15333 Split 32-byte AVX unaligned load and store.
15335 @item -mstack-protector-guard=@var{guard}
15336 @opindex mstack-protector-guard=@var{guard}
15337 Generate stack protection code using canary at @var{guard}.  Supported
15338 locations are @samp{global} for global canary or @samp{tls} for per-thread
15339 canary in the TLS block (the default).  This option has effect only when
15340 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
15342 @end table
15344 These @samp{-m} switches are supported in addition to the above
15345 on x86-64 processors in 64-bit environments.
15347 @table @gcctabopt
15348 @item -m32
15349 @itemx -m64
15350 @itemx -mx32
15351 @opindex m32
15352 @opindex m64
15353 @opindex mx32
15354 Generate code for a 32-bit or 64-bit environment.
15355 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
15356 to 32 bits, and
15357 generates code that runs on any i386 system.
15359 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
15360 types to 64 bits, and generates code for the x86-64 architecture.
15361 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
15362 and @option{-mdynamic-no-pic} options.
15364 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
15365 to 32 bits, and
15366 generates code for the x86-64 architecture.
15368 @item -mno-red-zone
15369 @opindex mno-red-zone
15370 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
15371 by the x86-64 ABI; it is a 128-byte area beyond the location of the
15372 stack pointer that is not modified by signal or interrupt handlers
15373 and therefore can be used for temporary data without adjusting the stack
15374 pointer.  The flag @option{-mno-red-zone} disables this red zone.
15376 @item -mcmodel=small
15377 @opindex mcmodel=small
15378 Generate code for the small code model: the program and its symbols must
15379 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
15380 Programs can be statically or dynamically linked.  This is the default
15381 code model.
15383 @item -mcmodel=kernel
15384 @opindex mcmodel=kernel
15385 Generate code for the kernel code model.  The kernel runs in the
15386 negative 2 GB of the address space.
15387 This model has to be used for Linux kernel code.
15389 @item -mcmodel=medium
15390 @opindex mcmodel=medium
15391 Generate code for the medium model: the program is linked in the lower 2
15392 GB of the address space.  Small symbols are also placed there.  Symbols
15393 with sizes larger than @option{-mlarge-data-threshold} are put into
15394 large data or BSS sections and can be located above 2GB.  Programs can
15395 be statically or dynamically linked.
15397 @item -mcmodel=large
15398 @opindex mcmodel=large
15399 Generate code for the large model.  This model makes no assumptions
15400 about addresses and sizes of sections.
15402 @item -maddress-mode=long
15403 @opindex maddress-mode=long
15404 Generate code for long address mode.  This is only supported for 64-bit
15405 and x32 environments.  It is the default address mode for 64-bit
15406 environments.
15408 @item -maddress-mode=short
15409 @opindex maddress-mode=short
15410 Generate code for short address mode.  This is only supported for 32-bit
15411 and x32 environments.  It is the default address mode for 32-bit and
15412 x32 environments.
15413 @end table
15415 @node i386 and x86-64 Windows Options
15416 @subsection i386 and x86-64 Windows Options
15417 @cindex i386 and x86-64 Windows Options
15419 These additional options are available for Microsoft Windows targets:
15421 @table @gcctabopt
15422 @item -mconsole
15423 @opindex mconsole
15424 This option
15425 specifies that a console application is to be generated, by
15426 instructing the linker to set the PE header subsystem type
15427 required for console applications.
15428 This option is available for Cygwin and MinGW targets and is
15429 enabled by default on those targets.
15431 @item -mdll
15432 @opindex mdll
15433 This option is available for Cygwin and MinGW targets.  It
15434 specifies that a DLL---a dynamic link library---is to be
15435 generated, enabling the selection of the required runtime
15436 startup object and entry point.
15438 @item -mnop-fun-dllimport
15439 @opindex mnop-fun-dllimport
15440 This option is available for Cygwin and MinGW targets.  It
15441 specifies that the @code{dllimport} attribute should be ignored.
15443 @item -mthread
15444 @opindex mthread
15445 This option is available for MinGW targets. It specifies
15446 that MinGW-specific thread support is to be used.
15448 @item -municode
15449 @opindex municode
15450 This option is available for MinGW-w64 targets.  It causes
15451 the @code{UNICODE} preprocessor macro to be predefined, and
15452 chooses Unicode-capable runtime startup code.
15454 @item -mwin32
15455 @opindex mwin32
15456 This option is available for Cygwin and MinGW targets.  It
15457 specifies that the typical Microsoft Windows predefined macros are to
15458 be set in the pre-processor, but does not influence the choice
15459 of runtime library/startup code.
15461 @item -mwindows
15462 @opindex mwindows
15463 This option is available for Cygwin and MinGW targets.  It
15464 specifies that a GUI application is to be generated by
15465 instructing the linker to set the PE header subsystem type
15466 appropriately.
15468 @item -fno-set-stack-executable
15469 @opindex fno-set-stack-executable
15470 This option is available for MinGW targets. It specifies that
15471 the executable flag for the stack used by nested functions isn't
15472 set. This is necessary for binaries running in kernel mode of
15473 Microsoft Windows, as there the User32 API, which is used to set executable
15474 privileges, isn't available.
15476 @item -fwritable-relocated-rdata
15477 @opindex fno-writable-relocated-rdata
15478 This option is available for MinGW and Cygwin targets.  It specifies
15479 that relocated-data in read-only section is put into .data
15480 section.  This is a necessary for older runtimes not supporting
15481 modification of .rdata sections for pseudo-relocation.
15483 @item -mpe-aligned-commons
15484 @opindex mpe-aligned-commons
15485 This option is available for Cygwin and MinGW targets.  It
15486 specifies that the GNU extension to the PE file format that
15487 permits the correct alignment of COMMON variables should be
15488 used when generating code.  It is enabled by default if
15489 GCC detects that the target assembler found during configuration
15490 supports the feature.
15491 @end table
15493 See also under @ref{i386 and x86-64 Options} for standard options.
15495 @node IA-64 Options
15496 @subsection IA-64 Options
15497 @cindex IA-64 Options
15499 These are the @samp{-m} options defined for the Intel IA-64 architecture.
15501 @table @gcctabopt
15502 @item -mbig-endian
15503 @opindex mbig-endian
15504 Generate code for a big-endian target.  This is the default for HP-UX@.
15506 @item -mlittle-endian
15507 @opindex mlittle-endian
15508 Generate code for a little-endian target.  This is the default for AIX5
15509 and GNU/Linux.
15511 @item -mgnu-as
15512 @itemx -mno-gnu-as
15513 @opindex mgnu-as
15514 @opindex mno-gnu-as
15515 Generate (or don't) code for the GNU assembler.  This is the default.
15516 @c Also, this is the default if the configure option @option{--with-gnu-as}
15517 @c is used.
15519 @item -mgnu-ld
15520 @itemx -mno-gnu-ld
15521 @opindex mgnu-ld
15522 @opindex mno-gnu-ld
15523 Generate (or don't) code for the GNU linker.  This is the default.
15524 @c Also, this is the default if the configure option @option{--with-gnu-ld}
15525 @c is used.
15527 @item -mno-pic
15528 @opindex mno-pic
15529 Generate code that does not use a global pointer register.  The result
15530 is not position independent code, and violates the IA-64 ABI@.
15532 @item -mvolatile-asm-stop
15533 @itemx -mno-volatile-asm-stop
15534 @opindex mvolatile-asm-stop
15535 @opindex mno-volatile-asm-stop
15536 Generate (or don't) a stop bit immediately before and after volatile asm
15537 statements.
15539 @item -mregister-names
15540 @itemx -mno-register-names
15541 @opindex mregister-names
15542 @opindex mno-register-names
15543 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
15544 the stacked registers.  This may make assembler output more readable.
15546 @item -mno-sdata
15547 @itemx -msdata
15548 @opindex mno-sdata
15549 @opindex msdata
15550 Disable (or enable) optimizations that use the small data section.  This may
15551 be useful for working around optimizer bugs.
15553 @item -mconstant-gp
15554 @opindex mconstant-gp
15555 Generate code that uses a single constant global pointer value.  This is
15556 useful when compiling kernel code.
15558 @item -mauto-pic
15559 @opindex mauto-pic
15560 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
15561 This is useful when compiling firmware code.
15563 @item -minline-float-divide-min-latency
15564 @opindex minline-float-divide-min-latency
15565 Generate code for inline divides of floating-point values
15566 using the minimum latency algorithm.
15568 @item -minline-float-divide-max-throughput
15569 @opindex minline-float-divide-max-throughput
15570 Generate code for inline divides of floating-point values
15571 using the maximum throughput algorithm.
15573 @item -mno-inline-float-divide
15574 @opindex mno-inline-float-divide
15575 Do not generate inline code for divides of floating-point values.
15577 @item -minline-int-divide-min-latency
15578 @opindex minline-int-divide-min-latency
15579 Generate code for inline divides of integer values
15580 using the minimum latency algorithm.
15582 @item -minline-int-divide-max-throughput
15583 @opindex minline-int-divide-max-throughput
15584 Generate code for inline divides of integer values
15585 using the maximum throughput algorithm.
15587 @item -mno-inline-int-divide
15588 @opindex mno-inline-int-divide
15589 Do not generate inline code for divides of integer values.
15591 @item -minline-sqrt-min-latency
15592 @opindex minline-sqrt-min-latency
15593 Generate code for inline square roots
15594 using the minimum latency algorithm.
15596 @item -minline-sqrt-max-throughput
15597 @opindex minline-sqrt-max-throughput
15598 Generate code for inline square roots
15599 using the maximum throughput algorithm.
15601 @item -mno-inline-sqrt
15602 @opindex mno-inline-sqrt
15603 Do not generate inline code for @code{sqrt}.
15605 @item -mfused-madd
15606 @itemx -mno-fused-madd
15607 @opindex mfused-madd
15608 @opindex mno-fused-madd
15609 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
15610 instructions.  The default is to use these instructions.
15612 @item -mno-dwarf2-asm
15613 @itemx -mdwarf2-asm
15614 @opindex mno-dwarf2-asm
15615 @opindex mdwarf2-asm
15616 Don't (or do) generate assembler code for the DWARF 2 line number debugging
15617 info.  This may be useful when not using the GNU assembler.
15619 @item -mearly-stop-bits
15620 @itemx -mno-early-stop-bits
15621 @opindex mearly-stop-bits
15622 @opindex mno-early-stop-bits
15623 Allow stop bits to be placed earlier than immediately preceding the
15624 instruction that triggered the stop bit.  This can improve instruction
15625 scheduling, but does not always do so.
15627 @item -mfixed-range=@var{register-range}
15628 @opindex mfixed-range
15629 Generate code treating the given register range as fixed registers.
15630 A fixed register is one that the register allocator cannot use.  This is
15631 useful when compiling kernel code.  A register range is specified as
15632 two registers separated by a dash.  Multiple register ranges can be
15633 specified separated by a comma.
15635 @item -mtls-size=@var{tls-size}
15636 @opindex mtls-size
15637 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
15640 @item -mtune=@var{cpu-type}
15641 @opindex mtune
15642 Tune the instruction scheduling for a particular CPU, Valid values are
15643 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
15644 and @samp{mckinley}.
15646 @item -milp32
15647 @itemx -mlp64
15648 @opindex milp32
15649 @opindex mlp64
15650 Generate code for a 32-bit or 64-bit environment.
15651 The 32-bit environment sets int, long and pointer to 32 bits.
15652 The 64-bit environment sets int to 32 bits and long and pointer
15653 to 64 bits.  These are HP-UX specific flags.
15655 @item -mno-sched-br-data-spec
15656 @itemx -msched-br-data-spec
15657 @opindex mno-sched-br-data-spec
15658 @opindex msched-br-data-spec
15659 (Dis/En)able data speculative scheduling before reload.
15660 This results in generation of @code{ld.a} instructions and
15661 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15662 The default is 'disable'.
15664 @item -msched-ar-data-spec
15665 @itemx -mno-sched-ar-data-spec
15666 @opindex msched-ar-data-spec
15667 @opindex mno-sched-ar-data-spec
15668 (En/Dis)able data speculative scheduling after reload.
15669 This results in generation of @code{ld.a} instructions and
15670 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15671 The default is 'enable'.
15673 @item -mno-sched-control-spec
15674 @itemx -msched-control-spec
15675 @opindex mno-sched-control-spec
15676 @opindex msched-control-spec
15677 (Dis/En)able control speculative scheduling.  This feature is
15678 available only during region scheduling (i.e.@: before reload).
15679 This results in generation of the @code{ld.s} instructions and
15680 the corresponding check instructions @code{chk.s}.
15681 The default is 'disable'.
15683 @item -msched-br-in-data-spec
15684 @itemx -mno-sched-br-in-data-spec
15685 @opindex msched-br-in-data-spec
15686 @opindex mno-sched-br-in-data-spec
15687 (En/Dis)able speculative scheduling of the instructions that
15688 are dependent on the data speculative loads before reload.
15689 This is effective only with @option{-msched-br-data-spec} enabled.
15690 The default is 'enable'.
15692 @item -msched-ar-in-data-spec
15693 @itemx -mno-sched-ar-in-data-spec
15694 @opindex msched-ar-in-data-spec
15695 @opindex mno-sched-ar-in-data-spec
15696 (En/Dis)able speculative scheduling of the instructions that
15697 are dependent on the data speculative loads after reload.
15698 This is effective only with @option{-msched-ar-data-spec} enabled.
15699 The default is 'enable'.
15701 @item -msched-in-control-spec
15702 @itemx -mno-sched-in-control-spec
15703 @opindex msched-in-control-spec
15704 @opindex mno-sched-in-control-spec
15705 (En/Dis)able speculative scheduling of the instructions that
15706 are dependent on the control speculative loads.
15707 This is effective only with @option{-msched-control-spec} enabled.
15708 The default is 'enable'.
15710 @item -mno-sched-prefer-non-data-spec-insns
15711 @itemx -msched-prefer-non-data-spec-insns
15712 @opindex mno-sched-prefer-non-data-spec-insns
15713 @opindex msched-prefer-non-data-spec-insns
15714 If enabled, data-speculative instructions are chosen for schedule
15715 only if there are no other choices at the moment.  This makes
15716 the use of the data speculation much more conservative.
15717 The default is 'disable'.
15719 @item -mno-sched-prefer-non-control-spec-insns
15720 @itemx -msched-prefer-non-control-spec-insns
15721 @opindex mno-sched-prefer-non-control-spec-insns
15722 @opindex msched-prefer-non-control-spec-insns
15723 If enabled, control-speculative instructions are chosen for schedule
15724 only if there are no other choices at the moment.  This makes
15725 the use of the control speculation much more conservative.
15726 The default is 'disable'.
15728 @item -mno-sched-count-spec-in-critical-path
15729 @itemx -msched-count-spec-in-critical-path
15730 @opindex mno-sched-count-spec-in-critical-path
15731 @opindex msched-count-spec-in-critical-path
15732 If enabled, speculative dependencies are considered during
15733 computation of the instructions priorities.  This makes the use of the
15734 speculation a bit more conservative.
15735 The default is 'disable'.
15737 @item -msched-spec-ldc
15738 @opindex msched-spec-ldc
15739 Use a simple data speculation check.  This option is on by default.
15741 @item -msched-control-spec-ldc
15742 @opindex msched-spec-ldc
15743 Use a simple check for control speculation.  This option is on by default.
15745 @item -msched-stop-bits-after-every-cycle
15746 @opindex msched-stop-bits-after-every-cycle
15747 Place a stop bit after every cycle when scheduling.  This option is on
15748 by default.
15750 @item -msched-fp-mem-deps-zero-cost
15751 @opindex msched-fp-mem-deps-zero-cost
15752 Assume that floating-point stores and loads are not likely to cause a conflict
15753 when placed into the same instruction group.  This option is disabled by
15754 default.
15756 @item -msel-sched-dont-check-control-spec
15757 @opindex msel-sched-dont-check-control-spec
15758 Generate checks for control speculation in selective scheduling.
15759 This flag is disabled by default.
15761 @item -msched-max-memory-insns=@var{max-insns}
15762 @opindex msched-max-memory-insns
15763 Limit on the number of memory insns per instruction group, giving lower
15764 priority to subsequent memory insns attempting to schedule in the same
15765 instruction group. Frequently useful to prevent cache bank conflicts.
15766 The default value is 1.
15768 @item -msched-max-memory-insns-hard-limit
15769 @opindex msched-max-memory-insns-hard-limit
15770 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
15771 disallowing more than that number in an instruction group.
15772 Otherwise, the limit is ``soft'', meaning that non-memory operations
15773 are preferred when the limit is reached, but memory operations may still
15774 be scheduled.
15776 @end table
15778 @node LM32 Options
15779 @subsection LM32 Options
15780 @cindex LM32 options
15782 These @option{-m} options are defined for the LatticeMico32 architecture:
15784 @table @gcctabopt
15785 @item -mbarrel-shift-enabled
15786 @opindex mbarrel-shift-enabled
15787 Enable barrel-shift instructions.
15789 @item -mdivide-enabled
15790 @opindex mdivide-enabled
15791 Enable divide and modulus instructions.
15793 @item -mmultiply-enabled
15794 @opindex multiply-enabled
15795 Enable multiply instructions.
15797 @item -msign-extend-enabled
15798 @opindex msign-extend-enabled
15799 Enable sign extend instructions.
15801 @item -muser-enabled
15802 @opindex muser-enabled
15803 Enable user-defined instructions.
15805 @end table
15807 @node M32C Options
15808 @subsection M32C Options
15809 @cindex M32C options
15811 @table @gcctabopt
15812 @item -mcpu=@var{name}
15813 @opindex mcpu=
15814 Select the CPU for which code is generated.  @var{name} may be one of
15815 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
15816 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
15817 the M32C/80 series.
15819 @item -msim
15820 @opindex msim
15821 Specifies that the program will be run on the simulator.  This causes
15822 an alternate runtime library to be linked in which supports, for
15823 example, file I/O@.  You must not use this option when generating
15824 programs that will run on real hardware; you must provide your own
15825 runtime library for whatever I/O functions are needed.
15827 @item -memregs=@var{number}
15828 @opindex memregs=
15829 Specifies the number of memory-based pseudo-registers GCC uses
15830 during code generation.  These pseudo-registers are used like real
15831 registers, so there is a tradeoff between GCC's ability to fit the
15832 code into available registers, and the performance penalty of using
15833 memory instead of registers.  Note that all modules in a program must
15834 be compiled with the same value for this option.  Because of that, you
15835 must not use this option with GCC's default runtime libraries.
15837 @end table
15839 @node M32R/D Options
15840 @subsection M32R/D Options
15841 @cindex M32R/D options
15843 These @option{-m} options are defined for Renesas M32R/D architectures:
15845 @table @gcctabopt
15846 @item -m32r2
15847 @opindex m32r2
15848 Generate code for the M32R/2@.
15850 @item -m32rx
15851 @opindex m32rx
15852 Generate code for the M32R/X@.
15854 @item -m32r
15855 @opindex m32r
15856 Generate code for the M32R@.  This is the default.
15858 @item -mmodel=small
15859 @opindex mmodel=small
15860 Assume all objects live in the lower 16MB of memory (so that their addresses
15861 can be loaded with the @code{ld24} instruction), and assume all subroutines
15862 are reachable with the @code{bl} instruction.
15863 This is the default.
15865 The addressability of a particular object can be set with the
15866 @code{model} attribute.
15868 @item -mmodel=medium
15869 @opindex mmodel=medium
15870 Assume objects may be anywhere in the 32-bit address space (the compiler
15871 generates @code{seth/add3} instructions to load their addresses), and
15872 assume all subroutines are reachable with the @code{bl} instruction.
15874 @item -mmodel=large
15875 @opindex mmodel=large
15876 Assume objects may be anywhere in the 32-bit address space (the compiler
15877 generates @code{seth/add3} instructions to load their addresses), and
15878 assume subroutines may not be reachable with the @code{bl} instruction
15879 (the compiler generates the much slower @code{seth/add3/jl}
15880 instruction sequence).
15882 @item -msdata=none
15883 @opindex msdata=none
15884 Disable use of the small data area.  Variables are put into
15885 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
15886 @code{section} attribute has been specified).
15887 This is the default.
15889 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
15890 Objects may be explicitly put in the small data area with the
15891 @code{section} attribute using one of these sections.
15893 @item -msdata=sdata
15894 @opindex msdata=sdata
15895 Put small global and static data in the small data area, but do not
15896 generate special code to reference them.
15898 @item -msdata=use
15899 @opindex msdata=use
15900 Put small global and static data in the small data area, and generate
15901 special instructions to reference them.
15903 @item -G @var{num}
15904 @opindex G
15905 @cindex smaller data references
15906 Put global and static objects less than or equal to @var{num} bytes
15907 into the small data or BSS sections instead of the normal data or BSS
15908 sections.  The default value of @var{num} is 8.
15909 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
15910 for this option to have any effect.
15912 All modules should be compiled with the same @option{-G @var{num}} value.
15913 Compiling with different values of @var{num} may or may not work; if it
15914 doesn't the linker gives an error message---incorrect code is not
15915 generated.
15917 @item -mdebug
15918 @opindex mdebug
15919 Makes the M32R-specific code in the compiler display some statistics
15920 that might help in debugging programs.
15922 @item -malign-loops
15923 @opindex malign-loops
15924 Align all loops to a 32-byte boundary.
15926 @item -mno-align-loops
15927 @opindex mno-align-loops
15928 Do not enforce a 32-byte alignment for loops.  This is the default.
15930 @item -missue-rate=@var{number}
15931 @opindex missue-rate=@var{number}
15932 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15933 or 2.
15935 @item -mbranch-cost=@var{number}
15936 @opindex mbranch-cost=@var{number}
15937 @var{number} can only be 1 or 2.  If it is 1 then branches are
15938 preferred over conditional code, if it is 2, then the opposite applies.
15940 @item -mflush-trap=@var{number}
15941 @opindex mflush-trap=@var{number}
15942 Specifies the trap number to use to flush the cache.  The default is
15943 12.  Valid numbers are between 0 and 15 inclusive.
15945 @item -mno-flush-trap
15946 @opindex mno-flush-trap
15947 Specifies that the cache cannot be flushed by using a trap.
15949 @item -mflush-func=@var{name}
15950 @opindex mflush-func=@var{name}
15951 Specifies the name of the operating system function to call to flush
15952 the cache.  The default is @emph{_flush_cache}, but a function call
15953 is only used if a trap is not available.
15955 @item -mno-flush-func
15956 @opindex mno-flush-func
15957 Indicates that there is no OS function for flushing the cache.
15959 @end table
15961 @node M680x0 Options
15962 @subsection M680x0 Options
15963 @cindex M680x0 options
15965 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15966 The default settings depend on which architecture was selected when
15967 the compiler was configured; the defaults for the most common choices
15968 are given below.
15970 @table @gcctabopt
15971 @item -march=@var{arch}
15972 @opindex march
15973 Generate code for a specific M680x0 or ColdFire instruction set
15974 architecture.  Permissible values of @var{arch} for M680x0
15975 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15976 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15977 architectures are selected according to Freescale's ISA classification
15978 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15979 @samp{isab} and @samp{isac}.
15981 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15982 code for a ColdFire target.  The @var{arch} in this macro is one of the
15983 @option{-march} arguments given above.
15985 When used together, @option{-march} and @option{-mtune} select code
15986 that runs on a family of similar processors but that is optimized
15987 for a particular microarchitecture.
15989 @item -mcpu=@var{cpu}
15990 @opindex mcpu
15991 Generate code for a specific M680x0 or ColdFire processor.
15992 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15993 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15994 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15995 below, which also classifies the CPUs into families:
15997 @multitable @columnfractions 0.20 0.80
15998 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15999 @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}
16000 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16001 @item @samp{5206e} @tab @samp{5206e}
16002 @item @samp{5208} @tab @samp{5207} @samp{5208}
16003 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16004 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16005 @item @samp{5216} @tab @samp{5214} @samp{5216}
16006 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16007 @item @samp{5225} @tab @samp{5224} @samp{5225}
16008 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16009 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16010 @item @samp{5249} @tab @samp{5249}
16011 @item @samp{5250} @tab @samp{5250}
16012 @item @samp{5271} @tab @samp{5270} @samp{5271}
16013 @item @samp{5272} @tab @samp{5272}
16014 @item @samp{5275} @tab @samp{5274} @samp{5275}
16015 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16016 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16017 @item @samp{5307} @tab @samp{5307}
16018 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16019 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16020 @item @samp{5407} @tab @samp{5407}
16021 @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}
16022 @end multitable
16024 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16025 @var{arch} is compatible with @var{cpu}.  Other combinations of
16026 @option{-mcpu} and @option{-march} are rejected.
16028 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
16029 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
16030 where the value of @var{family} is given by the table above.
16032 @item -mtune=@var{tune}
16033 @opindex mtune
16034 Tune the code for a particular microarchitecture within the
16035 constraints set by @option{-march} and @option{-mcpu}.
16036 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16037 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16038 and @samp{cpu32}.  The ColdFire microarchitectures
16039 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16041 You can also use @option{-mtune=68020-40} for code that needs
16042 to run relatively well on 68020, 68030 and 68040 targets.
16043 @option{-mtune=68020-60} is similar but includes 68060 targets
16044 as well.  These two options select the same tuning decisions as
16045 @option{-m68020-40} and @option{-m68020-60} respectively.
16047 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
16048 when tuning for 680x0 architecture @var{arch}.  It also defines
16049 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16050 option is used.  If GCC is tuning for a range of architectures,
16051 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16052 it defines the macros for every architecture in the range.
16054 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
16055 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16056 of the arguments given above.
16058 @item -m68000
16059 @itemx -mc68000
16060 @opindex m68000
16061 @opindex mc68000
16062 Generate output for a 68000.  This is the default
16063 when the compiler is configured for 68000-based systems.
16064 It is equivalent to @option{-march=68000}.
16066 Use this option for microcontrollers with a 68000 or EC000 core,
16067 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16069 @item -m68010
16070 @opindex m68010
16071 Generate output for a 68010.  This is the default
16072 when the compiler is configured for 68010-based systems.
16073 It is equivalent to @option{-march=68010}.
16075 @item -m68020
16076 @itemx -mc68020
16077 @opindex m68020
16078 @opindex mc68020
16079 Generate output for a 68020.  This is the default
16080 when the compiler is configured for 68020-based systems.
16081 It is equivalent to @option{-march=68020}.
16083 @item -m68030
16084 @opindex m68030
16085 Generate output for a 68030.  This is the default when the compiler is
16086 configured for 68030-based systems.  It is equivalent to
16087 @option{-march=68030}.
16089 @item -m68040
16090 @opindex m68040
16091 Generate output for a 68040.  This is the default when the compiler is
16092 configured for 68040-based systems.  It is equivalent to
16093 @option{-march=68040}.
16095 This option inhibits the use of 68881/68882 instructions that have to be
16096 emulated by software on the 68040.  Use this option if your 68040 does not
16097 have code to emulate those instructions.
16099 @item -m68060
16100 @opindex m68060
16101 Generate output for a 68060.  This is the default when the compiler is
16102 configured for 68060-based systems.  It is equivalent to
16103 @option{-march=68060}.
16105 This option inhibits the use of 68020 and 68881/68882 instructions that
16106 have to be emulated by software on the 68060.  Use this option if your 68060
16107 does not have code to emulate those instructions.
16109 @item -mcpu32
16110 @opindex mcpu32
16111 Generate output for a CPU32.  This is the default
16112 when the compiler is configured for CPU32-based systems.
16113 It is equivalent to @option{-march=cpu32}.
16115 Use this option for microcontrollers with a
16116 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16117 68336, 68340, 68341, 68349 and 68360.
16119 @item -m5200
16120 @opindex m5200
16121 Generate output for a 520X ColdFire CPU@.  This is the default
16122 when the compiler is configured for 520X-based systems.
16123 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16124 in favor of that option.
16126 Use this option for microcontroller with a 5200 core, including
16127 the MCF5202, MCF5203, MCF5204 and MCF5206.
16129 @item -m5206e
16130 @opindex m5206e
16131 Generate output for a 5206e ColdFire CPU@.  The option is now
16132 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16134 @item -m528x
16135 @opindex m528x
16136 Generate output for a member of the ColdFire 528X family.
16137 The option is now deprecated in favor of the equivalent
16138 @option{-mcpu=528x}.
16140 @item -m5307
16141 @opindex m5307
16142 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16143 in favor of the equivalent @option{-mcpu=5307}.
16145 @item -m5407
16146 @opindex m5407
16147 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16148 in favor of the equivalent @option{-mcpu=5407}.
16150 @item -mcfv4e
16151 @opindex mcfv4e
16152 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16153 This includes use of hardware floating-point instructions.
16154 The option is equivalent to @option{-mcpu=547x}, and is now
16155 deprecated in favor of that option.
16157 @item -m68020-40
16158 @opindex m68020-40
16159 Generate output for a 68040, without using any of the new instructions.
16160 This results in code that can run relatively efficiently on either a
16161 68020/68881 or a 68030 or a 68040.  The generated code does use the
16162 68881 instructions that are emulated on the 68040.
16164 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16166 @item -m68020-60
16167 @opindex m68020-60
16168 Generate output for a 68060, without using any of the new instructions.
16169 This results in code that can run relatively efficiently on either a
16170 68020/68881 or a 68030 or a 68040.  The generated code does use the
16171 68881 instructions that are emulated on the 68060.
16173 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16175 @item -mhard-float
16176 @itemx -m68881
16177 @opindex mhard-float
16178 @opindex m68881
16179 Generate floating-point instructions.  This is the default for 68020
16180 and above, and for ColdFire devices that have an FPU@.  It defines the
16181 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
16182 on ColdFire targets.
16184 @item -msoft-float
16185 @opindex msoft-float
16186 Do not generate floating-point instructions; use library calls instead.
16187 This is the default for 68000, 68010, and 68832 targets.  It is also
16188 the default for ColdFire devices that have no FPU.
16190 @item -mdiv
16191 @itemx -mno-div
16192 @opindex mdiv
16193 @opindex mno-div
16194 Generate (do not generate) ColdFire hardware divide and remainder
16195 instructions.  If @option{-march} is used without @option{-mcpu},
16196 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16197 architectures.  Otherwise, the default is taken from the target CPU
16198 (either the default CPU, or the one specified by @option{-mcpu}).  For
16199 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16200 @option{-mcpu=5206e}.
16202 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
16204 @item -mshort
16205 @opindex mshort
16206 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16207 Additionally, parameters passed on the stack are also aligned to a
16208 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16210 @item -mno-short
16211 @opindex mno-short
16212 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16214 @item -mnobitfield
16215 @itemx -mno-bitfield
16216 @opindex mnobitfield
16217 @opindex mno-bitfield
16218 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16219 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16221 @item -mbitfield
16222 @opindex mbitfield
16223 Do use the bit-field instructions.  The @option{-m68020} option implies
16224 @option{-mbitfield}.  This is the default if you use a configuration
16225 designed for a 68020.
16227 @item -mrtd
16228 @opindex mrtd
16229 Use a different function-calling convention, in which functions
16230 that take a fixed number of arguments return with the @code{rtd}
16231 instruction, which pops their arguments while returning.  This
16232 saves one instruction in the caller since there is no need to pop
16233 the arguments there.
16235 This calling convention is incompatible with the one normally
16236 used on Unix, so you cannot use it if you need to call libraries
16237 compiled with the Unix compiler.
16239 Also, you must provide function prototypes for all functions that
16240 take variable numbers of arguments (including @code{printf});
16241 otherwise incorrect code is generated for calls to those
16242 functions.
16244 In addition, seriously incorrect code results if you call a
16245 function with too many arguments.  (Normally, extra arguments are
16246 harmlessly ignored.)
16248 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16249 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16251 @item -mno-rtd
16252 @opindex mno-rtd
16253 Do not use the calling conventions selected by @option{-mrtd}.
16254 This is the default.
16256 @item -malign-int
16257 @itemx -mno-align-int
16258 @opindex malign-int
16259 @opindex mno-align-int
16260 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16261 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16262 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16263 Aligning variables on 32-bit boundaries produces code that runs somewhat
16264 faster on processors with 32-bit busses at the expense of more memory.
16266 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16267 aligns structures containing the above types differently than
16268 most published application binary interface specifications for the m68k.
16270 @item -mpcrel
16271 @opindex mpcrel
16272 Use the pc-relative addressing mode of the 68000 directly, instead of
16273 using a global offset table.  At present, this option implies @option{-fpic},
16274 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16275 not presently supported with @option{-mpcrel}, though this could be supported for
16276 68020 and higher processors.
16278 @item -mno-strict-align
16279 @itemx -mstrict-align
16280 @opindex mno-strict-align
16281 @opindex mstrict-align
16282 Do not (do) assume that unaligned memory references are handled by
16283 the system.
16285 @item -msep-data
16286 Generate code that allows the data segment to be located in a different
16287 area of memory from the text segment.  This allows for execute-in-place in
16288 an environment without virtual memory management.  This option implies
16289 @option{-fPIC}.
16291 @item -mno-sep-data
16292 Generate code that assumes that the data segment follows the text segment.
16293 This is the default.
16295 @item -mid-shared-library
16296 Generate code that supports shared libraries via the library ID method.
16297 This allows for execute-in-place and shared libraries in an environment
16298 without virtual memory management.  This option implies @option{-fPIC}.
16300 @item -mno-id-shared-library
16301 Generate code that doesn't assume ID-based shared libraries are being used.
16302 This is the default.
16304 @item -mshared-library-id=n
16305 Specifies the identification number of the ID-based shared library being
16306 compiled.  Specifying a value of 0 generates more compact code; specifying
16307 other values forces the allocation of that number to the current
16308 library, but is no more space- or time-efficient than omitting this option.
16310 @item -mxgot
16311 @itemx -mno-xgot
16312 @opindex mxgot
16313 @opindex mno-xgot
16314 When generating position-independent code for ColdFire, generate code
16315 that works if the GOT has more than 8192 entries.  This code is
16316 larger and slower than code generated without this option.  On M680x0
16317 processors, this option is not needed; @option{-fPIC} suffices.
16319 GCC normally uses a single instruction to load values from the GOT@.
16320 While this is relatively efficient, it only works if the GOT
16321 is smaller than about 64k.  Anything larger causes the linker
16322 to report an error such as:
16324 @cindex relocation truncated to fit (ColdFire)
16325 @smallexample
16326 relocation truncated to fit: R_68K_GOT16O foobar
16327 @end smallexample
16329 If this happens, you should recompile your code with @option{-mxgot}.
16330 It should then work with very large GOTs.  However, code generated with
16331 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
16332 the value of a global symbol.
16334 Note that some linkers, including newer versions of the GNU linker,
16335 can create multiple GOTs and sort GOT entries.  If you have such a linker,
16336 you should only need to use @option{-mxgot} when compiling a single
16337 object file that accesses more than 8192 GOT entries.  Very few do.
16339 These options have no effect unless GCC is generating
16340 position-independent code.
16342 @end table
16344 @node MCore Options
16345 @subsection MCore Options
16346 @cindex MCore options
16348 These are the @samp{-m} options defined for the Motorola M*Core
16349 processors.
16351 @table @gcctabopt
16353 @item -mhardlit
16354 @itemx -mno-hardlit
16355 @opindex mhardlit
16356 @opindex mno-hardlit
16357 Inline constants into the code stream if it can be done in two
16358 instructions or less.
16360 @item -mdiv
16361 @itemx -mno-div
16362 @opindex mdiv
16363 @opindex mno-div
16364 Use the divide instruction.  (Enabled by default).
16366 @item -mrelax-immediate
16367 @itemx -mno-relax-immediate
16368 @opindex mrelax-immediate
16369 @opindex mno-relax-immediate
16370 Allow arbitrary-sized immediates in bit operations.
16372 @item -mwide-bitfields
16373 @itemx -mno-wide-bitfields
16374 @opindex mwide-bitfields
16375 @opindex mno-wide-bitfields
16376 Always treat bit-fields as @code{int}-sized.
16378 @item -m4byte-functions
16379 @itemx -mno-4byte-functions
16380 @opindex m4byte-functions
16381 @opindex mno-4byte-functions
16382 Force all functions to be aligned to a 4-byte boundary.
16384 @item -mcallgraph-data
16385 @itemx -mno-callgraph-data
16386 @opindex mcallgraph-data
16387 @opindex mno-callgraph-data
16388 Emit callgraph information.
16390 @item -mslow-bytes
16391 @itemx -mno-slow-bytes
16392 @opindex mslow-bytes
16393 @opindex mno-slow-bytes
16394 Prefer word access when reading byte quantities.
16396 @item -mlittle-endian
16397 @itemx -mbig-endian
16398 @opindex mlittle-endian
16399 @opindex mbig-endian
16400 Generate code for a little-endian target.
16402 @item -m210
16403 @itemx -m340
16404 @opindex m210
16405 @opindex m340
16406 Generate code for the 210 processor.
16408 @item -mno-lsim
16409 @opindex mno-lsim
16410 Assume that runtime support has been provided and so omit the
16411 simulator library (@file{libsim.a)} from the linker command line.
16413 @item -mstack-increment=@var{size}
16414 @opindex mstack-increment
16415 Set the maximum amount for a single stack increment operation.  Large
16416 values can increase the speed of programs that contain functions
16417 that need a large amount of stack space, but they can also trigger a
16418 segmentation fault if the stack is extended too much.  The default
16419 value is 0x1000.
16421 @end table
16423 @node MeP Options
16424 @subsection MeP Options
16425 @cindex MeP options
16427 @table @gcctabopt
16429 @item -mabsdiff
16430 @opindex mabsdiff
16431 Enables the @code{abs} instruction, which is the absolute difference
16432 between two registers.
16434 @item -mall-opts
16435 @opindex mall-opts
16436 Enables all the optional instructions---average, multiply, divide, bit
16437 operations, leading zero, absolute difference, min/max, clip, and
16438 saturation.
16441 @item -maverage
16442 @opindex maverage
16443 Enables the @code{ave} instruction, which computes the average of two
16444 registers.
16446 @item -mbased=@var{n}
16447 @opindex mbased=
16448 Variables of size @var{n} bytes or smaller are placed in the
16449 @code{.based} section by default.  Based variables use the @code{$tp}
16450 register as a base register, and there is a 128-byte limit to the
16451 @code{.based} section.
16453 @item -mbitops
16454 @opindex mbitops
16455 Enables the bit operation instructions---bit test (@code{btstm}), set
16456 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
16457 test-and-set (@code{tas}).
16459 @item -mc=@var{name}
16460 @opindex mc=
16461 Selects which section constant data is placed in.  @var{name} may
16462 be @code{tiny}, @code{near}, or @code{far}.
16464 @item -mclip
16465 @opindex mclip
16466 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
16467 useful unless you also provide @code{-mminmax}.
16469 @item -mconfig=@var{name}
16470 @opindex mconfig=
16471 Selects one of the built-in core configurations.  Each MeP chip has
16472 one or more modules in it; each module has a core CPU and a variety of
16473 coprocessors, optional instructions, and peripherals.  The
16474 @code{MeP-Integrator} tool, not part of GCC, provides these
16475 configurations through this option; using this option is the same as
16476 using all the corresponding command-line options.  The default
16477 configuration is @code{default}.
16479 @item -mcop
16480 @opindex mcop
16481 Enables the coprocessor instructions.  By default, this is a 32-bit
16482 coprocessor.  Note that the coprocessor is normally enabled via the
16483 @code{-mconfig=} option.
16485 @item -mcop32
16486 @opindex mcop32
16487 Enables the 32-bit coprocessor's instructions.
16489 @item -mcop64
16490 @opindex mcop64
16491 Enables the 64-bit coprocessor's instructions.
16493 @item -mivc2
16494 @opindex mivc2
16495 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
16497 @item -mdc
16498 @opindex mdc
16499 Causes constant variables to be placed in the @code{.near} section.
16501 @item -mdiv
16502 @opindex mdiv
16503 Enables the @code{div} and @code{divu} instructions.
16505 @item -meb
16506 @opindex meb
16507 Generate big-endian code.
16509 @item -mel
16510 @opindex mel
16511 Generate little-endian code.
16513 @item -mio-volatile
16514 @opindex mio-volatile
16515 Tells the compiler that any variable marked with the @code{io}
16516 attribute is to be considered volatile.
16518 @item -ml
16519 @opindex ml
16520 Causes variables to be assigned to the @code{.far} section by default.
16522 @item -mleadz
16523 @opindex mleadz
16524 Enables the @code{leadz} (leading zero) instruction.
16526 @item -mm
16527 @opindex mm
16528 Causes variables to be assigned to the @code{.near} section by default.
16530 @item -mminmax
16531 @opindex mminmax
16532 Enables the @code{min} and @code{max} instructions.
16534 @item -mmult
16535 @opindex mmult
16536 Enables the multiplication and multiply-accumulate instructions.
16538 @item -mno-opts
16539 @opindex mno-opts
16540 Disables all the optional instructions enabled by @code{-mall-opts}.
16542 @item -mrepeat
16543 @opindex mrepeat
16544 Enables the @code{repeat} and @code{erepeat} instructions, used for
16545 low-overhead looping.
16547 @item -ms
16548 @opindex ms
16549 Causes all variables to default to the @code{.tiny} section.  Note
16550 that there is a 65536-byte limit to this section.  Accesses to these
16551 variables use the @code{%gp} base register.
16553 @item -msatur
16554 @opindex msatur
16555 Enables the saturation instructions.  Note that the compiler does not
16556 currently generate these itself, but this option is included for
16557 compatibility with other tools, like @code{as}.
16559 @item -msdram
16560 @opindex msdram
16561 Link the SDRAM-based runtime instead of the default ROM-based runtime.
16563 @item -msim
16564 @opindex msim
16565 Link the simulator run-time libraries.
16567 @item -msimnovec
16568 @opindex msimnovec
16569 Link the simulator runtime libraries, excluding built-in support
16570 for reset and exception vectors and tables.
16572 @item -mtf
16573 @opindex mtf
16574 Causes all functions to default to the @code{.far} section.  Without
16575 this option, functions default to the @code{.near} section.
16577 @item -mtiny=@var{n}
16578 @opindex mtiny=
16579 Variables that are @var{n} bytes or smaller are allocated to the
16580 @code{.tiny} section.  These variables use the @code{$gp} base
16581 register.  The default for this option is 4, but note that there's a
16582 65536-byte limit to the @code{.tiny} section.
16584 @end table
16586 @node MicroBlaze Options
16587 @subsection MicroBlaze Options
16588 @cindex MicroBlaze Options
16590 @table @gcctabopt
16592 @item -msoft-float
16593 @opindex msoft-float
16594 Use software emulation for floating point (default).
16596 @item -mhard-float
16597 @opindex mhard-float
16598 Use hardware floating-point instructions.
16600 @item -mmemcpy
16601 @opindex mmemcpy
16602 Do not optimize block moves, use @code{memcpy}.
16604 @item -mno-clearbss
16605 @opindex mno-clearbss
16606 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
16608 @item -mcpu=@var{cpu-type}
16609 @opindex mcpu=
16610 Use features of, and schedule code for, the given CPU.
16611 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
16612 where @var{X} is a major version, @var{YY} is the minor version, and
16613 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
16614 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
16616 @item -mxl-soft-mul
16617 @opindex mxl-soft-mul
16618 Use software multiply emulation (default).
16620 @item -mxl-soft-div
16621 @opindex mxl-soft-div
16622 Use software emulation for divides (default).
16624 @item -mxl-barrel-shift
16625 @opindex mxl-barrel-shift
16626 Use the hardware barrel shifter.
16628 @item -mxl-pattern-compare
16629 @opindex mxl-pattern-compare
16630 Use pattern compare instructions.
16632 @item -msmall-divides
16633 @opindex msmall-divides
16634 Use table lookup optimization for small signed integer divisions.
16636 @item -mxl-stack-check
16637 @opindex mxl-stack-check
16638 This option is deprecated.  Use @option{-fstack-check} instead.
16640 @item -mxl-gp-opt
16641 @opindex mxl-gp-opt
16642 Use GP-relative @code{.sdata}/@code{.sbss} sections.
16644 @item -mxl-multiply-high
16645 @opindex mxl-multiply-high
16646 Use multiply high instructions for high part of 32x32 multiply.
16648 @item -mxl-float-convert
16649 @opindex mxl-float-convert
16650 Use hardware floating-point conversion instructions.
16652 @item -mxl-float-sqrt
16653 @opindex mxl-float-sqrt
16654 Use hardware floating-point square root instruction.
16656 @item -mbig-endian
16657 @opindex mbig-endian
16658 Generate code for a big-endian target.
16660 @item -mlittle-endian
16661 @opindex mlittle-endian
16662 Generate code for a little-endian target.
16664 @item -mxl-reorder
16665 @opindex mxl-reorder
16666 Use reorder instructions (swap and byte reversed load/store).
16668 @item -mxl-mode-@var{app-model}
16669 Select application model @var{app-model}.  Valid models are
16670 @table @samp
16671 @item executable
16672 normal executable (default), uses startup code @file{crt0.o}.
16674 @item xmdstub
16675 for use with Xilinx Microprocessor Debugger (XMD) based
16676 software intrusive debug agent called xmdstub. This uses startup file
16677 @file{crt1.o} and sets the start address of the program to 0x800.
16679 @item bootstrap
16680 for applications that are loaded using a bootloader.
16681 This model uses startup file @file{crt2.o} which does not contain a processor
16682 reset vector handler. This is suitable for transferring control on a
16683 processor reset to the bootloader rather than the application.
16685 @item novectors
16686 for applications that do not require any of the
16687 MicroBlaze vectors. This option may be useful for applications running
16688 within a monitoring application. This model uses @file{crt3.o} as a startup file.
16689 @end table
16691 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
16692 @option{-mxl-mode-@var{app-model}}.
16694 @end table
16696 @node MIPS Options
16697 @subsection MIPS Options
16698 @cindex MIPS options
16700 @table @gcctabopt
16702 @item -EB
16703 @opindex EB
16704 Generate big-endian code.
16706 @item -EL
16707 @opindex EL
16708 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
16709 configurations.
16711 @item -march=@var{arch}
16712 @opindex march
16713 Generate code that runs on @var{arch}, which can be the name of a
16714 generic MIPS ISA, or the name of a particular processor.
16715 The ISA names are:
16716 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
16717 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
16718 The processor names are:
16719 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
16720 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
16721 @samp{5kc}, @samp{5kf},
16722 @samp{20kc},
16723 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
16724 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
16725 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
16726 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
16727 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
16728 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
16729 @samp{m4k},
16730 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
16731 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
16732 @samp{orion},
16733 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
16734 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
16735 @samp{rm7000}, @samp{rm9000},
16736 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
16737 @samp{sb1},
16738 @samp{sr71000},
16739 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
16740 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
16741 @samp{xlr} and @samp{xlp}.
16742 The special value @samp{from-abi} selects the
16743 most compatible architecture for the selected ABI (that is,
16744 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
16746 The native Linux/GNU toolchain also supports the value @samp{native},
16747 which selects the best architecture option for the host processor.
16748 @option{-march=native} has no effect if GCC does not recognize
16749 the processor.
16751 In processor names, a final @samp{000} can be abbreviated as @samp{k}
16752 (for example, @option{-march=r2k}).  Prefixes are optional, and
16753 @samp{vr} may be written @samp{r}.
16755 Names of the form @samp{@var{n}f2_1} refer to processors with
16756 FPUs clocked at half the rate of the core, names of the form
16757 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
16758 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
16759 processors with FPUs clocked a ratio of 3:2 with respect to the core.
16760 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
16761 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
16762 accepted as synonyms for @samp{@var{n}f1_1}.
16764 GCC defines two macros based on the value of this option.  The first
16765 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
16766 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
16767 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
16768 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
16769 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
16771 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
16772 above.  In other words, it has the full prefix and does not
16773 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
16774 the macro names the resolved architecture (either @samp{"mips1"} or
16775 @samp{"mips3"}).  It names the default architecture when no
16776 @option{-march} option is given.
16778 @item -mtune=@var{arch}
16779 @opindex mtune
16780 Optimize for @var{arch}.  Among other things, this option controls
16781 the way instructions are scheduled, and the perceived cost of arithmetic
16782 operations.  The list of @var{arch} values is the same as for
16783 @option{-march}.
16785 When this option is not used, GCC optimizes for the processor
16786 specified by @option{-march}.  By using @option{-march} and
16787 @option{-mtune} together, it is possible to generate code that
16788 runs on a family of processors, but optimize the code for one
16789 particular member of that family.
16791 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
16792 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
16793 @option{-march} ones described above.
16795 @item -mips1
16796 @opindex mips1
16797 Equivalent to @option{-march=mips1}.
16799 @item -mips2
16800 @opindex mips2
16801 Equivalent to @option{-march=mips2}.
16803 @item -mips3
16804 @opindex mips3
16805 Equivalent to @option{-march=mips3}.
16807 @item -mips4
16808 @opindex mips4
16809 Equivalent to @option{-march=mips4}.
16811 @item -mips32
16812 @opindex mips32
16813 Equivalent to @option{-march=mips32}.
16815 @item -mips32r2
16816 @opindex mips32r2
16817 Equivalent to @option{-march=mips32r2}.
16819 @item -mips64
16820 @opindex mips64
16821 Equivalent to @option{-march=mips64}.
16823 @item -mips64r2
16824 @opindex mips64r2
16825 Equivalent to @option{-march=mips64r2}.
16827 @item -mips16
16828 @itemx -mno-mips16
16829 @opindex mips16
16830 @opindex mno-mips16
16831 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16832 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16834 MIPS16 code generation can also be controlled on a per-function basis
16835 by means of @code{mips16} and @code{nomips16} attributes.
16836 @xref{Function Attributes}, for more information.
16838 @item -mflip-mips16
16839 @opindex mflip-mips16
16840 Generate MIPS16 code on alternating functions.  This option is provided
16841 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16842 not intended for ordinary use in compiling user code.
16844 @item -minterlink-compressed
16845 @item -mno-interlink-compressed
16846 @opindex minterlink-compressed
16847 @opindex mno-interlink-compressed
16848 Require (do not require) that code using the standard (uncompressed) MIPS ISA
16849 be link-compatible with MIPS16 and microMIPS code, and vice versa.
16851 For example, code using the standard ISA encoding cannot jump directly
16852 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
16853 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
16854 knows that the target of the jump is not compressed.
16856 @item -minterlink-mips16
16857 @itemx -mno-interlink-mips16
16858 @opindex minterlink-mips16
16859 @opindex mno-interlink-mips16
16860 Aliases of @option{-minterlink-compressed} and
16861 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
16862 and are retained for backwards compatibility.
16864 @item -mabi=32
16865 @itemx -mabi=o64
16866 @itemx -mabi=n32
16867 @itemx -mabi=64
16868 @itemx -mabi=eabi
16869 @opindex mabi=32
16870 @opindex mabi=o64
16871 @opindex mabi=n32
16872 @opindex mabi=64
16873 @opindex mabi=eabi
16874 Generate code for the given ABI@.
16876 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
16877 generates 64-bit code when you select a 64-bit architecture, but you
16878 can use @option{-mgp32} to get 32-bit code instead.
16880 For information about the O64 ABI, see
16881 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
16883 GCC supports a variant of the o32 ABI in which floating-point registers
16884 are 64 rather than 32 bits wide.  You can select this combination with
16885 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
16886 and @code{mfhc1} instructions and is therefore only supported for
16887 MIPS32R2 processors.
16889 The register assignments for arguments and return values remain the
16890 same, but each scalar value is passed in a single 64-bit register
16891 rather than a pair of 32-bit registers.  For example, scalar
16892 floating-point values are returned in @samp{$f0} only, not a
16893 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
16894 remains the same, but all 64 bits are saved.
16896 @item -mabicalls
16897 @itemx -mno-abicalls
16898 @opindex mabicalls
16899 @opindex mno-abicalls
16900 Generate (do not generate) code that is suitable for SVR4-style
16901 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
16902 systems.
16904 @item -mshared
16905 @itemx -mno-shared
16906 Generate (do not generate) code that is fully position-independent,
16907 and that can therefore be linked into shared libraries.  This option
16908 only affects @option{-mabicalls}.
16910 All @option{-mabicalls} code has traditionally been position-independent,
16911 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
16912 as an extension, the GNU toolchain allows executables to use absolute
16913 accesses for locally-binding symbols.  It can also use shorter GP
16914 initialization sequences and generate direct calls to locally-defined
16915 functions.  This mode is selected by @option{-mno-shared}.
16917 @option{-mno-shared} depends on binutils 2.16 or higher and generates
16918 objects that can only be linked by the GNU linker.  However, the option
16919 does not affect the ABI of the final executable; it only affects the ABI
16920 of relocatable objects.  Using @option{-mno-shared} generally makes
16921 executables both smaller and quicker.
16923 @option{-mshared} is the default.
16925 @item -mplt
16926 @itemx -mno-plt
16927 @opindex mplt
16928 @opindex mno-plt
16929 Assume (do not assume) that the static and dynamic linkers
16930 support PLTs and copy relocations.  This option only affects
16931 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
16932 has no effect without @option{-msym32}.
16934 You can make @option{-mplt} the default by configuring
16935 GCC with @option{--with-mips-plt}.  The default is
16936 @option{-mno-plt} otherwise.
16938 @item -mxgot
16939 @itemx -mno-xgot
16940 @opindex mxgot
16941 @opindex mno-xgot
16942 Lift (do not lift) the usual restrictions on the size of the global
16943 offset table.
16945 GCC normally uses a single instruction to load values from the GOT@.
16946 While this is relatively efficient, it only works if the GOT
16947 is smaller than about 64k.  Anything larger causes the linker
16948 to report an error such as:
16950 @cindex relocation truncated to fit (MIPS)
16951 @smallexample
16952 relocation truncated to fit: R_MIPS_GOT16 foobar
16953 @end smallexample
16955 If this happens, you should recompile your code with @option{-mxgot}.
16956 This works with very large GOTs, although the code is also
16957 less efficient, since it takes three instructions to fetch the
16958 value of a global symbol.
16960 Note that some linkers can create multiple GOTs.  If you have such a
16961 linker, you should only need to use @option{-mxgot} when a single object
16962 file accesses more than 64k's worth of GOT entries.  Very few do.
16964 These options have no effect unless GCC is generating position
16965 independent code.
16967 @item -mgp32
16968 @opindex mgp32
16969 Assume that general-purpose registers are 32 bits wide.
16971 @item -mgp64
16972 @opindex mgp64
16973 Assume that general-purpose registers are 64 bits wide.
16975 @item -mfp32
16976 @opindex mfp32
16977 Assume that floating-point registers are 32 bits wide.
16979 @item -mfp64
16980 @opindex mfp64
16981 Assume that floating-point registers are 64 bits wide.
16983 @item -mhard-float
16984 @opindex mhard-float
16985 Use floating-point coprocessor instructions.
16987 @item -msoft-float
16988 @opindex msoft-float
16989 Do not use floating-point coprocessor instructions.  Implement
16990 floating-point calculations using library calls instead.
16992 @item -mno-float
16993 @opindex mno-float
16994 Equivalent to @option{-msoft-float}, but additionally asserts that the
16995 program being compiled does not perform any floating-point operations.
16996 This option is presently supported only by some bare-metal MIPS
16997 configurations, where it may select a special set of libraries
16998 that lack all floating-point support (including, for example, the
16999 floating-point @code{printf} formats).  
17000 If code compiled with @code{-mno-float} accidentally contains
17001 floating-point operations, it is likely to suffer a link-time
17002 or run-time failure.
17004 @item -msingle-float
17005 @opindex msingle-float
17006 Assume that the floating-point coprocessor only supports single-precision
17007 operations.
17009 @item -mdouble-float
17010 @opindex mdouble-float
17011 Assume that the floating-point coprocessor supports double-precision
17012 operations.  This is the default.
17014 @item -mabs=2008
17015 @itemx -mabs=legacy
17016 @opindex mabs=2008
17017 @opindex mabs=legacy
17018 These options control the treatment of the special not-a-number (NaN)
17019 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17020 @code{neg.@i{fmt}} machine instructions.
17022 By default or when the @option{-mabs=legacy} is used the legacy
17023 treatment is selected.  In this case these instructions are considered
17024 arithmetic and avoided where correct operation is required and the
17025 input operand might be a NaN.  A longer sequence of instructions that
17026 manipulate the sign bit of floating-point datum manually is used
17027 instead unless the @option{-ffinite-math-only} option has also been
17028 specified.
17030 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17031 this case these instructions are considered non-arithmetic and therefore
17032 operating correctly in all cases, including in particular where the
17033 input operand is a NaN.  These instructions are therefore always used
17034 for the respective operations.
17036 @item -mnan=2008
17037 @itemx -mnan=legacy
17038 @opindex mnan=2008
17039 @opindex mnan=legacy
17040 These options control the encoding of the special not-a-number (NaN)
17041 IEEE 754 floating-point data.
17043 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17044 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17045 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17046 by the first bit of their trailing significand field being 1.
17048 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17049 this case qNaNs are denoted by the first bit of their trailing
17050 significand field being 1, whereas sNaNs are denoted by the first bit of
17051 their trailing significand field being 0.
17053 The default is @option{-mnan=legacy} unless GCC has been configured with
17054 @option{--with-nan=2008}.
17056 @item -mllsc
17057 @itemx -mno-llsc
17058 @opindex mllsc
17059 @opindex mno-llsc
17060 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17061 implement atomic memory built-in functions.  When neither option is
17062 specified, GCC uses the instructions if the target architecture
17063 supports them.
17065 @option{-mllsc} is useful if the runtime environment can emulate the
17066 instructions and @option{-mno-llsc} can be useful when compiling for
17067 nonstandard ISAs.  You can make either option the default by
17068 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17069 respectively.  @option{--with-llsc} is the default for some
17070 configurations; see the installation documentation for details.
17072 @item -mdsp
17073 @itemx -mno-dsp
17074 @opindex mdsp
17075 @opindex mno-dsp
17076 Use (do not use) revision 1 of the MIPS DSP ASE@.
17077 @xref{MIPS DSP Built-in Functions}.  This option defines the
17078 preprocessor macro @samp{__mips_dsp}.  It also defines
17079 @samp{__mips_dsp_rev} to 1.
17081 @item -mdspr2
17082 @itemx -mno-dspr2
17083 @opindex mdspr2
17084 @opindex mno-dspr2
17085 Use (do not use) revision 2 of the MIPS DSP ASE@.
17086 @xref{MIPS DSP Built-in Functions}.  This option defines the
17087 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
17088 It also defines @samp{__mips_dsp_rev} to 2.
17090 @item -msmartmips
17091 @itemx -mno-smartmips
17092 @opindex msmartmips
17093 @opindex mno-smartmips
17094 Use (do not use) the MIPS SmartMIPS ASE.
17096 @item -mpaired-single
17097 @itemx -mno-paired-single
17098 @opindex mpaired-single
17099 @opindex mno-paired-single
17100 Use (do not use) paired-single floating-point instructions.
17101 @xref{MIPS Paired-Single Support}.  This option requires
17102 hardware floating-point support to be enabled.
17104 @item -mdmx
17105 @itemx -mno-mdmx
17106 @opindex mdmx
17107 @opindex mno-mdmx
17108 Use (do not use) MIPS Digital Media Extension instructions.
17109 This option can only be used when generating 64-bit code and requires
17110 hardware floating-point support to be enabled.
17112 @item -mips3d
17113 @itemx -mno-mips3d
17114 @opindex mips3d
17115 @opindex mno-mips3d
17116 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17117 The option @option{-mips3d} implies @option{-mpaired-single}.
17119 @item -mmicromips
17120 @itemx -mno-micromips
17121 @opindex mmicromips
17122 @opindex mno-mmicromips
17123 Generate (do not generate) microMIPS code.
17125 MicroMIPS code generation can also be controlled on a per-function basis
17126 by means of @code{micromips} and @code{nomicromips} attributes.
17127 @xref{Function Attributes}, for more information.
17129 @item -mmt
17130 @itemx -mno-mt
17131 @opindex mmt
17132 @opindex mno-mt
17133 Use (do not use) MT Multithreading instructions.
17135 @item -mmcu
17136 @itemx -mno-mcu
17137 @opindex mmcu
17138 @opindex mno-mcu
17139 Use (do not use) the MIPS MCU ASE instructions.
17141 @item -meva
17142 @itemx -mno-eva
17143 @opindex meva
17144 @opindex mno-eva
17145 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17147 @item -mlong64
17148 @opindex mlong64
17149 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17150 an explanation of the default and the way that the pointer size is
17151 determined.
17153 @item -mlong32
17154 @opindex mlong32
17155 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17157 The default size of @code{int}s, @code{long}s and pointers depends on
17158 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17159 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17160 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17161 or the same size as integer registers, whichever is smaller.
17163 @item -msym32
17164 @itemx -mno-sym32
17165 @opindex msym32
17166 @opindex mno-sym32
17167 Assume (do not assume) that all symbols have 32-bit values, regardless
17168 of the selected ABI@.  This option is useful in combination with
17169 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17170 to generate shorter and faster references to symbolic addresses.
17172 @item -G @var{num}
17173 @opindex G
17174 Put definitions of externally-visible data in a small data section
17175 if that data is no bigger than @var{num} bytes.  GCC can then generate
17176 more efficient accesses to the data; see @option{-mgpopt} for details.
17178 The default @option{-G} option depends on the configuration.
17180 @item -mlocal-sdata
17181 @itemx -mno-local-sdata
17182 @opindex mlocal-sdata
17183 @opindex mno-local-sdata
17184 Extend (do not extend) the @option{-G} behavior to local data too,
17185 such as to static variables in C@.  @option{-mlocal-sdata} is the
17186 default for all configurations.
17188 If the linker complains that an application is using too much small data,
17189 you might want to try rebuilding the less performance-critical parts with
17190 @option{-mno-local-sdata}.  You might also want to build large
17191 libraries with @option{-mno-local-sdata}, so that the libraries leave
17192 more room for the main program.
17194 @item -mextern-sdata
17195 @itemx -mno-extern-sdata
17196 @opindex mextern-sdata
17197 @opindex mno-extern-sdata
17198 Assume (do not assume) that externally-defined data is in
17199 a small data section if the size of that data is within the @option{-G} limit.
17200 @option{-mextern-sdata} is the default for all configurations.
17202 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17203 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17204 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17205 is placed in a small data section.  If @var{Var} is defined by another
17206 module, you must either compile that module with a high-enough
17207 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17208 definition.  If @var{Var} is common, you must link the application
17209 with a high-enough @option{-G} setting.
17211 The easiest way of satisfying these restrictions is to compile
17212 and link every module with the same @option{-G} option.  However,
17213 you may wish to build a library that supports several different
17214 small data limits.  You can do this by compiling the library with
17215 the highest supported @option{-G} setting and additionally using
17216 @option{-mno-extern-sdata} to stop the library from making assumptions
17217 about externally-defined data.
17219 @item -mgpopt
17220 @itemx -mno-gpopt
17221 @opindex mgpopt
17222 @opindex mno-gpopt
17223 Use (do not use) GP-relative accesses for symbols that are known to be
17224 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17225 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17226 configurations.
17228 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17229 might not hold the value of @code{_gp}.  For example, if the code is
17230 part of a library that might be used in a boot monitor, programs that
17231 call boot monitor routines pass an unknown value in @code{$gp}.
17232 (In such situations, the boot monitor itself is usually compiled
17233 with @option{-G0}.)
17235 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17236 @option{-mno-extern-sdata}.
17238 @item -membedded-data
17239 @itemx -mno-embedded-data
17240 @opindex membedded-data
17241 @opindex mno-embedded-data
17242 Allocate variables to the read-only data section first if possible, then
17243 next in the small data section if possible, otherwise in data.  This gives
17244 slightly slower code than the default, but reduces the amount of RAM required
17245 when executing, and thus may be preferred for some embedded systems.
17247 @item -muninit-const-in-rodata
17248 @itemx -mno-uninit-const-in-rodata
17249 @opindex muninit-const-in-rodata
17250 @opindex mno-uninit-const-in-rodata
17251 Put uninitialized @code{const} variables in the read-only data section.
17252 This option is only meaningful in conjunction with @option{-membedded-data}.
17254 @item -mcode-readable=@var{setting}
17255 @opindex mcode-readable
17256 Specify whether GCC may generate code that reads from executable sections.
17257 There are three possible settings:
17259 @table @gcctabopt
17260 @item -mcode-readable=yes
17261 Instructions may freely access executable sections.  This is the
17262 default setting.
17264 @item -mcode-readable=pcrel
17265 MIPS16 PC-relative load instructions can access executable sections,
17266 but other instructions must not do so.  This option is useful on 4KSc
17267 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
17268 It is also useful on processors that can be configured to have a dual
17269 instruction/data SRAM interface and that, like the M4K, automatically
17270 redirect PC-relative loads to the instruction RAM.
17272 @item -mcode-readable=no
17273 Instructions must not access executable sections.  This option can be
17274 useful on targets that are configured to have a dual instruction/data
17275 SRAM interface but that (unlike the M4K) do not automatically redirect
17276 PC-relative loads to the instruction RAM.
17277 @end table
17279 @item -msplit-addresses
17280 @itemx -mno-split-addresses
17281 @opindex msplit-addresses
17282 @opindex mno-split-addresses
17283 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
17284 relocation operators.  This option has been superseded by
17285 @option{-mexplicit-relocs} but is retained for backwards compatibility.
17287 @item -mexplicit-relocs
17288 @itemx -mno-explicit-relocs
17289 @opindex mexplicit-relocs
17290 @opindex mno-explicit-relocs
17291 Use (do not use) assembler relocation operators when dealing with symbolic
17292 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
17293 is to use assembler macros instead.
17295 @option{-mexplicit-relocs} is the default if GCC was configured
17296 to use an assembler that supports relocation operators.
17298 @item -mcheck-zero-division
17299 @itemx -mno-check-zero-division
17300 @opindex mcheck-zero-division
17301 @opindex mno-check-zero-division
17302 Trap (do not trap) on integer division by zero.
17304 The default is @option{-mcheck-zero-division}.
17306 @item -mdivide-traps
17307 @itemx -mdivide-breaks
17308 @opindex mdivide-traps
17309 @opindex mdivide-breaks
17310 MIPS systems check for division by zero by generating either a
17311 conditional trap or a break instruction.  Using traps results in
17312 smaller code, but is only supported on MIPS II and later.  Also, some
17313 versions of the Linux kernel have a bug that prevents trap from
17314 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
17315 allow conditional traps on architectures that support them and
17316 @option{-mdivide-breaks} to force the use of breaks.
17318 The default is usually @option{-mdivide-traps}, but this can be
17319 overridden at configure time using @option{--with-divide=breaks}.
17320 Divide-by-zero checks can be completely disabled using
17321 @option{-mno-check-zero-division}.
17323 @item -mmemcpy
17324 @itemx -mno-memcpy
17325 @opindex mmemcpy
17326 @opindex mno-memcpy
17327 Force (do not force) the use of @code{memcpy()} for non-trivial block
17328 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
17329 most constant-sized copies.
17331 @item -mlong-calls
17332 @itemx -mno-long-calls
17333 @opindex mlong-calls
17334 @opindex mno-long-calls
17335 Disable (do not disable) use of the @code{jal} instruction.  Calling
17336 functions using @code{jal} is more efficient but requires the caller
17337 and callee to be in the same 256 megabyte segment.
17339 This option has no effect on abicalls code.  The default is
17340 @option{-mno-long-calls}.
17342 @item -mmad
17343 @itemx -mno-mad
17344 @opindex mmad
17345 @opindex mno-mad
17346 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
17347 instructions, as provided by the R4650 ISA@.
17349 @item -mimadd
17350 @itemx -mno-imadd
17351 @opindex mimadd
17352 @opindex mno-imadd
17353 Enable (disable) use of the @code{madd} and @code{msub} integer
17354 instructions.  The default is @option{-mimadd} on architectures
17355 that support @code{madd} and @code{msub} except for the 74k 
17356 architecture where it was found to generate slower code.
17358 @item -mfused-madd
17359 @itemx -mno-fused-madd
17360 @opindex mfused-madd
17361 @opindex mno-fused-madd
17362 Enable (disable) use of the floating-point multiply-accumulate
17363 instructions, when they are available.  The default is
17364 @option{-mfused-madd}.
17366 On the R8000 CPU when multiply-accumulate instructions are used,
17367 the intermediate product is calculated to infinite precision
17368 and is not subject to the FCSR Flush to Zero bit.  This may be
17369 undesirable in some circumstances.  On other processors the result
17370 is numerically identical to the equivalent computation using
17371 separate multiply, add, subtract and negate instructions.
17373 @item -nocpp
17374 @opindex nocpp
17375 Tell the MIPS assembler to not run its preprocessor over user
17376 assembler files (with a @samp{.s} suffix) when assembling them.
17378 @item -mfix-24k
17379 @item -mno-fix-24k
17380 @opindex mfix-24k
17381 @opindex mno-fix-24k
17382 Work around the 24K E48 (lost data on stores during refill) errata.
17383 The workarounds are implemented by the assembler rather than by GCC@.
17385 @item -mfix-r4000
17386 @itemx -mno-fix-r4000
17387 @opindex mfix-r4000
17388 @opindex mno-fix-r4000
17389 Work around certain R4000 CPU errata:
17390 @itemize @minus
17391 @item
17392 A double-word or a variable shift may give an incorrect result if executed
17393 immediately after starting an integer division.
17394 @item
17395 A double-word or a variable shift may give an incorrect result if executed
17396 while an integer multiplication is in progress.
17397 @item
17398 An integer division may give an incorrect result if started in a delay slot
17399 of a taken branch or a jump.
17400 @end itemize
17402 @item -mfix-r4400
17403 @itemx -mno-fix-r4400
17404 @opindex mfix-r4400
17405 @opindex mno-fix-r4400
17406 Work around certain R4400 CPU errata:
17407 @itemize @minus
17408 @item
17409 A double-word or a variable shift may give an incorrect result if executed
17410 immediately after starting an integer division.
17411 @end itemize
17413 @item -mfix-r10000
17414 @itemx -mno-fix-r10000
17415 @opindex mfix-r10000
17416 @opindex mno-fix-r10000
17417 Work around certain R10000 errata:
17418 @itemize @minus
17419 @item
17420 @code{ll}/@code{sc} sequences may not behave atomically on revisions
17421 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
17422 @end itemize
17424 This option can only be used if the target architecture supports
17425 branch-likely instructions.  @option{-mfix-r10000} is the default when
17426 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
17427 otherwise.
17429 @item -mfix-vr4120
17430 @itemx -mno-fix-vr4120
17431 @opindex mfix-vr4120
17432 Work around certain VR4120 errata:
17433 @itemize @minus
17434 @item
17435 @code{dmultu} does not always produce the correct result.
17436 @item
17437 @code{div} and @code{ddiv} do not always produce the correct result if one
17438 of the operands is negative.
17439 @end itemize
17440 The workarounds for the division errata rely on special functions in
17441 @file{libgcc.a}.  At present, these functions are only provided by
17442 the @code{mips64vr*-elf} configurations.
17444 Other VR4120 errata require a NOP to be inserted between certain pairs of
17445 instructions.  These errata are handled by the assembler, not by GCC itself.
17447 @item -mfix-vr4130
17448 @opindex mfix-vr4130
17449 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
17450 workarounds are implemented by the assembler rather than by GCC,
17451 although GCC avoids using @code{mflo} and @code{mfhi} if the
17452 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
17453 instructions are available instead.
17455 @item -mfix-sb1
17456 @itemx -mno-fix-sb1
17457 @opindex mfix-sb1
17458 Work around certain SB-1 CPU core errata.
17459 (This flag currently works around the SB-1 revision 2
17460 ``F1'' and ``F2'' floating-point errata.)
17462 @item -mr10k-cache-barrier=@var{setting}
17463 @opindex mr10k-cache-barrier
17464 Specify whether GCC should insert cache barriers to avoid the
17465 side-effects of speculation on R10K processors.
17467 In common with many processors, the R10K tries to predict the outcome
17468 of a conditional branch and speculatively executes instructions from
17469 the ``taken'' branch.  It later aborts these instructions if the
17470 predicted outcome is wrong.  However, on the R10K, even aborted
17471 instructions can have side effects.
17473 This problem only affects kernel stores and, depending on the system,
17474 kernel loads.  As an example, a speculatively-executed store may load
17475 the target memory into cache and mark the cache line as dirty, even if
17476 the store itself is later aborted.  If a DMA operation writes to the
17477 same area of memory before the ``dirty'' line is flushed, the cached
17478 data overwrites the DMA-ed data.  See the R10K processor manual
17479 for a full description, including other potential problems.
17481 One workaround is to insert cache barrier instructions before every memory
17482 access that might be speculatively executed and that might have side
17483 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
17484 controls GCC's implementation of this workaround.  It assumes that
17485 aborted accesses to any byte in the following regions does not have
17486 side effects:
17488 @enumerate
17489 @item
17490 the memory occupied by the current function's stack frame;
17492 @item
17493 the memory occupied by an incoming stack argument;
17495 @item
17496 the memory occupied by an object with a link-time-constant address.
17497 @end enumerate
17499 It is the kernel's responsibility to ensure that speculative
17500 accesses to these regions are indeed safe.
17502 If the input program contains a function declaration such as:
17504 @smallexample
17505 void foo (void);
17506 @end smallexample
17508 then the implementation of @code{foo} must allow @code{j foo} and
17509 @code{jal foo} to be executed speculatively.  GCC honors this
17510 restriction for functions it compiles itself.  It expects non-GCC
17511 functions (such as hand-written assembly code) to do the same.
17513 The option has three forms:
17515 @table @gcctabopt
17516 @item -mr10k-cache-barrier=load-store
17517 Insert a cache barrier before a load or store that might be
17518 speculatively executed and that might have side effects even
17519 if aborted.
17521 @item -mr10k-cache-barrier=store
17522 Insert a cache barrier before a store that might be speculatively
17523 executed and that might have side effects even if aborted.
17525 @item -mr10k-cache-barrier=none
17526 Disable the insertion of cache barriers.  This is the default setting.
17527 @end table
17529 @item -mflush-func=@var{func}
17530 @itemx -mno-flush-func
17531 @opindex mflush-func
17532 Specifies the function to call to flush the I and D caches, or to not
17533 call any such function.  If called, the function must take the same
17534 arguments as the common @code{_flush_func()}, that is, the address of the
17535 memory range for which the cache is being flushed, the size of the
17536 memory range, and the number 3 (to flush both caches).  The default
17537 depends on the target GCC was configured for, but commonly is either
17538 @samp{_flush_func} or @samp{__cpu_flush}.
17540 @item mbranch-cost=@var{num}
17541 @opindex mbranch-cost
17542 Set the cost of branches to roughly @var{num} ``simple'' instructions.
17543 This cost is only a heuristic and is not guaranteed to produce
17544 consistent results across releases.  A zero cost redundantly selects
17545 the default, which is based on the @option{-mtune} setting.
17547 @item -mbranch-likely
17548 @itemx -mno-branch-likely
17549 @opindex mbranch-likely
17550 @opindex mno-branch-likely
17551 Enable or disable use of Branch Likely instructions, regardless of the
17552 default for the selected architecture.  By default, Branch Likely
17553 instructions may be generated if they are supported by the selected
17554 architecture.  An exception is for the MIPS32 and MIPS64 architectures
17555 and processors that implement those architectures; for those, Branch
17556 Likely instructions are not be generated by default because the MIPS32
17557 and MIPS64 architectures specifically deprecate their use.
17559 @item -mfp-exceptions
17560 @itemx -mno-fp-exceptions
17561 @opindex mfp-exceptions
17562 Specifies whether FP exceptions are enabled.  This affects how
17563 FP instructions are scheduled for some processors.
17564 The default is that FP exceptions are
17565 enabled.
17567 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
17568 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
17569 FP pipe.
17571 @item -mvr4130-align
17572 @itemx -mno-vr4130-align
17573 @opindex mvr4130-align
17574 The VR4130 pipeline is two-way superscalar, but can only issue two
17575 instructions together if the first one is 8-byte aligned.  When this
17576 option is enabled, GCC aligns pairs of instructions that it
17577 thinks should execute in parallel.
17579 This option only has an effect when optimizing for the VR4130.
17580 It normally makes code faster, but at the expense of making it bigger.
17581 It is enabled by default at optimization level @option{-O3}.
17583 @item -msynci
17584 @itemx -mno-synci
17585 @opindex msynci
17586 Enable (disable) generation of @code{synci} instructions on
17587 architectures that support it.  The @code{synci} instructions (if
17588 enabled) are generated when @code{__builtin___clear_cache()} is
17589 compiled.
17591 This option defaults to @code{-mno-synci}, but the default can be
17592 overridden by configuring with @code{--with-synci}.
17594 When compiling code for single processor systems, it is generally safe
17595 to use @code{synci}.  However, on many multi-core (SMP) systems, it
17596 does not invalidate the instruction caches on all cores and may lead
17597 to undefined behavior.
17599 @item -mrelax-pic-calls
17600 @itemx -mno-relax-pic-calls
17601 @opindex mrelax-pic-calls
17602 Try to turn PIC calls that are normally dispatched via register
17603 @code{$25} into direct calls.  This is only possible if the linker can
17604 resolve the destination at link-time and if the destination is within
17605 range for a direct call.
17607 @option{-mrelax-pic-calls} is the default if GCC was configured to use
17608 an assembler and a linker that support the @code{.reloc} assembly
17609 directive and @code{-mexplicit-relocs} is in effect.  With
17610 @code{-mno-explicit-relocs}, this optimization can be performed by the
17611 assembler and the linker alone without help from the compiler.
17613 @item -mmcount-ra-address
17614 @itemx -mno-mcount-ra-address
17615 @opindex mmcount-ra-address
17616 @opindex mno-mcount-ra-address
17617 Emit (do not emit) code that allows @code{_mcount} to modify the
17618 calling function's return address.  When enabled, this option extends
17619 the usual @code{_mcount} interface with a new @var{ra-address}
17620 parameter, which has type @code{intptr_t *} and is passed in register
17621 @code{$12}.  @code{_mcount} can then modify the return address by
17622 doing both of the following:
17623 @itemize
17624 @item
17625 Returning the new address in register @code{$31}.
17626 @item
17627 Storing the new address in @code{*@var{ra-address}},
17628 if @var{ra-address} is nonnull.
17629 @end itemize
17631 The default is @option{-mno-mcount-ra-address}.
17633 @end table
17635 @node MMIX Options
17636 @subsection MMIX Options
17637 @cindex MMIX Options
17639 These options are defined for the MMIX:
17641 @table @gcctabopt
17642 @item -mlibfuncs
17643 @itemx -mno-libfuncs
17644 @opindex mlibfuncs
17645 @opindex mno-libfuncs
17646 Specify that intrinsic library functions are being compiled, passing all
17647 values in registers, no matter the size.
17649 @item -mepsilon
17650 @itemx -mno-epsilon
17651 @opindex mepsilon
17652 @opindex mno-epsilon
17653 Generate floating-point comparison instructions that compare with respect
17654 to the @code{rE} epsilon register.
17656 @item -mabi=mmixware
17657 @itemx -mabi=gnu
17658 @opindex mabi=mmixware
17659 @opindex mabi=gnu
17660 Generate code that passes function parameters and return values that (in
17661 the called function) are seen as registers @code{$0} and up, as opposed to
17662 the GNU ABI which uses global registers @code{$231} and up.
17664 @item -mzero-extend
17665 @itemx -mno-zero-extend
17666 @opindex mzero-extend
17667 @opindex mno-zero-extend
17668 When reading data from memory in sizes shorter than 64 bits, use (do not
17669 use) zero-extending load instructions by default, rather than
17670 sign-extending ones.
17672 @item -mknuthdiv
17673 @itemx -mno-knuthdiv
17674 @opindex mknuthdiv
17675 @opindex mno-knuthdiv
17676 Make the result of a division yielding a remainder have the same sign as
17677 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
17678 remainder follows the sign of the dividend.  Both methods are
17679 arithmetically valid, the latter being almost exclusively used.
17681 @item -mtoplevel-symbols
17682 @itemx -mno-toplevel-symbols
17683 @opindex mtoplevel-symbols
17684 @opindex mno-toplevel-symbols
17685 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
17686 code can be used with the @code{PREFIX} assembly directive.
17688 @item -melf
17689 @opindex melf
17690 Generate an executable in the ELF format, rather than the default
17691 @samp{mmo} format used by the @command{mmix} simulator.
17693 @item -mbranch-predict
17694 @itemx -mno-branch-predict
17695 @opindex mbranch-predict
17696 @opindex mno-branch-predict
17697 Use (do not use) the probable-branch instructions, when static branch
17698 prediction indicates a probable branch.
17700 @item -mbase-addresses
17701 @itemx -mno-base-addresses
17702 @opindex mbase-addresses
17703 @opindex mno-base-addresses
17704 Generate (do not generate) code that uses @emph{base addresses}.  Using a
17705 base address automatically generates a request (handled by the assembler
17706 and the linker) for a constant to be set up in a global register.  The
17707 register is used for one or more base address requests within the range 0
17708 to 255 from the value held in the register.  The generally leads to short
17709 and fast code, but the number of different data items that can be
17710 addressed is limited.  This means that a program that uses lots of static
17711 data may require @option{-mno-base-addresses}.
17713 @item -msingle-exit
17714 @itemx -mno-single-exit
17715 @opindex msingle-exit
17716 @opindex mno-single-exit
17717 Force (do not force) generated code to have a single exit point in each
17718 function.
17719 @end table
17721 @node MN10300 Options
17722 @subsection MN10300 Options
17723 @cindex MN10300 options
17725 These @option{-m} options are defined for Matsushita MN10300 architectures:
17727 @table @gcctabopt
17728 @item -mmult-bug
17729 @opindex mmult-bug
17730 Generate code to avoid bugs in the multiply instructions for the MN10300
17731 processors.  This is the default.
17733 @item -mno-mult-bug
17734 @opindex mno-mult-bug
17735 Do not generate code to avoid bugs in the multiply instructions for the
17736 MN10300 processors.
17738 @item -mam33
17739 @opindex mam33
17740 Generate code using features specific to the AM33 processor.
17742 @item -mno-am33
17743 @opindex mno-am33
17744 Do not generate code using features specific to the AM33 processor.  This
17745 is the default.
17747 @item -mam33-2
17748 @opindex mam33-2
17749 Generate code using features specific to the AM33/2.0 processor.
17751 @item -mam34
17752 @opindex mam34
17753 Generate code using features specific to the AM34 processor.
17755 @item -mtune=@var{cpu-type}
17756 @opindex mtune
17757 Use the timing characteristics of the indicated CPU type when
17758 scheduling instructions.  This does not change the targeted processor
17759 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
17760 @samp{am33-2} or @samp{am34}.
17762 @item -mreturn-pointer-on-d0
17763 @opindex mreturn-pointer-on-d0
17764 When generating a function that returns a pointer, return the pointer
17765 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
17766 only in @code{a0}, and attempts to call such functions without a prototype
17767 result in errors.  Note that this option is on by default; use
17768 @option{-mno-return-pointer-on-d0} to disable it.
17770 @item -mno-crt0
17771 @opindex mno-crt0
17772 Do not link in the C run-time initialization object file.
17774 @item -mrelax
17775 @opindex mrelax
17776 Indicate to the linker that it should perform a relaxation optimization pass
17777 to shorten branches, calls and absolute memory addresses.  This option only
17778 has an effect when used on the command line for the final link step.
17780 This option makes symbolic debugging impossible.
17782 @item -mliw
17783 @opindex mliw
17784 Allow the compiler to generate @emph{Long Instruction Word}
17785 instructions if the target is the @samp{AM33} or later.  This is the
17786 default.  This option defines the preprocessor macro @samp{__LIW__}.
17788 @item -mnoliw
17789 @opindex mnoliw
17790 Do not allow the compiler to generate @emph{Long Instruction Word}
17791 instructions.  This option defines the preprocessor macro
17792 @samp{__NO_LIW__}.
17794 @item -msetlb
17795 @opindex msetlb
17796 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
17797 instructions if the target is the @samp{AM33} or later.  This is the
17798 default.  This option defines the preprocessor macro @samp{__SETLB__}.
17800 @item -mnosetlb
17801 @opindex mnosetlb
17802 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
17803 instructions.  This option defines the preprocessor macro
17804 @samp{__NO_SETLB__}.
17806 @end table
17808 @node Moxie Options
17809 @subsection Moxie Options
17810 @cindex Moxie Options
17812 @table @gcctabopt
17814 @item -meb
17815 @opindex meb
17816 Generate big-endian code.  This is the default for @samp{moxie-*-*}
17817 configurations.
17819 @item -mel
17820 @opindex mel
17821 Generate little-endian code.
17823 @item -mno-crt0
17824 @opindex mno-crt0
17825 Do not link in the C run-time initialization object file.
17827 @end table
17829 @node MSP430 Options
17830 @subsection MSP430 Options
17831 @cindex MSP430 Options
17833 These options are defined for the MSP430:
17835 @table @gcctabopt
17837 @item -msim
17838 @opindex msim
17839 Link the simulator runtime libraries.
17841 @item -masm-hex
17842 @opindex masm-hex
17843 Force assembly output to always use hex constants.  Normally such
17844 constants are signed decimals, but this option is available for
17845 testsuite and/or aesthetic purposes.
17847 @item -mmcu=
17848 @opindex mmcu=
17849 Select the MCU to target.  Note that there are two ``generic'' MCUs,
17850 @code{msp430} and @code{msp430x}, which should be used most of the
17851 time.  This option is also passed to the assembler.
17853 @item -mlarge
17854 @opindex mlarge
17855 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
17857 @item -msmall
17858 @opindex msmall
17859 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
17861 @item -mrelax
17862 @opindex mrelax
17863 This option is passed to the assembler and linker, and allows the
17864 linker to perform certain optimizations that cannot be done until
17865 the final link.
17867 @end table
17869 @node PDP-11 Options
17870 @subsection PDP-11 Options
17871 @cindex PDP-11 Options
17873 These options are defined for the PDP-11:
17875 @table @gcctabopt
17876 @item -mfpu
17877 @opindex mfpu
17878 Use hardware FPP floating point.  This is the default.  (FIS floating
17879 point on the PDP-11/40 is not supported.)
17881 @item -msoft-float
17882 @opindex msoft-float
17883 Do not use hardware floating point.
17885 @item -mac0
17886 @opindex mac0
17887 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
17889 @item -mno-ac0
17890 @opindex mno-ac0
17891 Return floating-point results in memory.  This is the default.
17893 @item -m40
17894 @opindex m40
17895 Generate code for a PDP-11/40.
17897 @item -m45
17898 @opindex m45
17899 Generate code for a PDP-11/45.  This is the default.
17901 @item -m10
17902 @opindex m10
17903 Generate code for a PDP-11/10.
17905 @item -mbcopy-builtin
17906 @opindex mbcopy-builtin
17907 Use inline @code{movmemhi} patterns for copying memory.  This is the
17908 default.
17910 @item -mbcopy
17911 @opindex mbcopy
17912 Do not use inline @code{movmemhi} patterns for copying memory.
17914 @item -mint16
17915 @itemx -mno-int32
17916 @opindex mint16
17917 @opindex mno-int32
17918 Use 16-bit @code{int}.  This is the default.
17920 @item -mint32
17921 @itemx -mno-int16
17922 @opindex mint32
17923 @opindex mno-int16
17924 Use 32-bit @code{int}.
17926 @item -mfloat64
17927 @itemx -mno-float32
17928 @opindex mfloat64
17929 @opindex mno-float32
17930 Use 64-bit @code{float}.  This is the default.
17932 @item -mfloat32
17933 @itemx -mno-float64
17934 @opindex mfloat32
17935 @opindex mno-float64
17936 Use 32-bit @code{float}.
17938 @item -mabshi
17939 @opindex mabshi
17940 Use @code{abshi2} pattern.  This is the default.
17942 @item -mno-abshi
17943 @opindex mno-abshi
17944 Do not use @code{abshi2} pattern.
17946 @item -mbranch-expensive
17947 @opindex mbranch-expensive
17948 Pretend that branches are expensive.  This is for experimenting with
17949 code generation only.
17951 @item -mbranch-cheap
17952 @opindex mbranch-cheap
17953 Do not pretend that branches are expensive.  This is the default.
17955 @item -munix-asm
17956 @opindex munix-asm
17957 Use Unix assembler syntax.  This is the default when configured for
17958 @samp{pdp11-*-bsd}.
17960 @item -mdec-asm
17961 @opindex mdec-asm
17962 Use DEC assembler syntax.  This is the default when configured for any
17963 PDP-11 target other than @samp{pdp11-*-bsd}.
17964 @end table
17966 @node picoChip Options
17967 @subsection picoChip Options
17968 @cindex picoChip options
17970 These @samp{-m} options are defined for picoChip implementations:
17972 @table @gcctabopt
17974 @item -mae=@var{ae_type}
17975 @opindex mcpu
17976 Set the instruction set, register set, and instruction scheduling
17977 parameters for array element type @var{ae_type}.  Supported values
17978 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
17980 @option{-mae=ANY} selects a completely generic AE type.  Code
17981 generated with this option runs on any of the other AE types.  The
17982 code is not as efficient as it would be if compiled for a specific
17983 AE type, and some types of operation (e.g., multiplication) do not
17984 work properly on all types of AE.
17986 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
17987 for compiled code, and is the default.
17989 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
17990 option may suffer from poor performance of byte (char) manipulation,
17991 since the DSP AE does not provide hardware support for byte load/stores.
17993 @item -msymbol-as-address
17994 Enable the compiler to directly use a symbol name as an address in a
17995 load/store instruction, without first loading it into a
17996 register.  Typically, the use of this option generates larger
17997 programs, which run faster than when the option isn't used.  However, the
17998 results vary from program to program, so it is left as a user option,
17999 rather than being permanently enabled.
18001 @item -mno-inefficient-warnings
18002 Disables warnings about the generation of inefficient code.  These
18003 warnings can be generated, for example, when compiling code that
18004 performs byte-level memory operations on the MAC AE type.  The MAC AE has
18005 no hardware support for byte-level memory operations, so all byte
18006 load/stores must be synthesized from word load/store operations.  This is
18007 inefficient and a warning is generated to indicate
18008 that you should rewrite the code to avoid byte operations, or to target
18009 an AE type that has the necessary hardware support.  This option disables
18010 these warnings.
18012 @end table
18014 @node PowerPC Options
18015 @subsection PowerPC Options
18016 @cindex PowerPC options
18018 These are listed under @xref{RS/6000 and PowerPC Options}.
18020 @node RL78 Options
18021 @subsection RL78 Options
18022 @cindex RL78 Options
18024 @table @gcctabopt
18026 @item -msim
18027 @opindex msim
18028 Links in additional target libraries to support operation within a
18029 simulator.
18031 @item -mmul=none
18032 @itemx -mmul=g13
18033 @itemx -mmul=rl78
18034 @opindex mmul
18035 Specifies the type of hardware multiplication support to be used.  The
18036 default is @code{none}, which uses software multiplication functions.
18037 The @code{g13} option is for the hardware multiply/divide peripheral
18038 only on the RL78/G13 targets.  The @code{rl78} option is for the
18039 standard hardware multiplication defined in the RL78 software manual.
18041 @end table
18043 @node RS/6000 and PowerPC Options
18044 @subsection IBM RS/6000 and PowerPC Options
18045 @cindex RS/6000 and PowerPC Options
18046 @cindex IBM RS/6000 and PowerPC Options
18048 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
18049 @table @gcctabopt
18050 @item -mpowerpc-gpopt
18051 @itemx -mno-powerpc-gpopt
18052 @itemx -mpowerpc-gfxopt
18053 @itemx -mno-powerpc-gfxopt
18054 @need 800
18055 @itemx -mpowerpc64
18056 @itemx -mno-powerpc64
18057 @itemx -mmfcrf
18058 @itemx -mno-mfcrf
18059 @itemx -mpopcntb
18060 @itemx -mno-popcntb
18061 @itemx -mpopcntd
18062 @itemx -mno-popcntd
18063 @itemx -mfprnd
18064 @itemx -mno-fprnd
18065 @need 800
18066 @itemx -mcmpb
18067 @itemx -mno-cmpb
18068 @itemx -mmfpgpr
18069 @itemx -mno-mfpgpr
18070 @itemx -mhard-dfp
18071 @itemx -mno-hard-dfp
18072 @opindex mpowerpc-gpopt
18073 @opindex mno-powerpc-gpopt
18074 @opindex mpowerpc-gfxopt
18075 @opindex mno-powerpc-gfxopt
18076 @opindex mpowerpc64
18077 @opindex mno-powerpc64
18078 @opindex mmfcrf
18079 @opindex mno-mfcrf
18080 @opindex mpopcntb
18081 @opindex mno-popcntb
18082 @opindex mpopcntd
18083 @opindex mno-popcntd
18084 @opindex mfprnd
18085 @opindex mno-fprnd
18086 @opindex mcmpb
18087 @opindex mno-cmpb
18088 @opindex mmfpgpr
18089 @opindex mno-mfpgpr
18090 @opindex mhard-dfp
18091 @opindex mno-hard-dfp
18092 You use these options to specify which instructions are available on the
18093 processor you are using.  The default value of these options is
18094 determined when configuring GCC@.  Specifying the
18095 @option{-mcpu=@var{cpu_type}} overrides the specification of these
18096 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
18097 rather than the options listed above.
18099 Specifying @option{-mpowerpc-gpopt} allows
18100 GCC to use the optional PowerPC architecture instructions in the
18101 General Purpose group, including floating-point square root.  Specifying
18102 @option{-mpowerpc-gfxopt} allows GCC to
18103 use the optional PowerPC architecture instructions in the Graphics
18104 group, including floating-point select.
18106 The @option{-mmfcrf} option allows GCC to generate the move from
18107 condition register field instruction implemented on the POWER4
18108 processor and other processors that support the PowerPC V2.01
18109 architecture.
18110 The @option{-mpopcntb} option allows GCC to generate the popcount and
18111 double-precision FP reciprocal estimate instruction implemented on the
18112 POWER5 processor and other processors that support the PowerPC V2.02
18113 architecture.
18114 The @option{-mpopcntd} option allows GCC to generate the popcount
18115 instruction implemented on the POWER7 processor and other processors
18116 that support the PowerPC V2.06 architecture.
18117 The @option{-mfprnd} option allows GCC to generate the FP round to
18118 integer instructions implemented on the POWER5+ processor and other
18119 processors that support the PowerPC V2.03 architecture.
18120 The @option{-mcmpb} option allows GCC to generate the compare bytes
18121 instruction implemented on the POWER6 processor and other processors
18122 that support the PowerPC V2.05 architecture.
18123 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
18124 general-purpose register instructions implemented on the POWER6X
18125 processor and other processors that support the extended PowerPC V2.05
18126 architecture.
18127 The @option{-mhard-dfp} option allows GCC to generate the decimal
18128 floating-point instructions implemented on some POWER processors.
18130 The @option{-mpowerpc64} option allows GCC to generate the additional
18131 64-bit instructions that are found in the full PowerPC64 architecture
18132 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
18133 @option{-mno-powerpc64}.
18135 @item -mcpu=@var{cpu_type}
18136 @opindex mcpu
18137 Set architecture type, register usage, and
18138 instruction scheduling parameters for machine type @var{cpu_type}.
18139 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
18140 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
18141 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
18142 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
18143 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
18144 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
18145 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
18146 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
18147 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
18148 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
18149 @samp{powerpc64}, and @samp{rs64}.
18151 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
18152 PowerPC and 64-bit PowerPC architecture machine
18153 types, with an appropriate, generic processor model assumed for
18154 scheduling purposes.
18156 The other options specify a specific processor.  Code generated under
18157 those options runs best on that processor, and may not run at all on
18158 others.
18160 The @option{-mcpu} options automatically enable or disable the
18161 following options:
18163 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
18164 -mpopcntb -mpopcntd  -mpowerpc64 @gol
18165 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
18166 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
18167 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector -mquad-memory}
18169 The particular options set for any particular CPU varies between
18170 compiler versions, depending on what setting seems to produce optimal
18171 code for that CPU; it doesn't necessarily reflect the actual hardware's
18172 capabilities.  If you wish to set an individual option to a particular
18173 value, you may specify it after the @option{-mcpu} option, like
18174 @option{-mcpu=970 -mno-altivec}.
18176 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
18177 not enabled or disabled by the @option{-mcpu} option at present because
18178 AIX does not have full support for these options.  You may still
18179 enable or disable them individually if you're sure it'll work in your
18180 environment.
18182 @item -mtune=@var{cpu_type}
18183 @opindex mtune
18184 Set the instruction scheduling parameters for machine type
18185 @var{cpu_type}, but do not set the architecture type or register usage,
18186 as @option{-mcpu=@var{cpu_type}} does.  The same
18187 values for @var{cpu_type} are used for @option{-mtune} as for
18188 @option{-mcpu}.  If both are specified, the code generated uses the
18189 architecture and registers set by @option{-mcpu}, but the
18190 scheduling parameters set by @option{-mtune}.
18192 @item -mcmodel=small
18193 @opindex mcmodel=small
18194 Generate PowerPC64 code for the small model: The TOC is limited to
18195 64k.
18197 @item -mcmodel=medium
18198 @opindex mcmodel=medium
18199 Generate PowerPC64 code for the medium model: The TOC and other static
18200 data may be up to a total of 4G in size.
18202 @item -mcmodel=large
18203 @opindex mcmodel=large
18204 Generate PowerPC64 code for the large model: The TOC may be up to 4G
18205 in size.  Other data and code is only limited by the 64-bit address
18206 space.
18208 @item -maltivec
18209 @itemx -mno-altivec
18210 @opindex maltivec
18211 @opindex mno-altivec
18212 Generate code that uses (does not use) AltiVec instructions, and also
18213 enable the use of built-in functions that allow more direct access to
18214 the AltiVec instruction set.  You may also need to set
18215 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
18216 enhancements.
18218 @item -mvrsave
18219 @itemx -mno-vrsave
18220 @opindex mvrsave
18221 @opindex mno-vrsave
18222 Generate VRSAVE instructions when generating AltiVec code.
18224 @item -mgen-cell-microcode
18225 @opindex mgen-cell-microcode
18226 Generate Cell microcode instructions.
18228 @item -mwarn-cell-microcode
18229 @opindex mwarn-cell-microcode
18230 Warn when a Cell microcode instruction is emitted.  An example
18231 of a Cell microcode instruction is a variable shift.
18233 @item -msecure-plt
18234 @opindex msecure-plt
18235 Generate code that allows @command{ld} and @command{ld.so}
18236 to build executables and shared
18237 libraries with non-executable @code{.plt} and @code{.got} sections.
18238 This is a PowerPC
18239 32-bit SYSV ABI option.
18241 @item -mbss-plt
18242 @opindex mbss-plt
18243 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
18244 fills in, and
18245 requires @code{.plt} and @code{.got}
18246 sections that are both writable and executable.
18247 This is a PowerPC 32-bit SYSV ABI option.
18249 @item -misel
18250 @itemx -mno-isel
18251 @opindex misel
18252 @opindex mno-isel
18253 This switch enables or disables the generation of ISEL instructions.
18255 @item -misel=@var{yes/no}
18256 This switch has been deprecated.  Use @option{-misel} and
18257 @option{-mno-isel} instead.
18259 @item -mspe
18260 @itemx -mno-spe
18261 @opindex mspe
18262 @opindex mno-spe
18263 This switch enables or disables the generation of SPE simd
18264 instructions.
18266 @item -mpaired
18267 @itemx -mno-paired
18268 @opindex mpaired
18269 @opindex mno-paired
18270 This switch enables or disables the generation of PAIRED simd
18271 instructions.
18273 @item -mspe=@var{yes/no}
18274 This option has been deprecated.  Use @option{-mspe} and
18275 @option{-mno-spe} instead.
18277 @item -mvsx
18278 @itemx -mno-vsx
18279 @opindex mvsx
18280 @opindex mno-vsx
18281 Generate code that uses (does not use) vector/scalar (VSX)
18282 instructions, and also enable the use of built-in functions that allow
18283 more direct access to the VSX instruction set.
18285 @item -mcrypto
18286 @itemx -mno-crypto
18287 @opindex mcrypto
18288 @opindex mno-crypto
18289 Enable the use (disable) of the built-in functions that allow direct
18290 access to the cryptographic instructions that were added in version
18291 2.07 of the PowerPC ISA.
18293 @item -mdirect-move
18294 @itemx -mno-direct-move
18295 @opindex mdirect-move
18296 @opindex mno-direct-move
18297 Generate code that uses (does not use) the instructions to move data
18298 between the general purpose registers and the vector/scalar (VSX)
18299 registers that were added in version 2.07 of the PowerPC ISA.
18301 @item -mpower8-fusion
18302 @itemx -mno-power8-fusion
18303 @opindex mpower8-fusion
18304 @opindex mno-power8-fusion
18305 Generate code that keeps (does not keeps) some integer operations
18306 adjacent so that the instructions can be fused together on power8 and
18307 later processors.
18309 @item -mpower8-vector
18310 @itemx -mno-power8-vector
18311 @opindex mpower8-vector
18312 @opindex mno-power8-vector
18313 Generate code that uses (does not use) the vector and scalar
18314 instructions that were added in version 2.07 of the PowerPC ISA.  Also
18315 enable the use of built-in functions that allow more direct access to
18316 the vector instructions.
18318 @item -mquad-memory
18319 @itemx -mno-quad-memory
18320 @opindex mquad-memory
18321 @opindex mno-quad-memory
18322 Generate code that uses (does not use) the quad word memory
18323 instructions.  The @option{-mquad-memory} option requires use of
18324 64-bit mode.
18326 @item -mfloat-gprs=@var{yes/single/double/no}
18327 @itemx -mfloat-gprs
18328 @opindex mfloat-gprs
18329 This switch enables or disables the generation of floating-point
18330 operations on the general-purpose registers for architectures that
18331 support it.
18333 The argument @var{yes} or @var{single} enables the use of
18334 single-precision floating-point operations.
18336 The argument @var{double} enables the use of single and
18337 double-precision floating-point operations.
18339 The argument @var{no} disables floating-point operations on the
18340 general-purpose registers.
18342 This option is currently only available on the MPC854x.
18344 @item -m32
18345 @itemx -m64
18346 @opindex m32
18347 @opindex m64
18348 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
18349 targets (including GNU/Linux).  The 32-bit environment sets int, long
18350 and pointer to 32 bits and generates code that runs on any PowerPC
18351 variant.  The 64-bit environment sets int to 32 bits and long and
18352 pointer to 64 bits, and generates code for PowerPC64, as for
18353 @option{-mpowerpc64}.
18355 @item -mfull-toc
18356 @itemx -mno-fp-in-toc
18357 @itemx -mno-sum-in-toc
18358 @itemx -mminimal-toc
18359 @opindex mfull-toc
18360 @opindex mno-fp-in-toc
18361 @opindex mno-sum-in-toc
18362 @opindex mminimal-toc
18363 Modify generation of the TOC (Table Of Contents), which is created for
18364 every executable file.  The @option{-mfull-toc} option is selected by
18365 default.  In that case, GCC allocates at least one TOC entry for
18366 each unique non-automatic variable reference in your program.  GCC
18367 also places floating-point constants in the TOC@.  However, only
18368 16,384 entries are available in the TOC@.
18370 If you receive a linker error message that saying you have overflowed
18371 the available TOC space, you can reduce the amount of TOC space used
18372 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
18373 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
18374 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
18375 generate code to calculate the sum of an address and a constant at
18376 run time instead of putting that sum into the TOC@.  You may specify one
18377 or both of these options.  Each causes GCC to produce very slightly
18378 slower and larger code at the expense of conserving TOC space.
18380 If you still run out of space in the TOC even when you specify both of
18381 these options, specify @option{-mminimal-toc} instead.  This option causes
18382 GCC to make only one TOC entry for every file.  When you specify this
18383 option, GCC produces code that is slower and larger but which
18384 uses extremely little TOC space.  You may wish to use this option
18385 only on files that contain less frequently-executed code.
18387 @item -maix64
18388 @itemx -maix32
18389 @opindex maix64
18390 @opindex maix32
18391 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
18392 @code{long} type, and the infrastructure needed to support them.
18393 Specifying @option{-maix64} implies @option{-mpowerpc64},
18394 while @option{-maix32} disables the 64-bit ABI and
18395 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
18397 @item -mxl-compat
18398 @itemx -mno-xl-compat
18399 @opindex mxl-compat
18400 @opindex mno-xl-compat
18401 Produce code that conforms more closely to IBM XL compiler semantics
18402 when using AIX-compatible ABI@.  Pass floating-point arguments to
18403 prototyped functions beyond the register save area (RSA) on the stack
18404 in addition to argument FPRs.  Do not assume that most significant
18405 double in 128-bit long double value is properly rounded when comparing
18406 values and converting to double.  Use XL symbol names for long double
18407 support routines.
18409 The AIX calling convention was extended but not initially documented to
18410 handle an obscure K&R C case of calling a function that takes the
18411 address of its arguments with fewer arguments than declared.  IBM XL
18412 compilers access floating-point arguments that do not fit in the
18413 RSA from the stack when a subroutine is compiled without
18414 optimization.  Because always storing floating-point arguments on the
18415 stack is inefficient and rarely needed, this option is not enabled by
18416 default and only is necessary when calling subroutines compiled by IBM
18417 XL compilers without optimization.
18419 @item -mpe
18420 @opindex mpe
18421 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
18422 application written to use message passing with special startup code to
18423 enable the application to run.  The system must have PE installed in the
18424 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
18425 must be overridden with the @option{-specs=} option to specify the
18426 appropriate directory location.  The Parallel Environment does not
18427 support threads, so the @option{-mpe} option and the @option{-pthread}
18428 option are incompatible.
18430 @item -malign-natural
18431 @itemx -malign-power
18432 @opindex malign-natural
18433 @opindex malign-power
18434 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
18435 @option{-malign-natural} overrides the ABI-defined alignment of larger
18436 types, such as floating-point doubles, on their natural size-based boundary.
18437 The option @option{-malign-power} instructs GCC to follow the ABI-specified
18438 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
18440 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
18441 is not supported.
18443 @item -msoft-float
18444 @itemx -mhard-float
18445 @opindex msoft-float
18446 @opindex mhard-float
18447 Generate code that does not use (uses) the floating-point register set.
18448 Software floating-point emulation is provided if you use the
18449 @option{-msoft-float} option, and pass the option to GCC when linking.
18451 @item -msingle-float
18452 @itemx -mdouble-float
18453 @opindex msingle-float
18454 @opindex mdouble-float
18455 Generate code for single- or double-precision floating-point operations.
18456 @option{-mdouble-float} implies @option{-msingle-float}.
18458 @item -msimple-fpu
18459 @opindex msimple-fpu
18460 Do not generate @code{sqrt} and @code{div} instructions for hardware
18461 floating-point unit.
18463 @item -mfpu=@var{name}
18464 @opindex mfpu
18465 Specify type of floating-point unit.  Valid values for @var{name} are
18466 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
18467 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
18468 @samp{sp_full} (equivalent to @option{-msingle-float}),
18469 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
18471 @item -mxilinx-fpu
18472 @opindex mxilinx-fpu
18473 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
18475 @item -mmultiple
18476 @itemx -mno-multiple
18477 @opindex mmultiple
18478 @opindex mno-multiple
18479 Generate code that uses (does not use) the load multiple word
18480 instructions and the store multiple word instructions.  These
18481 instructions are generated by default on POWER systems, and not
18482 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
18483 PowerPC systems, since those instructions do not work when the
18484 processor is in little-endian mode.  The exceptions are PPC740 and
18485 PPC750 which permit these instructions in little-endian mode.
18487 @item -mstring
18488 @itemx -mno-string
18489 @opindex mstring
18490 @opindex mno-string
18491 Generate code that uses (does not use) the load string instructions
18492 and the store string word instructions to save multiple registers and
18493 do small block moves.  These instructions are generated by default on
18494 POWER systems, and not generated on PowerPC systems.  Do not use
18495 @option{-mstring} on little-endian PowerPC systems, since those
18496 instructions do not work when the processor is in little-endian mode.
18497 The exceptions are PPC740 and PPC750 which permit these instructions
18498 in little-endian mode.
18500 @item -mupdate
18501 @itemx -mno-update
18502 @opindex mupdate
18503 @opindex mno-update
18504 Generate code that uses (does not use) the load or store instructions
18505 that update the base register to the address of the calculated memory
18506 location.  These instructions are generated by default.  If you use
18507 @option{-mno-update}, there is a small window between the time that the
18508 stack pointer is updated and the address of the previous frame is
18509 stored, which means code that walks the stack frame across interrupts or
18510 signals may get corrupted data.
18512 @item -mavoid-indexed-addresses
18513 @itemx -mno-avoid-indexed-addresses
18514 @opindex mavoid-indexed-addresses
18515 @opindex mno-avoid-indexed-addresses
18516 Generate code that tries to avoid (not avoid) the use of indexed load
18517 or store instructions. These instructions can incur a performance
18518 penalty on Power6 processors in certain situations, such as when
18519 stepping through large arrays that cross a 16M boundary.  This option
18520 is enabled by default when targeting Power6 and disabled otherwise.
18522 @item -mfused-madd
18523 @itemx -mno-fused-madd
18524 @opindex mfused-madd
18525 @opindex mno-fused-madd
18526 Generate code that uses (does not use) the floating-point multiply and
18527 accumulate instructions.  These instructions are generated by default
18528 if hardware floating point is used.  The machine-dependent
18529 @option{-mfused-madd} option is now mapped to the machine-independent
18530 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
18531 mapped to @option{-ffp-contract=off}.
18533 @item -mmulhw
18534 @itemx -mno-mulhw
18535 @opindex mmulhw
18536 @opindex mno-mulhw
18537 Generate code that uses (does not use) the half-word multiply and
18538 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
18539 These instructions are generated by default when targeting those
18540 processors.
18542 @item -mdlmzb
18543 @itemx -mno-dlmzb
18544 @opindex mdlmzb
18545 @opindex mno-dlmzb
18546 Generate code that uses (does not use) the string-search @samp{dlmzb}
18547 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
18548 generated by default when targeting those processors.
18550 @item -mno-bit-align
18551 @itemx -mbit-align
18552 @opindex mno-bit-align
18553 @opindex mbit-align
18554 On System V.4 and embedded PowerPC systems do not (do) force structures
18555 and unions that contain bit-fields to be aligned to the base type of the
18556 bit-field.
18558 For example, by default a structure containing nothing but 8
18559 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
18560 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
18561 the structure is aligned to a 1-byte boundary and is 1 byte in
18562 size.
18564 @item -mno-strict-align
18565 @itemx -mstrict-align
18566 @opindex mno-strict-align
18567 @opindex mstrict-align
18568 On System V.4 and embedded PowerPC systems do not (do) assume that
18569 unaligned memory references are handled by the system.
18571 @item -mrelocatable
18572 @itemx -mno-relocatable
18573 @opindex mrelocatable
18574 @opindex mno-relocatable
18575 Generate code that allows (does not allow) a static executable to be
18576 relocated to a different address at run time.  A simple embedded
18577 PowerPC system loader should relocate the entire contents of
18578 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
18579 a table of 32-bit addresses generated by this option.  For this to
18580 work, all objects linked together must be compiled with
18581 @option{-mrelocatable} or @option{-mrelocatable-lib}.
18582 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
18584 @item -mrelocatable-lib
18585 @itemx -mno-relocatable-lib
18586 @opindex mrelocatable-lib
18587 @opindex mno-relocatable-lib
18588 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
18589 @code{.fixup} section to allow static executables to be relocated at
18590 run time, but @option{-mrelocatable-lib} does not use the smaller stack
18591 alignment of @option{-mrelocatable}.  Objects compiled with
18592 @option{-mrelocatable-lib} may be linked with objects compiled with
18593 any combination of the @option{-mrelocatable} options.
18595 @item -mno-toc
18596 @itemx -mtoc
18597 @opindex mno-toc
18598 @opindex mtoc
18599 On System V.4 and embedded PowerPC systems do not (do) assume that
18600 register 2 contains a pointer to a global area pointing to the addresses
18601 used in the program.
18603 @item -mlittle
18604 @itemx -mlittle-endian
18605 @opindex mlittle
18606 @opindex mlittle-endian
18607 On System V.4 and embedded PowerPC systems compile code for the
18608 processor in little-endian mode.  The @option{-mlittle-endian} option is
18609 the same as @option{-mlittle}.
18611 @item -mbig
18612 @itemx -mbig-endian
18613 @opindex mbig
18614 @opindex mbig-endian
18615 On System V.4 and embedded PowerPC systems compile code for the
18616 processor in big-endian mode.  The @option{-mbig-endian} option is
18617 the same as @option{-mbig}.
18619 @item -mdynamic-no-pic
18620 @opindex mdynamic-no-pic
18621 On Darwin and Mac OS X systems, compile code so that it is not
18622 relocatable, but that its external references are relocatable.  The
18623 resulting code is suitable for applications, but not shared
18624 libraries.
18626 @item -msingle-pic-base
18627 @opindex msingle-pic-base
18628 Treat the register used for PIC addressing as read-only, rather than
18629 loading it in the prologue for each function.  The runtime system is
18630 responsible for initializing this register with an appropriate value
18631 before execution begins.
18633 @item -mprioritize-restricted-insns=@var{priority}
18634 @opindex mprioritize-restricted-insns
18635 This option controls the priority that is assigned to
18636 dispatch-slot restricted instructions during the second scheduling
18637 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
18638 or @samp{2} to assign no, highest, or second-highest (respectively) 
18639 priority to dispatch-slot restricted
18640 instructions.
18642 @item -msched-costly-dep=@var{dependence_type}
18643 @opindex msched-costly-dep
18644 This option controls which dependences are considered costly
18645 by the target during instruction scheduling.  The argument
18646 @var{dependence_type} takes one of the following values:
18648 @table @asis
18649 @item @samp{no}
18650 No dependence is costly.
18652 @item @samp{all}
18653 All dependences are costly.
18655 @item @samp{true_store_to_load}
18656 A true dependence from store to load is costly.
18658 @item @samp{store_to_load}
18659 Any dependence from store to load is costly.
18661 @item @var{number}
18662 Any dependence for which the latency is greater than or equal to 
18663 @var{number} is costly.
18664 @end table
18666 @item -minsert-sched-nops=@var{scheme}
18667 @opindex minsert-sched-nops
18668 This option controls which NOP insertion scheme is used during
18669 the second scheduling pass.  The argument @var{scheme} takes one of the
18670 following values:
18672 @table @asis
18673 @item @samp{no}
18674 Don't insert NOPs.
18676 @item @samp{pad}
18677 Pad with NOPs any dispatch group that has vacant issue slots,
18678 according to the scheduler's grouping.
18680 @item @samp{regroup_exact}
18681 Insert NOPs to force costly dependent insns into
18682 separate groups.  Insert exactly as many NOPs as needed to force an insn
18683 to a new group, according to the estimated processor grouping.
18685 @item @var{number}
18686 Insert NOPs to force costly dependent insns into
18687 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
18688 @end table
18690 @item -mcall-sysv
18691 @opindex mcall-sysv
18692 On System V.4 and embedded PowerPC systems compile code using calling
18693 conventions that adhere to the March 1995 draft of the System V
18694 Application Binary Interface, PowerPC processor supplement.  This is the
18695 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
18697 @item -mcall-sysv-eabi
18698 @itemx -mcall-eabi
18699 @opindex mcall-sysv-eabi
18700 @opindex mcall-eabi
18701 Specify both @option{-mcall-sysv} and @option{-meabi} options.
18703 @item -mcall-sysv-noeabi
18704 @opindex mcall-sysv-noeabi
18705 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
18707 @item -mcall-aixdesc
18708 @opindex m
18709 On System V.4 and embedded PowerPC systems compile code for the AIX
18710 operating system.
18712 @item -mcall-linux
18713 @opindex mcall-linux
18714 On System V.4 and embedded PowerPC systems compile code for the
18715 Linux-based GNU system.
18717 @item -mcall-freebsd
18718 @opindex mcall-freebsd
18719 On System V.4 and embedded PowerPC systems compile code for the
18720 FreeBSD operating system.
18722 @item -mcall-netbsd
18723 @opindex mcall-netbsd
18724 On System V.4 and embedded PowerPC systems compile code for the
18725 NetBSD operating system.
18727 @item -mcall-openbsd
18728 @opindex mcall-netbsd
18729 On System V.4 and embedded PowerPC systems compile code for the
18730 OpenBSD operating system.
18732 @item -maix-struct-return
18733 @opindex maix-struct-return
18734 Return all structures in memory (as specified by the AIX ABI)@.
18736 @item -msvr4-struct-return
18737 @opindex msvr4-struct-return
18738 Return structures smaller than 8 bytes in registers (as specified by the
18739 SVR4 ABI)@.
18741 @item -mabi=@var{abi-type}
18742 @opindex mabi
18743 Extend the current ABI with a particular extension, or remove such extension.
18744 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
18745 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
18747 @item -mabi=spe
18748 @opindex mabi=spe
18749 Extend the current ABI with SPE ABI extensions.  This does not change
18750 the default ABI, instead it adds the SPE ABI extensions to the current
18751 ABI@.
18753 @item -mabi=no-spe
18754 @opindex mabi=no-spe
18755 Disable Book-E SPE ABI extensions for the current ABI@.
18757 @item -mabi=ibmlongdouble
18758 @opindex mabi=ibmlongdouble
18759 Change the current ABI to use IBM extended-precision long double.
18760 This is a PowerPC 32-bit SYSV ABI option.
18762 @item -mabi=ieeelongdouble
18763 @opindex mabi=ieeelongdouble
18764 Change the current ABI to use IEEE extended-precision long double.
18765 This is a PowerPC 32-bit Linux ABI option.
18767 @item -mprototype
18768 @itemx -mno-prototype
18769 @opindex mprototype
18770 @opindex mno-prototype
18771 On System V.4 and embedded PowerPC systems assume that all calls to
18772 variable argument functions are properly prototyped.  Otherwise, the
18773 compiler must insert an instruction before every non-prototyped call to
18774 set or clear bit 6 of the condition code register (@var{CR}) to
18775 indicate whether floating-point values are passed in the floating-point
18776 registers in case the function takes variable arguments.  With
18777 @option{-mprototype}, only calls to prototyped variable argument functions
18778 set or clear the bit.
18780 @item -msim
18781 @opindex msim
18782 On embedded PowerPC systems, assume that the startup module is called
18783 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
18784 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
18785 configurations.
18787 @item -mmvme
18788 @opindex mmvme
18789 On embedded PowerPC systems, assume that the startup module is called
18790 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
18791 @file{libc.a}.
18793 @item -mads
18794 @opindex mads
18795 On embedded PowerPC systems, assume that the startup module is called
18796 @file{crt0.o} and the standard C libraries are @file{libads.a} and
18797 @file{libc.a}.
18799 @item -myellowknife
18800 @opindex myellowknife
18801 On embedded PowerPC systems, assume that the startup module is called
18802 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
18803 @file{libc.a}.
18805 @item -mvxworks
18806 @opindex mvxworks
18807 On System V.4 and embedded PowerPC systems, specify that you are
18808 compiling for a VxWorks system.
18810 @item -memb
18811 @opindex memb
18812 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
18813 header to indicate that @samp{eabi} extended relocations are used.
18815 @item -meabi
18816 @itemx -mno-eabi
18817 @opindex meabi
18818 @opindex mno-eabi
18819 On System V.4 and embedded PowerPC systems do (do not) adhere to the
18820 Embedded Applications Binary Interface (EABI), which is a set of
18821 modifications to the System V.4 specifications.  Selecting @option{-meabi}
18822 means that the stack is aligned to an 8-byte boundary, a function
18823 @code{__eabi} is called from @code{main} to set up the EABI
18824 environment, and the @option{-msdata} option can use both @code{r2} and
18825 @code{r13} to point to two separate small data areas.  Selecting
18826 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
18827 no EABI initialization function is called from @code{main}, and the
18828 @option{-msdata} option only uses @code{r13} to point to a single
18829 small data area.  The @option{-meabi} option is on by default if you
18830 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
18832 @item -msdata=eabi
18833 @opindex msdata=eabi
18834 On System V.4 and embedded PowerPC systems, put small initialized
18835 @code{const} global and static data in the @samp{.sdata2} section, which
18836 is pointed to by register @code{r2}.  Put small initialized
18837 non-@code{const} global and static data in the @samp{.sdata} section,
18838 which is pointed to by register @code{r13}.  Put small uninitialized
18839 global and static data in the @samp{.sbss} section, which is adjacent to
18840 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
18841 incompatible with the @option{-mrelocatable} option.  The
18842 @option{-msdata=eabi} option also sets the @option{-memb} option.
18844 @item -msdata=sysv
18845 @opindex msdata=sysv
18846 On System V.4 and embedded PowerPC systems, put small global and static
18847 data in the @samp{.sdata} section, which is pointed to by register
18848 @code{r13}.  Put small uninitialized global and static data in the
18849 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
18850 The @option{-msdata=sysv} option is incompatible with the
18851 @option{-mrelocatable} option.
18853 @item -msdata=default
18854 @itemx -msdata
18855 @opindex msdata=default
18856 @opindex msdata
18857 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
18858 compile code the same as @option{-msdata=eabi}, otherwise compile code the
18859 same as @option{-msdata=sysv}.
18861 @item -msdata=data
18862 @opindex msdata=data
18863 On System V.4 and embedded PowerPC systems, put small global
18864 data in the @samp{.sdata} section.  Put small uninitialized global
18865 data in the @samp{.sbss} section.  Do not use register @code{r13}
18866 to address small data however.  This is the default behavior unless
18867 other @option{-msdata} options are used.
18869 @item -msdata=none
18870 @itemx -mno-sdata
18871 @opindex msdata=none
18872 @opindex mno-sdata
18873 On embedded PowerPC systems, put all initialized global and static data
18874 in the @samp{.data} section, and all uninitialized data in the
18875 @samp{.bss} section.
18877 @item -mblock-move-inline-limit=@var{num}
18878 @opindex mblock-move-inline-limit
18879 Inline all block moves (such as calls to @code{memcpy} or structure
18880 copies) less than or equal to @var{num} bytes.  The minimum value for
18881 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
18882 targets.  The default value is target-specific.
18884 @item -G @var{num}
18885 @opindex G
18886 @cindex smaller data references (PowerPC)
18887 @cindex .sdata/.sdata2 references (PowerPC)
18888 On embedded PowerPC systems, put global and static items less than or
18889 equal to @var{num} bytes into the small data or BSS sections instead of
18890 the normal data or BSS section.  By default, @var{num} is 8.  The
18891 @option{-G @var{num}} switch is also passed to the linker.
18892 All modules should be compiled with the same @option{-G @var{num}} value.
18894 @item -mregnames
18895 @itemx -mno-regnames
18896 @opindex mregnames
18897 @opindex mno-regnames
18898 On System V.4 and embedded PowerPC systems do (do not) emit register
18899 names in the assembly language output using symbolic forms.
18901 @item -mlongcall
18902 @itemx -mno-longcall
18903 @opindex mlongcall
18904 @opindex mno-longcall
18905 By default assume that all calls are far away so that a longer and more
18906 expensive calling sequence is required.  This is required for calls
18907 farther than 32 megabytes (33,554,432 bytes) from the current location.
18908 A short call is generated if the compiler knows
18909 the call cannot be that far away.  This setting can be overridden by
18910 the @code{shortcall} function attribute, or by @code{#pragma
18911 longcall(0)}.
18913 Some linkers are capable of detecting out-of-range calls and generating
18914 glue code on the fly.  On these systems, long calls are unnecessary and
18915 generate slower code.  As of this writing, the AIX linker can do this,
18916 as can the GNU linker for PowerPC/64.  It is planned to add this feature
18917 to the GNU linker for 32-bit PowerPC systems as well.
18919 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
18920 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
18921 addresses represent the callee and the branch island.  The
18922 Darwin/PPC linker prefers the first address and generates a @code{bl
18923 callee} if the PPC @code{bl} instruction reaches the callee directly;
18924 otherwise, the linker generates @code{bl L42} to call the branch
18925 island.  The branch island is appended to the body of the
18926 calling function; it computes the full 32-bit address of the callee
18927 and jumps to it.
18929 On Mach-O (Darwin) systems, this option directs the compiler emit to
18930 the glue for every direct call, and the Darwin linker decides whether
18931 to use or discard it.
18933 In the future, GCC may ignore all longcall specifications
18934 when the linker is known to generate glue.
18936 @item -mtls-markers
18937 @itemx -mno-tls-markers
18938 @opindex mtls-markers
18939 @opindex mno-tls-markers
18940 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
18941 specifying the function argument.  The relocation allows the linker to
18942 reliably associate function call with argument setup instructions for
18943 TLS optimization, which in turn allows GCC to better schedule the
18944 sequence.
18946 @item -pthread
18947 @opindex pthread
18948 Adds support for multithreading with the @dfn{pthreads} library.
18949 This option sets flags for both the preprocessor and linker.
18951 @item -mrecip
18952 @itemx -mno-recip
18953 @opindex mrecip
18954 This option enables use of the reciprocal estimate and
18955 reciprocal square root estimate instructions with additional
18956 Newton-Raphson steps to increase precision instead of doing a divide or
18957 square root and divide for floating-point arguments.  You should use
18958 the @option{-ffast-math} option when using @option{-mrecip} (or at
18959 least @option{-funsafe-math-optimizations},
18960 @option{-finite-math-only}, @option{-freciprocal-math} and
18961 @option{-fno-trapping-math}).  Note that while the throughput of the
18962 sequence is generally higher than the throughput of the non-reciprocal
18963 instruction, the precision of the sequence can be decreased by up to 2
18964 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
18965 roots.
18967 @item -mrecip=@var{opt}
18968 @opindex mrecip=opt
18969 This option controls which reciprocal estimate instructions
18970 may be used.  @var{opt} is a comma-separated list of options, which may
18971 be preceded by a @code{!} to invert the option:
18972 @code{all}: enable all estimate instructions,
18973 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
18974 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
18975 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
18976 @code{divf}: enable the single-precision reciprocal approximation instructions;
18977 @code{divd}: enable the double-precision reciprocal approximation instructions;
18978 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
18979 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
18980 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
18982 So, for example, @option{-mrecip=all,!rsqrtd} enables
18983 all of the reciprocal estimate instructions, except for the
18984 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
18985 which handle the double-precision reciprocal square root calculations.
18987 @item -mrecip-precision
18988 @itemx -mno-recip-precision
18989 @opindex mrecip-precision
18990 Assume (do not assume) that the reciprocal estimate instructions
18991 provide higher-precision estimates than is mandated by the PowerPC
18992 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
18993 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
18994 The double-precision square root estimate instructions are not generated by
18995 default on low-precision machines, since they do not provide an
18996 estimate that converges after three steps.
18998 @item -mveclibabi=@var{type}
18999 @opindex mveclibabi
19000 Specifies the ABI type to use for vectorizing intrinsics using an
19001 external library.  The only type supported at present is @code{mass},
19002 which specifies to use IBM's Mathematical Acceleration Subsystem
19003 (MASS) libraries for vectorizing intrinsics using external libraries.
19004 GCC currently emits calls to @code{acosd2}, @code{acosf4},
19005 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
19006 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
19007 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
19008 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
19009 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
19010 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
19011 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
19012 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
19013 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
19014 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
19015 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
19016 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
19017 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
19018 for power7.  Both @option{-ftree-vectorize} and
19019 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
19020 libraries must be specified at link time.
19022 @item -mfriz
19023 @itemx -mno-friz
19024 @opindex mfriz
19025 Generate (do not generate) the @code{friz} instruction when the
19026 @option{-funsafe-math-optimizations} option is used to optimize
19027 rounding of floating-point values to 64-bit integer and back to floating
19028 point.  The @code{friz} instruction does not return the same value if
19029 the floating-point number is too large to fit in an integer.
19031 @item -mpointers-to-nested-functions
19032 @itemx -mno-pointers-to-nested-functions
19033 @opindex mpointers-to-nested-functions
19034 Generate (do not generate) code to load up the static chain register
19035 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
19036 systems where a function pointer points to a 3-word descriptor giving
19037 the function address, TOC value to be loaded in register @var{r2}, and
19038 static chain value to be loaded in register @var{r11}.  The
19039 @option{-mpointers-to-nested-functions} is on by default.  You cannot
19040 call through pointers to nested functions or pointers
19041 to functions compiled in other languages that use the static chain if
19042 you use the @option{-mno-pointers-to-nested-functions}.
19044 @item -msave-toc-indirect
19045 @itemx -mno-save-toc-indirect
19046 @opindex msave-toc-indirect
19047 Generate (do not generate) code to save the TOC value in the reserved
19048 stack location in the function prologue if the function calls through
19049 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
19050 saved in the prologue, it is saved just before the call through the
19051 pointer.  The @option{-mno-save-toc-indirect} option is the default.
19053 @item -mcompat-align-parm
19054 @itemx -mno-compat-align-parm
19055 @opindex mcompat-align-parm
19056 Generate (do not generate) code to pass structure parameters with a
19057 maximum alignment of 64 bits, for compatibility with older versions
19058 of GCC.
19060 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
19061 structure parameter on a 128-bit boundary when that structure contained
19062 a member requiring 128-bit alignment.  This is corrected in more
19063 recent versions of GCC.  This option may be used to generate code
19064 that is compatible with functions compiled with older versions of
19065 GCC.
19067 The @option{-mno-compat-align-parm} option is the default.
19068 @end table
19070 @node RX Options
19071 @subsection RX Options
19072 @cindex RX Options
19074 These command-line options are defined for RX targets:
19076 @table @gcctabopt
19077 @item -m64bit-doubles
19078 @itemx -m32bit-doubles
19079 @opindex m64bit-doubles
19080 @opindex m32bit-doubles
19081 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19082 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19083 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
19084 works on 32-bit values, which is why the default is
19085 @option{-m32bit-doubles}.
19087 @item -fpu
19088 @itemx -nofpu
19089 @opindex fpu
19090 @opindex nofpu
19091 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
19092 floating-point hardware.  The default is enabled for the @var{RX600}
19093 series and disabled for the @var{RX200} series.
19095 Floating-point instructions are only generated for 32-bit floating-point 
19096 values, however, so the FPU hardware is not used for doubles if the
19097 @option{-m64bit-doubles} option is used.
19099 @emph{Note} If the @option{-fpu} option is enabled then
19100 @option{-funsafe-math-optimizations} is also enabled automatically.
19101 This is because the RX FPU instructions are themselves unsafe.
19103 @item -mcpu=@var{name}
19104 @opindex -mcpu
19105 Selects the type of RX CPU to be targeted.  Currently three types are
19106 supported, the generic @var{RX600} and @var{RX200} series hardware and
19107 the specific @var{RX610} CPU.  The default is @var{RX600}.
19109 The only difference between @var{RX600} and @var{RX610} is that the
19110 @var{RX610} does not support the @code{MVTIPL} instruction.
19112 The @var{RX200} series does not have a hardware floating-point unit
19113 and so @option{-nofpu} is enabled by default when this type is
19114 selected.
19116 @item -mbig-endian-data
19117 @itemx -mlittle-endian-data
19118 @opindex mbig-endian-data
19119 @opindex mlittle-endian-data
19120 Store data (but not code) in the big-endian format.  The default is
19121 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
19122 format.
19124 @item -msmall-data-limit=@var{N}
19125 @opindex msmall-data-limit
19126 Specifies the maximum size in bytes of global and static variables
19127 which can be placed into the small data area.  Using the small data
19128 area can lead to smaller and faster code, but the size of area is
19129 limited and it is up to the programmer to ensure that the area does
19130 not overflow.  Also when the small data area is used one of the RX's
19131 registers (usually @code{r13}) is reserved for use pointing to this
19132 area, so it is no longer available for use by the compiler.  This
19133 could result in slower and/or larger code if variables are pushed onto
19134 the stack instead of being held in this register.
19136 Note, common variables (variables that have not been initialized) and
19137 constants are not placed into the small data area as they are assigned
19138 to other sections in the output executable.
19140 The default value is zero, which disables this feature.  Note, this
19141 feature is not enabled by default with higher optimization levels
19142 (@option{-O2} etc) because of the potentially detrimental effects of
19143 reserving a register.  It is up to the programmer to experiment and
19144 discover whether this feature is of benefit to their program.  See the
19145 description of the @option{-mpid} option for a description of how the
19146 actual register to hold the small data area pointer is chosen.
19148 @item -msim
19149 @itemx -mno-sim
19150 @opindex msim
19151 @opindex mno-sim
19152 Use the simulator runtime.  The default is to use the libgloss
19153 board-specific runtime.
19155 @item -mas100-syntax
19156 @itemx -mno-as100-syntax
19157 @opindex mas100-syntax
19158 @opindex mno-as100-syntax
19159 When generating assembler output use a syntax that is compatible with
19160 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
19161 assembler, but it has some restrictions so it is not generated by default.
19163 @item -mmax-constant-size=@var{N}
19164 @opindex mmax-constant-size
19165 Specifies the maximum size, in bytes, of a constant that can be used as
19166 an operand in a RX instruction.  Although the RX instruction set does
19167 allow constants of up to 4 bytes in length to be used in instructions,
19168 a longer value equates to a longer instruction.  Thus in some
19169 circumstances it can be beneficial to restrict the size of constants
19170 that are used in instructions.  Constants that are too big are instead
19171 placed into a constant pool and referenced via register indirection.
19173 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
19174 or 4 means that constants of any size are allowed.
19176 @item -mrelax
19177 @opindex mrelax
19178 Enable linker relaxation.  Linker relaxation is a process whereby the
19179 linker attempts to reduce the size of a program by finding shorter
19180 versions of various instructions.  Disabled by default.
19182 @item -mint-register=@var{N}
19183 @opindex mint-register
19184 Specify the number of registers to reserve for fast interrupt handler
19185 functions.  The value @var{N} can be between 0 and 4.  A value of 1
19186 means that register @code{r13} is reserved for the exclusive use
19187 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
19188 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
19189 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
19190 A value of 0, the default, does not reserve any registers.
19192 @item -msave-acc-in-interrupts
19193 @opindex msave-acc-in-interrupts
19194 Specifies that interrupt handler functions should preserve the
19195 accumulator register.  This is only necessary if normal code might use
19196 the accumulator register, for example because it performs 64-bit
19197 multiplications.  The default is to ignore the accumulator as this
19198 makes the interrupt handlers faster.
19200 @item -mpid
19201 @itemx -mno-pid
19202 @opindex mpid
19203 @opindex mno-pid
19204 Enables the generation of position independent data.  When enabled any
19205 access to constant data is done via an offset from a base address
19206 held in a register.  This allows the location of constant data to be
19207 determined at run time without requiring the executable to be
19208 relocated, which is a benefit to embedded applications with tight
19209 memory constraints.  Data that can be modified is not affected by this
19210 option.
19212 Note, using this feature reserves a register, usually @code{r13}, for
19213 the constant data base address.  This can result in slower and/or
19214 larger code, especially in complicated functions.
19216 The actual register chosen to hold the constant data base address
19217 depends upon whether the @option{-msmall-data-limit} and/or the
19218 @option{-mint-register} command-line options are enabled.  Starting
19219 with register @code{r13} and proceeding downwards, registers are
19220 allocated first to satisfy the requirements of @option{-mint-register},
19221 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
19222 is possible for the small data area register to be @code{r8} if both
19223 @option{-mint-register=4} and @option{-mpid} are specified on the
19224 command line.
19226 By default this feature is not enabled.  The default can be restored
19227 via the @option{-mno-pid} command-line option.
19229 @item -mno-warn-multiple-fast-interrupts
19230 @itemx -mwarn-multiple-fast-interrupts
19231 @opindex mno-warn-multiple-fast-interrupts
19232 @opindex mwarn-multiple-fast-interrupts
19233 Prevents GCC from issuing a warning message if it finds more than one
19234 fast interrupt handler when it is compiling a file.  The default is to
19235 issue a warning for each extra fast interrupt handler found, as the RX
19236 only supports one such interrupt.
19238 @end table
19240 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
19241 has special significance to the RX port when used with the
19242 @code{interrupt} function attribute.  This attribute indicates a
19243 function intended to process fast interrupts.  GCC ensures
19244 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
19245 and/or @code{r13} and only provided that the normal use of the
19246 corresponding registers have been restricted via the
19247 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
19248 options.
19250 @node S/390 and zSeries Options
19251 @subsection S/390 and zSeries Options
19252 @cindex S/390 and zSeries Options
19254 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
19256 @table @gcctabopt
19257 @item -mhard-float
19258 @itemx -msoft-float
19259 @opindex mhard-float
19260 @opindex msoft-float
19261 Use (do not use) the hardware floating-point instructions and registers
19262 for floating-point operations.  When @option{-msoft-float} is specified,
19263 functions in @file{libgcc.a} are used to perform floating-point
19264 operations.  When @option{-mhard-float} is specified, the compiler
19265 generates IEEE floating-point instructions.  This is the default.
19267 @item -mhard-dfp
19268 @itemx -mno-hard-dfp
19269 @opindex mhard-dfp
19270 @opindex mno-hard-dfp
19271 Use (do not use) the hardware decimal-floating-point instructions for
19272 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
19273 specified, functions in @file{libgcc.a} are used to perform
19274 decimal-floating-point operations.  When @option{-mhard-dfp} is
19275 specified, the compiler generates decimal-floating-point hardware
19276 instructions.  This is the default for @option{-march=z9-ec} or higher.
19278 @item -mlong-double-64
19279 @itemx -mlong-double-128
19280 @opindex mlong-double-64
19281 @opindex mlong-double-128
19282 These switches control the size of @code{long double} type. A size
19283 of 64 bits makes the @code{long double} type equivalent to the @code{double}
19284 type. This is the default.
19286 @item -mbackchain
19287 @itemx -mno-backchain
19288 @opindex mbackchain
19289 @opindex mno-backchain
19290 Store (do not store) the address of the caller's frame as backchain pointer
19291 into the callee's stack frame.
19292 A backchain may be needed to allow debugging using tools that do not understand
19293 DWARF 2 call frame information.
19294 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
19295 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
19296 the backchain is placed into the topmost word of the 96/160 byte register
19297 save area.
19299 In general, code compiled with @option{-mbackchain} is call-compatible with
19300 code compiled with @option{-mmo-backchain}; however, use of the backchain
19301 for debugging purposes usually requires that the whole binary is built with
19302 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
19303 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
19304 to build a linux kernel use @option{-msoft-float}.
19306 The default is to not maintain the backchain.
19308 @item -mpacked-stack
19309 @itemx -mno-packed-stack
19310 @opindex mpacked-stack
19311 @opindex mno-packed-stack
19312 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
19313 specified, the compiler uses the all fields of the 96/160 byte register save
19314 area only for their default purpose; unused fields still take up stack space.
19315 When @option{-mpacked-stack} is specified, register save slots are densely
19316 packed at the top of the register save area; unused space is reused for other
19317 purposes, allowing for more efficient use of the available stack space.
19318 However, when @option{-mbackchain} is also in effect, the topmost word of
19319 the save area is always used to store the backchain, and the return address
19320 register is always saved two words below the backchain.
19322 As long as the stack frame backchain is not used, code generated with
19323 @option{-mpacked-stack} is call-compatible with code generated with
19324 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
19325 S/390 or zSeries generated code that uses the stack frame backchain at run
19326 time, not just for debugging purposes.  Such code is not call-compatible
19327 with code compiled with @option{-mpacked-stack}.  Also, note that the
19328 combination of @option{-mbackchain},
19329 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
19330 to build a linux kernel use @option{-msoft-float}.
19332 The default is to not use the packed stack layout.
19334 @item -msmall-exec
19335 @itemx -mno-small-exec
19336 @opindex msmall-exec
19337 @opindex mno-small-exec
19338 Generate (or do not generate) code using the @code{bras} instruction
19339 to do subroutine calls.
19340 This only works reliably if the total executable size does not
19341 exceed 64k.  The default is to use the @code{basr} instruction instead,
19342 which does not have this limitation.
19344 @item -m64
19345 @itemx -m31
19346 @opindex m64
19347 @opindex m31
19348 When @option{-m31} is specified, generate code compliant to the
19349 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
19350 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
19351 particular to generate 64-bit instructions.  For the @samp{s390}
19352 targets, the default is @option{-m31}, while the @samp{s390x}
19353 targets default to @option{-m64}.
19355 @item -mzarch
19356 @itemx -mesa
19357 @opindex mzarch
19358 @opindex mesa
19359 When @option{-mzarch} is specified, generate code using the
19360 instructions available on z/Architecture.
19361 When @option{-mesa} is specified, generate code using the
19362 instructions available on ESA/390.  Note that @option{-mesa} is
19363 not possible with @option{-m64}.
19364 When generating code compliant to the GNU/Linux for S/390 ABI,
19365 the default is @option{-mesa}.  When generating code compliant
19366 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
19368 @item -mmvcle
19369 @itemx -mno-mvcle
19370 @opindex mmvcle
19371 @opindex mno-mvcle
19372 Generate (or do not generate) code using the @code{mvcle} instruction
19373 to perform block moves.  When @option{-mno-mvcle} is specified,
19374 use a @code{mvc} loop instead.  This is the default unless optimizing for
19375 size.
19377 @item -mdebug
19378 @itemx -mno-debug
19379 @opindex mdebug
19380 @opindex mno-debug
19381 Print (or do not print) additional debug information when compiling.
19382 The default is to not print debug information.
19384 @item -march=@var{cpu-type}
19385 @opindex march
19386 Generate code that runs on @var{cpu-type}, which is the name of a system
19387 representing a certain processor type.  Possible values for
19388 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
19389 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
19390 When generating code using the instructions available on z/Architecture,
19391 the default is @option{-march=z900}.  Otherwise, the default is
19392 @option{-march=g5}.
19394 @item -mtune=@var{cpu-type}
19395 @opindex mtune
19396 Tune to @var{cpu-type} everything applicable about the generated code,
19397 except for the ABI and the set of available instructions.
19398 The list of @var{cpu-type} values is the same as for @option{-march}.
19399 The default is the value used for @option{-march}.
19401 @item -mtpf-trace
19402 @itemx -mno-tpf-trace
19403 @opindex mtpf-trace
19404 @opindex mno-tpf-trace
19405 Generate code that adds (does not add) in TPF OS specific branches to trace
19406 routines in the operating system.  This option is off by default, even
19407 when compiling for the TPF OS@.
19409 @item -mfused-madd
19410 @itemx -mno-fused-madd
19411 @opindex mfused-madd
19412 @opindex mno-fused-madd
19413 Generate code that uses (does not use) the floating-point multiply and
19414 accumulate instructions.  These instructions are generated by default if
19415 hardware floating point is used.
19417 @item -mwarn-framesize=@var{framesize}
19418 @opindex mwarn-framesize
19419 Emit a warning if the current function exceeds the given frame size.  Because
19420 this is a compile-time check it doesn't need to be a real problem when the program
19421 runs.  It is intended to identify functions that most probably cause
19422 a stack overflow.  It is useful to be used in an environment with limited stack
19423 size e.g.@: the linux kernel.
19425 @item -mwarn-dynamicstack
19426 @opindex mwarn-dynamicstack
19427 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
19428 arrays.  This is generally a bad idea with a limited stack size.
19430 @item -mstack-guard=@var{stack-guard}
19431 @itemx -mstack-size=@var{stack-size}
19432 @opindex mstack-guard
19433 @opindex mstack-size
19434 If these options are provided the S/390 back end emits additional instructions in
19435 the function prologue that trigger a trap if the stack size is @var{stack-guard}
19436 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
19437 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
19438 the frame size of the compiled function is chosen.
19439 These options are intended to be used to help debugging stack overflow problems.
19440 The additionally emitted code causes only little overhead and hence can also be
19441 used in production-like systems without greater performance degradation.  The given
19442 values have to be exact powers of 2 and @var{stack-size} has to be greater than
19443 @var{stack-guard} without exceeding 64k.
19444 In order to be efficient the extra code makes the assumption that the stack starts
19445 at an address aligned to the value given by @var{stack-size}.
19446 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
19447 @end table
19449 @node Score Options
19450 @subsection Score Options
19451 @cindex Score Options
19453 These options are defined for Score implementations:
19455 @table @gcctabopt
19456 @item -meb
19457 @opindex meb
19458 Compile code for big-endian mode.  This is the default.
19460 @item -mel
19461 @opindex mel
19462 Compile code for little-endian mode.
19464 @item -mnhwloop
19465 @opindex mnhwloop
19466 Disable generation of @code{bcnz} instructions.
19468 @item -muls
19469 @opindex muls
19470 Enable generation of unaligned load and store instructions.
19472 @item -mmac
19473 @opindex mmac
19474 Enable the use of multiply-accumulate instructions. Disabled by default.
19476 @item -mscore5
19477 @opindex mscore5
19478 Specify the SCORE5 as the target architecture.
19480 @item -mscore5u
19481 @opindex mscore5u
19482 Specify the SCORE5U of the target architecture.
19484 @item -mscore7
19485 @opindex mscore7
19486 Specify the SCORE7 as the target architecture. This is the default.
19488 @item -mscore7d
19489 @opindex mscore7d
19490 Specify the SCORE7D as the target architecture.
19491 @end table
19493 @node SH Options
19494 @subsection SH Options
19496 These @samp{-m} options are defined for the SH implementations:
19498 @table @gcctabopt
19499 @item -m1
19500 @opindex m1
19501 Generate code for the SH1.
19503 @item -m2
19504 @opindex m2
19505 Generate code for the SH2.
19507 @item -m2e
19508 Generate code for the SH2e.
19510 @item -m2a-nofpu
19511 @opindex m2a-nofpu
19512 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
19513 that the floating-point unit is not used.
19515 @item -m2a-single-only
19516 @opindex m2a-single-only
19517 Generate code for the SH2a-FPU, in such a way that no double-precision
19518 floating-point operations are used.
19520 @item -m2a-single
19521 @opindex m2a-single
19522 Generate code for the SH2a-FPU assuming the floating-point unit is in
19523 single-precision mode by default.
19525 @item -m2a
19526 @opindex m2a
19527 Generate code for the SH2a-FPU assuming the floating-point unit is in
19528 double-precision mode by default.
19530 @item -m3
19531 @opindex m3
19532 Generate code for the SH3.
19534 @item -m3e
19535 @opindex m3e
19536 Generate code for the SH3e.
19538 @item -m4-nofpu
19539 @opindex m4-nofpu
19540 Generate code for the SH4 without a floating-point unit.
19542 @item -m4-single-only
19543 @opindex m4-single-only
19544 Generate code for the SH4 with a floating-point unit that only
19545 supports single-precision arithmetic.
19547 @item -m4-single
19548 @opindex m4-single
19549 Generate code for the SH4 assuming the floating-point unit is in
19550 single-precision mode by default.
19552 @item -m4
19553 @opindex m4
19554 Generate code for the SH4.
19556 @item -m4a-nofpu
19557 @opindex m4a-nofpu
19558 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
19559 floating-point unit is not used.
19561 @item -m4a-single-only
19562 @opindex m4a-single-only
19563 Generate code for the SH4a, in such a way that no double-precision
19564 floating-point operations are used.
19566 @item -m4a-single
19567 @opindex m4a-single
19568 Generate code for the SH4a assuming the floating-point unit is in
19569 single-precision mode by default.
19571 @item -m4a
19572 @opindex m4a
19573 Generate code for the SH4a.
19575 @item -m4al
19576 @opindex m4al
19577 Same as @option{-m4a-nofpu}, except that it implicitly passes
19578 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
19579 instructions at the moment.
19581 @item -mb
19582 @opindex mb
19583 Compile code for the processor in big-endian mode.
19585 @item -ml
19586 @opindex ml
19587 Compile code for the processor in little-endian mode.
19589 @item -mdalign
19590 @opindex mdalign
19591 Align doubles at 64-bit boundaries.  Note that this changes the calling
19592 conventions, and thus some functions from the standard C library do
19593 not work unless you recompile it first with @option{-mdalign}.
19595 @item -mrelax
19596 @opindex mrelax
19597 Shorten some address references at link time, when possible; uses the
19598 linker option @option{-relax}.
19600 @item -mbigtable
19601 @opindex mbigtable
19602 Use 32-bit offsets in @code{switch} tables.  The default is to use
19603 16-bit offsets.
19605 @item -mbitops
19606 @opindex mbitops
19607 Enable the use of bit manipulation instructions on SH2A.
19609 @item -mfmovd
19610 @opindex mfmovd
19611 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
19612 alignment constraints.
19614 @item -mhitachi
19615 @opindex mhitachi
19616 Comply with the calling conventions defined by Renesas.
19618 @item -mrenesas
19619 @opindex mhitachi
19620 Comply with the calling conventions defined by Renesas.
19622 @item -mno-renesas
19623 @opindex mhitachi
19624 Comply with the calling conventions defined for GCC before the Renesas
19625 conventions were available.  This option is the default for all
19626 targets of the SH toolchain.
19628 @item -mnomacsave
19629 @opindex mnomacsave
19630 Mark the @code{MAC} register as call-clobbered, even if
19631 @option{-mhitachi} is given.
19633 @item -mieee
19634 @itemx -mno-ieee
19635 @opindex mieee
19636 @opindex mnoieee
19637 Control the IEEE compliance of floating-point comparisons, which affects the
19638 handling of cases where the result of a comparison is unordered.  By default
19639 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
19640 enabled @option{-mno-ieee} is implicitly set, which results in faster
19641 floating-point greater-equal and less-equal comparisons.  The implcit settings
19642 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
19644 @item -minline-ic_invalidate
19645 @opindex minline-ic_invalidate
19646 Inline code to invalidate instruction cache entries after setting up
19647 nested function trampolines.
19648 This option has no effect if @option{-musermode} is in effect and the selected
19649 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
19650 instruction.
19651 If the selected code generation option does not allow the use of the @code{icbi}
19652 instruction, and @option{-musermode} is not in effect, the inlined code
19653 manipulates the instruction cache address array directly with an associative
19654 write.  This not only requires privileged mode at run time, but it also
19655 fails if the cache line had been mapped via the TLB and has become unmapped.
19657 @item -misize
19658 @opindex misize
19659 Dump instruction size and location in the assembly code.
19661 @item -mpadstruct
19662 @opindex mpadstruct
19663 This option is deprecated.  It pads structures to multiple of 4 bytes,
19664 which is incompatible with the SH ABI@.
19666 @item -matomic-model=@var{model}
19667 @opindex matomic-model=@var{model}
19668 Sets the model of atomic operations and additional parameters as a comma
19669 separated list.  For details on the atomic built-in functions see
19670 @ref{__atomic Builtins}.  The following models and parameters are supported:
19672 @table @samp
19674 @item none
19675 Disable compiler generated atomic sequences and emit library calls for atomic
19676 operations.  This is the default if the target is not @code{sh-*-linux*}.
19678 @item soft-gusa
19679 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
19680 built-in functions.  The generated atomic sequences require additional support
19681 from the interrupt/exception handling code of the system and are only suitable
19682 for SH3* and SH4* single-core systems.  This option is enabled by default when
19683 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
19684 this option will also partially utilize the hardware atomic instructions
19685 @code{movli.l} and @code{movco.l} to create more efficient code, unless
19686 @samp{strict} is specified.  
19688 @item soft-tcb
19689 Generate software atomic sequences that use a variable in the thread control
19690 block.  This is a variation of the gUSA sequences which can also be used on
19691 SH1* and SH2* targets.  The generated atomic sequences require additional
19692 support from the interrupt/exception handling code of the system and are only
19693 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
19694 parameter has to be specified as well.
19696 @item soft-imask
19697 Generate software atomic sequences that temporarily disable interrupts by
19698 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
19699 in privileged mode and is only suitable for single-core systems.  Additional
19700 support from the interrupt/exception handling code of the system is not
19701 required.  This model is enabled by default when the target is
19702 @code{sh-*-linux*} and SH1* or SH2*.
19704 @item hard-llcs
19705 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
19706 instructions only.  This is only available on SH4A and is suitable for
19707 multi-core systems.  Since the hardware instructions support only 32 bit atomic
19708 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
19709 Code compiled with this option will also be compatible with other software
19710 atomic model interrupt/exception handling systems if executed on an SH4A
19711 system.  Additional support from the interrupt/exception handling code of the
19712 system is not required for this model.
19714 @item gbr-offset=
19715 This parameter specifies the offset in bytes of the variable in the thread
19716 control block structure that should be used by the generated atomic sequences
19717 when the @samp{soft-tcb} model has been selected.  For other models this
19718 parameter is ignored.  The specified value must be an integer multiple of four
19719 and in the range 0-1020.
19721 @item strict
19722 This parameter prevents mixed usage of multiple atomic models, even though they
19723 would be compatible, and will make the compiler generate atomic sequences of the
19724 specified model only.
19726 @end table
19728 @item -mtas
19729 @opindex mtas
19730 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
19731 Notice that depending on the particular hardware and software configuration
19732 this can degrade overall performance due to the operand cache line flushes
19733 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
19734 processors the @code{tas.b} instruction must be used with caution since it
19735 can result in data corruption for certain cache configurations.
19737 @item -mspace
19738 @opindex mspace
19739 Optimize for space instead of speed.  Implied by @option{-Os}.
19741 @item -mprefergot
19742 @opindex mprefergot
19743 When generating position-independent code, emit function calls using
19744 the Global Offset Table instead of the Procedure Linkage Table.
19746 @item -musermode
19747 @opindex musermode
19748 Don't generate privileged mode only code.  This option
19749 implies @option{-mno-inline-ic_invalidate}
19750 if the inlined code would not work in user mode.
19751 This is the default when the target is @code{sh-*-linux*}.
19753 @item -multcost=@var{number}
19754 @opindex multcost=@var{number}
19755 Set the cost to assume for a multiply insn.
19757 @item -mdiv=@var{strategy}
19758 @opindex mdiv=@var{strategy}
19759 Set the division strategy to be used for integer division operations.
19760 For SHmedia @var{strategy} can be one of: 
19762 @table @samp
19764 @item fp 
19765 Performs the operation in floating point.  This has a very high latency,
19766 but needs only a few instructions, so it might be a good choice if
19767 your code has enough easily-exploitable ILP to allow the compiler to
19768 schedule the floating-point instructions together with other instructions.
19769 Division by zero causes a floating-point exception.
19771 @item inv
19772 Uses integer operations to calculate the inverse of the divisor,
19773 and then multiplies the dividend with the inverse.  This strategy allows
19774 CSE and hoisting of the inverse calculation.  Division by zero calculates
19775 an unspecified result, but does not trap.
19777 @item inv:minlat
19778 A variant of @samp{inv} where, if no CSE or hoisting opportunities
19779 have been found, or if the entire operation has been hoisted to the same
19780 place, the last stages of the inverse calculation are intertwined with the
19781 final multiply to reduce the overall latency, at the expense of using a few
19782 more instructions, and thus offering fewer scheduling opportunities with
19783 other code.
19785 @item call
19786 Calls a library function that usually implements the @samp{inv:minlat}
19787 strategy.
19788 This gives high code density for @code{m5-*media-nofpu} compilations.
19790 @item call2
19791 Uses a different entry point of the same library function, where it
19792 assumes that a pointer to a lookup table has already been set up, which
19793 exposes the pointer load to CSE and code hoisting optimizations.
19795 @item inv:call
19796 @itemx inv:call2
19797 @itemx inv:fp
19798 Use the @samp{inv} algorithm for initial
19799 code generation, but if the code stays unoptimized, revert to the @samp{call},
19800 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
19801 potentially-trapping side effect of division by zero is carried by a
19802 separate instruction, so it is possible that all the integer instructions
19803 are hoisted out, but the marker for the side effect stays where it is.
19804 A recombination to floating-point operations or a call is not possible
19805 in that case.
19807 @item inv20u
19808 @itemx inv20l
19809 Variants of the @samp{inv:minlat} strategy.  In the case
19810 that the inverse calculation is not separated from the multiply, they speed
19811 up division where the dividend fits into 20 bits (plus sign where applicable)
19812 by inserting a test to skip a number of operations in this case; this test
19813 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
19814 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
19816 @end table
19818 For targets other than SHmedia @var{strategy} can be one of:
19820 @table @samp
19822 @item call-div1
19823 Calls a library function that uses the single-step division instruction
19824 @code{div1} to perform the operation.  Division by zero calculates an
19825 unspecified result and does not trap.  This is the default except for SH4,
19826 SH2A and SHcompact.
19828 @item call-fp
19829 Calls a library function that performs the operation in double precision
19830 floating point.  Division by zero causes a floating-point exception.  This is
19831 the default for SHcompact with FPU.  Specifying this for targets that do not
19832 have a double precision FPU will default to @code{call-div1}.
19834 @item call-table
19835 Calls a library function that uses a lookup table for small divisors and
19836 the @code{div1} instruction with case distinction for larger divisors.  Division
19837 by zero calculates an unspecified result and does not trap.  This is the default
19838 for SH4.  Specifying this for targets that do not have dynamic shift
19839 instructions will default to @code{call-div1}.
19841 @end table
19843 When a division strategy has not been specified the default strategy will be
19844 selected based on the current target.  For SH2A the default strategy is to
19845 use the @code{divs} and @code{divu} instructions instead of library function
19846 calls.
19848 @item -maccumulate-outgoing-args
19849 @opindex maccumulate-outgoing-args
19850 Reserve space once for outgoing arguments in the function prologue rather
19851 than around each call.  Generally beneficial for performance and size.  Also
19852 needed for unwinding to avoid changing the stack frame around conditional code.
19854 @item -mdivsi3_libfunc=@var{name}
19855 @opindex mdivsi3_libfunc=@var{name}
19856 Set the name of the library function used for 32-bit signed division to
19857 @var{name}.
19858 This only affects the name used in the @samp{call} and @samp{inv:call}
19859 division strategies, and the compiler still expects the same
19860 sets of input/output/clobbered registers as if this option were not present.
19862 @item -mfixed-range=@var{register-range}
19863 @opindex mfixed-range
19864 Generate code treating the given register range as fixed registers.
19865 A fixed register is one that the register allocator can not use.  This is
19866 useful when compiling kernel code.  A register range is specified as
19867 two registers separated by a dash.  Multiple register ranges can be
19868 specified separated by a comma.
19870 @item -mindexed-addressing
19871 @opindex mindexed-addressing
19872 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
19873 This is only safe if the hardware and/or OS implement 32-bit wrap-around
19874 semantics for the indexed addressing mode.  The architecture allows the
19875 implementation of processors with 64-bit MMU, which the OS could use to
19876 get 32-bit addressing, but since no current hardware implementation supports
19877 this or any other way to make the indexed addressing mode safe to use in
19878 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
19880 @item -mgettrcost=@var{number}
19881 @opindex mgettrcost=@var{number}
19882 Set the cost assumed for the @code{gettr} instruction to @var{number}.
19883 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
19885 @item -mpt-fixed
19886 @opindex mpt-fixed
19887 Assume @code{pt*} instructions won't trap.  This generally generates
19888 better-scheduled code, but is unsafe on current hardware.
19889 The current architecture
19890 definition says that @code{ptabs} and @code{ptrel} trap when the target 
19891 anded with 3 is 3.
19892 This has the unintentional effect of making it unsafe to schedule these
19893 instructions before a branch, or hoist them out of a loop.  For example,
19894 @code{__do_global_ctors}, a part of @file{libgcc}
19895 that runs constructors at program
19896 startup, calls functions in a list which is delimited by @minus{}1.  With the
19897 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
19898 That means that all the constructors run a bit more quickly, but when
19899 the loop comes to the end of the list, the program crashes because @code{ptabs}
19900 loads @minus{}1 into a target register.  
19902 Since this option is unsafe for any
19903 hardware implementing the current architecture specification, the default
19904 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
19905 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
19906 this deters register allocation from using target registers for storing
19907 ordinary integers.
19909 @item -minvalid-symbols
19910 @opindex minvalid-symbols
19911 Assume symbols might be invalid.  Ordinary function symbols generated by
19912 the compiler are always valid to load with
19913 @code{movi}/@code{shori}/@code{ptabs} or
19914 @code{movi}/@code{shori}/@code{ptrel},
19915 but with assembler and/or linker tricks it is possible
19916 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
19917 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
19918 It prevents cross-basic-block CSE, hoisting and most scheduling
19919 of symbol loads.  The default is @option{-mno-invalid-symbols}.
19921 @item -mbranch-cost=@var{num}
19922 @opindex mbranch-cost=@var{num}
19923 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
19924 make the compiler try to generate more branch-free code if possible.  
19925 If not specified the value is selected depending on the processor type that
19926 is being compiled for.
19928 @item -mzdcbranch
19929 @itemx -mno-zdcbranch
19930 @opindex mzdcbranch
19931 @opindex mno-zdcbranch
19932 Assume (do not assume) that zero displacement conditional branch instructions
19933 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
19934 compiler will try to prefer zero displacement branch code sequences.  This is
19935 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
19936 disabled by specifying @option{-mno-zdcbranch}.
19938 @item -mcbranchdi
19939 @opindex mcbranchdi
19940 Enable the @code{cbranchdi4} instruction pattern.
19942 @item -mcmpeqdi
19943 @opindex mcmpeqdi
19944 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
19945 is in effect.
19947 @item -mfused-madd
19948 @itemx -mno-fused-madd
19949 @opindex mfused-madd
19950 @opindex mno-fused-madd
19951 Generate code that uses (does not use) the floating-point multiply and
19952 accumulate instructions.  These instructions are generated by default
19953 if hardware floating point is used.  The machine-dependent
19954 @option{-mfused-madd} option is now mapped to the machine-independent
19955 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19956 mapped to @option{-ffp-contract=off}.
19958 @item -mfsca
19959 @itemx -mno-fsca
19960 @opindex mfsca
19961 @opindex mno-fsca
19962 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
19963 and cosine approximations.  The option @code{-mfsca} must be used in
19964 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
19965 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
19966 approximations even if @code{-funsafe-math-optimizations} is in effect.
19968 @item -mfsrra
19969 @itemx -mno-fsrra
19970 @opindex mfsrra
19971 @opindex mno-fsrra
19972 Allow or disallow the compiler to emit the @code{fsrra} instruction for
19973 reciprocal square root approximations.  The option @code{-mfsrra} must be used
19974 in combination with @code{-funsafe-math-optimizations} and
19975 @code{-ffinite-math-only}.  It is enabled by default when generating code for
19976 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
19977 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
19978 in effect.
19980 @item -mpretend-cmove
19981 @opindex mpretend-cmove
19982 Prefer zero-displacement conditional branches for conditional move instruction
19983 patterns.  This can result in faster code on the SH4 processor.
19985 @end table
19987 @node Solaris 2 Options
19988 @subsection Solaris 2 Options
19989 @cindex Solaris 2 options
19991 These @samp{-m} options are supported on Solaris 2:
19993 @table @gcctabopt
19994 @item -mimpure-text
19995 @opindex mimpure-text
19996 @option{-mimpure-text}, used in addition to @option{-shared}, tells
19997 the compiler to not pass @option{-z text} to the linker when linking a
19998 shared object.  Using this option, you can link position-dependent
19999 code into a shared object.
20001 @option{-mimpure-text} suppresses the ``relocations remain against
20002 allocatable but non-writable sections'' linker error message.
20003 However, the necessary relocations trigger copy-on-write, and the
20004 shared object is not actually shared across processes.  Instead of
20005 using @option{-mimpure-text}, you should compile all source code with
20006 @option{-fpic} or @option{-fPIC}.
20008 @end table
20010 These switches are supported in addition to the above on Solaris 2:
20012 @table @gcctabopt
20013 @item -pthreads
20014 @opindex pthreads
20015 Add support for multithreading using the POSIX threads library.  This
20016 option sets flags for both the preprocessor and linker.  This option does
20017 not affect the thread safety of object code produced  by the compiler or
20018 that of libraries supplied with it.
20020 @item -pthread
20021 @opindex pthread
20022 This is a synonym for @option{-pthreads}.
20023 @end table
20025 @node SPARC Options
20026 @subsection SPARC Options
20027 @cindex SPARC options
20029 These @samp{-m} options are supported on the SPARC:
20031 @table @gcctabopt
20032 @item -mno-app-regs
20033 @itemx -mapp-regs
20034 @opindex mno-app-regs
20035 @opindex mapp-regs
20036 Specify @option{-mapp-regs} to generate output using the global registers
20037 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
20038 is the default.
20040 To be fully SVR4 ABI-compliant at the cost of some performance loss,
20041 specify @option{-mno-app-regs}.  You should compile libraries and system
20042 software with this option.
20044 @item -mflat
20045 @itemx -mno-flat
20046 @opindex mflat
20047 @opindex mno-flat
20048 With @option{-mflat}, the compiler does not generate save/restore instructions
20049 and uses a ``flat'' or single register window model.  This model is compatible
20050 with the regular register window model.  The local registers and the input
20051 registers (0--5) are still treated as ``call-saved'' registers and are
20052 saved on the stack as needed.
20054 With @option{-mno-flat} (the default), the compiler generates save/restore
20055 instructions (except for leaf functions).  This is the normal operating mode.
20057 @item -mfpu
20058 @itemx -mhard-float
20059 @opindex mfpu
20060 @opindex mhard-float
20061 Generate output containing floating-point instructions.  This is the
20062 default.
20064 @item -mno-fpu
20065 @itemx -msoft-float
20066 @opindex mno-fpu
20067 @opindex msoft-float
20068 Generate output containing library calls for floating point.
20069 @strong{Warning:} the requisite libraries are not available for all SPARC
20070 targets.  Normally the facilities of the machine's usual C compiler are
20071 used, but this cannot be done directly in cross-compilation.  You must make
20072 your own arrangements to provide suitable library functions for
20073 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
20074 @samp{sparclite-*-*} do provide software floating-point support.
20076 @option{-msoft-float} changes the calling convention in the output file;
20077 therefore, it is only useful if you compile @emph{all} of a program with
20078 this option.  In particular, you need to compile @file{libgcc.a}, the
20079 library that comes with GCC, with @option{-msoft-float} in order for
20080 this to work.
20082 @item -mhard-quad-float
20083 @opindex mhard-quad-float
20084 Generate output containing quad-word (long double) floating-point
20085 instructions.
20087 @item -msoft-quad-float
20088 @opindex msoft-quad-float
20089 Generate output containing library calls for quad-word (long double)
20090 floating-point instructions.  The functions called are those specified
20091 in the SPARC ABI@.  This is the default.
20093 As of this writing, there are no SPARC implementations that have hardware
20094 support for the quad-word floating-point instructions.  They all invoke
20095 a trap handler for one of these instructions, and then the trap handler
20096 emulates the effect of the instruction.  Because of the trap handler overhead,
20097 this is much slower than calling the ABI library routines.  Thus the
20098 @option{-msoft-quad-float} option is the default.
20100 @item -mno-unaligned-doubles
20101 @itemx -munaligned-doubles
20102 @opindex mno-unaligned-doubles
20103 @opindex munaligned-doubles
20104 Assume that doubles have 8-byte alignment.  This is the default.
20106 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
20107 alignment only if they are contained in another type, or if they have an
20108 absolute address.  Otherwise, it assumes they have 4-byte alignment.
20109 Specifying this option avoids some rare compatibility problems with code
20110 generated by other compilers.  It is not the default because it results
20111 in a performance loss, especially for floating-point code.
20113 @item -mno-faster-structs
20114 @itemx -mfaster-structs
20115 @opindex mno-faster-structs
20116 @opindex mfaster-structs
20117 With @option{-mfaster-structs}, the compiler assumes that structures
20118 should have 8-byte alignment.  This enables the use of pairs of
20119 @code{ldd} and @code{std} instructions for copies in structure
20120 assignment, in place of twice as many @code{ld} and @code{st} pairs.
20121 However, the use of this changed alignment directly violates the SPARC
20122 ABI@.  Thus, it's intended only for use on targets where the developer
20123 acknowledges that their resulting code is not directly in line with
20124 the rules of the ABI@.
20126 @item -mcpu=@var{cpu_type}
20127 @opindex mcpu
20128 Set the instruction set, register set, and instruction scheduling parameters
20129 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
20130 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
20131 @samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934},
20132 @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
20133 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
20134 @samp{niagara3} and @samp{niagara4}.
20136 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
20137 which selects the best architecture option for the host processor.
20138 @option{-mcpu=native} has no effect if GCC does not recognize
20139 the processor.
20141 Default instruction scheduling parameters are used for values that select
20142 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
20143 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
20145 Here is a list of each supported architecture and their supported
20146 implementations.
20148 @table @asis
20149 @item v7
20150 cypress
20152 @item v8
20153 supersparc, hypersparc, leon, leon3
20155 @item sparclite
20156 f930, f934, sparclite86x
20158 @item sparclet
20159 tsc701
20161 @item v9
20162 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
20163 @end table
20165 By default (unless configured otherwise), GCC generates code for the V7
20166 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
20167 additionally optimizes it for the Cypress CY7C602 chip, as used in the
20168 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
20169 SPARCStation 1, 2, IPX etc.
20171 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
20172 architecture.  The only difference from V7 code is that the compiler emits
20173 the integer multiply and integer divide instructions which exist in SPARC-V8
20174 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
20175 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
20176 2000 series.
20178 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
20179 the SPARC architecture.  This adds the integer multiply, integer divide step
20180 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
20181 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
20182 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
20183 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
20184 MB86934 chip, which is the more recent SPARClite with FPU@.
20186 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
20187 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
20188 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
20189 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
20190 optimizes it for the TEMIC SPARClet chip.
20192 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
20193 architecture.  This adds 64-bit integer and floating-point move instructions,
20194 3 additional floating-point condition code registers and conditional move
20195 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
20196 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
20197 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
20198 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
20199 @option{-mcpu=niagara}, the compiler additionally optimizes it for
20200 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
20201 additionally optimizes it for Sun UltraSPARC T2 chips. With
20202 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
20203 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
20204 additionally optimizes it for Sun UltraSPARC T4 chips.
20206 @item -mtune=@var{cpu_type}
20207 @opindex mtune
20208 Set the instruction scheduling parameters for machine type
20209 @var{cpu_type}, but do not set the instruction set or register set that the
20210 option @option{-mcpu=@var{cpu_type}} does.
20212 The same values for @option{-mcpu=@var{cpu_type}} can be used for
20213 @option{-mtune=@var{cpu_type}}, but the only useful values are those
20214 that select a particular CPU implementation.  Those are @samp{cypress},
20215 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930},
20216 @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
20217 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and
20218 @samp{niagara4}.  With native Solaris and GNU/Linux toolchains, @samp{native}
20219 can also be used.
20221 @item -mv8plus
20222 @itemx -mno-v8plus
20223 @opindex mv8plus
20224 @opindex mno-v8plus
20225 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
20226 difference from the V8 ABI is that the global and out registers are
20227 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
20228 mode for all SPARC-V9 processors.
20230 @item -mvis
20231 @itemx -mno-vis
20232 @opindex mvis
20233 @opindex mno-vis
20234 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
20235 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
20237 @item -mvis2
20238 @itemx -mno-vis2
20239 @opindex mvis2
20240 @opindex mno-vis2
20241 With @option{-mvis2}, GCC generates code that takes advantage of
20242 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
20243 default is @option{-mvis2} when targeting a cpu that supports such
20244 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
20245 also sets @option{-mvis}.
20247 @item -mvis3
20248 @itemx -mno-vis3
20249 @opindex mvis3
20250 @opindex mno-vis3
20251 With @option{-mvis3}, GCC generates code that takes advantage of
20252 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
20253 default is @option{-mvis3} when targeting a cpu that supports such
20254 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
20255 also sets @option{-mvis2} and @option{-mvis}.
20257 @item -mcbcond
20258 @itemx -mno-cbcond
20259 @opindex mcbcond
20260 @opindex mno-cbcond
20261 With @option{-mcbcond}, GCC generates code that takes advantage of
20262 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
20263 The default is @option{-mcbcond} when targeting a cpu that supports such
20264 instructions, such as niagara-4 and later.
20266 @item -mpopc
20267 @itemx -mno-popc
20268 @opindex mpopc
20269 @opindex mno-popc
20270 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
20271 population count instruction.  The default is @option{-mpopc}
20272 when targeting a cpu that supports such instructions, such as Niagara-2 and
20273 later.
20275 @item -mfmaf
20276 @itemx -mno-fmaf
20277 @opindex mfmaf
20278 @opindex mno-fmaf
20279 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
20280 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
20281 when targeting a cpu that supports such instructions, such as Niagara-3 and
20282 later.
20284 @item -mfix-at697f
20285 @opindex mfix-at697f
20286 Enable the documented workaround for the single erratum of the Atmel AT697F
20287 processor (which corresponds to erratum #13 of the AT697E processor).
20289 @item -mfix-ut699
20290 @opindex mfix-ut699
20291 Enable the documented workarounds for the floating-point errata and the data
20292 cache nullify errata of the UT699 processor.
20293 @end table
20295 These @samp{-m} options are supported in addition to the above
20296 on SPARC-V9 processors in 64-bit environments:
20298 @table @gcctabopt
20299 @item -m32
20300 @itemx -m64
20301 @opindex m32
20302 @opindex m64
20303 Generate code for a 32-bit or 64-bit environment.
20304 The 32-bit environment sets int, long and pointer to 32 bits.
20305 The 64-bit environment sets int to 32 bits and long and pointer
20306 to 64 bits.
20308 @item -mcmodel=@var{which}
20309 @opindex mcmodel
20310 Set the code model to one of
20312 @table @samp
20313 @item medlow
20314 The Medium/Low code model: 64-bit addresses, programs
20315 must be linked in the low 32 bits of memory.  Programs can be statically
20316 or dynamically linked.
20318 @item medmid
20319 The Medium/Middle code model: 64-bit addresses, programs
20320 must be linked in the low 44 bits of memory, the text and data segments must
20321 be less than 2GB in size and the data segment must be located within 2GB of
20322 the text segment.
20324 @item medany
20325 The Medium/Anywhere code model: 64-bit addresses, programs
20326 may be linked anywhere in memory, the text and data segments must be less
20327 than 2GB in size and the data segment must be located within 2GB of the
20328 text segment.
20330 @item embmedany
20331 The Medium/Anywhere code model for embedded systems:
20332 64-bit addresses, the text and data segments must be less than 2GB in
20333 size, both starting anywhere in memory (determined at link time).  The
20334 global register %g4 points to the base of the data segment.  Programs
20335 are statically linked and PIC is not supported.
20336 @end table
20338 @item -mmemory-model=@var{mem-model}
20339 @opindex mmemory-model
20340 Set the memory model in force on the processor to one of
20342 @table @samp
20343 @item default
20344 The default memory model for the processor and operating system.
20346 @item rmo
20347 Relaxed Memory Order
20349 @item pso
20350 Partial Store Order
20352 @item tso
20353 Total Store Order
20355 @item sc
20356 Sequential Consistency
20357 @end table
20359 These memory models are formally defined in Appendix D of the Sparc V9
20360 architecture manual, as set in the processor's @code{PSTATE.MM} field.
20362 @item -mstack-bias
20363 @itemx -mno-stack-bias
20364 @opindex mstack-bias
20365 @opindex mno-stack-bias
20366 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
20367 frame pointer if present, are offset by @minus{}2047 which must be added back
20368 when making stack frame references.  This is the default in 64-bit mode.
20369 Otherwise, assume no such offset is present.
20370 @end table
20372 @node SPU Options
20373 @subsection SPU Options
20374 @cindex SPU options
20376 These @samp{-m} options are supported on the SPU:
20378 @table @gcctabopt
20379 @item -mwarn-reloc
20380 @itemx -merror-reloc
20381 @opindex mwarn-reloc
20382 @opindex merror-reloc
20384 The loader for SPU does not handle dynamic relocations.  By default, GCC
20385 gives an error when it generates code that requires a dynamic
20386 relocation.  @option{-mno-error-reloc} disables the error,
20387 @option{-mwarn-reloc} generates a warning instead.
20389 @item -msafe-dma
20390 @itemx -munsafe-dma
20391 @opindex msafe-dma
20392 @opindex munsafe-dma
20394 Instructions that initiate or test completion of DMA must not be
20395 reordered with respect to loads and stores of the memory that is being
20396 accessed.
20397 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
20398 memory accesses, but that can lead to inefficient code in places where the
20399 memory is known to not change.  Rather than mark the memory as volatile,
20400 you can use @option{-msafe-dma} to tell the compiler to treat
20401 the DMA instructions as potentially affecting all memory.  
20403 @item -mbranch-hints
20404 @opindex mbranch-hints
20406 By default, GCC generates a branch hint instruction to avoid
20407 pipeline stalls for always-taken or probably-taken branches.  A hint
20408 is not generated closer than 8 instructions away from its branch.
20409 There is little reason to disable them, except for debugging purposes,
20410 or to make an object a little bit smaller.
20412 @item -msmall-mem
20413 @itemx -mlarge-mem
20414 @opindex msmall-mem
20415 @opindex mlarge-mem
20417 By default, GCC generates code assuming that addresses are never larger
20418 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
20419 a full 32-bit address.
20421 @item -mstdmain
20422 @opindex mstdmain
20424 By default, GCC links against startup code that assumes the SPU-style
20425 main function interface (which has an unconventional parameter list).
20426 With @option{-mstdmain}, GCC links your program against startup
20427 code that assumes a C99-style interface to @code{main}, including a
20428 local copy of @code{argv} strings.
20430 @item -mfixed-range=@var{register-range}
20431 @opindex mfixed-range
20432 Generate code treating the given register range as fixed registers.
20433 A fixed register is one that the register allocator cannot use.  This is
20434 useful when compiling kernel code.  A register range is specified as
20435 two registers separated by a dash.  Multiple register ranges can be
20436 specified separated by a comma.
20438 @item -mea32
20439 @itemx -mea64
20440 @opindex mea32
20441 @opindex mea64
20442 Compile code assuming that pointers to the PPU address space accessed
20443 via the @code{__ea} named address space qualifier are either 32 or 64
20444 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
20445 all object code in an executable must be compiled with the same setting.
20447 @item -maddress-space-conversion
20448 @itemx -mno-address-space-conversion
20449 @opindex maddress-space-conversion
20450 @opindex mno-address-space-conversion
20451 Allow/disallow treating the @code{__ea} address space as superset
20452 of the generic address space.  This enables explicit type casts
20453 between @code{__ea} and generic pointer as well as implicit
20454 conversions of generic pointers to @code{__ea} pointers.  The
20455 default is to allow address space pointer conversions.
20457 @item -mcache-size=@var{cache-size}
20458 @opindex mcache-size
20459 This option controls the version of libgcc that the compiler links to an
20460 executable and selects a software-managed cache for accessing variables
20461 in the @code{__ea} address space with a particular cache size.  Possible
20462 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
20463 and @samp{128}.  The default cache size is 64KB.
20465 @item -matomic-updates
20466 @itemx -mno-atomic-updates
20467 @opindex matomic-updates
20468 @opindex mno-atomic-updates
20469 This option controls the version of libgcc that the compiler links to an
20470 executable and selects whether atomic updates to the software-managed
20471 cache of PPU-side variables are used.  If you use atomic updates, changes
20472 to a PPU variable from SPU code using the @code{__ea} named address space
20473 qualifier do not interfere with changes to other PPU variables residing
20474 in the same cache line from PPU code.  If you do not use atomic updates,
20475 such interference may occur; however, writing back cache lines is
20476 more efficient.  The default behavior is to use atomic updates.
20478 @item -mdual-nops
20479 @itemx -mdual-nops=@var{n}
20480 @opindex mdual-nops
20481 By default, GCC inserts nops to increase dual issue when it expects
20482 it to increase performance.  @var{n} can be a value from 0 to 10.  A
20483 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
20484 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
20486 @item -mhint-max-nops=@var{n}
20487 @opindex mhint-max-nops
20488 Maximum number of nops to insert for a branch hint.  A branch hint must
20489 be at least 8 instructions away from the branch it is affecting.  GCC
20490 inserts up to @var{n} nops to enforce this, otherwise it does not
20491 generate the branch hint.
20493 @item -mhint-max-distance=@var{n}
20494 @opindex mhint-max-distance
20495 The encoding of the branch hint instruction limits the hint to be within
20496 256 instructions of the branch it is affecting.  By default, GCC makes
20497 sure it is within 125.
20499 @item -msafe-hints
20500 @opindex msafe-hints
20501 Work around a hardware bug that causes the SPU to stall indefinitely.
20502 By default, GCC inserts the @code{hbrp} instruction to make sure
20503 this stall won't happen.
20505 @end table
20507 @node System V Options
20508 @subsection Options for System V
20510 These additional options are available on System V Release 4 for
20511 compatibility with other compilers on those systems:
20513 @table @gcctabopt
20514 @item -G
20515 @opindex G
20516 Create a shared object.
20517 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
20519 @item -Qy
20520 @opindex Qy
20521 Identify the versions of each tool used by the compiler, in a
20522 @code{.ident} assembler directive in the output.
20524 @item -Qn
20525 @opindex Qn
20526 Refrain from adding @code{.ident} directives to the output file (this is
20527 the default).
20529 @item -YP,@var{dirs}
20530 @opindex YP
20531 Search the directories @var{dirs}, and no others, for libraries
20532 specified with @option{-l}.
20534 @item -Ym,@var{dir}
20535 @opindex Ym
20536 Look in the directory @var{dir} to find the M4 preprocessor.
20537 The assembler uses this option.
20538 @c This is supposed to go with a -Yd for predefined M4 macro files, but
20539 @c the generic assembler that comes with Solaris takes just -Ym.
20540 @end table
20542 @node TILE-Gx Options
20543 @subsection TILE-Gx Options
20544 @cindex TILE-Gx options
20546 These @samp{-m} options are supported on the TILE-Gx:
20548 @table @gcctabopt
20549 @item -mcmodel=small
20550 @opindex mcmodel=small
20551 Generate code for the small model.  The distance for direct calls is
20552 limited to 500M in either direction.  PC-relative addresses are 32
20553 bits.  Absolute addresses support the full address range.
20555 @item -mcmodel=large
20556 @opindex mcmodel=large
20557 Generate code for the large model.  There is no limitation on call
20558 distance, pc-relative addresses, or absolute addresses.
20560 @item -mcpu=@var{name}
20561 @opindex mcpu
20562 Selects the type of CPU to be targeted.  Currently the only supported
20563 type is @samp{tilegx}.
20565 @item -m32
20566 @itemx -m64
20567 @opindex m32
20568 @opindex m64
20569 Generate code for a 32-bit or 64-bit environment.  The 32-bit
20570 environment sets int, long, and pointer to 32 bits.  The 64-bit
20571 environment sets int to 32 bits and long and pointer to 64 bits.
20572 @end table
20574 @node TILEPro Options
20575 @subsection TILEPro Options
20576 @cindex TILEPro options
20578 These @samp{-m} options are supported on the TILEPro:
20580 @table @gcctabopt
20581 @item -mcpu=@var{name}
20582 @opindex mcpu
20583 Selects the type of CPU to be targeted.  Currently the only supported
20584 type is @samp{tilepro}.
20586 @item -m32
20587 @opindex m32
20588 Generate code for a 32-bit environment, which sets int, long, and
20589 pointer to 32 bits.  This is the only supported behavior so the flag
20590 is essentially ignored.
20591 @end table
20593 @node V850 Options
20594 @subsection V850 Options
20595 @cindex V850 Options
20597 These @samp{-m} options are defined for V850 implementations:
20599 @table @gcctabopt
20600 @item -mlong-calls
20601 @itemx -mno-long-calls
20602 @opindex mlong-calls
20603 @opindex mno-long-calls
20604 Treat all calls as being far away (near).  If calls are assumed to be
20605 far away, the compiler always loads the function's address into a
20606 register, and calls indirect through the pointer.
20608 @item -mno-ep
20609 @itemx -mep
20610 @opindex mno-ep
20611 @opindex mep
20612 Do not optimize (do optimize) basic blocks that use the same index
20613 pointer 4 or more times to copy pointer into the @code{ep} register, and
20614 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
20615 option is on by default if you optimize.
20617 @item -mno-prolog-function
20618 @itemx -mprolog-function
20619 @opindex mno-prolog-function
20620 @opindex mprolog-function
20621 Do not use (do use) external functions to save and restore registers
20622 at the prologue and epilogue of a function.  The external functions
20623 are slower, but use less code space if more than one function saves
20624 the same number of registers.  The @option{-mprolog-function} option
20625 is on by default if you optimize.
20627 @item -mspace
20628 @opindex mspace
20629 Try to make the code as small as possible.  At present, this just turns
20630 on the @option{-mep} and @option{-mprolog-function} options.
20632 @item -mtda=@var{n}
20633 @opindex mtda
20634 Put static or global variables whose size is @var{n} bytes or less into
20635 the tiny data area that register @code{ep} points to.  The tiny data
20636 area can hold up to 256 bytes in total (128 bytes for byte references).
20638 @item -msda=@var{n}
20639 @opindex msda
20640 Put static or global variables whose size is @var{n} bytes or less into
20641 the small data area that register @code{gp} points to.  The small data
20642 area can hold up to 64 kilobytes.
20644 @item -mzda=@var{n}
20645 @opindex mzda
20646 Put static or global variables whose size is @var{n} bytes or less into
20647 the first 32 kilobytes of memory.
20649 @item -mv850
20650 @opindex mv850
20651 Specify that the target processor is the V850.
20653 @item -mv850e3v5
20654 @opindex mv850e3v5
20655 Specify that the target processor is the V850E3V5.  The preprocessor
20656 constant @samp{__v850e3v5__} is defined if this option is used.
20658 @item -mv850e2v4
20659 @opindex mv850e2v4
20660 Specify that the target processor is the V850E3V5.  This is an alias for
20661 the @option{-mv850e3v5} option.
20663 @item -mv850e2v3
20664 @opindex mv850e2v3
20665 Specify that the target processor is the V850E2V3.  The preprocessor
20666 constant @samp{__v850e2v3__} is defined if this option is used.
20668 @item -mv850e2
20669 @opindex mv850e2
20670 Specify that the target processor is the V850E2.  The preprocessor
20671 constant @samp{__v850e2__} is defined if this option is used.
20673 @item -mv850e1
20674 @opindex mv850e1
20675 Specify that the target processor is the V850E1.  The preprocessor
20676 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
20677 this option is used.
20679 @item -mv850es
20680 @opindex mv850es
20681 Specify that the target processor is the V850ES.  This is an alias for
20682 the @option{-mv850e1} option.
20684 @item -mv850e
20685 @opindex mv850e
20686 Specify that the target processor is the V850E@.  The preprocessor
20687 constant @samp{__v850e__} is defined if this option is used.
20689 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
20690 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
20691 are defined then a default target processor is chosen and the
20692 relevant @samp{__v850*__} preprocessor constant is defined.
20694 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
20695 defined, regardless of which processor variant is the target.
20697 @item -mdisable-callt
20698 @itemx -mno-disable-callt
20699 @opindex mdisable-callt
20700 @opindex mno-disable-callt
20701 This option suppresses generation of the @code{CALLT} instruction for the
20702 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
20703 architecture.
20705 This option is enabled by default when the RH850 ABI is
20706 in use (see @option{-mrh850-abi}), and disabled by default when the
20707 GCC ABI is in use.  If @code{CALLT} instructions are being generated
20708 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
20710 @item -mrelax
20711 @itemx -mno-relax
20712 @opindex mrelax
20713 @opindex mno-relax
20714 Pass on (or do not pass on) the @option{-mrelax} command line option
20715 to the assembler.
20717 @item -mlong-jumps
20718 @itemx -mno-long-jumps
20719 @opindex mlong-jumps
20720 @opindex mno-long-jumps
20721 Disable (or re-enable) the generation of PC-relative jump instructions.
20723 @item -msoft-float
20724 @itemx -mhard-float
20725 @opindex msoft-float
20726 @opindex mhard-float
20727 Disable (or re-enable) the generation of hardware floating point
20728 instructions.  This option is only significant when the target
20729 architecture is @samp{V850E2V3} or higher.  If hardware floating point
20730 instructions are being generated then the C preprocessor symbol
20731 @code{__FPU_OK__} will be defined, otherwise the symbol
20732 @code{__NO_FPU__} will be defined.
20734 @item -mloop
20735 @opindex mloop
20736 Enables the use of the e3v5 LOOP instruction.  The use of this
20737 instruction is not enabled by default when the e3v5 architecture is
20738 selected because its use is still experimental.
20740 @item -mrh850-abi
20741 @itemx -mghs
20742 @opindex mrh850-abi
20743 @opindex mghs
20744 Enables support for the RH850 version of the V850 ABI.  This is the
20745 default.  With this version of the ABI the following rules apply:
20747 @itemize
20748 @item
20749 Integer sized structures and unions are returned via a memory pointer
20750 rather than a register.
20752 @item
20753 Large structures and unions (more than 8 bytes in size) are passed by
20754 value.
20756 @item
20757 Functions are aligned to 16-bit boundaries.
20759 @item
20760 The @option{-m8byte-align} command line option is supported.
20762 @item
20763 The @option{-mdisable-callt} command line option is enabled by
20764 default.  The @option{-mno-disable-callt} command line option is not
20765 supported.
20766 @end itemize
20768 When this version of the ABI is enabled the C preprocessor symbol
20769 @code{__V850_RH850_ABI__} is defined.
20771 @item -mgcc-abi
20772 @opindex mgcc-abi
20773 Enables support for the old GCC version of the V850 ABI.  With this
20774 version of the ABI the following rules apply:
20776 @itemize
20777 @item
20778 Integer sized structures and unions are returned in register @code{r10}.
20780 @item
20781 Large structures and unions (more than 8 bytes in size) are passed by
20782 reference.
20784 @item
20785 Functions are aligned to 32-bit boundaries, unless optimizing for
20786 size.
20788 @item
20789 The @option{-m8byte-align} command line option is not supported.
20791 @item
20792 The @option{-mdisable-callt} command line option is supported but not
20793 enabled by default.
20794 @end itemize
20796 When this version of the ABI is enabled the C preprocessor symbol
20797 @code{__V850_GCC_ABI__} is defined.
20799 @item -m8byte-align
20800 @itemx -mno-8byte-align
20801 @opindex m8byte-align
20802 @opindex mno-8byte-align
20803 Enables support for @code{doubles} and @code{long long} types to be
20804 aligned on 8-byte boundaries.  The default is to restrict the
20805 alignment of all objects to at most 4-bytes.  When
20806 @option{-m8byte-align} is in effect the C preprocessor symbol
20807 @code{__V850_8BYTE_ALIGN__} will be defined.
20809 @item -mbig-switch
20810 @opindex mbig-switch
20811 Generate code suitable for big switch tables.  Use this option only if
20812 the assembler/linker complain about out of range branches within a switch
20813 table.
20815 @item -mapp-regs
20816 @opindex mapp-regs
20817 This option causes r2 and r5 to be used in the code generated by
20818 the compiler.  This setting is the default.
20820 @item -mno-app-regs
20821 @opindex mno-app-regs
20822 This option causes r2 and r5 to be treated as fixed registers.
20824 @end table
20826 @node VAX Options
20827 @subsection VAX Options
20828 @cindex VAX options
20830 These @samp{-m} options are defined for the VAX:
20832 @table @gcctabopt
20833 @item -munix
20834 @opindex munix
20835 Do not output certain jump instructions (@code{aobleq} and so on)
20836 that the Unix assembler for the VAX cannot handle across long
20837 ranges.
20839 @item -mgnu
20840 @opindex mgnu
20841 Do output those jump instructions, on the assumption that the
20842 GNU assembler is being used.
20844 @item -mg
20845 @opindex mg
20846 Output code for G-format floating-point numbers instead of D-format.
20847 @end table
20849 @node VMS Options
20850 @subsection VMS Options
20852 These @samp{-m} options are defined for the VMS implementations:
20854 @table @gcctabopt
20855 @item -mvms-return-codes
20856 @opindex mvms-return-codes
20857 Return VMS condition codes from @code{main}. The default is to return POSIX-style
20858 condition (e.g.@ error) codes.
20860 @item -mdebug-main=@var{prefix}
20861 @opindex mdebug-main=@var{prefix}
20862 Flag the first routine whose name starts with @var{prefix} as the main
20863 routine for the debugger.
20865 @item -mmalloc64
20866 @opindex mmalloc64
20867 Default to 64-bit memory allocation routines.
20869 @item -mpointer-size=@var{size}
20870 @opindex -mpointer-size=@var{size}
20871 Set the default size of pointers. Possible options for @var{size} are
20872 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
20873 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
20874 The later option disables @code{pragma pointer_size}.
20875 @end table
20877 @node VxWorks Options
20878 @subsection VxWorks Options
20879 @cindex VxWorks Options
20881 The options in this section are defined for all VxWorks targets.
20882 Options specific to the target hardware are listed with the other
20883 options for that target.
20885 @table @gcctabopt
20886 @item -mrtp
20887 @opindex mrtp
20888 GCC can generate code for both VxWorks kernels and real time processes
20889 (RTPs).  This option switches from the former to the latter.  It also
20890 defines the preprocessor macro @code{__RTP__}.
20892 @item -non-static
20893 @opindex non-static
20894 Link an RTP executable against shared libraries rather than static
20895 libraries.  The options @option{-static} and @option{-shared} can
20896 also be used for RTPs (@pxref{Link Options}); @option{-static}
20897 is the default.
20899 @item -Bstatic
20900 @itemx -Bdynamic
20901 @opindex Bstatic
20902 @opindex Bdynamic
20903 These options are passed down to the linker.  They are defined for
20904 compatibility with Diab.
20906 @item -Xbind-lazy
20907 @opindex Xbind-lazy
20908 Enable lazy binding of function calls.  This option is equivalent to
20909 @option{-Wl,-z,now} and is defined for compatibility with Diab.
20911 @item -Xbind-now
20912 @opindex Xbind-now
20913 Disable lazy binding of function calls.  This option is the default and
20914 is defined for compatibility with Diab.
20915 @end table
20917 @node x86-64 Options
20918 @subsection x86-64 Options
20919 @cindex x86-64 options
20921 These are listed under @xref{i386 and x86-64 Options}.
20923 @node Xstormy16 Options
20924 @subsection Xstormy16 Options
20925 @cindex Xstormy16 Options
20927 These options are defined for Xstormy16:
20929 @table @gcctabopt
20930 @item -msim
20931 @opindex msim
20932 Choose startup files and linker script suitable for the simulator.
20933 @end table
20935 @node Xtensa Options
20936 @subsection Xtensa Options
20937 @cindex Xtensa Options
20939 These options are supported for Xtensa targets:
20941 @table @gcctabopt
20942 @item -mconst16
20943 @itemx -mno-const16
20944 @opindex mconst16
20945 @opindex mno-const16
20946 Enable or disable use of @code{CONST16} instructions for loading
20947 constant values.  The @code{CONST16} instruction is currently not a
20948 standard option from Tensilica.  When enabled, @code{CONST16}
20949 instructions are always used in place of the standard @code{L32R}
20950 instructions.  The use of @code{CONST16} is enabled by default only if
20951 the @code{L32R} instruction is not available.
20953 @item -mfused-madd
20954 @itemx -mno-fused-madd
20955 @opindex mfused-madd
20956 @opindex mno-fused-madd
20957 Enable or disable use of fused multiply/add and multiply/subtract
20958 instructions in the floating-point option.  This has no effect if the
20959 floating-point option is not also enabled.  Disabling fused multiply/add
20960 and multiply/subtract instructions forces the compiler to use separate
20961 instructions for the multiply and add/subtract operations.  This may be
20962 desirable in some cases where strict IEEE 754-compliant results are
20963 required: the fused multiply add/subtract instructions do not round the
20964 intermediate result, thereby producing results with @emph{more} bits of
20965 precision than specified by the IEEE standard.  Disabling fused multiply
20966 add/subtract instructions also ensures that the program output is not
20967 sensitive to the compiler's ability to combine multiply and add/subtract
20968 operations.
20970 @item -mserialize-volatile
20971 @itemx -mno-serialize-volatile
20972 @opindex mserialize-volatile
20973 @opindex mno-serialize-volatile
20974 When this option is enabled, GCC inserts @code{MEMW} instructions before
20975 @code{volatile} memory references to guarantee sequential consistency.
20976 The default is @option{-mserialize-volatile}.  Use
20977 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
20979 @item -mforce-no-pic
20980 @opindex mforce-no-pic
20981 For targets, like GNU/Linux, where all user-mode Xtensa code must be
20982 position-independent code (PIC), this option disables PIC for compiling
20983 kernel code.
20985 @item -mtext-section-literals
20986 @itemx -mno-text-section-literals
20987 @opindex mtext-section-literals
20988 @opindex mno-text-section-literals
20989 Control the treatment of literal pools.  The default is
20990 @option{-mno-text-section-literals}, which places literals in a separate
20991 section in the output file.  This allows the literal pool to be placed
20992 in a data RAM/ROM, and it also allows the linker to combine literal
20993 pools from separate object files to remove redundant literals and
20994 improve code size.  With @option{-mtext-section-literals}, the literals
20995 are interspersed in the text section in order to keep them as close as
20996 possible to their references.  This may be necessary for large assembly
20997 files.
20999 @item -mtarget-align
21000 @itemx -mno-target-align
21001 @opindex mtarget-align
21002 @opindex mno-target-align
21003 When this option is enabled, GCC instructs the assembler to
21004 automatically align instructions to reduce branch penalties at the
21005 expense of some code density.  The assembler attempts to widen density
21006 instructions to align branch targets and the instructions following call
21007 instructions.  If there are not enough preceding safe density
21008 instructions to align a target, no widening is performed.  The
21009 default is @option{-mtarget-align}.  These options do not affect the
21010 treatment of auto-aligned instructions like @code{LOOP}, which the
21011 assembler always aligns, either by widening density instructions or
21012 by inserting NOP instructions.
21014 @item -mlongcalls
21015 @itemx -mno-longcalls
21016 @opindex mlongcalls
21017 @opindex mno-longcalls
21018 When this option is enabled, GCC instructs the assembler to translate
21019 direct calls to indirect calls unless it can determine that the target
21020 of a direct call is in the range allowed by the call instruction.  This
21021 translation typically occurs for calls to functions in other source
21022 files.  Specifically, the assembler translates a direct @code{CALL}
21023 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
21024 The default is @option{-mno-longcalls}.  This option should be used in
21025 programs where the call target can potentially be out of range.  This
21026 option is implemented in the assembler, not the compiler, so the
21027 assembly code generated by GCC still shows direct call
21028 instructions---look at the disassembled object code to see the actual
21029 instructions.  Note that the assembler uses an indirect call for
21030 every cross-file call, not just those that really are out of range.
21031 @end table
21033 @node zSeries Options
21034 @subsection zSeries Options
21035 @cindex zSeries options
21037 These are listed under @xref{S/390 and zSeries Options}.
21039 @node Code Gen Options
21040 @section Options for Code Generation Conventions
21041 @cindex code generation conventions
21042 @cindex options, code generation
21043 @cindex run-time options
21045 These machine-independent options control the interface conventions
21046 used in code generation.
21048 Most of them have both positive and negative forms; the negative form
21049 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
21050 one of the forms is listed---the one that is not the default.  You
21051 can figure out the other form by either removing @samp{no-} or adding
21054 @table @gcctabopt
21055 @item -fbounds-check
21056 @opindex fbounds-check
21057 For front ends that support it, generate additional code to check that
21058 indices used to access arrays are within the declared range.  This is
21059 currently only supported by the Java and Fortran front ends, where
21060 this option defaults to true and false respectively.
21062 @item -fstack-reuse=@var{reuse-level}
21063 @opindex fstack_reuse
21064 This option controls stack space reuse for user declared local/auto variables
21065 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
21066 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
21067 local variables and temporaries, @samp{named_vars} enables the reuse only for
21068 user defined local variables with names, and @samp{none} disables stack reuse
21069 completely. The default value is @samp{all}. The option is needed when the
21070 program extends the lifetime of a scoped local variable or a compiler generated
21071 temporary beyond the end point defined by the language.  When a lifetime of
21072 a variable ends, and if the variable lives in memory, the optimizing compiler
21073 has the freedom to reuse its stack space with other temporaries or scoped
21074 local variables whose live range does not overlap with it. Legacy code extending
21075 local lifetime will likely to break with the stack reuse optimization.
21077 For example,
21079 @smallexample
21080    int *p;
21081    @{
21082      int local1;
21084      p = &local1;
21085      local1 = 10;
21086      ....
21087    @}
21088    @{
21089       int local2;
21090       local2 = 20;
21091       ...
21092    @}
21094    if (*p == 10)  // out of scope use of local1
21095      @{
21097      @}
21098 @end smallexample
21100 Another example:
21101 @smallexample
21103    struct A
21104    @{
21105        A(int k) : i(k), j(k) @{ @}
21106        int i;
21107        int j;
21108    @};
21110    A *ap;
21112    void foo(const A& ar)
21113    @{
21114       ap = &ar;
21115    @}
21117    void bar()
21118    @{
21119       foo(A(10)); // temp object's lifetime ends when foo returns
21121       @{
21122         A a(20);
21123         ....
21124       @}
21125       ap->i+= 10;  // ap references out of scope temp whose space
21126                    // is reused with a. What is the value of ap->i?
21127    @}
21129 @end smallexample
21131 The lifetime of a compiler generated temporary is well defined by the C++
21132 standard. When a lifetime of a temporary ends, and if the temporary lives
21133 in memory, the optimizing compiler has the freedom to reuse its stack
21134 space with other temporaries or scoped local variables whose live range
21135 does not overlap with it. However some of the legacy code relies on
21136 the behavior of older compilers in which temporaries' stack space is
21137 not reused, the aggressive stack reuse can lead to runtime errors. This
21138 option is used to control the temporary stack reuse optimization.
21140 @item -ftrapv
21141 @opindex ftrapv
21142 This option generates traps for signed overflow on addition, subtraction,
21143 multiplication operations.
21145 @item -fwrapv
21146 @opindex fwrapv
21147 This option instructs the compiler to assume that signed arithmetic
21148 overflow of addition, subtraction and multiplication wraps around
21149 using twos-complement representation.  This flag enables some optimizations
21150 and disables others.  This option is enabled by default for the Java
21151 front end, as required by the Java language specification.
21153 @item -fexceptions
21154 @opindex fexceptions
21155 Enable exception handling.  Generates extra code needed to propagate
21156 exceptions.  For some targets, this implies GCC generates frame
21157 unwind information for all functions, which can produce significant data
21158 size overhead, although it does not affect execution.  If you do not
21159 specify this option, GCC enables it by default for languages like
21160 C++ that normally require exception handling, and disables it for
21161 languages like C that do not normally require it.  However, you may need
21162 to enable this option when compiling C code that needs to interoperate
21163 properly with exception handlers written in C++.  You may also wish to
21164 disable this option if you are compiling older C++ programs that don't
21165 use exception handling.
21167 @item -fnon-call-exceptions
21168 @opindex fnon-call-exceptions
21169 Generate code that allows trapping instructions to throw exceptions.
21170 Note that this requires platform-specific runtime support that does
21171 not exist everywhere.  Moreover, it only allows @emph{trapping}
21172 instructions to throw exceptions, i.e.@: memory references or floating-point
21173 instructions.  It does not allow exceptions to be thrown from
21174 arbitrary signal handlers such as @code{SIGALRM}.
21176 @item -fdelete-dead-exceptions
21177 @opindex fdelete-dead-exceptions
21178 Consider that instructions that may throw exceptions but don't otherwise
21179 contribute to the execution of the program can be optimized away.
21180 This option is enabled by default for the Ada front end, as permitted by
21181 the Ada language specification.
21182 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
21184 @item -funwind-tables
21185 @opindex funwind-tables
21186 Similar to @option{-fexceptions}, except that it just generates any needed
21187 static data, but does not affect the generated code in any other way.
21188 You normally do not need to enable this option; instead, a language processor
21189 that needs this handling enables it on your behalf.
21191 @item -fasynchronous-unwind-tables
21192 @opindex fasynchronous-unwind-tables
21193 Generate unwind table in DWARF 2 format, if supported by target machine.  The
21194 table is exact at each instruction boundary, so it can be used for stack
21195 unwinding from asynchronous events (such as debugger or garbage collector).
21197 @item -fpcc-struct-return
21198 @opindex fpcc-struct-return
21199 Return ``short'' @code{struct} and @code{union} values in memory like
21200 longer ones, rather than in registers.  This convention is less
21201 efficient, but it has the advantage of allowing intercallability between
21202 GCC-compiled files and files compiled with other compilers, particularly
21203 the Portable C Compiler (pcc).
21205 The precise convention for returning structures in memory depends
21206 on the target configuration macros.
21208 Short structures and unions are those whose size and alignment match
21209 that of some integer type.
21211 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
21212 switch is not binary compatible with code compiled with the
21213 @option{-freg-struct-return} switch.
21214 Use it to conform to a non-default application binary interface.
21216 @item -freg-struct-return
21217 @opindex freg-struct-return
21218 Return @code{struct} and @code{union} values in registers when possible.
21219 This is more efficient for small structures than
21220 @option{-fpcc-struct-return}.
21222 If you specify neither @option{-fpcc-struct-return} nor
21223 @option{-freg-struct-return}, GCC defaults to whichever convention is
21224 standard for the target.  If there is no standard convention, GCC
21225 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
21226 the principal compiler.  In those cases, we can choose the standard, and
21227 we chose the more efficient register return alternative.
21229 @strong{Warning:} code compiled with the @option{-freg-struct-return}
21230 switch is not binary compatible with code compiled with the
21231 @option{-fpcc-struct-return} switch.
21232 Use it to conform to a non-default application binary interface.
21234 @item -fshort-enums
21235 @opindex fshort-enums
21236 Allocate to an @code{enum} type only as many bytes as it needs for the
21237 declared range of possible values.  Specifically, the @code{enum} type
21238 is equivalent to the smallest integer type that has enough room.
21240 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
21241 code that is not binary compatible with code generated without that switch.
21242 Use it to conform to a non-default application binary interface.
21244 @item -fshort-double
21245 @opindex fshort-double
21246 Use the same size for @code{double} as for @code{float}.
21248 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
21249 code that is not binary compatible with code generated without that switch.
21250 Use it to conform to a non-default application binary interface.
21252 @item -fshort-wchar
21253 @opindex fshort-wchar
21254 Override the underlying type for @samp{wchar_t} to be @samp{short
21255 unsigned int} instead of the default for the target.  This option is
21256 useful for building programs to run under WINE@.
21258 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
21259 code that is not binary compatible with code generated without that switch.
21260 Use it to conform to a non-default application binary interface.
21262 @item -fno-common
21263 @opindex fno-common
21264 In C code, controls the placement of uninitialized global variables.
21265 Unix C compilers have traditionally permitted multiple definitions of
21266 such variables in different compilation units by placing the variables
21267 in a common block.
21268 This is the behavior specified by @option{-fcommon}, and is the default
21269 for GCC on most targets.
21270 On the other hand, this behavior is not required by ISO C, and on some
21271 targets may carry a speed or code size penalty on variable references.
21272 The @option{-fno-common} option specifies that the compiler should place
21273 uninitialized global variables in the data section of the object file,
21274 rather than generating them as common blocks.
21275 This has the effect that if the same variable is declared
21276 (without @code{extern}) in two different compilations,
21277 you get a multiple-definition error when you link them.
21278 In this case, you must compile with @option{-fcommon} instead.
21279 Compiling with @option{-fno-common} is useful on targets for which
21280 it provides better performance, or if you wish to verify that the
21281 program will work on other systems that always treat uninitialized
21282 variable declarations this way.
21284 @item -fno-ident
21285 @opindex fno-ident
21286 Ignore the @samp{#ident} directive.
21288 @item -finhibit-size-directive
21289 @opindex finhibit-size-directive
21290 Don't output a @code{.size} assembler directive, or anything else that
21291 would cause trouble if the function is split in the middle, and the
21292 two halves are placed at locations far apart in memory.  This option is
21293 used when compiling @file{crtstuff.c}; you should not need to use it
21294 for anything else.
21296 @item -fverbose-asm
21297 @opindex fverbose-asm
21298 Put extra commentary information in the generated assembly code to
21299 make it more readable.  This option is generally only of use to those
21300 who actually need to read the generated assembly code (perhaps while
21301 debugging the compiler itself).
21303 @option{-fno-verbose-asm}, the default, causes the
21304 extra information to be omitted and is useful when comparing two assembler
21305 files.
21307 @item -frecord-gcc-switches
21308 @opindex frecord-gcc-switches
21309 This switch causes the command line used to invoke the
21310 compiler to be recorded into the object file that is being created.
21311 This switch is only implemented on some targets and the exact format
21312 of the recording is target and binary file format dependent, but it
21313 usually takes the form of a section containing ASCII text.  This
21314 switch is related to the @option{-fverbose-asm} switch, but that
21315 switch only records information in the assembler output file as
21316 comments, so it never reaches the object file.
21317 See also @option{-grecord-gcc-switches} for another
21318 way of storing compiler options into the object file.
21320 @item -fpic
21321 @opindex fpic
21322 @cindex global offset table
21323 @cindex PIC
21324 Generate position-independent code (PIC) suitable for use in a shared
21325 library, if supported for the target machine.  Such code accesses all
21326 constant addresses through a global offset table (GOT)@.  The dynamic
21327 loader resolves the GOT entries when the program starts (the dynamic
21328 loader is not part of GCC; it is part of the operating system).  If
21329 the GOT size for the linked executable exceeds a machine-specific
21330 maximum size, you get an error message from the linker indicating that
21331 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
21332 instead.  (These maximums are 8k on the SPARC and 32k
21333 on the m68k and RS/6000.  The 386 has no such limit.)
21335 Position-independent code requires special support, and therefore works
21336 only on certain machines.  For the 386, GCC supports PIC for System V
21337 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
21338 position-independent.
21340 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
21341 are defined to 1.
21343 @item -fPIC
21344 @opindex fPIC
21345 If supported for the target machine, emit position-independent code,
21346 suitable for dynamic linking and avoiding any limit on the size of the
21347 global offset table.  This option makes a difference on the m68k,
21348 PowerPC and SPARC@.
21350 Position-independent code requires special support, and therefore works
21351 only on certain machines.
21353 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
21354 are defined to 2.
21356 @item -fpie
21357 @itemx -fPIE
21358 @opindex fpie
21359 @opindex fPIE
21360 These options are similar to @option{-fpic} and @option{-fPIC}, but
21361 generated position independent code can be only linked into executables.
21362 Usually these options are used when @option{-pie} GCC option is
21363 used during linking.
21365 @option{-fpie} and @option{-fPIE} both define the macros
21366 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
21367 for @option{-fpie} and 2 for @option{-fPIE}.
21369 @item -fno-jump-tables
21370 @opindex fno-jump-tables
21371 Do not use jump tables for switch statements even where it would be
21372 more efficient than other code generation strategies.  This option is
21373 of use in conjunction with @option{-fpic} or @option{-fPIC} for
21374 building code that forms part of a dynamic linker and cannot
21375 reference the address of a jump table.  On some targets, jump tables
21376 do not require a GOT and this option is not needed.
21378 @item -ffixed-@var{reg}
21379 @opindex ffixed
21380 Treat the register named @var{reg} as a fixed register; generated code
21381 should never refer to it (except perhaps as a stack pointer, frame
21382 pointer or in some other fixed role).
21384 @var{reg} must be the name of a register.  The register names accepted
21385 are machine-specific and are defined in the @code{REGISTER_NAMES}
21386 macro in the machine description macro file.
21388 This flag does not have a negative form, because it specifies a
21389 three-way choice.
21391 @item -fcall-used-@var{reg}
21392 @opindex fcall-used
21393 Treat the register named @var{reg} as an allocable register that is
21394 clobbered by function calls.  It may be allocated for temporaries or
21395 variables that do not live across a call.  Functions compiled this way
21396 do not save and restore the register @var{reg}.
21398 It is an error to use this flag with the frame pointer or stack pointer.
21399 Use of this flag for other registers that have fixed pervasive roles in
21400 the machine's execution model produces disastrous results.
21402 This flag does not have a negative form, because it specifies a
21403 three-way choice.
21405 @item -fcall-saved-@var{reg}
21406 @opindex fcall-saved
21407 Treat the register named @var{reg} as an allocable register saved by
21408 functions.  It may be allocated even for temporaries or variables that
21409 live across a call.  Functions compiled this way save and restore
21410 the register @var{reg} if they use it.
21412 It is an error to use this flag with the frame pointer or stack pointer.
21413 Use of this flag for other registers that have fixed pervasive roles in
21414 the machine's execution model produces disastrous results.
21416 A different sort of disaster results from the use of this flag for
21417 a register in which function values may be returned.
21419 This flag does not have a negative form, because it specifies a
21420 three-way choice.
21422 @item -fpack-struct[=@var{n}]
21423 @opindex fpack-struct
21424 Without a value specified, pack all structure members together without
21425 holes.  When a value is specified (which must be a small power of two), pack
21426 structure members according to this value, representing the maximum
21427 alignment (that is, objects with default alignment requirements larger than
21428 this are output potentially unaligned at the next fitting location.
21430 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
21431 code that is not binary compatible with code generated without that switch.
21432 Additionally, it makes the code suboptimal.
21433 Use it to conform to a non-default application binary interface.
21435 @item -finstrument-functions
21436 @opindex finstrument-functions
21437 Generate instrumentation calls for entry and exit to functions.  Just
21438 after function entry and just before function exit, the following
21439 profiling functions are called with the address of the current
21440 function and its call site.  (On some platforms,
21441 @code{__builtin_return_address} does not work beyond the current
21442 function, so the call site information may not be available to the
21443 profiling functions otherwise.)
21445 @smallexample
21446 void __cyg_profile_func_enter (void *this_fn,
21447                                void *call_site);
21448 void __cyg_profile_func_exit  (void *this_fn,
21449                                void *call_site);
21450 @end smallexample
21452 The first argument is the address of the start of the current function,
21453 which may be looked up exactly in the symbol table.
21455 This instrumentation is also done for functions expanded inline in other
21456 functions.  The profiling calls indicate where, conceptually, the
21457 inline function is entered and exited.  This means that addressable
21458 versions of such functions must be available.  If all your uses of a
21459 function are expanded inline, this may mean an additional expansion of
21460 code size.  If you use @samp{extern inline} in your C code, an
21461 addressable version of such functions must be provided.  (This is
21462 normally the case anyway, but if you get lucky and the optimizer always
21463 expands the functions inline, you might have gotten away without
21464 providing static copies.)
21466 A function may be given the attribute @code{no_instrument_function}, in
21467 which case this instrumentation is not done.  This can be used, for
21468 example, for the profiling functions listed above, high-priority
21469 interrupt routines, and any functions from which the profiling functions
21470 cannot safely be called (perhaps signal handlers, if the profiling
21471 routines generate output or allocate memory).
21473 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
21474 @opindex finstrument-functions-exclude-file-list
21476 Set the list of functions that are excluded from instrumentation (see
21477 the description of @code{-finstrument-functions}).  If the file that
21478 contains a function definition matches with one of @var{file}, then
21479 that function is not instrumented.  The match is done on substrings:
21480 if the @var{file} parameter is a substring of the file name, it is
21481 considered to be a match.
21483 For example:
21485 @smallexample
21486 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
21487 @end smallexample
21489 @noindent
21490 excludes any inline function defined in files whose pathnames
21491 contain @code{/bits/stl} or @code{include/sys}.
21493 If, for some reason, you want to include letter @code{','} in one of
21494 @var{sym}, write @code{'\,'}. For example,
21495 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
21496 (note the single quote surrounding the option).
21498 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
21499 @opindex finstrument-functions-exclude-function-list
21501 This is similar to @code{-finstrument-functions-exclude-file-list},
21502 but this option sets the list of function names to be excluded from
21503 instrumentation.  The function name to be matched is its user-visible
21504 name, such as @code{vector<int> blah(const vector<int> &)}, not the
21505 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
21506 match is done on substrings: if the @var{sym} parameter is a substring
21507 of the function name, it is considered to be a match.  For C99 and C++
21508 extended identifiers, the function name must be given in UTF-8, not
21509 using universal character names.
21511 @item -fstack-check
21512 @opindex fstack-check
21513 Generate code to verify that you do not go beyond the boundary of the
21514 stack.  You should specify this flag if you are running in an
21515 environment with multiple threads, but you only rarely need to specify it in
21516 a single-threaded environment since stack overflow is automatically
21517 detected on nearly all systems if there is only one stack.
21519 Note that this switch does not actually cause checking to be done; the
21520 operating system or the language runtime must do that.  The switch causes
21521 generation of code to ensure that they see the stack being extended.
21523 You can additionally specify a string parameter: @code{no} means no
21524 checking, @code{generic} means force the use of old-style checking,
21525 @code{specific} means use the best checking method and is equivalent
21526 to bare @option{-fstack-check}.
21528 Old-style checking is a generic mechanism that requires no specific
21529 target support in the compiler but comes with the following drawbacks:
21531 @enumerate
21532 @item
21533 Modified allocation strategy for large objects: they are always
21534 allocated dynamically if their size exceeds a fixed threshold.
21536 @item
21537 Fixed limit on the size of the static frame of functions: when it is
21538 topped by a particular function, stack checking is not reliable and
21539 a warning is issued by the compiler.
21541 @item
21542 Inefficiency: because of both the modified allocation strategy and the
21543 generic implementation, code performance is hampered.
21544 @end enumerate
21546 Note that old-style stack checking is also the fallback method for
21547 @code{specific} if no target support has been added in the compiler.
21549 @item -fstack-limit-register=@var{reg}
21550 @itemx -fstack-limit-symbol=@var{sym}
21551 @itemx -fno-stack-limit
21552 @opindex fstack-limit-register
21553 @opindex fstack-limit-symbol
21554 @opindex fno-stack-limit
21555 Generate code to ensure that the stack does not grow beyond a certain value,
21556 either the value of a register or the address of a symbol.  If a larger
21557 stack is required, a signal is raised at run time.  For most targets,
21558 the signal is raised before the stack overruns the boundary, so
21559 it is possible to catch the signal without taking special precautions.
21561 For instance, if the stack starts at absolute address @samp{0x80000000}
21562 and grows downwards, you can use the flags
21563 @option{-fstack-limit-symbol=__stack_limit} and
21564 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
21565 of 128KB@.  Note that this may only work with the GNU linker.
21567 @item -fsplit-stack
21568 @opindex fsplit-stack
21569 Generate code to automatically split the stack before it overflows.
21570 The resulting program has a discontiguous stack which can only
21571 overflow if the program is unable to allocate any more memory.  This
21572 is most useful when running threaded programs, as it is no longer
21573 necessary to calculate a good stack size to use for each thread.  This
21574 is currently only implemented for the i386 and x86_64 back ends running
21575 GNU/Linux.
21577 When code compiled with @option{-fsplit-stack} calls code compiled
21578 without @option{-fsplit-stack}, there may not be much stack space
21579 available for the latter code to run.  If compiling all code,
21580 including library code, with @option{-fsplit-stack} is not an option,
21581 then the linker can fix up these calls so that the code compiled
21582 without @option{-fsplit-stack} always has a large stack.  Support for
21583 this is implemented in the gold linker in GNU binutils release 2.21
21584 and later.
21586 @item -fleading-underscore
21587 @opindex fleading-underscore
21588 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
21589 change the way C symbols are represented in the object file.  One use
21590 is to help link with legacy assembly code.
21592 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
21593 generate code that is not binary compatible with code generated without that
21594 switch.  Use it to conform to a non-default application binary interface.
21595 Not all targets provide complete support for this switch.
21597 @item -ftls-model=@var{model}
21598 @opindex ftls-model
21599 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
21600 The @var{model} argument should be one of @code{global-dynamic},
21601 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
21602 Note that the choice is subject to optimization: the compiler may use
21603 a more efficient model for symbols not visible outside of the translation
21604 unit, or if @option{-fpic} is not given on the command line.
21606 The default without @option{-fpic} is @code{initial-exec}; with
21607 @option{-fpic} the default is @code{global-dynamic}.
21609 @item -fvisibility=@var{default|internal|hidden|protected}
21610 @opindex fvisibility
21611 Set the default ELF image symbol visibility to the specified option---all
21612 symbols are marked with this unless overridden within the code.
21613 Using this feature can very substantially improve linking and
21614 load times of shared object libraries, produce more optimized
21615 code, provide near-perfect API export and prevent symbol clashes.
21616 It is @strong{strongly} recommended that you use this in any shared objects
21617 you distribute.
21619 Despite the nomenclature, @code{default} always means public; i.e.,
21620 available to be linked against from outside the shared object.
21621 @code{protected} and @code{internal} are pretty useless in real-world
21622 usage so the only other commonly used option is @code{hidden}.
21623 The default if @option{-fvisibility} isn't specified is
21624 @code{default}, i.e., make every
21625 symbol public---this causes the same behavior as previous versions of
21626 GCC@.
21628 A good explanation of the benefits offered by ensuring ELF
21629 symbols have the correct visibility is given by ``How To Write
21630 Shared Libraries'' by Ulrich Drepper (which can be found at
21631 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
21632 solution made possible by this option to marking things hidden when
21633 the default is public is to make the default hidden and mark things
21634 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
21635 and @code{__attribute__ ((visibility("default")))} instead of
21636 @code{__declspec(dllexport)} you get almost identical semantics with
21637 identical syntax.  This is a great boon to those working with
21638 cross-platform projects.
21640 For those adding visibility support to existing code, you may find
21641 @samp{#pragma GCC visibility} of use.  This works by you enclosing
21642 the declarations you wish to set visibility for with (for example)
21643 @samp{#pragma GCC visibility push(hidden)} and
21644 @samp{#pragma GCC visibility pop}.
21645 Bear in mind that symbol visibility should be viewed @strong{as
21646 part of the API interface contract} and thus all new code should
21647 always specify visibility when it is not the default; i.e., declarations
21648 only for use within the local DSO should @strong{always} be marked explicitly
21649 as hidden as so to avoid PLT indirection overheads---making this
21650 abundantly clear also aids readability and self-documentation of the code.
21651 Note that due to ISO C++ specification requirements, @code{operator new} and
21652 @code{operator delete} must always be of default visibility.
21654 Be aware that headers from outside your project, in particular system
21655 headers and headers from any other library you use, may not be
21656 expecting to be compiled with visibility other than the default.  You
21657 may need to explicitly say @samp{#pragma GCC visibility push(default)}
21658 before including any such headers.
21660 @samp{extern} declarations are not affected by @option{-fvisibility}, so
21661 a lot of code can be recompiled with @option{-fvisibility=hidden} with
21662 no modifications.  However, this means that calls to @code{extern}
21663 functions with no explicit visibility use the PLT, so it is more
21664 effective to use @code{__attribute ((visibility))} and/or
21665 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
21666 declarations should be treated as hidden.
21668 Note that @option{-fvisibility} does affect C++ vague linkage
21669 entities. This means that, for instance, an exception class that is
21670 be thrown between DSOs must be explicitly marked with default
21671 visibility so that the @samp{type_info} nodes are unified between
21672 the DSOs.
21674 An overview of these techniques, their benefits and how to use them
21675 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
21677 @item -fstrict-volatile-bitfields
21678 @opindex fstrict-volatile-bitfields
21679 This option should be used if accesses to volatile bit-fields (or other
21680 structure fields, although the compiler usually honors those types
21681 anyway) should use a single access of the width of the
21682 field's type, aligned to a natural alignment if possible.  For
21683 example, targets with memory-mapped peripheral registers might require
21684 all such accesses to be 16 bits wide; with this flag you can
21685 declare all peripheral bit-fields as @code{unsigned short} (assuming short
21686 is 16 bits on these targets) to force GCC to use 16-bit accesses
21687 instead of, perhaps, a more efficient 32-bit access.
21689 If this option is disabled, the compiler uses the most efficient
21690 instruction.  In the previous example, that might be a 32-bit load
21691 instruction, even though that accesses bytes that do not contain
21692 any portion of the bit-field, or memory-mapped registers unrelated to
21693 the one being updated.
21695 The default value of this option is determined by the application binary
21696 interface for the target processor.
21698 @item -fsync-libcalls
21699 @opindex fsync-libcalls
21700 This option controls whether any out-of-line instance of the @code{__sync}
21701 family of functions may be used to implement the C++11 @code{__atomic}
21702 family of functions.
21704 The default value of this option is enabled, thus the only useful form
21705 of the option is @option{-fno-sync-libcalls}.  This option is used in
21706 the implementation of the @file{libatomic} runtime library.
21708 @end table
21710 @c man end
21712 @node Environment Variables
21713 @section Environment Variables Affecting GCC
21714 @cindex environment variables
21716 @c man begin ENVIRONMENT
21717 This section describes several environment variables that affect how GCC
21718 operates.  Some of them work by specifying directories or prefixes to use
21719 when searching for various kinds of files.  Some are used to specify other
21720 aspects of the compilation environment.
21722 Note that you can also specify places to search using options such as
21723 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
21724 take precedence over places specified using environment variables, which
21725 in turn take precedence over those specified by the configuration of GCC@.
21726 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
21727 GNU Compiler Collection (GCC) Internals}.
21729 @table @env
21730 @item LANG
21731 @itemx LC_CTYPE
21732 @c @itemx LC_COLLATE
21733 @itemx LC_MESSAGES
21734 @c @itemx LC_MONETARY
21735 @c @itemx LC_NUMERIC
21736 @c @itemx LC_TIME
21737 @itemx LC_ALL
21738 @findex LANG
21739 @findex LC_CTYPE
21740 @c @findex LC_COLLATE
21741 @findex LC_MESSAGES
21742 @c @findex LC_MONETARY
21743 @c @findex LC_NUMERIC
21744 @c @findex LC_TIME
21745 @findex LC_ALL
21746 @cindex locale
21747 These environment variables control the way that GCC uses
21748 localization information which allows GCC to work with different
21749 national conventions.  GCC inspects the locale categories
21750 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
21751 so.  These locale categories can be set to any value supported by your
21752 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
21753 Kingdom encoded in UTF-8.
21755 The @env{LC_CTYPE} environment variable specifies character
21756 classification.  GCC uses it to determine the character boundaries in
21757 a string; this is needed for some multibyte encodings that contain quote
21758 and escape characters that are otherwise interpreted as a string
21759 end or escape.
21761 The @env{LC_MESSAGES} environment variable specifies the language to
21762 use in diagnostic messages.
21764 If the @env{LC_ALL} environment variable is set, it overrides the value
21765 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
21766 and @env{LC_MESSAGES} default to the value of the @env{LANG}
21767 environment variable.  If none of these variables are set, GCC
21768 defaults to traditional C English behavior.
21770 @item TMPDIR
21771 @findex TMPDIR
21772 If @env{TMPDIR} is set, it specifies the directory to use for temporary
21773 files.  GCC uses temporary files to hold the output of one stage of
21774 compilation which is to be used as input to the next stage: for example,
21775 the output of the preprocessor, which is the input to the compiler
21776 proper.
21778 @item GCC_COMPARE_DEBUG
21779 @findex GCC_COMPARE_DEBUG
21780 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
21781 @option{-fcompare-debug} to the compiler driver.  See the documentation
21782 of this option for more details.
21784 @item GCC_EXEC_PREFIX
21785 @findex GCC_EXEC_PREFIX
21786 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
21787 names of the subprograms executed by the compiler.  No slash is added
21788 when this prefix is combined with the name of a subprogram, but you can
21789 specify a prefix that ends with a slash if you wish.
21791 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
21792 an appropriate prefix to use based on the pathname it is invoked with.
21794 If GCC cannot find the subprogram using the specified prefix, it
21795 tries looking in the usual places for the subprogram.
21797 The default value of @env{GCC_EXEC_PREFIX} is
21798 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
21799 the installed compiler. In many cases @var{prefix} is the value
21800 of @code{prefix} when you ran the @file{configure} script.
21802 Other prefixes specified with @option{-B} take precedence over this prefix.
21804 This prefix is also used for finding files such as @file{crt0.o} that are
21805 used for linking.
21807 In addition, the prefix is used in an unusual way in finding the
21808 directories to search for header files.  For each of the standard
21809 directories whose name normally begins with @samp{/usr/local/lib/gcc}
21810 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
21811 replacing that beginning with the specified prefix to produce an
21812 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
21813 @file{foo/bar} just before it searches the standard directory 
21814 @file{/usr/local/lib/bar}.
21815 If a standard directory begins with the configured
21816 @var{prefix} then the value of @var{prefix} is replaced by
21817 @env{GCC_EXEC_PREFIX} when looking for header files.
21819 @item COMPILER_PATH
21820 @findex COMPILER_PATH
21821 The value of @env{COMPILER_PATH} is a colon-separated list of
21822 directories, much like @env{PATH}.  GCC tries the directories thus
21823 specified when searching for subprograms, if it can't find the
21824 subprograms using @env{GCC_EXEC_PREFIX}.
21826 @item LIBRARY_PATH
21827 @findex LIBRARY_PATH
21828 The value of @env{LIBRARY_PATH} is a colon-separated list of
21829 directories, much like @env{PATH}.  When configured as a native compiler,
21830 GCC tries the directories thus specified when searching for special
21831 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
21832 using GCC also uses these directories when searching for ordinary
21833 libraries for the @option{-l} option (but directories specified with
21834 @option{-L} come first).
21836 @item LANG
21837 @findex LANG
21838 @cindex locale definition
21839 This variable is used to pass locale information to the compiler.  One way in
21840 which this information is used is to determine the character set to be used
21841 when character literals, string literals and comments are parsed in C and C++.
21842 When the compiler is configured to allow multibyte characters,
21843 the following values for @env{LANG} are recognized:
21845 @table @samp
21846 @item C-JIS
21847 Recognize JIS characters.
21848 @item C-SJIS
21849 Recognize SJIS characters.
21850 @item C-EUCJP
21851 Recognize EUCJP characters.
21852 @end table
21854 If @env{LANG} is not defined, or if it has some other value, then the
21855 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
21856 recognize and translate multibyte characters.
21857 @end table
21859 @noindent
21860 Some additional environment variables affect the behavior of the
21861 preprocessor.
21863 @include cppenv.texi
21865 @c man end
21867 @node Precompiled Headers
21868 @section Using Precompiled Headers
21869 @cindex precompiled headers
21870 @cindex speed of compilation
21872 Often large projects have many header files that are included in every
21873 source file.  The time the compiler takes to process these header files
21874 over and over again can account for nearly all of the time required to
21875 build the project.  To make builds faster, GCC allows you to
21876 @dfn{precompile} a header file.
21878 To create a precompiled header file, simply compile it as you would any
21879 other file, if necessary using the @option{-x} option to make the driver
21880 treat it as a C or C++ header file.  You may want to use a
21881 tool like @command{make} to keep the precompiled header up-to-date when
21882 the headers it contains change.
21884 A precompiled header file is searched for when @code{#include} is
21885 seen in the compilation.  As it searches for the included file
21886 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
21887 compiler looks for a precompiled header in each directory just before it
21888 looks for the include file in that directory.  The name searched for is
21889 the name specified in the @code{#include} with @samp{.gch} appended.  If
21890 the precompiled header file can't be used, it is ignored.
21892 For instance, if you have @code{#include "all.h"}, and you have
21893 @file{all.h.gch} in the same directory as @file{all.h}, then the
21894 precompiled header file is used if possible, and the original
21895 header is used otherwise.
21897 Alternatively, you might decide to put the precompiled header file in a
21898 directory and use @option{-I} to ensure that directory is searched
21899 before (or instead of) the directory containing the original header.
21900 Then, if you want to check that the precompiled header file is always
21901 used, you can put a file of the same name as the original header in this
21902 directory containing an @code{#error} command.
21904 This also works with @option{-include}.  So yet another way to use
21905 precompiled headers, good for projects not designed with precompiled
21906 header files in mind, is to simply take most of the header files used by
21907 a project, include them from another header file, precompile that header
21908 file, and @option{-include} the precompiled header.  If the header files
21909 have guards against multiple inclusion, they are skipped because
21910 they've already been included (in the precompiled header).
21912 If you need to precompile the same header file for different
21913 languages, targets, or compiler options, you can instead make a
21914 @emph{directory} named like @file{all.h.gch}, and put each precompiled
21915 header in the directory, perhaps using @option{-o}.  It doesn't matter
21916 what you call the files in the directory; every precompiled header in
21917 the directory is considered.  The first precompiled header
21918 encountered in the directory that is valid for this compilation is
21919 used; they're searched in no particular order.
21921 There are many other possibilities, limited only by your imagination,
21922 good sense, and the constraints of your build system.
21924 A precompiled header file can be used only when these conditions apply:
21926 @itemize
21927 @item
21928 Only one precompiled header can be used in a particular compilation.
21930 @item
21931 A precompiled header can't be used once the first C token is seen.  You
21932 can have preprocessor directives before a precompiled header; you cannot
21933 include a precompiled header from inside another header.
21935 @item
21936 The precompiled header file must be produced for the same language as
21937 the current compilation.  You can't use a C precompiled header for a C++
21938 compilation.
21940 @item
21941 The precompiled header file must have been produced by the same compiler
21942 binary as the current compilation is using.
21944 @item
21945 Any macros defined before the precompiled header is included must
21946 either be defined in the same way as when the precompiled header was
21947 generated, or must not affect the precompiled header, which usually
21948 means that they don't appear in the precompiled header at all.
21950 The @option{-D} option is one way to define a macro before a
21951 precompiled header is included; using a @code{#define} can also do it.
21952 There are also some options that define macros implicitly, like
21953 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
21954 defined this way.
21956 @item If debugging information is output when using the precompiled
21957 header, using @option{-g} or similar, the same kind of debugging information
21958 must have been output when building the precompiled header.  However,
21959 a precompiled header built using @option{-g} can be used in a compilation
21960 when no debugging information is being output.
21962 @item The same @option{-m} options must generally be used when building
21963 and using the precompiled header.  @xref{Submodel Options},
21964 for any cases where this rule is relaxed.
21966 @item Each of the following options must be the same when building and using
21967 the precompiled header:
21969 @gccoptlist{-fexceptions}
21971 @item
21972 Some other command-line options starting with @option{-f},
21973 @option{-p}, or @option{-O} must be defined in the same way as when
21974 the precompiled header was generated.  At present, it's not clear
21975 which options are safe to change and which are not; the safest choice
21976 is to use exactly the same options when generating and using the
21977 precompiled header.  The following are known to be safe:
21979 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
21980 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
21981 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
21982 -pedantic-errors}
21984 @end itemize
21986 For all of these except the last, the compiler automatically
21987 ignores the precompiled header if the conditions aren't met.  If you
21988 find an option combination that doesn't work and doesn't cause the
21989 precompiled header to be ignored, please consider filing a bug report,
21990 see @ref{Bugs}.
21992 If you do use differing options when generating and using the
21993 precompiled header, the actual behavior is a mixture of the
21994 behavior for the options.  For instance, if you use @option{-g} to
21995 generate the precompiled header but not when using it, you may or may
21996 not get debugging information for routines in the precompiled header.