Implement --param=vect-max-peeling-for-alignment=..
[official-gcc.git] / gcc / doc / invoke.texi
blob508bbb43838ae4644c305ceca72cd9bebef32a9f
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-vect-loop-version -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{ARM Options}
494 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
495 -mabi=@var{name} @gol
496 -mapcs-stack-check  -mno-apcs-stack-check @gol
497 -mapcs-float  -mno-apcs-float @gol
498 -mapcs-reentrant  -mno-apcs-reentrant @gol
499 -msched-prolog  -mno-sched-prolog @gol
500 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
501 -mfloat-abi=@var{name} @gol
502 -mfp16-format=@var{name}
503 -mthumb-interwork  -mno-thumb-interwork @gol
504 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
505 -mstructure-size-boundary=@var{n} @gol
506 -mabort-on-noreturn @gol
507 -mlong-calls  -mno-long-calls @gol
508 -msingle-pic-base  -mno-single-pic-base @gol
509 -mpic-register=@var{reg} @gol
510 -mnop-fun-dllimport @gol
511 -mpoke-function-name @gol
512 -mthumb  -marm @gol
513 -mtpcs-frame  -mtpcs-leaf-frame @gol
514 -mcaller-super-interworking  -mcallee-super-interworking @gol
515 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
516 -mword-relocations @gol
517 -mfix-cortex-m3-ldrd @gol
518 -munaligned-access @gol
519 -mneon-for-64bits @gol
520 -mrestrict-it}
522 @emph{AVR Options}
523 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
524 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
525 -mstrict-X -mtiny-stack -Waddr-space-convert}
527 @emph{Blackfin Options}
528 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
529 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
530 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
531 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
532 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
533 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
534 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
535 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
536 -micplb}
538 @emph{C6X Options}
539 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
540 -msim -msdata=@var{sdata-type}}
542 @emph{CRIS Options}
543 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
544 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
545 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
546 -mstack-align  -mdata-align  -mconst-align @gol
547 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
548 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
549 -mmul-bug-workaround  -mno-mul-bug-workaround}
551 @emph{CR16 Options}
552 @gccoptlist{-mmac @gol
553 -mcr16cplus -mcr16c @gol
554 -msim -mint32 -mbit-ops
555 -mdata-model=@var{model}}
557 @emph{Darwin Options}
558 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
559 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
560 -client_name  -compatibility_version  -current_version @gol
561 -dead_strip @gol
562 -dependency-file  -dylib_file  -dylinker_install_name @gol
563 -dynamic  -dynamiclib  -exported_symbols_list @gol
564 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
565 -force_flat_namespace  -headerpad_max_install_names @gol
566 -iframework @gol
567 -image_base  -init  -install_name  -keep_private_externs @gol
568 -multi_module  -multiply_defined  -multiply_defined_unused @gol
569 -noall_load   -no_dead_strip_inits_and_terms @gol
570 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
571 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
572 -private_bundle  -read_only_relocs  -sectalign @gol
573 -sectobjectsymbols  -whyload  -seg1addr @gol
574 -sectcreate  -sectobjectsymbols  -sectorder @gol
575 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
576 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
577 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
578 -single_module  -static  -sub_library  -sub_umbrella @gol
579 -twolevel_namespace  -umbrella  -undefined @gol
580 -unexported_symbols_list  -weak_reference_mismatches @gol
581 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
582 -mkernel -mone-byte-bool}
584 @emph{DEC Alpha Options}
585 @gccoptlist{-mno-fp-regs  -msoft-float @gol
586 -mieee  -mieee-with-inexact  -mieee-conformant @gol
587 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
588 -mtrap-precision=@var{mode}  -mbuild-constants @gol
589 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
590 -mbwx  -mmax  -mfix  -mcix @gol
591 -mfloat-vax  -mfloat-ieee @gol
592 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
593 -msmall-text  -mlarge-text @gol
594 -mmemory-latency=@var{time}}
596 @emph{FR30 Options}
597 @gccoptlist{-msmall-model -mno-lsim}
599 @emph{FRV Options}
600 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
601 -mhard-float  -msoft-float @gol
602 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
603 -mdouble  -mno-double @gol
604 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
605 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
606 -mlinked-fp  -mlong-calls  -malign-labels @gol
607 -mlibrary-pic  -macc-4  -macc-8 @gol
608 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
609 -moptimize-membar -mno-optimize-membar @gol
610 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
611 -mvliw-branch  -mno-vliw-branch @gol
612 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
613 -mno-nested-cond-exec  -mtomcat-stats @gol
614 -mTLS -mtls @gol
615 -mcpu=@var{cpu}}
617 @emph{GNU/Linux Options}
618 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
619 -tno-android-cc -tno-android-ld}
621 @emph{H8/300 Options}
622 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
624 @emph{HPPA Options}
625 @gccoptlist{-march=@var{architecture-type} @gol
626 -mdisable-fpregs  -mdisable-indexing @gol
627 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
628 -mfixed-range=@var{register-range} @gol
629 -mjump-in-delay -mlinker-opt -mlong-calls @gol
630 -mlong-load-store  -mno-disable-fpregs @gol
631 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
632 -mno-jump-in-delay  -mno-long-load-store @gol
633 -mno-portable-runtime  -mno-soft-float @gol
634 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
635 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
636 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
637 -munix=@var{unix-std}  -nolibdld  -static  -threads}
639 @emph{i386 and x86-64 Options}
640 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
641 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
642 -mfpmath=@var{unit} @gol
643 -masm=@var{dialect}  -mno-fancy-math-387 @gol
644 -mno-fp-ret-in-387  -msoft-float @gol
645 -mno-wide-multiply  -mrtd  -malign-double @gol
646 -mpreferred-stack-boundary=@var{num} @gol
647 -mincoming-stack-boundary=@var{num} @gol
648 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
649 -mrecip -mrecip=@var{opt} @gol
650 -mvzeroupper -mprefer-avx128 @gol
651 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
652 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd @gol
653 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
654 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
655 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mthreads @gol
656 -mno-align-stringops  -minline-all-stringops @gol
657 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
658 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy}
659 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
660 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
661 -mregparm=@var{num}  -msseregparm @gol
662 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
663 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
664 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
665 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
666 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
667 -msse2avx -mfentry -m8bit-idiv @gol
668 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
669 -mstack-protector-guard=@var{guard}}
671 @emph{i386 and x86-64 Windows Options}
672 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
673 -mnop-fun-dllimport -mthread @gol
674 -municode -mwin32 -mwindows -fno-set-stack-executable}
676 @emph{IA-64 Options}
677 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
678 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
679 -mconstant-gp  -mauto-pic  -mfused-madd @gol
680 -minline-float-divide-min-latency @gol
681 -minline-float-divide-max-throughput @gol
682 -mno-inline-float-divide @gol
683 -minline-int-divide-min-latency @gol
684 -minline-int-divide-max-throughput  @gol
685 -mno-inline-int-divide @gol
686 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
687 -mno-inline-sqrt @gol
688 -mdwarf2-asm -mearly-stop-bits @gol
689 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
690 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
691 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
692 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
693 -msched-spec-ldc -msched-spec-control-ldc @gol
694 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
695 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
696 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
697 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
699 @emph{LM32 Options}
700 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
701 -msign-extend-enabled -muser-enabled}
703 @emph{M32R/D Options}
704 @gccoptlist{-m32r2 -m32rx -m32r @gol
705 -mdebug @gol
706 -malign-loops -mno-align-loops @gol
707 -missue-rate=@var{number} @gol
708 -mbranch-cost=@var{number} @gol
709 -mmodel=@var{code-size-model-type} @gol
710 -msdata=@var{sdata-type} @gol
711 -mno-flush-func -mflush-func=@var{name} @gol
712 -mno-flush-trap -mflush-trap=@var{number} @gol
713 -G @var{num}}
715 @emph{M32C Options}
716 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
718 @emph{M680x0 Options}
719 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
720 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
721 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
722 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
723 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
724 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
725 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
726 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
727 -mxgot -mno-xgot}
729 @emph{MCore Options}
730 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
731 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
732 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
733 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
734 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
736 @emph{MeP Options}
737 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
738 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
739 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
740 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
741 -mtiny=@var{n}}
743 @emph{MicroBlaze Options}
744 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
745 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
746 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
747 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
748 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
750 @emph{MIPS Options}
751 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
752 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
753 -mips64  -mips64r2 @gol
754 -mips16  -mno-mips16  -mflip-mips16 @gol
755 -minterlink-compressed -mno-interlink-compressed @gol
756 -minterlink-mips16  -mno-interlink-mips16 @gol
757 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
758 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
759 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
760 -mno-float  -msingle-float  -mdouble-float @gol
761 -mabs=@var{mode}  -mnan=@var{encoding} @gol
762 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
763 -mmcu -mmno-mcu @gol
764 -meva -mno-eva @gol
765 -mmicromips -mno-micromips @gol
766 -mfpu=@var{fpu-type} @gol
767 -msmartmips  -mno-smartmips @gol
768 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
769 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
770 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
771 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
772 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
773 -membedded-data  -mno-embedded-data @gol
774 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
775 -mcode-readable=@var{setting} @gol
776 -msplit-addresses  -mno-split-addresses @gol
777 -mexplicit-relocs  -mno-explicit-relocs @gol
778 -mcheck-zero-division  -mno-check-zero-division @gol
779 -mdivide-traps  -mdivide-breaks @gol
780 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
781 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
782 -mfix-24k -mno-fix-24k @gol
783 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
784 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
785 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
786 -mflush-func=@var{func}  -mno-flush-func @gol
787 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
788 -mfp-exceptions -mno-fp-exceptions @gol
789 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
790 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
792 @emph{MMIX Options}
793 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
794 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
795 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
796 -mno-base-addresses  -msingle-exit  -mno-single-exit}
798 @emph{MN10300 Options}
799 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
800 -mno-am33 -mam33 -mam33-2 -mam34 @gol
801 -mtune=@var{cpu-type} @gol
802 -mreturn-pointer-on-d0 @gol
803 -mno-crt0  -mrelax -mliw -msetlb}
805 @emph{Moxie Options}
806 @gccoptlist{-meb -mel -mno-crt0}
808 @emph{MSP430 Options}
809 @gccoptlist{-msim -masm-hex -mmcu= -mlarge -msmall -mrelax}
811 @emph{PDP-11 Options}
812 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
813 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
814 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
815 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
816 -mbranch-expensive  -mbranch-cheap @gol
817 -munix-asm  -mdec-asm}
819 @emph{picoChip Options}
820 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
821 -msymbol-as-address -mno-inefficient-warnings}
823 @emph{PowerPC Options}
824 See RS/6000 and PowerPC Options.
826 @emph{RL78 Options}
827 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
829 @emph{RS/6000 and PowerPC Options}
830 @gccoptlist{-mcpu=@var{cpu-type} @gol
831 -mtune=@var{cpu-type} @gol
832 -mcmodel=@var{code-model} @gol
833 -mpowerpc64 @gol
834 -maltivec  -mno-altivec @gol
835 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
836 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
837 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
838 -mfprnd  -mno-fprnd @gol
839 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
840 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
841 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
842 -malign-power  -malign-natural @gol
843 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
844 -msingle-float -mdouble-float -msimple-fpu @gol
845 -mstring  -mno-string  -mupdate  -mno-update @gol
846 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
847 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
848 -mstrict-align  -mno-strict-align  -mrelocatable @gol
849 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
850 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
851 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
852 -mprioritize-restricted-insns=@var{priority} @gol
853 -msched-costly-dep=@var{dependence_type} @gol
854 -minsert-sched-nops=@var{scheme} @gol
855 -mcall-sysv  -mcall-netbsd @gol
856 -maix-struct-return  -msvr4-struct-return @gol
857 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
858 -mblock-move-inline-limit=@var{num} @gol
859 -misel -mno-isel @gol
860 -misel=yes  -misel=no @gol
861 -mspe -mno-spe @gol
862 -mspe=yes  -mspe=no @gol
863 -mpaired @gol
864 -mgen-cell-microcode -mwarn-cell-microcode @gol
865 -mvrsave -mno-vrsave @gol
866 -mmulhw -mno-mulhw @gol
867 -mdlmzb -mno-dlmzb @gol
868 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
869 -mprototype  -mno-prototype @gol
870 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
871 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
872 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
873 -mno-recip-precision @gol
874 -mveclibabi=@var{type} -mfriz -mno-friz @gol
875 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
876 -msave-toc-indirect -mno-save-toc-indirect @gol
877 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
878 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
879 -mquad-memory -mno-quad-memory @gol
880 -mcompat-align-parm -mno-compat-align-parm}
882 @emph{RX Options}
883 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
884 -mcpu=@gol
885 -mbig-endian-data -mlittle-endian-data @gol
886 -msmall-data @gol
887 -msim  -mno-sim@gol
888 -mas100-syntax -mno-as100-syntax@gol
889 -mrelax@gol
890 -mmax-constant-size=@gol
891 -mint-register=@gol
892 -mpid@gol
893 -mno-warn-multiple-fast-interrupts@gol
894 -msave-acc-in-interrupts}
896 @emph{S/390 and zSeries Options}
897 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
898 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
899 -mlong-double-64 -mlong-double-128 @gol
900 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
901 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
902 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
903 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
904 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
906 @emph{Score Options}
907 @gccoptlist{-meb -mel @gol
908 -mnhwloop @gol
909 -muls @gol
910 -mmac @gol
911 -mscore5 -mscore5u -mscore7 -mscore7d}
913 @emph{SH Options}
914 @gccoptlist{-m1  -m2  -m2e @gol
915 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
916 -m3  -m3e @gol
917 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
918 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
919 -m5-64media  -m5-64media-nofpu @gol
920 -m5-32media  -m5-32media-nofpu @gol
921 -m5-compact  -m5-compact-nofpu @gol
922 -mb  -ml  -mdalign  -mrelax @gol
923 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
924 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
925 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
926 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
927 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
928 -maccumulate-outgoing-args -minvalid-symbols @gol
929 -matomic-model=@var{atomic-model} @gol
930 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
931 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
932 -mpretend-cmove -mtas}
934 @emph{Solaris 2 Options}
935 @gccoptlist{-mimpure-text  -mno-impure-text @gol
936 -pthreads -pthread}
938 @emph{SPARC Options}
939 @gccoptlist{-mcpu=@var{cpu-type} @gol
940 -mtune=@var{cpu-type} @gol
941 -mcmodel=@var{code-model} @gol
942 -mmemory-model=@var{mem-model} @gol
943 -m32  -m64  -mapp-regs  -mno-app-regs @gol
944 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
945 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
946 -mhard-quad-float  -msoft-quad-float @gol
947 -mstack-bias  -mno-stack-bias @gol
948 -munaligned-doubles  -mno-unaligned-doubles @gol
949 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
950 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
951 -mcbcond -mno-cbcond @gol
952 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
953 -mfix-at697f -mfix-ut699}
955 @emph{SPU Options}
956 @gccoptlist{-mwarn-reloc -merror-reloc @gol
957 -msafe-dma -munsafe-dma @gol
958 -mbranch-hints @gol
959 -msmall-mem -mlarge-mem -mstdmain @gol
960 -mfixed-range=@var{register-range} @gol
961 -mea32 -mea64 @gol
962 -maddress-space-conversion -mno-address-space-conversion @gol
963 -mcache-size=@var{cache-size} @gol
964 -matomic-updates -mno-atomic-updates}
966 @emph{System V Options}
967 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
969 @emph{TILE-Gx Options}
970 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
972 @emph{TILEPro Options}
973 @gccoptlist{-mcpu=@var{cpu} -m32}
975 @emph{V850 Options}
976 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
977 -mprolog-function  -mno-prolog-function  -mspace @gol
978 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
979 -mapp-regs  -mno-app-regs @gol
980 -mdisable-callt  -mno-disable-callt @gol
981 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
982 -mv850e -mv850 -mv850e3v5 @gol
983 -mloop @gol
984 -mrelax @gol
985 -mlong-jumps @gol
986 -msoft-float @gol
987 -mhard-float @gol
988 -mgcc-abi @gol
989 -mrh850-abi @gol
990 -mbig-switch}
992 @emph{VAX Options}
993 @gccoptlist{-mg  -mgnu  -munix}
995 @emph{VMS Options}
996 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
997 -mpointer-size=@var{size}}
999 @emph{VxWorks Options}
1000 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1001 -Xbind-lazy  -Xbind-now}
1003 @emph{x86-64 Options}
1004 See i386 and x86-64 Options.
1006 @emph{Xstormy16 Options}
1007 @gccoptlist{-msim}
1009 @emph{Xtensa Options}
1010 @gccoptlist{-mconst16 -mno-const16 @gol
1011 -mfused-madd  -mno-fused-madd @gol
1012 -mforce-no-pic @gol
1013 -mserialize-volatile  -mno-serialize-volatile @gol
1014 -mtext-section-literals  -mno-text-section-literals @gol
1015 -mtarget-align  -mno-target-align @gol
1016 -mlongcalls  -mno-longcalls}
1018 @emph{zSeries Options}
1019 See S/390 and zSeries Options.
1021 @item Code Generation Options
1022 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1023 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1024 -ffixed-@var{reg}  -fexceptions @gol
1025 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1026 -fasynchronous-unwind-tables @gol
1027 -finhibit-size-directive  -finstrument-functions @gol
1028 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1029 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1030 -fno-common  -fno-ident @gol
1031 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1032 -fno-jump-tables @gol
1033 -frecord-gcc-switches @gol
1034 -freg-struct-return  -fshort-enums @gol
1035 -fshort-double  -fshort-wchar @gol
1036 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1037 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1038 -fno-stack-limit -fsplit-stack @gol
1039 -fleading-underscore  -ftls-model=@var{model} @gol
1040 -fstack-reuse=@var{reuse_level} @gol
1041 -ftrapv  -fwrapv  -fbounds-check @gol
1042 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1043 @end table
1045 @menu
1046 * Overall Options::     Controlling the kind of output:
1047                         an executable, object files, assembler files,
1048                         or preprocessed source.
1049 * C Dialect Options::   Controlling the variant of C language compiled.
1050 * C++ Dialect Options:: Variations on C++.
1051 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1052                         and Objective-C++.
1053 * Language Independent Options:: Controlling how diagnostics should be
1054                         formatted.
1055 * Warning Options::     How picky should the compiler be?
1056 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1057 * Optimize Options::    How much optimization?
1058 * Preprocessor Options:: Controlling header files and macro definitions.
1059                          Also, getting dependency information for Make.
1060 * Assembler Options::   Passing options to the assembler.
1061 * Link Options::        Specifying libraries and so on.
1062 * Directory Options::   Where to find header files and libraries.
1063                         Where to find the compiler executable files.
1064 * Spec Files::          How to pass switches to sub-processes.
1065 * Target Options::      Running a cross-compiler, or an old version of GCC.
1066 @end menu
1068 @node Overall Options
1069 @section Options Controlling the Kind of Output
1071 Compilation can involve up to four stages: preprocessing, compilation
1072 proper, assembly and linking, always in that order.  GCC is capable of
1073 preprocessing and compiling several files either into several
1074 assembler input files, or into one assembler input file; then each
1075 assembler input file produces an object file, and linking combines all
1076 the object files (those newly compiled, and those specified as input)
1077 into an executable file.
1079 @cindex file name suffix
1080 For any given input file, the file name suffix determines what kind of
1081 compilation is done:
1083 @table @gcctabopt
1084 @item @var{file}.c
1085 C source code that must be preprocessed.
1087 @item @var{file}.i
1088 C source code that should not be preprocessed.
1090 @item @var{file}.ii
1091 C++ source code that should not be preprocessed.
1093 @item @var{file}.m
1094 Objective-C source code.  Note that you must link with the @file{libobjc}
1095 library to make an Objective-C program work.
1097 @item @var{file}.mi
1098 Objective-C source code that should not be preprocessed.
1100 @item @var{file}.mm
1101 @itemx @var{file}.M
1102 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1103 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1104 to a literal capital M@.
1106 @item @var{file}.mii
1107 Objective-C++ source code that should not be preprocessed.
1109 @item @var{file}.h
1110 C, C++, Objective-C or Objective-C++ header file to be turned into a
1111 precompiled header (default), or C, C++ header file to be turned into an
1112 Ada spec (via the @option{-fdump-ada-spec} switch).
1114 @item @var{file}.cc
1115 @itemx @var{file}.cp
1116 @itemx @var{file}.cxx
1117 @itemx @var{file}.cpp
1118 @itemx @var{file}.CPP
1119 @itemx @var{file}.c++
1120 @itemx @var{file}.C
1121 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1122 the last two letters must both be literally @samp{x}.  Likewise,
1123 @samp{.C} refers to a literal capital C@.
1125 @item @var{file}.mm
1126 @itemx @var{file}.M
1127 Objective-C++ source code that must be preprocessed.
1129 @item @var{file}.mii
1130 Objective-C++ source code that should not be preprocessed.
1132 @item @var{file}.hh
1133 @itemx @var{file}.H
1134 @itemx @var{file}.hp
1135 @itemx @var{file}.hxx
1136 @itemx @var{file}.hpp
1137 @itemx @var{file}.HPP
1138 @itemx @var{file}.h++
1139 @itemx @var{file}.tcc
1140 C++ header file to be turned into a precompiled header or Ada spec.
1142 @item @var{file}.f
1143 @itemx @var{file}.for
1144 @itemx @var{file}.ftn
1145 Fixed form Fortran source code that should not be preprocessed.
1147 @item @var{file}.F
1148 @itemx @var{file}.FOR
1149 @itemx @var{file}.fpp
1150 @itemx @var{file}.FPP
1151 @itemx @var{file}.FTN
1152 Fixed form Fortran source code that must be preprocessed (with the traditional
1153 preprocessor).
1155 @item @var{file}.f90
1156 @itemx @var{file}.f95
1157 @itemx @var{file}.f03
1158 @itemx @var{file}.f08
1159 Free form Fortran source code that should not be preprocessed.
1161 @item @var{file}.F90
1162 @itemx @var{file}.F95
1163 @itemx @var{file}.F03
1164 @itemx @var{file}.F08
1165 Free form Fortran source code that must be preprocessed (with the
1166 traditional preprocessor).
1168 @item @var{file}.go
1169 Go source code.
1171 @c FIXME: Descriptions of Java file types.
1172 @c @var{file}.java
1173 @c @var{file}.class
1174 @c @var{file}.zip
1175 @c @var{file}.jar
1177 @item @var{file}.ads
1178 Ada source code file that contains a library unit declaration (a
1179 declaration of a package, subprogram, or generic, or a generic
1180 instantiation), or a library unit renaming declaration (a package,
1181 generic, or subprogram renaming declaration).  Such files are also
1182 called @dfn{specs}.
1184 @item @var{file}.adb
1185 Ada source code file containing a library unit body (a subprogram or
1186 package body).  Such files are also called @dfn{bodies}.
1188 @c GCC also knows about some suffixes for languages not yet included:
1189 @c Pascal:
1190 @c @var{file}.p
1191 @c @var{file}.pas
1192 @c Ratfor:
1193 @c @var{file}.r
1195 @item @var{file}.s
1196 Assembler code.
1198 @item @var{file}.S
1199 @itemx @var{file}.sx
1200 Assembler code that must be preprocessed.
1202 @item @var{other}
1203 An object file to be fed straight into linking.
1204 Any file name with no recognized suffix is treated this way.
1205 @end table
1207 @opindex x
1208 You can specify the input language explicitly with the @option{-x} option:
1210 @table @gcctabopt
1211 @item -x @var{language}
1212 Specify explicitly the @var{language} for the following input files
1213 (rather than letting the compiler choose a default based on the file
1214 name suffix).  This option applies to all following input files until
1215 the next @option{-x} option.  Possible values for @var{language} are:
1216 @smallexample
1217 c  c-header  cpp-output
1218 c++  c++-header  c++-cpp-output
1219 objective-c  objective-c-header  objective-c-cpp-output
1220 objective-c++ objective-c++-header objective-c++-cpp-output
1221 assembler  assembler-with-cpp
1223 f77  f77-cpp-input f95  f95-cpp-input
1225 java
1226 @end smallexample
1228 @item -x none
1229 Turn off any specification of a language, so that subsequent files are
1230 handled according to their file name suffixes (as they are if @option{-x}
1231 has not been used at all).
1233 @item -pass-exit-codes
1234 @opindex pass-exit-codes
1235 Normally the @command{gcc} program exits with the code of 1 if any
1236 phase of the compiler returns a non-success return code.  If you specify
1237 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1238 the numerically highest error produced by any phase returning an error
1239 indication.  The C, C++, and Fortran front ends return 4 if an internal
1240 compiler error is encountered.
1241 @end table
1243 If you only want some of the stages of compilation, you can use
1244 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1245 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1246 @command{gcc} is to stop.  Note that some combinations (for example,
1247 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1249 @table @gcctabopt
1250 @item -c
1251 @opindex c
1252 Compile or assemble the source files, but do not link.  The linking
1253 stage simply is not done.  The ultimate output is in the form of an
1254 object file for each source file.
1256 By default, the object file name for a source file is made by replacing
1257 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1259 Unrecognized input files, not requiring compilation or assembly, are
1260 ignored.
1262 @item -S
1263 @opindex S
1264 Stop after the stage of compilation proper; do not assemble.  The output
1265 is in the form of an assembler code file for each non-assembler input
1266 file specified.
1268 By default, the assembler file name for a source file is made by
1269 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1271 Input files that don't require compilation are ignored.
1273 @item -E
1274 @opindex E
1275 Stop after the preprocessing stage; do not run the compiler proper.  The
1276 output is in the form of preprocessed source code, which is sent to the
1277 standard output.
1279 Input files that don't require preprocessing are ignored.
1281 @cindex output file option
1282 @item -o @var{file}
1283 @opindex o
1284 Place output in file @var{file}.  This applies to whatever
1285 sort of output is being produced, whether it be an executable file,
1286 an object file, an assembler file or preprocessed C code.
1288 If @option{-o} is not specified, the default is to put an executable
1289 file in @file{a.out}, the object file for
1290 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1291 assembler file in @file{@var{source}.s}, a precompiled header file in
1292 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1293 standard output.
1295 @item -v
1296 @opindex v
1297 Print (on standard error output) the commands executed to run the stages
1298 of compilation.  Also print the version number of the compiler driver
1299 program and of the preprocessor and the compiler proper.
1301 @item -###
1302 @opindex ###
1303 Like @option{-v} except the commands are not executed and arguments
1304 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1305 This is useful for shell scripts to capture the driver-generated command lines.
1307 @item -pipe
1308 @opindex pipe
1309 Use pipes rather than temporary files for communication between the
1310 various stages of compilation.  This fails to work on some systems where
1311 the assembler is unable to read from a pipe; but the GNU assembler has
1312 no trouble.
1314 @item --help
1315 @opindex help
1316 Print (on the standard output) a description of the command-line options
1317 understood by @command{gcc}.  If the @option{-v} option is also specified
1318 then @option{--help} is also passed on to the various processes
1319 invoked by @command{gcc}, so that they can display the command-line options
1320 they accept.  If the @option{-Wextra} option has also been specified
1321 (prior to the @option{--help} option), then command-line options that
1322 have no documentation associated with them are also displayed.
1324 @item --target-help
1325 @opindex target-help
1326 Print (on the standard output) a description of target-specific command-line
1327 options for each tool.  For some targets extra target-specific
1328 information may also be printed.
1330 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1331 Print (on the standard output) a description of the command-line
1332 options understood by the compiler that fit into all specified classes
1333 and qualifiers.  These are the supported classes:
1335 @table @asis
1336 @item @samp{optimizers}
1337 Display all of the optimization options supported by the
1338 compiler.
1340 @item @samp{warnings}
1341 Display all of the options controlling warning messages
1342 produced by the compiler.
1344 @item @samp{target}
1345 Display target-specific options.  Unlike the
1346 @option{--target-help} option however, target-specific options of the
1347 linker and assembler are not displayed.  This is because those
1348 tools do not currently support the extended @option{--help=} syntax.
1350 @item @samp{params}
1351 Display the values recognized by the @option{--param}
1352 option.
1354 @item @var{language}
1355 Display the options supported for @var{language}, where
1356 @var{language} is the name of one of the languages supported in this
1357 version of GCC@.
1359 @item @samp{common}
1360 Display the options that are common to all languages.
1361 @end table
1363 These are the supported qualifiers:
1365 @table @asis
1366 @item @samp{undocumented}
1367 Display only those options that are undocumented.
1369 @item @samp{joined}
1370 Display options taking an argument that appears after an equal
1371 sign in the same continuous piece of text, such as:
1372 @samp{--help=target}.
1374 @item @samp{separate}
1375 Display options taking an argument that appears as a separate word
1376 following the original option, such as: @samp{-o output-file}.
1377 @end table
1379 Thus for example to display all the undocumented target-specific
1380 switches supported by the compiler, use:
1382 @smallexample
1383 --help=target,undocumented
1384 @end smallexample
1386 The sense of a qualifier can be inverted by prefixing it with the
1387 @samp{^} character, so for example to display all binary warning
1388 options (i.e., ones that are either on or off and that do not take an
1389 argument) that have a description, use:
1391 @smallexample
1392 --help=warnings,^joined,^undocumented
1393 @end smallexample
1395 The argument to @option{--help=} should not consist solely of inverted
1396 qualifiers.
1398 Combining several classes is possible, although this usually
1399 restricts the output so much that there is nothing to display.  One
1400 case where it does work, however, is when one of the classes is
1401 @var{target}.  For example, to display all the target-specific
1402 optimization options, use:
1404 @smallexample
1405 --help=target,optimizers
1406 @end smallexample
1408 The @option{--help=} option can be repeated on the command line.  Each
1409 successive use displays its requested class of options, skipping
1410 those that have already been displayed.
1412 If the @option{-Q} option appears on the command line before the
1413 @option{--help=} option, then the descriptive text displayed by
1414 @option{--help=} is changed.  Instead of describing the displayed
1415 options, an indication is given as to whether the option is enabled,
1416 disabled or set to a specific value (assuming that the compiler
1417 knows this at the point where the @option{--help=} option is used).
1419 Here is a truncated example from the ARM port of @command{gcc}:
1421 @smallexample
1422   % gcc -Q -mabi=2 --help=target -c
1423   The following options are target specific:
1424   -mabi=                                2
1425   -mabort-on-noreturn                   [disabled]
1426   -mapcs                                [disabled]
1427 @end smallexample
1429 The output is sensitive to the effects of previous command-line
1430 options, so for example it is possible to find out which optimizations
1431 are enabled at @option{-O2} by using:
1433 @smallexample
1434 -Q -O2 --help=optimizers
1435 @end smallexample
1437 Alternatively you can discover which binary optimizations are enabled
1438 by @option{-O3} by using:
1440 @smallexample
1441 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1442 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1443 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1444 @end smallexample
1446 @item -no-canonical-prefixes
1447 @opindex no-canonical-prefixes
1448 Do not expand any symbolic links, resolve references to @samp{/../}
1449 or @samp{/./}, or make the path absolute when generating a relative
1450 prefix.
1452 @item --version
1453 @opindex version
1454 Display the version number and copyrights of the invoked GCC@.
1456 @item -wrapper
1457 @opindex wrapper
1458 Invoke all subcommands under a wrapper program.  The name of the
1459 wrapper program and its parameters are passed as a comma separated
1460 list.
1462 @smallexample
1463 gcc -c t.c -wrapper gdb,--args
1464 @end smallexample
1466 @noindent
1467 This invokes all subprograms of @command{gcc} under
1468 @samp{gdb --args}, thus the invocation of @command{cc1} is
1469 @samp{gdb --args cc1 @dots{}}.
1471 @item -fplugin=@var{name}.so
1472 Load the plugin code in file @var{name}.so, assumed to be a
1473 shared object to be dlopen'd by the compiler.  The base name of
1474 the shared object file is used to identify the plugin for the
1475 purposes of argument parsing (See
1476 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1477 Each plugin should define the callback functions specified in the
1478 Plugins API.
1480 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1481 Define an argument called @var{key} with a value of @var{value}
1482 for the plugin called @var{name}.
1484 @item -fdump-ada-spec@r{[}-slim@r{]}
1485 For C and C++ source and include files, generate corresponding Ada
1486 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1487 GNAT User's Guide}, which provides detailed documentation on this feature.
1489 @item -fdump-go-spec=@var{file}
1490 For input files in any language, generate corresponding Go
1491 declarations in @var{file}.  This generates Go @code{const},
1492 @code{type}, @code{var}, and @code{func} declarations which may be a
1493 useful way to start writing a Go interface to code written in some
1494 other language.
1496 @include @value{srcdir}/../libiberty/at-file.texi
1497 @end table
1499 @node Invoking G++
1500 @section Compiling C++ Programs
1502 @cindex suffixes for C++ source
1503 @cindex C++ source file suffixes
1504 C++ source files conventionally use one of the suffixes @samp{.C},
1505 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1506 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1507 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1508 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1509 files with these names and compiles them as C++ programs even if you
1510 call the compiler the same way as for compiling C programs (usually
1511 with the name @command{gcc}).
1513 @findex g++
1514 @findex c++
1515 However, the use of @command{gcc} does not add the C++ library.
1516 @command{g++} is a program that calls GCC and automatically specifies linking
1517 against the C++ library.  It treats @samp{.c},
1518 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1519 files unless @option{-x} is used.  This program is also useful when
1520 precompiling a C header file with a @samp{.h} extension for use in C++
1521 compilations.  On many systems, @command{g++} is also installed with
1522 the name @command{c++}.
1524 @cindex invoking @command{g++}
1525 When you compile C++ programs, you may specify many of the same
1526 command-line options that you use for compiling programs in any
1527 language; or command-line options meaningful for C and related
1528 languages; or options that are meaningful only for C++ programs.
1529 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1530 explanations of options for languages related to C@.
1531 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1532 explanations of options that are meaningful only for C++ programs.
1534 @node C Dialect Options
1535 @section Options Controlling C Dialect
1536 @cindex dialect options
1537 @cindex language dialect options
1538 @cindex options, dialect
1540 The following options control the dialect of C (or languages derived
1541 from C, such as C++, Objective-C and Objective-C++) that the compiler
1542 accepts:
1544 @table @gcctabopt
1545 @cindex ANSI support
1546 @cindex ISO support
1547 @item -ansi
1548 @opindex ansi
1549 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1550 equivalent to @option{-std=c++98}.
1552 This turns off certain features of GCC that are incompatible with ISO
1553 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1554 such as the @code{asm} and @code{typeof} keywords, and
1555 predefined macros such as @code{unix} and @code{vax} that identify the
1556 type of system you are using.  It also enables the undesirable and
1557 rarely used ISO trigraph feature.  For the C compiler,
1558 it disables recognition of C++ style @samp{//} comments as well as
1559 the @code{inline} keyword.
1561 The alternate keywords @code{__asm__}, @code{__extension__},
1562 @code{__inline__} and @code{__typeof__} continue to work despite
1563 @option{-ansi}.  You would not want to use them in an ISO C program, of
1564 course, but it is useful to put them in header files that might be included
1565 in compilations done with @option{-ansi}.  Alternate predefined macros
1566 such as @code{__unix__} and @code{__vax__} are also available, with or
1567 without @option{-ansi}.
1569 The @option{-ansi} option does not cause non-ISO programs to be
1570 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1571 addition to @option{-ansi}.  @xref{Warning Options}.
1573 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1574 option is used.  Some header files may notice this macro and refrain
1575 from declaring certain functions or defining certain macros that the
1576 ISO standard doesn't call for; this is to avoid interfering with any
1577 programs that might use these names for other things.
1579 Functions that are normally built in but do not have semantics
1580 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1581 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1582 built-in functions provided by GCC}, for details of the functions
1583 affected.
1585 @item -std=
1586 @opindex std
1587 Determine the language standard. @xref{Standards,,Language Standards
1588 Supported by GCC}, for details of these standard versions.  This option
1589 is currently only supported when compiling C or C++.
1591 The compiler can accept several base standards, such as @samp{c90} or
1592 @samp{c++98}, and GNU dialects of those standards, such as
1593 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1594 compiler accepts all programs following that standard plus those
1595 using GNU extensions that do not contradict it.  For example,
1596 @option{-std=c90} turns off certain features of GCC that are
1597 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1598 keywords, but not other GNU extensions that do not have a meaning in
1599 ISO C90, such as omitting the middle term of a @code{?:}
1600 expression. On the other hand, when a GNU dialect of a standard is
1601 specified, all features supported by the compiler are enabled, even when
1602 those features change the meaning of the base standard.  As a result, some
1603 strict-conforming programs may be rejected.  The particular standard
1604 is used by @option{-Wpedantic} to identify which features are GNU
1605 extensions given that version of the standard. For example
1606 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1607 comments, while @option{-std=gnu99 -Wpedantic} does not.
1609 A value for this option must be provided; possible values are
1611 @table @samp
1612 @item c90
1613 @itemx c89
1614 @itemx iso9899:1990
1615 Support all ISO C90 programs (certain GNU extensions that conflict
1616 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1618 @item iso9899:199409
1619 ISO C90 as modified in amendment 1.
1621 @item c99
1622 @itemx c9x
1623 @itemx iso9899:1999
1624 @itemx iso9899:199x
1625 ISO C99.  Note that this standard is not yet fully supported; see
1626 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1627 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1629 @item c11
1630 @itemx c1x
1631 @itemx iso9899:2011
1632 ISO C11, the 2011 revision of the ISO C standard.
1633 Support is incomplete and experimental.  The name @samp{c1x} is
1634 deprecated.
1636 @item gnu90
1637 @itemx gnu89
1638 GNU dialect of ISO C90 (including some C99 features). This
1639 is the default for C code.
1641 @item gnu99
1642 @itemx gnu9x
1643 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1644 this will become the default.  The name @samp{gnu9x} is deprecated.
1646 @item gnu11
1647 @itemx gnu1x
1648 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1649 name @samp{gnu1x} is deprecated.
1651 @item c++98
1652 @itemx c++03
1653 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1654 additional defect reports. Same as @option{-ansi} for C++ code.
1656 @item gnu++98
1657 @itemx gnu++03
1658 GNU dialect of @option{-std=c++98}.  This is the default for
1659 C++ code.
1661 @item c++11
1662 @itemx c++0x
1663 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1664 experimental, and may change in incompatible ways in future releases.
1665 The name @samp{c++0x} is deprecated.
1667 @item gnu++11
1668 @itemx gnu++0x
1669 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1670 experimental, and may change in incompatible ways in future releases.
1671 The name @samp{gnu++0x} is deprecated.
1673 @item c++1y
1674 The next revision of the ISO C++ standard, tentatively planned for
1675 2014.  Support is highly experimental, and will almost certainly
1676 change in incompatible ways in future releases.
1678 @item gnu++1y
1679 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1680 and will almost certainly change in incompatible ways in future
1681 releases.
1682 @end table
1684 @item -fgnu89-inline
1685 @opindex fgnu89-inline
1686 The option @option{-fgnu89-inline} tells GCC to use the traditional
1687 GNU semantics for @code{inline} functions when in C99 mode.
1688 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1689 is accepted and ignored by GCC versions 4.1.3 up to but not including
1690 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1691 C99 mode.  Using this option is roughly equivalent to adding the
1692 @code{gnu_inline} function attribute to all inline functions
1693 (@pxref{Function Attributes}).
1695 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1696 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1697 specifies the default behavior).  This option was first supported in
1698 GCC 4.3.  This option is not supported in @option{-std=c90} or
1699 @option{-std=gnu90} mode.
1701 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1702 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1703 in effect for @code{inline} functions.  @xref{Common Predefined
1704 Macros,,,cpp,The C Preprocessor}.
1706 @item -aux-info @var{filename}
1707 @opindex aux-info
1708 Output to the given filename prototyped declarations for all functions
1709 declared and/or defined in a translation unit, including those in header
1710 files.  This option is silently ignored in any language other than C@.
1712 Besides declarations, the file indicates, in comments, the origin of
1713 each declaration (source file and line), whether the declaration was
1714 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1715 @samp{O} for old, respectively, in the first character after the line
1716 number and the colon), and whether it came from a declaration or a
1717 definition (@samp{C} or @samp{F}, respectively, in the following
1718 character).  In the case of function definitions, a K&R-style list of
1719 arguments followed by their declarations is also provided, inside
1720 comments, after the declaration.
1722 @item -fallow-parameterless-variadic-functions
1723 Accept variadic functions without named parameters.
1725 Although it is possible to define such a function, this is not very
1726 useful as it is not possible to read the arguments.  This is only
1727 supported for C as this construct is allowed by C++.
1729 @item -fno-asm
1730 @opindex fno-asm
1731 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1732 keyword, so that code can use these words as identifiers.  You can use
1733 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1734 instead.  @option{-ansi} implies @option{-fno-asm}.
1736 In C++, this switch only affects the @code{typeof} keyword, since
1737 @code{asm} and @code{inline} are standard keywords.  You may want to
1738 use the @option{-fno-gnu-keywords} flag instead, which has the same
1739 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1740 switch only affects the @code{asm} and @code{typeof} keywords, since
1741 @code{inline} is a standard keyword in ISO C99.
1743 @item -fno-builtin
1744 @itemx -fno-builtin-@var{function}
1745 @opindex fno-builtin
1746 @cindex built-in functions
1747 Don't recognize built-in functions that do not begin with
1748 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1749 functions provided by GCC}, for details of the functions affected,
1750 including those which are not built-in functions when @option{-ansi} or
1751 @option{-std} options for strict ISO C conformance are used because they
1752 do not have an ISO standard meaning.
1754 GCC normally generates special code to handle certain built-in functions
1755 more efficiently; for instance, calls to @code{alloca} may become single
1756 instructions which adjust the stack directly, and calls to @code{memcpy}
1757 may become inline copy loops.  The resulting code is often both smaller
1758 and faster, but since the function calls no longer appear as such, you
1759 cannot set a breakpoint on those calls, nor can you change the behavior
1760 of the functions by linking with a different library.  In addition,
1761 when a function is recognized as a built-in function, GCC may use
1762 information about that function to warn about problems with calls to
1763 that function, or to generate more efficient code, even if the
1764 resulting code still contains calls to that function.  For example,
1765 warnings are given with @option{-Wformat} for bad calls to
1766 @code{printf} when @code{printf} is built in and @code{strlen} is
1767 known not to modify global memory.
1769 With the @option{-fno-builtin-@var{function}} option
1770 only the built-in function @var{function} is
1771 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1772 function is named that is not built-in in this version of GCC, this
1773 option is ignored.  There is no corresponding
1774 @option{-fbuiltin-@var{function}} option; if you wish to enable
1775 built-in functions selectively when using @option{-fno-builtin} or
1776 @option{-ffreestanding}, you may define macros such as:
1778 @smallexample
1779 #define abs(n)          __builtin_abs ((n))
1780 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1781 @end smallexample
1783 @item -fhosted
1784 @opindex fhosted
1785 @cindex hosted environment
1787 Assert that compilation targets a hosted environment.  This implies
1788 @option{-fbuiltin}.  A hosted environment is one in which the
1789 entire standard library is available, and in which @code{main} has a return
1790 type of @code{int}.  Examples are nearly everything except a kernel.
1791 This is equivalent to @option{-fno-freestanding}.
1793 @item -ffreestanding
1794 @opindex ffreestanding
1795 @cindex hosted environment
1797 Assert that compilation targets a freestanding environment.  This
1798 implies @option{-fno-builtin}.  A freestanding environment
1799 is one in which the standard library may not exist, and program startup may
1800 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1801 This is equivalent to @option{-fno-hosted}.
1803 @xref{Standards,,Language Standards Supported by GCC}, for details of
1804 freestanding and hosted environments.
1806 @item -fopenmp
1807 @opindex fopenmp
1808 @cindex OpenMP parallel
1809 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1810 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1811 compiler generates parallel code according to the OpenMP Application
1812 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1813 implies @option{-pthread}, and thus is only supported on targets that
1814 have support for @option{-pthread}.
1816 @item -fcilkplus
1817 @opindex fcilkplus
1818 @cindex Enable Cilk Plus
1819 Enable the usage of Cilk Plus language extension features for C/C++.
1820 When the option @option{-fcilkplus} is specified, enable the usage of
1821 the Cilk Plus Language extension features for C/C++.  The present
1822 implementation follows ABI version 0.9.  This is an experimental
1823 feature that is only partially complete, and whose interface may
1824 change in future versions of GCC as the official specification
1825 changes.  Currently only the array notation feature of the language
1826 specification has been implemented.  More features will be implemented
1827 in subsequent release cycles.
1829 @item -fgnu-tm
1830 @opindex fgnu-tm
1831 When the option @option{-fgnu-tm} is specified, the compiler
1832 generates code for the Linux variant of Intel's current Transactional
1833 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1834 an experimental feature whose interface may change in future versions
1835 of GCC, as the official specification changes.  Please note that not
1836 all architectures are supported for this feature.
1838 For more information on GCC's support for transactional memory,
1839 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1840 Transactional Memory Library}.
1842 Note that the transactional memory feature is not supported with
1843 non-call exceptions (@option{-fnon-call-exceptions}).
1845 @item -fms-extensions
1846 @opindex fms-extensions
1847 Accept some non-standard constructs used in Microsoft header files.
1849 In C++ code, this allows member names in structures to be similar
1850 to previous types declarations.
1852 @smallexample
1853 typedef int UOW;
1854 struct ABC @{
1855   UOW UOW;
1857 @end smallexample
1859 Some cases of unnamed fields in structures and unions are only
1860 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1861 fields within structs/unions}, for details.
1863 Note that this option is off for all targets but i?86 and x86_64
1864 targets using ms-abi.
1865 @item -fplan9-extensions
1866 Accept some non-standard constructs used in Plan 9 code.
1868 This enables @option{-fms-extensions}, permits passing pointers to
1869 structures with anonymous fields to functions that expect pointers to
1870 elements of the type of the field, and permits referring to anonymous
1871 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1872 struct/union fields within structs/unions}, for details.  This is only
1873 supported for C, not C++.
1875 @item -trigraphs
1876 @opindex trigraphs
1877 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1878 options for strict ISO C conformance) implies @option{-trigraphs}.
1880 @cindex traditional C language
1881 @cindex C language, traditional
1882 @item -traditional
1883 @itemx -traditional-cpp
1884 @opindex traditional-cpp
1885 @opindex traditional
1886 Formerly, these options caused GCC to attempt to emulate a pre-standard
1887 C compiler.  They are now only supported with the @option{-E} switch.
1888 The preprocessor continues to support a pre-standard mode.  See the GNU
1889 CPP manual for details.
1891 @item -fcond-mismatch
1892 @opindex fcond-mismatch
1893 Allow conditional expressions with mismatched types in the second and
1894 third arguments.  The value of such an expression is void.  This option
1895 is not supported for C++.
1897 @item -flax-vector-conversions
1898 @opindex flax-vector-conversions
1899 Allow implicit conversions between vectors with differing numbers of
1900 elements and/or incompatible element types.  This option should not be
1901 used for new code.
1903 @item -funsigned-char
1904 @opindex funsigned-char
1905 Let the type @code{char} be unsigned, like @code{unsigned char}.
1907 Each kind of machine has a default for what @code{char} should
1908 be.  It is either like @code{unsigned char} by default or like
1909 @code{signed char} by default.
1911 Ideally, a portable program should always use @code{signed char} or
1912 @code{unsigned char} when it depends on the signedness of an object.
1913 But many programs have been written to use plain @code{char} and
1914 expect it to be signed, or expect it to be unsigned, depending on the
1915 machines they were written for.  This option, and its inverse, let you
1916 make such a program work with the opposite default.
1918 The type @code{char} is always a distinct type from each of
1919 @code{signed char} or @code{unsigned char}, even though its behavior
1920 is always just like one of those two.
1922 @item -fsigned-char
1923 @opindex fsigned-char
1924 Let the type @code{char} be signed, like @code{signed char}.
1926 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1927 the negative form of @option{-funsigned-char}.  Likewise, the option
1928 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1930 @item -fsigned-bitfields
1931 @itemx -funsigned-bitfields
1932 @itemx -fno-signed-bitfields
1933 @itemx -fno-unsigned-bitfields
1934 @opindex fsigned-bitfields
1935 @opindex funsigned-bitfields
1936 @opindex fno-signed-bitfields
1937 @opindex fno-unsigned-bitfields
1938 These options control whether a bit-field is signed or unsigned, when the
1939 declaration does not use either @code{signed} or @code{unsigned}.  By
1940 default, such a bit-field is signed, because this is consistent: the
1941 basic integer types such as @code{int} are signed types.
1942 @end table
1944 @node C++ Dialect Options
1945 @section Options Controlling C++ Dialect
1947 @cindex compiler options, C++
1948 @cindex C++ options, command-line
1949 @cindex options, C++
1950 This section describes the command-line options that are only meaningful
1951 for C++ programs.  You can also use most of the GNU compiler options
1952 regardless of what language your program is in.  For example, you
1953 might compile a file @code{firstClass.C} like this:
1955 @smallexample
1956 g++ -g -frepo -O -c firstClass.C
1957 @end smallexample
1959 @noindent
1960 In this example, only @option{-frepo} is an option meant
1961 only for C++ programs; you can use the other options with any
1962 language supported by GCC@.
1964 Here is a list of options that are @emph{only} for compiling C++ programs:
1966 @table @gcctabopt
1968 @item -fabi-version=@var{n}
1969 @opindex fabi-version
1970 Use version @var{n} of the C++ ABI@.  The default is version 2.
1972 Version 0 refers to the version conforming most closely to
1973 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1974 will change in different versions of G++ as ABI bugs are fixed.
1976 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1978 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1980 Version 3 corrects an error in mangling a constant address as a
1981 template argument.
1983 Version 4, which first appeared in G++ 4.5, implements a standard
1984 mangling for vector types.
1986 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1987 attribute const/volatile on function pointer types, decltype of a
1988 plain decl, and use of a function parameter in the declaration of
1989 another parameter.
1991 Version 6, which first appeared in G++ 4.7, corrects the promotion
1992 behavior of C++11 scoped enums and the mangling of template argument
1993 packs, const/static_cast, prefix ++ and --, and a class scope function
1994 used as a template argument.
1996 See also @option{-Wabi}.
1998 @item -fno-access-control
1999 @opindex fno-access-control
2000 Turn off all access checking.  This switch is mainly useful for working
2001 around bugs in the access control code.
2003 @item -fcheck-new
2004 @opindex fcheck-new
2005 Check that the pointer returned by @code{operator new} is non-null
2006 before attempting to modify the storage allocated.  This check is
2007 normally unnecessary because the C++ standard specifies that
2008 @code{operator new} only returns @code{0} if it is declared
2009 @samp{throw()}, in which case the compiler always checks the
2010 return value even without this option.  In all other cases, when
2011 @code{operator new} has a non-empty exception specification, memory
2012 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2013 @samp{new (nothrow)}.
2015 @item -fconstexpr-depth=@var{n}
2016 @opindex fconstexpr-depth
2017 Set the maximum nested evaluation depth for C++11 constexpr functions
2018 to @var{n}.  A limit is needed to detect endless recursion during
2019 constant expression evaluation.  The minimum specified by the standard
2020 is 512.
2022 @item -fdeduce-init-list
2023 @opindex fdeduce-init-list
2024 Enable deduction of a template type parameter as
2025 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2027 @smallexample
2028 template <class T> auto forward(T t) -> decltype (realfn (t))
2030   return realfn (t);
2033 void f()
2035   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2037 @end smallexample
2039 This deduction was implemented as a possible extension to the
2040 originally proposed semantics for the C++11 standard, but was not part
2041 of the final standard, so it is disabled by default.  This option is
2042 deprecated, and may be removed in a future version of G++.
2044 @item -ffriend-injection
2045 @opindex ffriend-injection
2046 Inject friend functions into the enclosing namespace, so that they are
2047 visible outside the scope of the class in which they are declared.
2048 Friend functions were documented to work this way in the old Annotated
2049 C++ Reference Manual, and versions of G++ before 4.1 always worked
2050 that way.  However, in ISO C++ a friend function that is not declared
2051 in an enclosing scope can only be found using argument dependent
2052 lookup.  This option causes friends to be injected as they were in
2053 earlier releases.
2055 This option is for compatibility, and may be removed in a future
2056 release of G++.
2058 @item -fno-elide-constructors
2059 @opindex fno-elide-constructors
2060 The C++ standard allows an implementation to omit creating a temporary
2061 that is only used to initialize another object of the same type.
2062 Specifying this option disables that optimization, and forces G++ to
2063 call the copy constructor in all cases.
2065 @item -fno-enforce-eh-specs
2066 @opindex fno-enforce-eh-specs
2067 Don't generate code to check for violation of exception specifications
2068 at run time.  This option violates the C++ standard, but may be useful
2069 for reducing code size in production builds, much like defining
2070 @samp{NDEBUG}.  This does not give user code permission to throw
2071 exceptions in violation of the exception specifications; the compiler
2072 still optimizes based on the specifications, so throwing an
2073 unexpected exception results in undefined behavior at run time.
2075 @item -fextern-tls-init
2076 @itemx -fno-extern-tls-init
2077 @opindex fextern-tls-init
2078 @opindex fno-extern-tls-init
2079 The C++11 and OpenMP standards allow @samp{thread_local} and
2080 @samp{threadprivate} variables to have dynamic (runtime)
2081 initialization.  To support this, any use of such a variable goes
2082 through a wrapper function that performs any necessary initialization.
2083 When the use and definition of the variable are in the same
2084 translation unit, this overhead can be optimized away, but when the
2085 use is in a different translation unit there is significant overhead
2086 even if the variable doesn't actually need dynamic initialization.  If
2087 the programmer can be sure that no use of the variable in a
2088 non-defining TU needs to trigger dynamic initialization (either
2089 because the variable is statically initialized, or a use of the
2090 variable in the defining TU will be executed before any uses in
2091 another TU), they can avoid this overhead with the
2092 @option{-fno-extern-tls-init} option.
2094 On targets that support symbol aliases, the default is
2095 @option{-fextern-tls-init}.  On targets that do not support symbol
2096 aliases, the default is @option{-fno-extern-tls-init}.
2098 @item -ffor-scope
2099 @itemx -fno-for-scope
2100 @opindex ffor-scope
2101 @opindex fno-for-scope
2102 If @option{-ffor-scope} is specified, the scope of variables declared in
2103 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2104 as specified by the C++ standard.
2105 If @option{-fno-for-scope} is specified, the scope of variables declared in
2106 a @i{for-init-statement} extends to the end of the enclosing scope,
2107 as was the case in old versions of G++, and other (traditional)
2108 implementations of C++.
2110 If neither flag is given, the default is to follow the standard,
2111 but to allow and give a warning for old-style code that would
2112 otherwise be invalid, or have different behavior.
2114 @item -fno-gnu-keywords
2115 @opindex fno-gnu-keywords
2116 Do not recognize @code{typeof} as a keyword, so that code can use this
2117 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2118 @option{-ansi} implies @option{-fno-gnu-keywords}.
2120 @item -fno-implicit-templates
2121 @opindex fno-implicit-templates
2122 Never emit code for non-inline templates that are instantiated
2123 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2124 @xref{Template Instantiation}, for more information.
2126 @item -fno-implicit-inline-templates
2127 @opindex fno-implicit-inline-templates
2128 Don't emit code for implicit instantiations of inline templates, either.
2129 The default is to handle inlines differently so that compiles with and
2130 without optimization need the same set of explicit instantiations.
2132 @item -fno-implement-inlines
2133 @opindex fno-implement-inlines
2134 To save space, do not emit out-of-line copies of inline functions
2135 controlled by @samp{#pragma implementation}.  This causes linker
2136 errors if these functions are not inlined everywhere they are called.
2138 @item -fms-extensions
2139 @opindex fms-extensions
2140 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2141 int and getting a pointer to member function via non-standard syntax.
2143 @item -fno-nonansi-builtins
2144 @opindex fno-nonansi-builtins
2145 Disable built-in declarations of functions that are not mandated by
2146 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2147 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2149 @item -fnothrow-opt
2150 @opindex fnothrow-opt
2151 Treat a @code{throw()} exception specification as if it were a
2152 @code{noexcept} specification to reduce or eliminate the text size
2153 overhead relative to a function with no exception specification.  If
2154 the function has local variables of types with non-trivial
2155 destructors, the exception specification actually makes the
2156 function smaller because the EH cleanups for those variables can be
2157 optimized away.  The semantic effect is that an exception thrown out of
2158 a function with such an exception specification results in a call
2159 to @code{terminate} rather than @code{unexpected}.
2161 @item -fno-operator-names
2162 @opindex fno-operator-names
2163 Do not treat the operator name keywords @code{and}, @code{bitand},
2164 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2165 synonyms as keywords.
2167 @item -fno-optional-diags
2168 @opindex fno-optional-diags
2169 Disable diagnostics that the standard says a compiler does not need to
2170 issue.  Currently, the only such diagnostic issued by G++ is the one for
2171 a name having multiple meanings within a class.
2173 @item -fpermissive
2174 @opindex fpermissive
2175 Downgrade some diagnostics about nonconformant code from errors to
2176 warnings.  Thus, using @option{-fpermissive} allows some
2177 nonconforming code to compile.
2179 @item -fno-pretty-templates
2180 @opindex fno-pretty-templates
2181 When an error message refers to a specialization of a function
2182 template, the compiler normally prints the signature of the
2183 template followed by the template arguments and any typedefs or
2184 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2185 rather than @code{void f(int)}) so that it's clear which template is
2186 involved.  When an error message refers to a specialization of a class
2187 template, the compiler omits any template arguments that match
2188 the default template arguments for that template.  If either of these
2189 behaviors make it harder to understand the error message rather than
2190 easier, you can use @option{-fno-pretty-templates} to disable them.
2192 @item -frepo
2193 @opindex frepo
2194 Enable automatic template instantiation at link time.  This option also
2195 implies @option{-fno-implicit-templates}.  @xref{Template
2196 Instantiation}, for more information.
2198 @item -fno-rtti
2199 @opindex fno-rtti
2200 Disable generation of information about every class with virtual
2201 functions for use by the C++ run-time type identification features
2202 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2203 of the language, you can save some space by using this flag.  Note that
2204 exception handling uses the same information, but G++ generates it as
2205 needed. The @samp{dynamic_cast} operator can still be used for casts that
2206 do not require run-time type information, i.e.@: casts to @code{void *} or to
2207 unambiguous base classes.
2209 @item -fstats
2210 @opindex fstats
2211 Emit statistics about front-end processing at the end of the compilation.
2212 This information is generally only useful to the G++ development team.
2214 @item -fstrict-enums
2215 @opindex fstrict-enums
2216 Allow the compiler to optimize using the assumption that a value of
2217 enumerated type can only be one of the values of the enumeration (as
2218 defined in the C++ standard; basically, a value that can be
2219 represented in the minimum number of bits needed to represent all the
2220 enumerators).  This assumption may not be valid if the program uses a
2221 cast to convert an arbitrary integer value to the enumerated type.
2223 @item -ftemplate-backtrace-limit=@var{n}
2224 @opindex ftemplate-backtrace-limit
2225 Set the maximum number of template instantiation notes for a single
2226 warning or error to @var{n}.  The default value is 10.
2228 @item -ftemplate-depth=@var{n}
2229 @opindex ftemplate-depth
2230 Set the maximum instantiation depth for template classes to @var{n}.
2231 A limit on the template instantiation depth is needed to detect
2232 endless recursions during template class instantiation.  ANSI/ISO C++
2233 conforming programs must not rely on a maximum depth greater than 17
2234 (changed to 1024 in C++11).  The default value is 900, as the compiler
2235 can run out of stack space before hitting 1024 in some situations.
2237 @item -fno-threadsafe-statics
2238 @opindex fno-threadsafe-statics
2239 Do not emit the extra code to use the routines specified in the C++
2240 ABI for thread-safe initialization of local statics.  You can use this
2241 option to reduce code size slightly in code that doesn't need to be
2242 thread-safe.
2244 @item -fuse-cxa-atexit
2245 @opindex fuse-cxa-atexit
2246 Register destructors for objects with static storage duration with the
2247 @code{__cxa_atexit} function rather than the @code{atexit} function.
2248 This option is required for fully standards-compliant handling of static
2249 destructors, but only works if your C library supports
2250 @code{__cxa_atexit}.
2252 @item -fno-use-cxa-get-exception-ptr
2253 @opindex fno-use-cxa-get-exception-ptr
2254 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2255 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2256 if the runtime routine is not available.
2258 @item -fvisibility-inlines-hidden
2259 @opindex fvisibility-inlines-hidden
2260 This switch declares that the user does not attempt to compare
2261 pointers to inline functions or methods where the addresses of the two functions
2262 are taken in different shared objects.
2264 The effect of this is that GCC may, effectively, mark inline methods with
2265 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2266 appear in the export table of a DSO and do not require a PLT indirection
2267 when used within the DSO@.  Enabling this option can have a dramatic effect
2268 on load and link times of a DSO as it massively reduces the size of the
2269 dynamic export table when the library makes heavy use of templates.
2271 The behavior of this switch is not quite the same as marking the
2272 methods as hidden directly, because it does not affect static variables
2273 local to the function or cause the compiler to deduce that
2274 the function is defined in only one shared object.
2276 You may mark a method as having a visibility explicitly to negate the
2277 effect of the switch for that method.  For example, if you do want to
2278 compare pointers to a particular inline method, you might mark it as
2279 having default visibility.  Marking the enclosing class with explicit
2280 visibility has no effect.
2282 Explicitly instantiated inline methods are unaffected by this option
2283 as their linkage might otherwise cross a shared library boundary.
2284 @xref{Template Instantiation}.
2286 @item -fvisibility-ms-compat
2287 @opindex fvisibility-ms-compat
2288 This flag attempts to use visibility settings to make GCC's C++
2289 linkage model compatible with that of Microsoft Visual Studio.
2291 The flag makes these changes to GCC's linkage model:
2293 @enumerate
2294 @item
2295 It sets the default visibility to @code{hidden}, like
2296 @option{-fvisibility=hidden}.
2298 @item
2299 Types, but not their members, are not hidden by default.
2301 @item
2302 The One Definition Rule is relaxed for types without explicit
2303 visibility specifications that are defined in more than one
2304 shared object: those declarations are permitted if they are
2305 permitted when this option is not used.
2306 @end enumerate
2308 In new code it is better to use @option{-fvisibility=hidden} and
2309 export those classes that are intended to be externally visible.
2310 Unfortunately it is possible for code to rely, perhaps accidentally,
2311 on the Visual Studio behavior.
2313 Among the consequences of these changes are that static data members
2314 of the same type with the same name but defined in different shared
2315 objects are different, so changing one does not change the other;
2316 and that pointers to function members defined in different shared
2317 objects may not compare equal.  When this flag is given, it is a
2318 violation of the ODR to define types with the same name differently.
2320 @item -fvtable-verify=@var{std|preinit|none}
2321 @opindex fvtable-verify
2322 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2323 feature that verifies at runtime, for every virtual call that is made, that
2324 the vtable pointer through which the call is made is valid for the type of
2325 the object, and has not been corrupted or overwritten.  If an invalid vtable
2326 pointer is detected (at runtime), an error is reported and execution of the
2327 program is immediately halted.
2329 This option causes runtime data structures to be built, at program start up,
2330 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2331 control the timing of when these data structures are built.  In both cases the
2332 data structures are built before execution reaches 'main'.  The
2333 @option{-fvtable-verify=std} causes these data structure to be built after the
2334 shared libraries have been loaded and initialized.
2335 @option{-fvtable-verify=preinit} causes them to be built before the shared
2336 libraries have been loaded and initialized.
2338 If this option appears multiple times in the compiler line, with different
2339 values specified, 'none' will take highest priority over both 'std' and
2340 'preinit'; 'preinit' will take priority over 'std'.
2342 @item -fvtv-debug
2343 @opindex (fvtv-debug)
2344 Causes debug versions of the runtime functions for the vtable verification 
2345 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2346 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2347 compiler to keep track of which vtable pointers it found for each class, and
2348 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2349 file directory on the user's machine.
2351 Note:  This feature APPENDS data to the log file. If you want a fresh log
2352 file, be sure to delete any existing one.
2354 @item -fvtv-counts
2355 @opindex (fvtv-counts)
2356 This is a debugging flag.  When used in conjunction with
2357 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2358 causes the compiler to keep track of the total number of virtual calls
2359 it encountered and the number of verifications it inserted.  It also
2360 counts the number of calls to certain runtime library functions
2361 that it inserts.  This information, for each compilation unit, is written
2362 to a file named ``vtv_count_data.log'', in the dump_file directory on
2363 the user's machine.   It also counts the size of the vtable pointer sets
2364 for each class, and writes this information to ``vtv_class_set_sizes.log''
2365 in the same directory.
2367 Note:  This feature APPENDS data to the log files.  To get a fresh log
2368 files, be sure to delete any existing ones.
2370 @item -fno-weak
2371 @opindex fno-weak
2372 Do not use weak symbol support, even if it is provided by the linker.
2373 By default, G++ uses weak symbols if they are available.  This
2374 option exists only for testing, and should not be used by end-users;
2375 it results in inferior code and has no benefits.  This option may
2376 be removed in a future release of G++.
2378 @item -nostdinc++
2379 @opindex nostdinc++
2380 Do not search for header files in the standard directories specific to
2381 C++, but do still search the other standard directories.  (This option
2382 is used when building the C++ library.)
2383 @end table
2385 In addition, these optimization, warning, and code generation options
2386 have meanings only for C++ programs:
2388 @table @gcctabopt
2389 @item -fno-default-inline
2390 @opindex fno-default-inline
2391 Do not assume @samp{inline} for functions defined inside a class scope.
2392 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2393 functions have linkage like inline functions; they just aren't
2394 inlined by default.
2396 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2397 @opindex Wabi
2398 @opindex Wno-abi
2399 Warn when G++ generates code that is probably not compatible with the
2400 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2401 all such cases, there are probably some cases that are not warned about,
2402 even though G++ is generating incompatible code.  There may also be
2403 cases where warnings are emitted even though the code that is generated
2404 is compatible.
2406 You should rewrite your code to avoid these warnings if you are
2407 concerned about the fact that code generated by G++ may not be binary
2408 compatible with code generated by other compilers.
2410 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2412 @itemize @bullet
2414 @item
2415 A template with a non-type template parameter of reference type is
2416 mangled incorrectly:
2417 @smallexample
2418 extern int N;
2419 template <int &> struct S @{@};
2420 void n (S<N>) @{2@}
2421 @end smallexample
2423 This is fixed in @option{-fabi-version=3}.
2425 @item
2426 SIMD vector types declared using @code{__attribute ((vector_size))} are
2427 mangled in a non-standard way that does not allow for overloading of
2428 functions taking vectors of different sizes.
2430 The mangling is changed in @option{-fabi-version=4}.
2431 @end itemize
2433 The known incompatibilities in @option{-fabi-version=1} include:
2435 @itemize @bullet
2437 @item
2438 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2439 pack data into the same byte as a base class.  For example:
2441 @smallexample
2442 struct A @{ virtual void f(); int f1 : 1; @};
2443 struct B : public A @{ int f2 : 1; @};
2444 @end smallexample
2446 @noindent
2447 In this case, G++ places @code{B::f2} into the same byte
2448 as @code{A::f1}; other compilers do not.  You can avoid this problem
2449 by explicitly padding @code{A} so that its size is a multiple of the
2450 byte size on your platform; that causes G++ and other compilers to
2451 lay out @code{B} identically.
2453 @item
2454 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2455 tail padding when laying out virtual bases.  For example:
2457 @smallexample
2458 struct A @{ virtual void f(); char c1; @};
2459 struct B @{ B(); char c2; @};
2460 struct C : public A, public virtual B @{@};
2461 @end smallexample
2463 @noindent
2464 In this case, G++ does not place @code{B} into the tail-padding for
2465 @code{A}; other compilers do.  You can avoid this problem by
2466 explicitly padding @code{A} so that its size is a multiple of its
2467 alignment (ignoring virtual base classes); that causes G++ and other
2468 compilers to lay out @code{C} identically.
2470 @item
2471 Incorrect handling of bit-fields with declared widths greater than that
2472 of their underlying types, when the bit-fields appear in a union.  For
2473 example:
2475 @smallexample
2476 union U @{ int i : 4096; @};
2477 @end smallexample
2479 @noindent
2480 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2481 union too small by the number of bits in an @code{int}.
2483 @item
2484 Empty classes can be placed at incorrect offsets.  For example:
2486 @smallexample
2487 struct A @{@};
2489 struct B @{
2490   A a;
2491   virtual void f ();
2494 struct C : public B, public A @{@};
2495 @end smallexample
2497 @noindent
2498 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2499 it should be placed at offset zero.  G++ mistakenly believes that the
2500 @code{A} data member of @code{B} is already at offset zero.
2502 @item
2503 Names of template functions whose types involve @code{typename} or
2504 template template parameters can be mangled incorrectly.
2506 @smallexample
2507 template <typename Q>
2508 void f(typename Q::X) @{@}
2510 template <template <typename> class Q>
2511 void f(typename Q<int>::X) @{@}
2512 @end smallexample
2514 @noindent
2515 Instantiations of these templates may be mangled incorrectly.
2517 @end itemize
2519 It also warns about psABI-related changes.  The known psABI changes at this
2520 point include:
2522 @itemize @bullet
2524 @item
2525 For SysV/x86-64, unions with @code{long double} members are 
2526 passed in memory as specified in psABI.  For example:
2528 @smallexample
2529 union U @{
2530   long double ld;
2531   int i;
2533 @end smallexample
2535 @noindent
2536 @code{union U} is always passed in memory.
2538 @end itemize
2540 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2541 @opindex Wctor-dtor-privacy
2542 @opindex Wno-ctor-dtor-privacy
2543 Warn when a class seems unusable because all the constructors or
2544 destructors in that class are private, and it has neither friends nor
2545 public static member functions.  Also warn if there are no non-private
2546 methods, and there's at least one private member function that isn't
2547 a constructor or destructor.
2549 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2550 @opindex Wdelete-non-virtual-dtor
2551 @opindex Wno-delete-non-virtual-dtor
2552 Warn when @samp{delete} is used to destroy an instance of a class that
2553 has virtual functions and non-virtual destructor. It is unsafe to delete
2554 an instance of a derived class through a pointer to a base class if the
2555 base class does not have a virtual destructor.  This warning is enabled
2556 by @option{-Wall}.
2558 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2559 @opindex Wliteral-suffix
2560 @opindex Wno-literal-suffix
2561 Warn when a string or character literal is followed by a ud-suffix which does
2562 not begin with an underscore.  As a conforming extension, GCC treats such
2563 suffixes as separate preprocessing tokens in order to maintain backwards
2564 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2565 For example:
2567 @smallexample
2568 #define __STDC_FORMAT_MACROS
2569 #include <inttypes.h>
2570 #include <stdio.h>
2572 int main() @{
2573   int64_t i64 = 123;
2574   printf("My int64: %"PRId64"\n", i64);
2576 @end smallexample
2578 In this case, @code{PRId64} is treated as a separate preprocessing token.
2580 This warning is enabled by default.
2582 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2583 @opindex Wnarrowing
2584 @opindex Wno-narrowing
2585 Warn when a narrowing conversion prohibited by C++11 occurs within
2586 @samp{@{ @}}, e.g.
2588 @smallexample
2589 int i = @{ 2.2 @}; // error: narrowing from double to int
2590 @end smallexample
2592 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2594 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2595 required by the standard.  Note that this does not affect the meaning
2596 of well-formed code; narrowing conversions are still considered
2597 ill-formed in SFINAE context.
2599 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2600 @opindex Wnoexcept
2601 @opindex Wno-noexcept
2602 Warn when a noexcept-expression evaluates to false because of a call
2603 to a function that does not have a non-throwing exception
2604 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2605 the compiler to never throw an exception.
2607 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2608 @opindex Wnon-virtual-dtor
2609 @opindex Wno-non-virtual-dtor
2610 Warn when a class has virtual functions and an accessible non-virtual
2611 destructor, in which case it is possible but unsafe to delete
2612 an instance of a derived class through a pointer to the base class.
2613 This warning is also enabled if @option{-Weffc++} is specified.
2615 @item -Wreorder @r{(C++ and Objective-C++ only)}
2616 @opindex Wreorder
2617 @opindex Wno-reorder
2618 @cindex reordering, warning
2619 @cindex warning for reordering of member initializers
2620 Warn when the order of member initializers given in the code does not
2621 match the order in which they must be executed.  For instance:
2623 @smallexample
2624 struct A @{
2625   int i;
2626   int j;
2627   A(): j (0), i (1) @{ @}
2629 @end smallexample
2631 @noindent
2632 The compiler rearranges the member initializers for @samp{i}
2633 and @samp{j} to match the declaration order of the members, emitting
2634 a warning to that effect.  This warning is enabled by @option{-Wall}.
2636 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2637 @opindex fext-numeric-literals
2638 @opindex fno-ext-numeric-literals
2639 Accept imaginary, fixed-point, or machine-defined
2640 literal number suffixes as GNU extensions.
2641 When this option is turned off these suffixes are treated
2642 as C++11 user-defined literal numeric suffixes.
2643 This is on by default for all pre-C++11 dialects and all GNU dialects:
2644 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2645 @option{-std=gnu++1y}.
2646 This option is off by default
2647 for ISO C++11 onwards (@option{-std=c++11}, ...).
2648 @end table
2650 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2652 @table @gcctabopt
2653 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2654 @opindex Weffc++
2655 @opindex Wno-effc++
2656 Warn about violations of the following style guidelines from Scott Meyers'
2657 @cite{Effective C++, Second Edition} book:
2659 @itemize @bullet
2660 @item
2661 Item 11:  Define a copy constructor and an assignment operator for classes
2662 with dynamically-allocated memory.
2664 @item
2665 Item 12:  Prefer initialization to assignment in constructors.
2667 @item
2668 Item 14:  Make destructors virtual in base classes.
2670 @item
2671 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2673 @item
2674 Item 23:  Don't try to return a reference when you must return an object.
2676 @end itemize
2678 Also warn about violations of the following style guidelines from
2679 Scott Meyers' @cite{More Effective C++} book:
2681 @itemize @bullet
2682 @item
2683 Item 6:  Distinguish between prefix and postfix forms of increment and
2684 decrement operators.
2686 @item
2687 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2689 @end itemize
2691 When selecting this option, be aware that the standard library
2692 headers do not obey all of these guidelines; use @samp{grep -v}
2693 to filter out those warnings.
2695 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2696 @opindex Wstrict-null-sentinel
2697 @opindex Wno-strict-null-sentinel
2698 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2699 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2700 to @code{__null}.  Although it is a null pointer constant rather than a
2701 null pointer, it is guaranteed to be of the same size as a pointer.
2702 But this use is not portable across different compilers.
2704 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2705 @opindex Wno-non-template-friend
2706 @opindex Wnon-template-friend
2707 Disable warnings when non-templatized friend functions are declared
2708 within a template.  Since the advent of explicit template specification
2709 support in G++, if the name of the friend is an unqualified-id (i.e.,
2710 @samp{friend foo(int)}), the C++ language specification demands that the
2711 friend declare or define an ordinary, nontemplate function.  (Section
2712 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2713 could be interpreted as a particular specialization of a templatized
2714 function.  Because this non-conforming behavior is no longer the default
2715 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2716 check existing code for potential trouble spots and is on by default.
2717 This new compiler behavior can be turned off with
2718 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2719 but disables the helpful warning.
2721 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2722 @opindex Wold-style-cast
2723 @opindex Wno-old-style-cast
2724 Warn if an old-style (C-style) cast to a non-void type is used within
2725 a C++ program.  The new-style casts (@samp{dynamic_cast},
2726 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2727 less vulnerable to unintended effects and much easier to search for.
2729 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2730 @opindex Woverloaded-virtual
2731 @opindex Wno-overloaded-virtual
2732 @cindex overloaded virtual function, warning
2733 @cindex warning for overloaded virtual function
2734 Warn when a function declaration hides virtual functions from a
2735 base class.  For example, in:
2737 @smallexample
2738 struct A @{
2739   virtual void f();
2742 struct B: public A @{
2743   void f(int);
2745 @end smallexample
2747 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2748 like:
2750 @smallexample
2751 B* b;
2752 b->f();
2753 @end smallexample
2755 @noindent
2756 fails to compile.
2758 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2759 @opindex Wno-pmf-conversions
2760 @opindex Wpmf-conversions
2761 Disable the diagnostic for converting a bound pointer to member function
2762 to a plain pointer.
2764 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2765 @opindex Wsign-promo
2766 @opindex Wno-sign-promo
2767 Warn when overload resolution chooses a promotion from unsigned or
2768 enumerated type to a signed type, over a conversion to an unsigned type of
2769 the same size.  Previous versions of G++ tried to preserve
2770 unsignedness, but the standard mandates the current behavior.
2771 @end table
2773 @node Objective-C and Objective-C++ Dialect Options
2774 @section Options Controlling Objective-C and Objective-C++ Dialects
2776 @cindex compiler options, Objective-C and Objective-C++
2777 @cindex Objective-C and Objective-C++ options, command-line
2778 @cindex options, Objective-C and Objective-C++
2779 (NOTE: This manual does not describe the Objective-C and Objective-C++
2780 languages themselves.  @xref{Standards,,Language Standards
2781 Supported by GCC}, for references.)
2783 This section describes the command-line options that are only meaningful
2784 for Objective-C and Objective-C++ programs.  You can also use most of
2785 the language-independent GNU compiler options.
2786 For example, you might compile a file @code{some_class.m} like this:
2788 @smallexample
2789 gcc -g -fgnu-runtime -O -c some_class.m
2790 @end smallexample
2792 @noindent
2793 In this example, @option{-fgnu-runtime} is an option meant only for
2794 Objective-C and Objective-C++ programs; you can use the other options with
2795 any language supported by GCC@.
2797 Note that since Objective-C is an extension of the C language, Objective-C
2798 compilations may also use options specific to the C front-end (e.g.,
2799 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2800 C++-specific options (e.g., @option{-Wabi}).
2802 Here is a list of options that are @emph{only} for compiling Objective-C
2803 and Objective-C++ programs:
2805 @table @gcctabopt
2806 @item -fconstant-string-class=@var{class-name}
2807 @opindex fconstant-string-class
2808 Use @var{class-name} as the name of the class to instantiate for each
2809 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2810 class name is @code{NXConstantString} if the GNU runtime is being used, and
2811 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2812 @option{-fconstant-cfstrings} option, if also present, overrides the
2813 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2814 to be laid out as constant CoreFoundation strings.
2816 @item -fgnu-runtime
2817 @opindex fgnu-runtime
2818 Generate object code compatible with the standard GNU Objective-C
2819 runtime.  This is the default for most types of systems.
2821 @item -fnext-runtime
2822 @opindex fnext-runtime
2823 Generate output compatible with the NeXT runtime.  This is the default
2824 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2825 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2826 used.
2828 @item -fno-nil-receivers
2829 @opindex fno-nil-receivers
2830 Assume that all Objective-C message dispatches (@code{[receiver
2831 message:arg]}) in this translation unit ensure that the receiver is
2832 not @code{nil}.  This allows for more efficient entry points in the
2833 runtime to be used.  This option is only available in conjunction with
2834 the NeXT runtime and ABI version 0 or 1.
2836 @item -fobjc-abi-version=@var{n}
2837 @opindex fobjc-abi-version
2838 Use version @var{n} of the Objective-C ABI for the selected runtime.
2839 This option is currently supported only for the NeXT runtime.  In that
2840 case, Version 0 is the traditional (32-bit) ABI without support for
2841 properties and other Objective-C 2.0 additions.  Version 1 is the
2842 traditional (32-bit) ABI with support for properties and other
2843 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2844 nothing is specified, the default is Version 0 on 32-bit target
2845 machines, and Version 2 on 64-bit target machines.
2847 @item -fobjc-call-cxx-cdtors
2848 @opindex fobjc-call-cxx-cdtors
2849 For each Objective-C class, check if any of its instance variables is a
2850 C++ object with a non-trivial default constructor.  If so, synthesize a
2851 special @code{- (id) .cxx_construct} instance method which runs
2852 non-trivial default constructors on any such instance variables, in order,
2853 and then return @code{self}.  Similarly, check if any instance variable
2854 is a C++ object with a non-trivial destructor, and if so, synthesize a
2855 special @code{- (void) .cxx_destruct} method which runs
2856 all such default destructors, in reverse order.
2858 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2859 methods thusly generated only operate on instance variables
2860 declared in the current Objective-C class, and not those inherited
2861 from superclasses.  It is the responsibility of the Objective-C
2862 runtime to invoke all such methods in an object's inheritance
2863 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2864 by the runtime immediately after a new object instance is allocated;
2865 the @code{- (void) .cxx_destruct} methods are invoked immediately
2866 before the runtime deallocates an object instance.
2868 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2869 support for invoking the @code{- (id) .cxx_construct} and
2870 @code{- (void) .cxx_destruct} methods.
2872 @item -fobjc-direct-dispatch
2873 @opindex fobjc-direct-dispatch
2874 Allow fast jumps to the message dispatcher.  On Darwin this is
2875 accomplished via the comm page.
2877 @item -fobjc-exceptions
2878 @opindex fobjc-exceptions
2879 Enable syntactic support for structured exception handling in
2880 Objective-C, similar to what is offered by C++ and Java.  This option
2881 is required to use the Objective-C keywords @code{@@try},
2882 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2883 @code{@@synchronized}.  This option is available with both the GNU
2884 runtime and the NeXT runtime (but not available in conjunction with
2885 the NeXT runtime on Mac OS X 10.2 and earlier).
2887 @item -fobjc-gc
2888 @opindex fobjc-gc
2889 Enable garbage collection (GC) in Objective-C and Objective-C++
2890 programs.  This option is only available with the NeXT runtime; the
2891 GNU runtime has a different garbage collection implementation that
2892 does not require special compiler flags.
2894 @item -fobjc-nilcheck
2895 @opindex fobjc-nilcheck
2896 For the NeXT runtime with version 2 of the ABI, check for a nil
2897 receiver in method invocations before doing the actual method call.
2898 This is the default and can be disabled using
2899 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2900 checked for nil in this way no matter what this flag is set to.
2901 Currently this flag does nothing when the GNU runtime, or an older
2902 version of the NeXT runtime ABI, is used.
2904 @item -fobjc-std=objc1
2905 @opindex fobjc-std
2906 Conform to the language syntax of Objective-C 1.0, the language
2907 recognized by GCC 4.0.  This only affects the Objective-C additions to
2908 the C/C++ language; it does not affect conformance to C/C++ standards,
2909 which is controlled by the separate C/C++ dialect option flags.  When
2910 this option is used with the Objective-C or Objective-C++ compiler,
2911 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2912 This is useful if you need to make sure that your Objective-C code can
2913 be compiled with older versions of GCC@.
2915 @item -freplace-objc-classes
2916 @opindex freplace-objc-classes
2917 Emit a special marker instructing @command{ld(1)} not to statically link in
2918 the resulting object file, and allow @command{dyld(1)} to load it in at
2919 run time instead.  This is used in conjunction with the Fix-and-Continue
2920 debugging mode, where the object file in question may be recompiled and
2921 dynamically reloaded in the course of program execution, without the need
2922 to restart the program itself.  Currently, Fix-and-Continue functionality
2923 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2924 and later.
2926 @item -fzero-link
2927 @opindex fzero-link
2928 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2929 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2930 compile time) with static class references that get initialized at load time,
2931 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2932 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2933 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2934 for individual class implementations to be modified during program execution.
2935 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2936 regardless of command-line options.
2938 @item -gen-decls
2939 @opindex gen-decls
2940 Dump interface declarations for all classes seen in the source file to a
2941 file named @file{@var{sourcename}.decl}.
2943 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2944 @opindex Wassign-intercept
2945 @opindex Wno-assign-intercept
2946 Warn whenever an Objective-C assignment is being intercepted by the
2947 garbage collector.
2949 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2950 @opindex Wno-protocol
2951 @opindex Wprotocol
2952 If a class is declared to implement a protocol, a warning is issued for
2953 every method in the protocol that is not implemented by the class.  The
2954 default behavior is to issue a warning for every method not explicitly
2955 implemented in the class, even if a method implementation is inherited
2956 from the superclass.  If you use the @option{-Wno-protocol} option, then
2957 methods inherited from the superclass are considered to be implemented,
2958 and no warning is issued for them.
2960 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2961 @opindex Wselector
2962 @opindex Wno-selector
2963 Warn if multiple methods of different types for the same selector are
2964 found during compilation.  The check is performed on the list of methods
2965 in the final stage of compilation.  Additionally, a check is performed
2966 for each selector appearing in a @code{@@selector(@dots{})}
2967 expression, and a corresponding method for that selector has been found
2968 during compilation.  Because these checks scan the method table only at
2969 the end of compilation, these warnings are not produced if the final
2970 stage of compilation is not reached, for example because an error is
2971 found during compilation, or because the @option{-fsyntax-only} option is
2972 being used.
2974 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2975 @opindex Wstrict-selector-match
2976 @opindex Wno-strict-selector-match
2977 Warn if multiple methods with differing argument and/or return types are
2978 found for a given selector when attempting to send a message using this
2979 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2980 is off (which is the default behavior), the compiler omits such warnings
2981 if any differences found are confined to types that share the same size
2982 and alignment.
2984 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2985 @opindex Wundeclared-selector
2986 @opindex Wno-undeclared-selector
2987 Warn if a @code{@@selector(@dots{})} expression referring to an
2988 undeclared selector is found.  A selector is considered undeclared if no
2989 method with that name has been declared before the
2990 @code{@@selector(@dots{})} expression, either explicitly in an
2991 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2992 an @code{@@implementation} section.  This option always performs its
2993 checks as soon as a @code{@@selector(@dots{})} expression is found,
2994 while @option{-Wselector} only performs its checks in the final stage of
2995 compilation.  This also enforces the coding style convention
2996 that methods and selectors must be declared before being used.
2998 @item -print-objc-runtime-info
2999 @opindex print-objc-runtime-info
3000 Generate C header describing the largest structure that is passed by
3001 value, if any.
3003 @end table
3005 @node Language Independent Options
3006 @section Options to Control Diagnostic Messages Formatting
3007 @cindex options to control diagnostics formatting
3008 @cindex diagnostic messages
3009 @cindex message formatting
3011 Traditionally, diagnostic messages have been formatted irrespective of
3012 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3013 options described below
3014 to control the formatting algorithm for diagnostic messages, 
3015 e.g.@: how many characters per line, how often source location
3016 information should be reported.  Note that some language front ends may not
3017 honor these options.
3019 @table @gcctabopt
3020 @item -fmessage-length=@var{n}
3021 @opindex fmessage-length
3022 Try to format error messages so that they fit on lines of about @var{n}
3023 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
3024 the front ends supported by GCC@.  If @var{n} is zero, then no
3025 line-wrapping is done; each error message appears on a single
3026 line.
3028 @item -fdiagnostics-show-location=once
3029 @opindex fdiagnostics-show-location
3030 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3031 reporter to emit source location information @emph{once}; that is, in
3032 case the message is too long to fit on a single physical line and has to
3033 be wrapped, the source location won't be emitted (as prefix) again,
3034 over and over, in subsequent continuation lines.  This is the default
3035 behavior.
3037 @item -fdiagnostics-show-location=every-line
3038 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3039 messages reporter to emit the same source location information (as
3040 prefix) for physical lines that result from the process of breaking
3041 a message which is too long to fit on a single line.
3043 @item -fdiagnostics-color[=@var{WHEN}]
3044 @itemx -fno-diagnostics-color
3045 @opindex fdiagnostics-color
3046 @cindex highlight, color, colour
3047 @vindex GCC_COLORS @r{environment variable}
3048 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3049 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3050 variable isn't present in the environment, and @samp{auto} otherwise.
3051 @samp{auto} means to use color only when the standard error is a terminal.
3052 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3053 aliases for @option{-fdiagnostics-color=always} and
3054 @option{-fdiagnostics-color=never}, respectively.
3056 The colors are defined by the environment variable @env{GCC_COLORS}.
3057 Its value is a colon-separated list of capabilities and Select Graphic
3058 Rendition (SGR) substrings. SGR commands are interpreted by the
3059 terminal or terminal emulator.  (See the section in the documentation
3060 of your text terminal for permitted values and their meanings as
3061 character attributes.)  These substring values are integers in decimal
3062 representation and can be concatenated with semicolons.
3063 Common values to concatenate include
3064 @samp{1} for bold,
3065 @samp{4} for underline,
3066 @samp{5} for blink,
3067 @samp{7} for inverse,
3068 @samp{39} for default foreground color,
3069 @samp{30} to @samp{37} for foreground colors,
3070 @samp{90} to @samp{97} for 16-color mode foreground colors,
3071 @samp{38;5;0} to @samp{38;5;255}
3072 for 88-color and 256-color modes foreground colors,
3073 @samp{49} for default background color,
3074 @samp{40} to @samp{47} for background colors,
3075 @samp{100} to @samp{107} for 16-color mode background colors,
3076 and @samp{48;5;0} to @samp{48;5;255}
3077 for 88-color and 256-color modes background colors.
3079 The default @env{GCC_COLORS} is
3080 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3081 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3082 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3083 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3084 string disables colors.
3085 Supported capabilities are as follows.
3087 @table @code
3088 @item error=
3089 @vindex error GCC_COLORS @r{capability}
3090 SGR substring for error: markers.
3092 @item warning=
3093 @vindex warning GCC_COLORS @r{capability}
3094 SGR substring for warning: markers.
3096 @item note=
3097 @vindex note GCC_COLORS @r{capability}
3098 SGR substring for note: markers.
3100 @item caret=
3101 @vindex caret GCC_COLORS @r{capability}
3102 SGR substring for caret line.
3104 @item locus=
3105 @vindex locus GCC_COLORS @r{capability}
3106 SGR substring for location information, @samp{file:line} or
3107 @samp{file:line:column} etc.
3109 @item quote=
3110 @vindex quote GCC_COLORS @r{capability}
3111 SGR substring for information printed within quotes.
3112 @end table
3114 @item -fno-diagnostics-show-option
3115 @opindex fno-diagnostics-show-option
3116 @opindex fdiagnostics-show-option
3117 By default, each diagnostic emitted includes text indicating the
3118 command-line option that directly controls the diagnostic (if such an
3119 option is known to the diagnostic machinery).  Specifying the
3120 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3122 @item -fno-diagnostics-show-caret
3123 @opindex fno-diagnostics-show-caret
3124 @opindex fdiagnostics-show-caret
3125 By default, each diagnostic emitted includes the original source line
3126 and a caret '^' indicating the column.  This option suppresses this
3127 information.
3129 @end table
3131 @node Warning Options
3132 @section Options to Request or Suppress Warnings
3133 @cindex options to control warnings
3134 @cindex warning messages
3135 @cindex messages, warning
3136 @cindex suppressing warnings
3138 Warnings are diagnostic messages that report constructions that
3139 are not inherently erroneous but that are risky or suggest there
3140 may have been an error.
3142 The following language-independent options do not enable specific
3143 warnings but control the kinds of diagnostics produced by GCC@.
3145 @table @gcctabopt
3146 @cindex syntax checking
3147 @item -fsyntax-only
3148 @opindex fsyntax-only
3149 Check the code for syntax errors, but don't do anything beyond that.
3151 @item -fmax-errors=@var{n}
3152 @opindex fmax-errors
3153 Limits the maximum number of error messages to @var{n}, at which point
3154 GCC bails out rather than attempting to continue processing the source
3155 code.  If @var{n} is 0 (the default), there is no limit on the number
3156 of error messages produced.  If @option{-Wfatal-errors} is also
3157 specified, then @option{-Wfatal-errors} takes precedence over this
3158 option.
3160 @item -w
3161 @opindex w
3162 Inhibit all warning messages.
3164 @item -Werror
3165 @opindex Werror
3166 @opindex Wno-error
3167 Make all warnings into errors.
3169 @item -Werror=
3170 @opindex Werror=
3171 @opindex Wno-error=
3172 Make the specified warning into an error.  The specifier for a warning
3173 is appended; for example @option{-Werror=switch} turns the warnings
3174 controlled by @option{-Wswitch} into errors.  This switch takes a
3175 negative form, to be used to negate @option{-Werror} for specific
3176 warnings; for example @option{-Wno-error=switch} makes
3177 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3178 is in effect.
3180 The warning message for each controllable warning includes the
3181 option that controls the warning.  That option can then be used with
3182 @option{-Werror=} and @option{-Wno-error=} as described above.
3183 (Printing of the option in the warning message can be disabled using the
3184 @option{-fno-diagnostics-show-option} flag.)
3186 Note that specifying @option{-Werror=}@var{foo} automatically implies
3187 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3188 imply anything.
3190 @item -Wfatal-errors
3191 @opindex Wfatal-errors
3192 @opindex Wno-fatal-errors
3193 This option causes the compiler to abort compilation on the first error
3194 occurred rather than trying to keep going and printing further error
3195 messages.
3197 @end table
3199 You can request many specific warnings with options beginning with
3200 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3201 implicit declarations.  Each of these specific warning options also
3202 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3203 example, @option{-Wno-implicit}.  This manual lists only one of the
3204 two forms, whichever is not the default.  For further
3205 language-specific options also refer to @ref{C++ Dialect Options} and
3206 @ref{Objective-C and Objective-C++ Dialect Options}.
3208 When an unrecognized warning option is requested (e.g.,
3209 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3210 that the option is not recognized.  However, if the @option{-Wno-} form
3211 is used, the behavior is slightly different: no diagnostic is
3212 produced for @option{-Wno-unknown-warning} unless other diagnostics
3213 are being produced.  This allows the use of new @option{-Wno-} options
3214 with old compilers, but if something goes wrong, the compiler
3215 warns that an unrecognized option is present.
3217 @table @gcctabopt
3218 @item -Wpedantic
3219 @itemx -pedantic
3220 @opindex pedantic
3221 @opindex Wpedantic
3222 Issue all the warnings demanded by strict ISO C and ISO C++;
3223 reject all programs that use forbidden extensions, and some other
3224 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3225 version of the ISO C standard specified by any @option{-std} option used.
3227 Valid ISO C and ISO C++ programs should compile properly with or without
3228 this option (though a rare few require @option{-ansi} or a
3229 @option{-std} option specifying the required version of ISO C)@.  However,
3230 without this option, certain GNU extensions and traditional C and C++
3231 features are supported as well.  With this option, they are rejected.
3233 @option{-Wpedantic} does not cause warning messages for use of the
3234 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3235 warnings are also disabled in the expression that follows
3236 @code{__extension__}.  However, only system header files should use
3237 these escape routes; application programs should avoid them.
3238 @xref{Alternate Keywords}.
3240 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3241 C conformance.  They soon find that it does not do quite what they want:
3242 it finds some non-ISO practices, but not all---only those for which
3243 ISO C @emph{requires} a diagnostic, and some others for which
3244 diagnostics have been added.
3246 A feature to report any failure to conform to ISO C might be useful in
3247 some instances, but would require considerable additional work and would
3248 be quite different from @option{-Wpedantic}.  We don't have plans to
3249 support such a feature in the near future.
3251 Where the standard specified with @option{-std} represents a GNU
3252 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3253 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3254 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3255 where they are required by the base standard.  (It does not make sense
3256 for such warnings to be given only for features not in the specified GNU
3257 C dialect, since by definition the GNU dialects of C include all
3258 features the compiler supports with the given option, and there would be
3259 nothing to warn about.)
3261 @item -pedantic-errors
3262 @opindex pedantic-errors
3263 Like @option{-Wpedantic}, except that errors are produced rather than
3264 warnings.
3266 @item -Wall
3267 @opindex Wall
3268 @opindex Wno-all
3269 This enables all the warnings about constructions that some users
3270 consider questionable, and that are easy to avoid (or modify to
3271 prevent the warning), even in conjunction with macros.  This also
3272 enables some language-specific warnings described in @ref{C++ Dialect
3273 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3275 @option{-Wall} turns on the following warning flags:
3277 @gccoptlist{-Waddress   @gol
3278 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3279 -Wc++11-compat  @gol
3280 -Wchar-subscripts  @gol
3281 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3282 -Wimplicit-int @r{(C and Objective-C only)} @gol
3283 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3284 -Wcomment  @gol
3285 -Wformat   @gol
3286 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3287 -Wmaybe-uninitialized @gol
3288 -Wmissing-braces @r{(only for C/ObjC)} @gol
3289 -Wnonnull  @gol
3290 -Wparentheses  @gol
3291 -Wpointer-sign  @gol
3292 -Wreorder   @gol
3293 -Wreturn-type  @gol
3294 -Wsequence-point  @gol
3295 -Wsign-compare @r{(only in C++)}  @gol
3296 -Wstrict-aliasing  @gol
3297 -Wstrict-overflow=1  @gol
3298 -Wswitch  @gol
3299 -Wtrigraphs  @gol
3300 -Wuninitialized  @gol
3301 -Wunknown-pragmas  @gol
3302 -Wunused-function  @gol
3303 -Wunused-label     @gol
3304 -Wunused-value     @gol
3305 -Wunused-variable  @gol
3306 -Wvolatile-register-var @gol
3309 Note that some warning flags are not implied by @option{-Wall}.  Some of
3310 them warn about constructions that users generally do not consider
3311 questionable, but which occasionally you might wish to check for;
3312 others warn about constructions that are necessary or hard to avoid in
3313 some cases, and there is no simple way to modify the code to suppress
3314 the warning. Some of them are enabled by @option{-Wextra} but many of
3315 them must be enabled individually.
3317 @item -Wextra
3318 @opindex W
3319 @opindex Wextra
3320 @opindex Wno-extra
3321 This enables some extra warning flags that are not enabled by
3322 @option{-Wall}. (This option used to be called @option{-W}.  The older
3323 name is still supported, but the newer name is more descriptive.)
3325 @gccoptlist{-Wclobbered  @gol
3326 -Wempty-body  @gol
3327 -Wignored-qualifiers @gol
3328 -Wmissing-field-initializers  @gol
3329 -Wmissing-parameter-type @r{(C only)}  @gol
3330 -Wold-style-declaration @r{(C only)}  @gol
3331 -Woverride-init  @gol
3332 -Wsign-compare  @gol
3333 -Wtype-limits  @gol
3334 -Wuninitialized  @gol
3335 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3336 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3339 The option @option{-Wextra} also prints warning messages for the
3340 following cases:
3342 @itemize @bullet
3344 @item
3345 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3346 @samp{>}, or @samp{>=}.
3348 @item
3349 (C++ only) An enumerator and a non-enumerator both appear in a
3350 conditional expression.
3352 @item
3353 (C++ only) Ambiguous virtual bases.
3355 @item
3356 (C++ only) Subscripting an array that has been declared @samp{register}.
3358 @item
3359 (C++ only) Taking the address of a variable that has been declared
3360 @samp{register}.
3362 @item
3363 (C++ only) A base class is not initialized in a derived class's copy
3364 constructor.
3366 @end itemize
3368 @item -Wchar-subscripts
3369 @opindex Wchar-subscripts
3370 @opindex Wno-char-subscripts
3371 Warn if an array subscript has type @code{char}.  This is a common cause
3372 of error, as programmers often forget that this type is signed on some
3373 machines.
3374 This warning is enabled by @option{-Wall}.
3376 @item -Wcomment
3377 @opindex Wcomment
3378 @opindex Wno-comment
3379 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3380 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3381 This warning is enabled by @option{-Wall}.
3383 @item -Wno-coverage-mismatch
3384 @opindex Wno-coverage-mismatch
3385 Warn if feedback profiles do not match when using the
3386 @option{-fprofile-use} option.
3387 If a source file is changed between compiling with @option{-fprofile-gen} and
3388 with @option{-fprofile-use}, the files with the profile feedback can fail
3389 to match the source file and GCC cannot use the profile feedback
3390 information.  By default, this warning is enabled and is treated as an
3391 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3392 warning or @option{-Wno-error=coverage-mismatch} can be used to
3393 disable the error.  Disabling the error for this warning can result in
3394 poorly optimized code and is useful only in the
3395 case of very minor changes such as bug fixes to an existing code-base.
3396 Completely disabling the warning is not recommended.
3398 @item -Wno-cpp
3399 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3401 Suppress warning messages emitted by @code{#warning} directives.
3403 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3404 @opindex Wdouble-promotion
3405 @opindex Wno-double-promotion
3406 Give a warning when a value of type @code{float} is implicitly
3407 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3408 floating-point unit implement @code{float} in hardware, but emulate
3409 @code{double} in software.  On such a machine, doing computations
3410 using @code{double} values is much more expensive because of the
3411 overhead required for software emulation.
3413 It is easy to accidentally do computations with @code{double} because
3414 floating-point literals are implicitly of type @code{double}.  For
3415 example, in:
3416 @smallexample
3417 @group
3418 float area(float radius)
3420    return 3.14159 * radius * radius;
3422 @end group
3423 @end smallexample
3424 the compiler performs the entire computation with @code{double}
3425 because the floating-point literal is a @code{double}.
3427 @item -Wformat
3428 @itemx -Wformat=@var{n}
3429 @opindex Wformat
3430 @opindex Wno-format
3431 @opindex ffreestanding
3432 @opindex fno-builtin
3433 @opindex Wformat=
3434 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3435 the arguments supplied have types appropriate to the format string
3436 specified, and that the conversions specified in the format string make
3437 sense.  This includes standard functions, and others specified by format
3438 attributes (@pxref{Function Attributes}), in the @code{printf},
3439 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3440 not in the C standard) families (or other target-specific families).
3441 Which functions are checked without format attributes having been
3442 specified depends on the standard version selected, and such checks of
3443 functions without the attribute specified are disabled by
3444 @option{-ffreestanding} or @option{-fno-builtin}.
3446 The formats are checked against the format features supported by GNU
3447 libc version 2.2.  These include all ISO C90 and C99 features, as well
3448 as features from the Single Unix Specification and some BSD and GNU
3449 extensions.  Other library implementations may not support all these
3450 features; GCC does not support warning about features that go beyond a
3451 particular library's limitations.  However, if @option{-Wpedantic} is used
3452 with @option{-Wformat}, warnings are given about format features not
3453 in the selected standard version (but not for @code{strfmon} formats,
3454 since those are not in any version of the C standard).  @xref{C Dialect
3455 Options,,Options Controlling C Dialect}.
3457 @table @gcctabopt
3458 @item -Wformat=1
3459 @itemx -Wformat
3460 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3461 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3462 @option{-Wformat} also checks for null format arguments for several
3463 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3464 aspects of this level of format checking can be disabled by the
3465 options: @option{-Wno-format-contains-nul},
3466 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3467 @option{-Wformat} is enabled by @option{-Wall}.
3469 @item -Wno-format-contains-nul
3470 @opindex Wno-format-contains-nul
3471 @opindex Wformat-contains-nul
3472 If @option{-Wformat} is specified, do not warn about format strings that
3473 contain NUL bytes.
3475 @item -Wno-format-extra-args
3476 @opindex Wno-format-extra-args
3477 @opindex Wformat-extra-args
3478 If @option{-Wformat} is specified, do not warn about excess arguments to a
3479 @code{printf} or @code{scanf} format function.  The C standard specifies
3480 that such arguments are ignored.
3482 Where the unused arguments lie between used arguments that are
3483 specified with @samp{$} operand number specifications, normally
3484 warnings are still given, since the implementation could not know what
3485 type to pass to @code{va_arg} to skip the unused arguments.  However,
3486 in the case of @code{scanf} formats, this option suppresses the
3487 warning if the unused arguments are all pointers, since the Single
3488 Unix Specification says that such unused arguments are allowed.
3490 @item -Wno-format-zero-length
3491 @opindex Wno-format-zero-length
3492 @opindex Wformat-zero-length
3493 If @option{-Wformat} is specified, do not warn about zero-length formats.
3494 The C standard specifies that zero-length formats are allowed.
3497 @item -Wformat=2
3498 Enable @option{-Wformat} plus additional format checks.  Currently
3499 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3500 -Wformat-y2k}.
3502 @item -Wformat-nonliteral
3503 @opindex Wformat-nonliteral
3504 @opindex Wno-format-nonliteral
3505 If @option{-Wformat} is specified, also warn if the format string is not a
3506 string literal and so cannot be checked, unless the format function
3507 takes its format arguments as a @code{va_list}.
3509 @item -Wformat-security
3510 @opindex Wformat-security
3511 @opindex Wno-format-security
3512 If @option{-Wformat} is specified, also warn about uses of format
3513 functions that represent possible security problems.  At present, this
3514 warns about calls to @code{printf} and @code{scanf} functions where the
3515 format string is not a string literal and there are no format arguments,
3516 as in @code{printf (foo);}.  This may be a security hole if the format
3517 string came from untrusted input and contains @samp{%n}.  (This is
3518 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3519 in future warnings may be added to @option{-Wformat-security} that are not
3520 included in @option{-Wformat-nonliteral}.)
3522 @item -Wformat-y2k
3523 @opindex Wformat-y2k
3524 @opindex Wno-format-y2k
3525 If @option{-Wformat} is specified, also warn about @code{strftime}
3526 formats that may yield only a two-digit year.
3527 @end table
3529 @item -Wnonnull
3530 @opindex Wnonnull
3531 @opindex Wno-nonnull
3532 Warn about passing a null pointer for arguments marked as
3533 requiring a non-null value by the @code{nonnull} function attribute.
3535 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3536 can be disabled with the @option{-Wno-nonnull} option.
3538 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3539 @opindex Winit-self
3540 @opindex Wno-init-self
3541 Warn about uninitialized variables that are initialized with themselves.
3542 Note this option can only be used with the @option{-Wuninitialized} option.
3544 For example, GCC warns about @code{i} being uninitialized in the
3545 following snippet only when @option{-Winit-self} has been specified:
3546 @smallexample
3547 @group
3548 int f()
3550   int i = i;
3551   return i;
3553 @end group
3554 @end smallexample
3556 This warning is enabled by @option{-Wall} in C++.
3558 @item -Wimplicit-int @r{(C and Objective-C only)}
3559 @opindex Wimplicit-int
3560 @opindex Wno-implicit-int
3561 Warn when a declaration does not specify a type.
3562 This warning is enabled by @option{-Wall}.
3564 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3565 @opindex Wimplicit-function-declaration
3566 @opindex Wno-implicit-function-declaration
3567 Give a warning whenever a function is used before being declared. In
3568 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3569 enabled by default and it is made into an error by
3570 @option{-pedantic-errors}. This warning is also enabled by
3571 @option{-Wall}.
3573 @item -Wimplicit @r{(C and Objective-C only)}
3574 @opindex Wimplicit
3575 @opindex Wno-implicit
3576 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3577 This warning is enabled by @option{-Wall}.
3579 @item -Wignored-qualifiers @r{(C and C++ only)}
3580 @opindex Wignored-qualifiers
3581 @opindex Wno-ignored-qualifiers
3582 Warn if the return type of a function has a type qualifier
3583 such as @code{const}.  For ISO C such a type qualifier has no effect,
3584 since the value returned by a function is not an lvalue.
3585 For C++, the warning is only emitted for scalar types or @code{void}.
3586 ISO C prohibits qualified @code{void} return types on function
3587 definitions, so such return types always receive a warning
3588 even without this option.
3590 This warning is also enabled by @option{-Wextra}.
3592 @item -Wmain
3593 @opindex Wmain
3594 @opindex Wno-main
3595 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3596 a function with external linkage, returning int, taking either zero
3597 arguments, two, or three arguments of appropriate types.  This warning
3598 is enabled by default in C++ and is enabled by either @option{-Wall}
3599 or @option{-Wpedantic}.
3601 @item -Wmissing-braces
3602 @opindex Wmissing-braces
3603 @opindex Wno-missing-braces
3604 Warn if an aggregate or union initializer is not fully bracketed.  In
3605 the following example, the initializer for @samp{a} is not fully
3606 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3607 enabled by @option{-Wall} in C.
3609 @smallexample
3610 int a[2][2] = @{ 0, 1, 2, 3 @};
3611 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3612 @end smallexample
3614 This warning is enabled by @option{-Wall}.
3616 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3617 @opindex Wmissing-include-dirs
3618 @opindex Wno-missing-include-dirs
3619 Warn if a user-supplied include directory does not exist.
3621 @item -Wparentheses
3622 @opindex Wparentheses
3623 @opindex Wno-parentheses
3624 Warn if parentheses are omitted in certain contexts, such
3625 as when there is an assignment in a context where a truth value
3626 is expected, or when operators are nested whose precedence people
3627 often get confused about.
3629 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3630 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3631 interpretation from that of ordinary mathematical notation.
3633 Also warn about constructions where there may be confusion to which
3634 @code{if} statement an @code{else} branch belongs.  Here is an example of
3635 such a case:
3637 @smallexample
3638 @group
3640   if (a)
3641     if (b)
3642       foo ();
3643   else
3644     bar ();
3646 @end group
3647 @end smallexample
3649 In C/C++, every @code{else} branch belongs to the innermost possible
3650 @code{if} statement, which in this example is @code{if (b)}.  This is
3651 often not what the programmer expected, as illustrated in the above
3652 example by indentation the programmer chose.  When there is the
3653 potential for this confusion, GCC issues a warning when this flag
3654 is specified.  To eliminate the warning, add explicit braces around
3655 the innermost @code{if} statement so there is no way the @code{else}
3656 can belong to the enclosing @code{if}.  The resulting code
3657 looks like this:
3659 @smallexample
3660 @group
3662   if (a)
3663     @{
3664       if (b)
3665         foo ();
3666       else
3667         bar ();
3668     @}
3670 @end group
3671 @end smallexample
3673 Also warn for dangerous uses of the GNU extension to
3674 @code{?:} with omitted middle operand. When the condition
3675 in the @code{?}: operator is a boolean expression, the omitted value is
3676 always 1.  Often programmers expect it to be a value computed
3677 inside the conditional expression instead.
3679 This warning is enabled by @option{-Wall}.
3681 @item -Wsequence-point
3682 @opindex Wsequence-point
3683 @opindex Wno-sequence-point
3684 Warn about code that may have undefined semantics because of violations
3685 of sequence point rules in the C and C++ standards.
3687 The C and C++ standards define the order in which expressions in a C/C++
3688 program are evaluated in terms of @dfn{sequence points}, which represent
3689 a partial ordering between the execution of parts of the program: those
3690 executed before the sequence point, and those executed after it.  These
3691 occur after the evaluation of a full expression (one which is not part
3692 of a larger expression), after the evaluation of the first operand of a
3693 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3694 function is called (but after the evaluation of its arguments and the
3695 expression denoting the called function), and in certain other places.
3696 Other than as expressed by the sequence point rules, the order of
3697 evaluation of subexpressions of an expression is not specified.  All
3698 these rules describe only a partial order rather than a total order,
3699 since, for example, if two functions are called within one expression
3700 with no sequence point between them, the order in which the functions
3701 are called is not specified.  However, the standards committee have
3702 ruled that function calls do not overlap.
3704 It is not specified when between sequence points modifications to the
3705 values of objects take effect.  Programs whose behavior depends on this
3706 have undefined behavior; the C and C++ standards specify that ``Between
3707 the previous and next sequence point an object shall have its stored
3708 value modified at most once by the evaluation of an expression.
3709 Furthermore, the prior value shall be read only to determine the value
3710 to be stored.''.  If a program breaks these rules, the results on any
3711 particular implementation are entirely unpredictable.
3713 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3714 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3715 diagnosed by this option, and it may give an occasional false positive
3716 result, but in general it has been found fairly effective at detecting
3717 this sort of problem in programs.
3719 The standard is worded confusingly, therefore there is some debate
3720 over the precise meaning of the sequence point rules in subtle cases.
3721 Links to discussions of the problem, including proposed formal
3722 definitions, may be found on the GCC readings page, at
3723 @uref{http://gcc.gnu.org/@/readings.html}.
3725 This warning is enabled by @option{-Wall} for C and C++.
3727 @item -Wno-return-local-addr
3728 @opindex Wno-return-local-addr
3729 @opindex Wreturn-local-addr
3730 Do not warn about returning a pointer (or in C++, a reference) to a
3731 variable that goes out of scope after the function returns.
3733 @item -Wreturn-type
3734 @opindex Wreturn-type
3735 @opindex Wno-return-type
3736 Warn whenever a function is defined with a return type that defaults
3737 to @code{int}.  Also warn about any @code{return} statement with no
3738 return value in a function whose return type is not @code{void}
3739 (falling off the end of the function body is considered returning
3740 without a value), and about a @code{return} statement with an
3741 expression in a function whose return type is @code{void}.
3743 For C++, a function without return type always produces a diagnostic
3744 message, even when @option{-Wno-return-type} is specified.  The only
3745 exceptions are @samp{main} and functions defined in system headers.
3747 This warning is enabled by @option{-Wall}.
3749 @item -Wswitch
3750 @opindex Wswitch
3751 @opindex Wno-switch
3752 Warn whenever a @code{switch} statement has an index of enumerated type
3753 and lacks a @code{case} for one or more of the named codes of that
3754 enumeration.  (The presence of a @code{default} label prevents this
3755 warning.)  @code{case} labels outside the enumeration range also
3756 provoke warnings when this option is used (even if there is a
3757 @code{default} label).
3758 This warning is enabled by @option{-Wall}.
3760 @item -Wswitch-default
3761 @opindex Wswitch-default
3762 @opindex Wno-switch-default
3763 Warn whenever a @code{switch} statement does not have a @code{default}
3764 case.
3766 @item -Wswitch-enum
3767 @opindex Wswitch-enum
3768 @opindex Wno-switch-enum
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.  @code{case} labels outside the enumeration range also
3772 provoke warnings when this option is used.  The only difference
3773 between @option{-Wswitch} and this option is that this option gives a
3774 warning about an omitted enumeration code even if there is a
3775 @code{default} label.
3777 @item -Wsync-nand @r{(C and C++ only)}
3778 @opindex Wsync-nand
3779 @opindex Wno-sync-nand
3780 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3781 built-in functions are used.  These functions changed semantics in GCC 4.4.
3783 @item -Wtrigraphs
3784 @opindex Wtrigraphs
3785 @opindex Wno-trigraphs
3786 Warn if any trigraphs are encountered that might change the meaning of
3787 the program (trigraphs within comments are not warned about).
3788 This warning is enabled by @option{-Wall}.
3790 @item -Wunused-but-set-parameter
3791 @opindex Wunused-but-set-parameter
3792 @opindex Wno-unused-but-set-parameter
3793 Warn whenever a function parameter is assigned to, but otherwise unused
3794 (aside from its declaration).
3796 To suppress this warning use the @samp{unused} attribute
3797 (@pxref{Variable Attributes}).
3799 This warning is also enabled by @option{-Wunused} together with
3800 @option{-Wextra}.
3802 @item -Wunused-but-set-variable
3803 @opindex Wunused-but-set-variable
3804 @opindex Wno-unused-but-set-variable
3805 Warn whenever a local variable is assigned to, but otherwise unused
3806 (aside from its declaration).
3807 This warning is enabled by @option{-Wall}.
3809 To suppress this warning use the @samp{unused} attribute
3810 (@pxref{Variable Attributes}).
3812 This warning is also enabled by @option{-Wunused}, which is enabled
3813 by @option{-Wall}.
3815 @item -Wunused-function
3816 @opindex Wunused-function
3817 @opindex Wno-unused-function
3818 Warn whenever a static function is declared but not defined or a
3819 non-inline static function is unused.
3820 This warning is enabled by @option{-Wall}.
3822 @item -Wunused-label
3823 @opindex Wunused-label
3824 @opindex Wno-unused-label
3825 Warn whenever a label is declared but not used.
3826 This warning is enabled by @option{-Wall}.
3828 To suppress this warning use the @samp{unused} attribute
3829 (@pxref{Variable Attributes}).
3831 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3832 @opindex Wunused-local-typedefs
3833 Warn when a typedef locally defined in a function is not used.
3834 This warning is enabled by @option{-Wall}.
3836 @item -Wunused-parameter
3837 @opindex Wunused-parameter
3838 @opindex Wno-unused-parameter
3839 Warn whenever a function parameter is unused aside from its declaration.
3841 To suppress this warning use the @samp{unused} attribute
3842 (@pxref{Variable Attributes}).
3844 @item -Wno-unused-result
3845 @opindex Wunused-result
3846 @opindex Wno-unused-result
3847 Do not warn if a caller of a function marked with attribute
3848 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3849 its return value. The default is @option{-Wunused-result}.
3851 @item -Wunused-variable
3852 @opindex Wunused-variable
3853 @opindex Wno-unused-variable
3854 Warn whenever a local variable or non-constant static variable is unused
3855 aside from its declaration.
3856 This warning is enabled by @option{-Wall}.
3858 To suppress this warning use the @samp{unused} attribute
3859 (@pxref{Variable Attributes}).
3861 @item -Wunused-value
3862 @opindex Wunused-value
3863 @opindex Wno-unused-value
3864 Warn whenever a statement computes a result that is explicitly not
3865 used. To suppress this warning cast the unused expression to
3866 @samp{void}. This includes an expression-statement or the left-hand
3867 side of a comma expression that contains no side effects. For example,
3868 an expression such as @samp{x[i,j]} causes a warning, while
3869 @samp{x[(void)i,j]} does not.
3871 This warning is enabled by @option{-Wall}.
3873 @item -Wunused
3874 @opindex Wunused
3875 @opindex Wno-unused
3876 All the above @option{-Wunused} options combined.
3878 In order to get a warning about an unused function parameter, you must
3879 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3880 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3882 @item -Wuninitialized
3883 @opindex Wuninitialized
3884 @opindex Wno-uninitialized
3885 Warn if an automatic variable is used without first being initialized
3886 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3887 warn if a non-static reference or non-static @samp{const} member
3888 appears in a class without constructors.
3890 If you want to warn about code that uses the uninitialized value of the
3891 variable in its own initializer, use the @option{-Winit-self} option.
3893 These warnings occur for individual uninitialized or clobbered
3894 elements of structure, union or array variables as well as for
3895 variables that are uninitialized or clobbered as a whole.  They do
3896 not occur for variables or elements declared @code{volatile}.  Because
3897 these warnings depend on optimization, the exact variables or elements
3898 for which there are warnings depends on the precise optimization
3899 options and version of GCC used.
3901 Note that there may be no warning about a variable that is used only
3902 to compute a value that itself is never used, because such
3903 computations may be deleted by data flow analysis before the warnings
3904 are printed.
3906 @item -Wmaybe-uninitialized
3907 @opindex Wmaybe-uninitialized
3908 @opindex Wno-maybe-uninitialized
3909 For an automatic variable, if there exists a path from the function
3910 entry to a use of the variable that is initialized, but there exist
3911 some other paths for which the variable is not initialized, the compiler
3912 emits a warning if it cannot prove the uninitialized paths are not
3913 executed at run time. These warnings are made optional because GCC is
3914 not smart enough to see all the reasons why the code might be correct
3915 in spite of appearing to have an error.  Here is one example of how
3916 this can happen:
3918 @smallexample
3919 @group
3921   int x;
3922   switch (y)
3923     @{
3924     case 1: x = 1;
3925       break;
3926     case 2: x = 4;
3927       break;
3928     case 3: x = 5;
3929     @}
3930   foo (x);
3932 @end group
3933 @end smallexample
3935 @noindent
3936 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3937 always initialized, but GCC doesn't know this. To suppress the
3938 warning, you need to provide a default case with assert(0) or
3939 similar code.
3941 @cindex @code{longjmp} warnings
3942 This option also warns when a non-volatile automatic variable might be
3943 changed by a call to @code{longjmp}.  These warnings as well are possible
3944 only in optimizing compilation.
3946 The compiler sees only the calls to @code{setjmp}.  It cannot know
3947 where @code{longjmp} will be called; in fact, a signal handler could
3948 call it at any point in the code.  As a result, you may get a warning
3949 even when there is in fact no problem because @code{longjmp} cannot
3950 in fact be called at the place that would cause a problem.
3952 Some spurious warnings can be avoided if you declare all the functions
3953 you use that never return as @code{noreturn}.  @xref{Function
3954 Attributes}.
3956 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3958 @item -Wunknown-pragmas
3959 @opindex Wunknown-pragmas
3960 @opindex Wno-unknown-pragmas
3961 @cindex warning for unknown pragmas
3962 @cindex unknown pragmas, warning
3963 @cindex pragmas, warning of unknown
3964 Warn when a @code{#pragma} directive is encountered that is not understood by 
3965 GCC@.  If this command-line option is used, warnings are even issued
3966 for unknown pragmas in system header files.  This is not the case if
3967 the warnings are only enabled by the @option{-Wall} command-line option.
3969 @item -Wno-pragmas
3970 @opindex Wno-pragmas
3971 @opindex Wpragmas
3972 Do not warn about misuses of pragmas, such as incorrect parameters,
3973 invalid syntax, or conflicts between pragmas.  See also
3974 @option{-Wunknown-pragmas}.
3976 @item -Wstrict-aliasing
3977 @opindex Wstrict-aliasing
3978 @opindex Wno-strict-aliasing
3979 This option is only active when @option{-fstrict-aliasing} is active.
3980 It warns about code that might break the strict aliasing rules that the
3981 compiler is using for optimization.  The warning does not catch all
3982 cases, but does attempt to catch the more common pitfalls.  It is
3983 included in @option{-Wall}.
3984 It is equivalent to @option{-Wstrict-aliasing=3}
3986 @item -Wstrict-aliasing=n
3987 @opindex Wstrict-aliasing=n
3988 This option is only active when @option{-fstrict-aliasing} is active.
3989 It warns about code that might break the strict aliasing rules that the
3990 compiler is using for optimization.
3991 Higher levels correspond to higher accuracy (fewer false positives).
3992 Higher levels also correspond to more effort, similar to the way @option{-O} 
3993 works.
3994 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3996 Level 1: Most aggressive, quick, least accurate.
3997 Possibly useful when higher levels
3998 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3999 false negatives.  However, it has many false positives.
4000 Warns for all pointer conversions between possibly incompatible types,
4001 even if never dereferenced.  Runs in the front end only.
4003 Level 2: Aggressive, quick, not too precise.
4004 May still have many false positives (not as many as level 1 though),
4005 and few false negatives (but possibly more than level 1).
4006 Unlike level 1, it only warns when an address is taken.  Warns about
4007 incomplete types.  Runs in the front end only.
4009 Level 3 (default for @option{-Wstrict-aliasing}):
4010 Should have very few false positives and few false
4011 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4012 Takes care of the common pun+dereference pattern in the front end:
4013 @code{*(int*)&some_float}.
4014 If optimization is enabled, it also runs in the back end, where it deals
4015 with multiple statement cases using flow-sensitive points-to information.
4016 Only warns when the converted pointer is dereferenced.
4017 Does not warn about incomplete types.
4019 @item -Wstrict-overflow
4020 @itemx -Wstrict-overflow=@var{n}
4021 @opindex Wstrict-overflow
4022 @opindex Wno-strict-overflow
4023 This option is only active when @option{-fstrict-overflow} is active.
4024 It warns about cases where the compiler optimizes based on the
4025 assumption that signed overflow does not occur.  Note that it does not
4026 warn about all cases where the code might overflow: it only warns
4027 about cases where the compiler implements some optimization.  Thus
4028 this warning depends on the optimization level.
4030 An optimization that assumes that signed overflow does not occur is
4031 perfectly safe if the values of the variables involved are such that
4032 overflow never does, in fact, occur.  Therefore this warning can
4033 easily give a false positive: a warning about code that is not
4034 actually a problem.  To help focus on important issues, several
4035 warning levels are defined.  No warnings are issued for the use of
4036 undefined signed overflow when estimating how many iterations a loop
4037 requires, in particular when determining whether a loop will be
4038 executed at all.
4040 @table @gcctabopt
4041 @item -Wstrict-overflow=1
4042 Warn about cases that are both questionable and easy to avoid.  For
4043 example,  with @option{-fstrict-overflow}, the compiler simplifies
4044 @code{x + 1 > x} to @code{1}.  This level of
4045 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4046 are not, and must be explicitly requested.
4048 @item -Wstrict-overflow=2
4049 Also warn about other cases where a comparison is simplified to a
4050 constant.  For example: @code{abs (x) >= 0}.  This can only be
4051 simplified when @option{-fstrict-overflow} is in effect, because
4052 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4053 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4054 @option{-Wstrict-overflow=2}.
4056 @item -Wstrict-overflow=3
4057 Also warn about other cases where a comparison is simplified.  For
4058 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4060 @item -Wstrict-overflow=4
4061 Also warn about other simplifications not covered by the above cases.
4062 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4064 @item -Wstrict-overflow=5
4065 Also warn about cases where the compiler reduces the magnitude of a
4066 constant involved in a comparison.  For example: @code{x + 2 > y} is
4067 simplified to @code{x + 1 >= y}.  This is reported only at the
4068 highest warning level because this simplification applies to many
4069 comparisons, so this warning level gives a very large number of
4070 false positives.
4071 @end table
4073 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4074 @opindex Wsuggest-attribute=
4075 @opindex Wno-suggest-attribute=
4076 Warn for cases where adding an attribute may be beneficial. The
4077 attributes currently supported are listed below.
4079 @table @gcctabopt
4080 @item -Wsuggest-attribute=pure
4081 @itemx -Wsuggest-attribute=const
4082 @itemx -Wsuggest-attribute=noreturn
4083 @opindex Wsuggest-attribute=pure
4084 @opindex Wno-suggest-attribute=pure
4085 @opindex Wsuggest-attribute=const
4086 @opindex Wno-suggest-attribute=const
4087 @opindex Wsuggest-attribute=noreturn
4088 @opindex Wno-suggest-attribute=noreturn
4090 Warn about functions that might be candidates for attributes
4091 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4092 functions visible in other compilation units or (in the case of @code{pure} and
4093 @code{const}) if it cannot prove that the function returns normally. A function
4094 returns normally if it doesn't contain an infinite loop or return abnormally
4095 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4096 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4097 higher.  Higher optimization levels improve the accuracy of the analysis.
4099 @item -Wsuggest-attribute=format
4100 @itemx -Wmissing-format-attribute
4101 @opindex Wsuggest-attribute=format
4102 @opindex Wmissing-format-attribute
4103 @opindex Wno-suggest-attribute=format
4104 @opindex Wno-missing-format-attribute
4105 @opindex Wformat
4106 @opindex Wno-format
4108 Warn about function pointers that might be candidates for @code{format}
4109 attributes.  Note these are only possible candidates, not absolute ones.
4110 GCC guesses that function pointers with @code{format} attributes that
4111 are used in assignment, initialization, parameter passing or return
4112 statements should have a corresponding @code{format} attribute in the
4113 resulting type.  I.e.@: the left-hand side of the assignment or
4114 initialization, the type of the parameter variable, or the return type
4115 of the containing function respectively should also have a @code{format}
4116 attribute to avoid the warning.
4118 GCC also warns about function definitions that might be
4119 candidates for @code{format} attributes.  Again, these are only
4120 possible candidates.  GCC guesses that @code{format} attributes
4121 might be appropriate for any function that calls a function like
4122 @code{vprintf} or @code{vscanf}, but this might not always be the
4123 case, and some functions for which @code{format} attributes are
4124 appropriate may not be detected.
4125 @end table
4127 @item -Warray-bounds
4128 @opindex Wno-array-bounds
4129 @opindex Warray-bounds
4130 This option is only active when @option{-ftree-vrp} is active
4131 (default for @option{-O2} and above). It warns about subscripts to arrays
4132 that are always out of bounds. This warning is enabled by @option{-Wall}.
4134 @item -Wno-div-by-zero
4135 @opindex Wno-div-by-zero
4136 @opindex Wdiv-by-zero
4137 Do not warn about compile-time integer division by zero.  Floating-point
4138 division by zero is not warned about, as it can be a legitimate way of
4139 obtaining infinities and NaNs.
4141 @item -Wsystem-headers
4142 @opindex Wsystem-headers
4143 @opindex Wno-system-headers
4144 @cindex warnings from system headers
4145 @cindex system headers, warnings from
4146 Print warning messages for constructs found in system header files.
4147 Warnings from system headers are normally suppressed, on the assumption
4148 that they usually do not indicate real problems and would only make the
4149 compiler output harder to read.  Using this command-line option tells
4150 GCC to emit warnings from system headers as if they occurred in user
4151 code.  However, note that using @option{-Wall} in conjunction with this
4152 option does @emph{not} warn about unknown pragmas in system
4153 headers---for that, @option{-Wunknown-pragmas} must also be used.
4155 @item -Wtrampolines
4156 @opindex Wtrampolines
4157 @opindex Wno-trampolines
4158  Warn about trampolines generated for pointers to nested functions.
4160  A trampoline is a small piece of data or code that is created at run
4161  time on the stack when the address of a nested function is taken, and
4162  is used to call the nested function indirectly.  For some targets, it
4163  is made up of data only and thus requires no special treatment.  But,
4164  for most targets, it is made up of code and thus requires the stack
4165  to be made executable in order for the program to work properly.
4167 @item -Wfloat-equal
4168 @opindex Wfloat-equal
4169 @opindex Wno-float-equal
4170 Warn if floating-point values are used in equality comparisons.
4172 The idea behind this is that sometimes it is convenient (for the
4173 programmer) to consider floating-point values as approximations to
4174 infinitely precise real numbers.  If you are doing this, then you need
4175 to compute (by analyzing the code, or in some other way) the maximum or
4176 likely maximum error that the computation introduces, and allow for it
4177 when performing comparisons (and when producing output, but that's a
4178 different problem).  In particular, instead of testing for equality, you
4179 should check to see whether the two values have ranges that overlap; and
4180 this is done with the relational operators, so equality comparisons are
4181 probably mistaken.
4183 @item -Wtraditional @r{(C and Objective-C only)}
4184 @opindex Wtraditional
4185 @opindex Wno-traditional
4186 Warn about certain constructs that behave differently in traditional and
4187 ISO C@.  Also warn about ISO C constructs that have no traditional C
4188 equivalent, and/or problematic constructs that should be avoided.
4190 @itemize @bullet
4191 @item
4192 Macro parameters that appear within string literals in the macro body.
4193 In traditional C macro replacement takes place within string literals,
4194 but in ISO C it does not.
4196 @item
4197 In traditional C, some preprocessor directives did not exist.
4198 Traditional preprocessors only considered a line to be a directive
4199 if the @samp{#} appeared in column 1 on the line.  Therefore
4200 @option{-Wtraditional} warns about directives that traditional C
4201 understands but ignores because the @samp{#} does not appear as the
4202 first character on the line.  It also suggests you hide directives like
4203 @samp{#pragma} not understood by traditional C by indenting them.  Some
4204 traditional implementations do not recognize @samp{#elif}, so this option
4205 suggests avoiding it altogether.
4207 @item
4208 A function-like macro that appears without arguments.
4210 @item
4211 The unary plus operator.
4213 @item
4214 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4215 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4216 constants.)  Note, these suffixes appear in macros defined in the system
4217 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4218 Use of these macros in user code might normally lead to spurious
4219 warnings, however GCC's integrated preprocessor has enough context to
4220 avoid warning in these cases.
4222 @item
4223 A function declared external in one block and then used after the end of
4224 the block.
4226 @item
4227 A @code{switch} statement has an operand of type @code{long}.
4229 @item
4230 A non-@code{static} function declaration follows a @code{static} one.
4231 This construct is not accepted by some traditional C compilers.
4233 @item
4234 The ISO type of an integer constant has a different width or
4235 signedness from its traditional type.  This warning is only issued if
4236 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4237 typically represent bit patterns, are not warned about.
4239 @item
4240 Usage of ISO string concatenation is detected.
4242 @item
4243 Initialization of automatic aggregates.
4245 @item
4246 Identifier conflicts with labels.  Traditional C lacks a separate
4247 namespace for labels.
4249 @item
4250 Initialization of unions.  If the initializer is zero, the warning is
4251 omitted.  This is done under the assumption that the zero initializer in
4252 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4253 initializer warnings and relies on default initialization to zero in the
4254 traditional C case.
4256 @item
4257 Conversions by prototypes between fixed/floating-point values and vice
4258 versa.  The absence of these prototypes when compiling with traditional
4259 C causes serious problems.  This is a subset of the possible
4260 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4262 @item
4263 Use of ISO C style function definitions.  This warning intentionally is
4264 @emph{not} issued for prototype declarations or variadic functions
4265 because these ISO C features appear in your code when using
4266 libiberty's traditional C compatibility macros, @code{PARAMS} and
4267 @code{VPARAMS}.  This warning is also bypassed for nested functions
4268 because that feature is already a GCC extension and thus not relevant to
4269 traditional C compatibility.
4270 @end itemize
4272 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4273 @opindex Wtraditional-conversion
4274 @opindex Wno-traditional-conversion
4275 Warn if a prototype causes a type conversion that is different from what
4276 would happen to the same argument in the absence of a prototype.  This
4277 includes conversions of fixed point to floating and vice versa, and
4278 conversions changing the width or signedness of a fixed-point argument
4279 except when the same as the default promotion.
4281 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4282 @opindex Wdeclaration-after-statement
4283 @opindex Wno-declaration-after-statement
4284 Warn when a declaration is found after a statement in a block.  This
4285 construct, known from C++, was introduced with ISO C99 and is by default
4286 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4287 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4289 @item -Wundef
4290 @opindex Wundef
4291 @opindex Wno-undef
4292 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4294 @item -Wno-endif-labels
4295 @opindex Wno-endif-labels
4296 @opindex Wendif-labels
4297 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4299 @item -Wshadow
4300 @opindex Wshadow
4301 @opindex Wno-shadow
4302 Warn whenever a local variable or type declaration shadows another variable,
4303 parameter, type, or class member (in C++), or whenever a built-in function
4304 is shadowed. Note that in C++, the compiler warns if a local variable
4305 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4307 @item -Wlarger-than=@var{len}
4308 @opindex Wlarger-than=@var{len}
4309 @opindex Wlarger-than-@var{len}
4310 Warn whenever an object of larger than @var{len} bytes is defined.
4312 @item -Wframe-larger-than=@var{len}
4313 @opindex Wframe-larger-than
4314 Warn if the size of a function frame is larger than @var{len} bytes.
4315 The computation done to determine the stack frame size is approximate
4316 and not conservative.
4317 The actual requirements may be somewhat greater than @var{len}
4318 even if you do not get a warning.  In addition, any space allocated
4319 via @code{alloca}, variable-length arrays, or related constructs
4320 is not included by the compiler when determining
4321 whether or not to issue a warning.
4323 @item -Wno-free-nonheap-object
4324 @opindex Wno-free-nonheap-object
4325 @opindex Wfree-nonheap-object
4326 Do not warn when attempting to free an object that was not allocated
4327 on the heap.
4329 @item -Wstack-usage=@var{len}
4330 @opindex Wstack-usage
4331 Warn if the stack usage of a function might be larger than @var{len} bytes.
4332 The computation done to determine the stack usage is conservative.
4333 Any space allocated via @code{alloca}, variable-length arrays, or related
4334 constructs is included by the compiler when determining whether or not to
4335 issue a warning.
4337 The message is in keeping with the output of @option{-fstack-usage}.
4339 @itemize
4340 @item
4341 If the stack usage is fully static but exceeds the specified amount, it's:
4343 @smallexample
4344   warning: stack usage is 1120 bytes
4345 @end smallexample
4346 @item
4347 If the stack usage is (partly) dynamic but bounded, it's:
4349 @smallexample
4350   warning: stack usage might be 1648 bytes
4351 @end smallexample
4352 @item
4353 If the stack usage is (partly) dynamic and not bounded, it's:
4355 @smallexample
4356   warning: stack usage might be unbounded
4357 @end smallexample
4358 @end itemize
4360 @item -Wunsafe-loop-optimizations
4361 @opindex Wunsafe-loop-optimizations
4362 @opindex Wno-unsafe-loop-optimizations
4363 Warn if the loop cannot be optimized because the compiler cannot
4364 assume anything on the bounds of the loop indices.  With
4365 @option{-funsafe-loop-optimizations} warn if the compiler makes
4366 such assumptions.
4368 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4369 @opindex Wno-pedantic-ms-format
4370 @opindex Wpedantic-ms-format
4371 When used in combination with @option{-Wformat}
4372 and @option{-pedantic} without GNU extensions, this option
4373 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4374 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4375 which depend on the MS runtime.
4377 @item -Wpointer-arith
4378 @opindex Wpointer-arith
4379 @opindex Wno-pointer-arith
4380 Warn about anything that depends on the ``size of'' a function type or
4381 of @code{void}.  GNU C assigns these types a size of 1, for
4382 convenience in calculations with @code{void *} pointers and pointers
4383 to functions.  In C++, warn also when an arithmetic operation involves
4384 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4386 @item -Wtype-limits
4387 @opindex Wtype-limits
4388 @opindex Wno-type-limits
4389 Warn if a comparison is always true or always false due to the limited
4390 range of the data type, but do not warn for constant expressions.  For
4391 example, warn if an unsigned variable is compared against zero with
4392 @samp{<} or @samp{>=}.  This warning is also enabled by
4393 @option{-Wextra}.
4395 @item -Wbad-function-cast @r{(C and Objective-C only)}
4396 @opindex Wbad-function-cast
4397 @opindex Wno-bad-function-cast
4398 Warn whenever a function call is cast to a non-matching type.
4399 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4401 @item -Wc++-compat @r{(C and Objective-C only)}
4402 Warn about ISO C constructs that are outside of the common subset of
4403 ISO C and ISO C++, e.g.@: request for implicit conversion from
4404 @code{void *} to a pointer to non-@code{void} type.
4406 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4407 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4408 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4409 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4410 enabled by @option{-Wall}.
4412 @item -Wcast-qual
4413 @opindex Wcast-qual
4414 @opindex Wno-cast-qual
4415 Warn whenever a pointer is cast so as to remove a type qualifier from
4416 the target type.  For example, warn if a @code{const char *} is cast
4417 to an ordinary @code{char *}.
4419 Also warn when making a cast that introduces a type qualifier in an
4420 unsafe way.  For example, casting @code{char **} to @code{const char **}
4421 is unsafe, as in this example:
4423 @smallexample
4424   /* p is char ** value.  */
4425   const char **q = (const char **) p;
4426   /* Assignment of readonly string to const char * is OK.  */
4427   *q = "string";
4428   /* Now char** pointer points to read-only memory.  */
4429   **p = 'b';
4430 @end smallexample
4432 @item -Wcast-align
4433 @opindex Wcast-align
4434 @opindex Wno-cast-align
4435 Warn whenever a pointer is cast such that the required alignment of the
4436 target is increased.  For example, warn if a @code{char *} is cast to
4437 an @code{int *} on machines where integers can only be accessed at
4438 two- or four-byte boundaries.
4440 @item -Wwrite-strings
4441 @opindex Wwrite-strings
4442 @opindex Wno-write-strings
4443 When compiling C, give string constants the type @code{const
4444 char[@var{length}]} so that copying the address of one into a
4445 non-@code{const} @code{char *} pointer produces a warning.  These
4446 warnings help you find at compile time code that can try to write
4447 into a string constant, but only if you have been very careful about
4448 using @code{const} in declarations and prototypes.  Otherwise, it is
4449 just a nuisance. This is why we did not make @option{-Wall} request
4450 these warnings.
4452 When compiling C++, warn about the deprecated conversion from string
4453 literals to @code{char *}.  This warning is enabled by default for C++
4454 programs.
4456 @item -Wclobbered
4457 @opindex Wclobbered
4458 @opindex Wno-clobbered
4459 Warn for variables that might be changed by @samp{longjmp} or
4460 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4462 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4463 @opindex Wconditionally-supported
4464 @opindex Wno-conditionally-supported
4465 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4467 @item -Wconversion
4468 @opindex Wconversion
4469 @opindex Wno-conversion
4470 Warn for implicit conversions that may alter a value. This includes
4471 conversions between real and integer, like @code{abs (x)} when
4472 @code{x} is @code{double}; conversions between signed and unsigned,
4473 like @code{unsigned ui = -1}; and conversions to smaller types, like
4474 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4475 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4476 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4477 conversions between signed and unsigned integers can be disabled by
4478 using @option{-Wno-sign-conversion}.
4480 For C++, also warn for confusing overload resolution for user-defined
4481 conversions; and conversions that never use a type conversion
4482 operator: conversions to @code{void}, the same type, a base class or a
4483 reference to them. Warnings about conversions between signed and
4484 unsigned integers are disabled by default in C++ unless
4485 @option{-Wsign-conversion} is explicitly enabled.
4487 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4488 @opindex Wconversion-null
4489 @opindex Wno-conversion-null
4490 Do not warn for conversions between @code{NULL} and non-pointer
4491 types. @option{-Wconversion-null} is enabled by default.
4493 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4494 @opindex Wzero-as-null-pointer-constant
4495 @opindex Wno-zero-as-null-pointer-constant
4496 Warn when a literal '0' is used as null pointer constant.  This can
4497 be useful to facilitate the conversion to @code{nullptr} in C++11.
4499 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4500 @opindex Wdelete-incomplete
4501 @opindex Wno-delete-incomplete
4502 Warn when deleting a pointer to incomplete type, which may cause
4503 undefined behavior at runtime.  This warning is enabled by default.
4505 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4506 @opindex Wuseless-cast
4507 @opindex Wno-useless-cast
4508 Warn when an expression is casted to its own type.
4510 @item -Wempty-body
4511 @opindex Wempty-body
4512 @opindex Wno-empty-body
4513 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4514 while} statement.  This warning is also enabled by @option{-Wextra}.
4516 @item -Wenum-compare
4517 @opindex Wenum-compare
4518 @opindex Wno-enum-compare
4519 Warn about a comparison between values of different enumerated types.
4520 In C++ enumeral mismatches in conditional expressions are also
4521 diagnosed and the warning is enabled by default.  In C this warning is 
4522 enabled by @option{-Wall}.
4524 @item -Wjump-misses-init @r{(C, Objective-C only)}
4525 @opindex Wjump-misses-init
4526 @opindex Wno-jump-misses-init
4527 Warn if a @code{goto} statement or a @code{switch} statement jumps
4528 forward across the initialization of a variable, or jumps backward to a
4529 label after the variable has been initialized.  This only warns about
4530 variables that are initialized when they are declared.  This warning is
4531 only supported for C and Objective-C; in C++ this sort of branch is an
4532 error in any case.
4534 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4535 can be disabled with the @option{-Wno-jump-misses-init} option.
4537 @item -Wsign-compare
4538 @opindex Wsign-compare
4539 @opindex Wno-sign-compare
4540 @cindex warning for comparison of signed and unsigned values
4541 @cindex comparison of signed and unsigned values, warning
4542 @cindex signed and unsigned values, comparison warning
4543 Warn when a comparison between signed and unsigned values could produce
4544 an incorrect result when the signed value is converted to unsigned.
4545 This warning is also enabled by @option{-Wextra}; to get the other warnings
4546 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4548 @item -Wsign-conversion
4549 @opindex Wsign-conversion
4550 @opindex Wno-sign-conversion
4551 Warn for implicit conversions that may change the sign of an integer
4552 value, like assigning a signed integer expression to an unsigned
4553 integer variable. An explicit cast silences the warning. In C, this
4554 option is enabled also by @option{-Wconversion}.
4556 @item -Wsizeof-pointer-memaccess
4557 @opindex Wsizeof-pointer-memaccess
4558 @opindex Wno-sizeof-pointer-memaccess
4559 Warn for suspicious length parameters to certain string and memory built-in
4560 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4561 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4562 but a pointer, and suggests a possible fix, or about
4563 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4564 @option{-Wall}.
4566 @item -Waddress
4567 @opindex Waddress
4568 @opindex Wno-address
4569 Warn about suspicious uses of memory addresses. These include using
4570 the address of a function in a conditional expression, such as
4571 @code{void func(void); if (func)}, and comparisons against the memory
4572 address of a string literal, such as @code{if (x == "abc")}.  Such
4573 uses typically indicate a programmer error: the address of a function
4574 always evaluates to true, so their use in a conditional usually
4575 indicate that the programmer forgot the parentheses in a function
4576 call; and comparisons against string literals result in unspecified
4577 behavior and are not portable in C, so they usually indicate that the
4578 programmer intended to use @code{strcmp}.  This warning is enabled by
4579 @option{-Wall}.
4581 @item -Wlogical-op
4582 @opindex Wlogical-op
4583 @opindex Wno-logical-op
4584 Warn about suspicious uses of logical operators in expressions.
4585 This includes using logical operators in contexts where a
4586 bit-wise operator is likely to be expected.
4588 @item -Waggregate-return
4589 @opindex Waggregate-return
4590 @opindex Wno-aggregate-return
4591 Warn if any functions that return structures or unions are defined or
4592 called.  (In languages where you can return an array, this also elicits
4593 a warning.)
4595 @item -Wno-aggressive-loop-optimizations
4596 @opindex Wno-aggressive-loop-optimizations
4597 @opindex Waggressive-loop-optimizations
4598 Warn if in a loop with constant number of iterations the compiler detects
4599 undefined behavior in some statement during one or more of the iterations.
4601 @item -Wno-attributes
4602 @opindex Wno-attributes
4603 @opindex Wattributes
4604 Do not warn if an unexpected @code{__attribute__} is used, such as
4605 unrecognized attributes, function attributes applied to variables,
4606 etc.  This does not stop errors for incorrect use of supported
4607 attributes.
4609 @item -Wno-builtin-macro-redefined
4610 @opindex Wno-builtin-macro-redefined
4611 @opindex Wbuiltin-macro-redefined
4612 Do not warn if certain built-in macros are redefined.  This suppresses
4613 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4614 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4616 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4617 @opindex Wstrict-prototypes
4618 @opindex Wno-strict-prototypes
4619 Warn if a function is declared or defined without specifying the
4620 argument types.  (An old-style function definition is permitted without
4621 a warning if preceded by a declaration that specifies the argument
4622 types.)
4624 @item -Wold-style-declaration @r{(C and Objective-C only)}
4625 @opindex Wold-style-declaration
4626 @opindex Wno-old-style-declaration
4627 Warn for obsolescent usages, according to the C Standard, in a
4628 declaration. For example, warn if storage-class specifiers like
4629 @code{static} are not the first things in a declaration.  This warning
4630 is also enabled by @option{-Wextra}.
4632 @item -Wold-style-definition @r{(C and Objective-C only)}
4633 @opindex Wold-style-definition
4634 @opindex Wno-old-style-definition
4635 Warn if an old-style function definition is used.  A warning is given
4636 even if there is a previous prototype.
4638 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4639 @opindex Wmissing-parameter-type
4640 @opindex Wno-missing-parameter-type
4641 A function parameter is declared without a type specifier in K&R-style
4642 functions:
4644 @smallexample
4645 void foo(bar) @{ @}
4646 @end smallexample
4648 This warning is also enabled by @option{-Wextra}.
4650 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4651 @opindex Wmissing-prototypes
4652 @opindex Wno-missing-prototypes
4653 Warn if a global function is defined without a previous prototype
4654 declaration.  This warning is issued even if the definition itself
4655 provides a prototype.  Use this option to detect global functions
4656 that do not have a matching prototype declaration in a header file.
4657 This option is not valid for C++ because all function declarations
4658 provide prototypes and a non-matching declaration will declare an
4659 overload rather than conflict with an earlier declaration.
4660 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4662 @item -Wmissing-declarations
4663 @opindex Wmissing-declarations
4664 @opindex Wno-missing-declarations
4665 Warn if a global function is defined without a previous declaration.
4666 Do so even if the definition itself provides a prototype.
4667 Use this option to detect global functions that are not declared in
4668 header files.  In C, no warnings are issued for functions with previous
4669 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4670 missing prototypes.  In C++, no warnings are issued for function templates,
4671 or for inline functions, or for functions in anonymous namespaces.
4673 @item -Wmissing-field-initializers
4674 @opindex Wmissing-field-initializers
4675 @opindex Wno-missing-field-initializers
4676 @opindex W
4677 @opindex Wextra
4678 @opindex Wno-extra
4679 Warn if a structure's initializer has some fields missing.  For
4680 example, the following code causes such a warning, because
4681 @code{x.h} is implicitly zero:
4683 @smallexample
4684 struct s @{ int f, g, h; @};
4685 struct s x = @{ 3, 4 @};
4686 @end smallexample
4688 This option does not warn about designated initializers, so the following
4689 modification does not trigger a warning:
4691 @smallexample
4692 struct s @{ int f, g, h; @};
4693 struct s x = @{ .f = 3, .g = 4 @};
4694 @end smallexample
4696 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4697 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4699 @item -Wno-multichar
4700 @opindex Wno-multichar
4701 @opindex Wmultichar
4702 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4703 Usually they indicate a typo in the user's code, as they have
4704 implementation-defined values, and should not be used in portable code.
4706 @item -Wnormalized=<none|id|nfc|nfkc>
4707 @opindex Wnormalized=
4708 @cindex NFC
4709 @cindex NFKC
4710 @cindex character set, input normalization
4711 In ISO C and ISO C++, two identifiers are different if they are
4712 different sequences of characters.  However, sometimes when characters
4713 outside the basic ASCII character set are used, you can have two
4714 different character sequences that look the same.  To avoid confusion,
4715 the ISO 10646 standard sets out some @dfn{normalization rules} which
4716 when applied ensure that two sequences that look the same are turned into
4717 the same sequence.  GCC can warn you if you are using identifiers that
4718 have not been normalized; this option controls that warning.
4720 There are four levels of warning supported by GCC@.  The default is
4721 @option{-Wnormalized=nfc}, which warns about any identifier that is
4722 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4723 recommended form for most uses.
4725 Unfortunately, there are some characters allowed in identifiers by
4726 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4727 identifiers.  That is, there's no way to use these symbols in portable
4728 ISO C or C++ and have all your identifiers in NFC@.
4729 @option{-Wnormalized=id} suppresses the warning for these characters.
4730 It is hoped that future versions of the standards involved will correct
4731 this, which is why this option is not the default.
4733 You can switch the warning off for all characters by writing
4734 @option{-Wnormalized=none}.  You should only do this if you
4735 are using some other normalization scheme (like ``D''), because
4736 otherwise you can easily create bugs that are literally impossible to see.
4738 Some characters in ISO 10646 have distinct meanings but look identical
4739 in some fonts or display methodologies, especially once formatting has
4740 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4741 LETTER N'', displays just like a regular @code{n} that has been
4742 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4743 normalization scheme to convert all these into a standard form as
4744 well, and GCC warns if your code is not in NFKC if you use
4745 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4746 about every identifier that contains the letter O because it might be
4747 confused with the digit 0, and so is not the default, but may be
4748 useful as a local coding convention if the programming environment 
4749 cannot be fixed to display these characters distinctly.
4751 @item -Wno-deprecated
4752 @opindex Wno-deprecated
4753 @opindex Wdeprecated
4754 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4756 @item -Wno-deprecated-declarations
4757 @opindex Wno-deprecated-declarations
4758 @opindex Wdeprecated-declarations
4759 Do not warn about uses of functions (@pxref{Function Attributes}),
4760 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4761 Attributes}) marked as deprecated by using the @code{deprecated}
4762 attribute.
4764 @item -Wno-overflow
4765 @opindex Wno-overflow
4766 @opindex Woverflow
4767 Do not warn about compile-time overflow in constant expressions.
4769 @item -Woverride-init @r{(C and Objective-C only)}
4770 @opindex Woverride-init
4771 @opindex Wno-override-init
4772 @opindex W
4773 @opindex Wextra
4774 @opindex Wno-extra
4775 Warn if an initialized field without side effects is overridden when
4776 using designated initializers (@pxref{Designated Inits, , Designated
4777 Initializers}).
4779 This warning is included in @option{-Wextra}.  To get other
4780 @option{-Wextra} warnings without this one, use @option{-Wextra
4781 -Wno-override-init}.
4783 @item -Wpacked
4784 @opindex Wpacked
4785 @opindex Wno-packed
4786 Warn if a structure is given the packed attribute, but the packed
4787 attribute has no effect on the layout or size of the structure.
4788 Such structures may be mis-aligned for little benefit.  For
4789 instance, in this code, the variable @code{f.x} in @code{struct bar}
4790 is misaligned even though @code{struct bar} does not itself
4791 have the packed attribute:
4793 @smallexample
4794 @group
4795 struct foo @{
4796   int x;
4797   char a, b, c, d;
4798 @} __attribute__((packed));
4799 struct bar @{
4800   char z;
4801   struct foo f;
4803 @end group
4804 @end smallexample
4806 @item -Wpacked-bitfield-compat
4807 @opindex Wpacked-bitfield-compat
4808 @opindex Wno-packed-bitfield-compat
4809 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4810 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4811 the change can lead to differences in the structure layout.  GCC
4812 informs you when the offset of such a field has changed in GCC 4.4.
4813 For example there is no longer a 4-bit padding between field @code{a}
4814 and @code{b} in this structure:
4816 @smallexample
4817 struct foo
4819   char a:4;
4820   char b:8;
4821 @} __attribute__ ((packed));
4822 @end smallexample
4824 This warning is enabled by default.  Use
4825 @option{-Wno-packed-bitfield-compat} to disable this warning.
4827 @item -Wpadded
4828 @opindex Wpadded
4829 @opindex Wno-padded
4830 Warn if padding is included in a structure, either to align an element
4831 of the structure or to align the whole structure.  Sometimes when this
4832 happens it is possible to rearrange the fields of the structure to
4833 reduce the padding and so make the structure smaller.
4835 @item -Wredundant-decls
4836 @opindex Wredundant-decls
4837 @opindex Wno-redundant-decls
4838 Warn if anything is declared more than once in the same scope, even in
4839 cases where multiple declaration is valid and changes nothing.
4841 @item -Wnested-externs @r{(C and Objective-C only)}
4842 @opindex Wnested-externs
4843 @opindex Wno-nested-externs
4844 Warn if an @code{extern} declaration is encountered within a function.
4846 @item -Wno-inherited-variadic-ctor
4847 @opindex Winherited-variadic-ctor
4848 @opindex Wno-inherited-variadic-ctor
4849 Suppress warnings about use of C++11 inheriting constructors when the
4850 base class inherited from has a C variadic constructor; the warning is
4851 on by default because the ellipsis is not inherited.
4853 @item -Winline
4854 @opindex Winline
4855 @opindex Wno-inline
4856 Warn if a function that is declared as inline cannot be inlined.
4857 Even with this option, the compiler does not warn about failures to
4858 inline functions declared in system headers.
4860 The compiler uses a variety of heuristics to determine whether or not
4861 to inline a function.  For example, the compiler takes into account
4862 the size of the function being inlined and the amount of inlining
4863 that has already been done in the current function.  Therefore,
4864 seemingly insignificant changes in the source program can cause the
4865 warnings produced by @option{-Winline} to appear or disappear.
4867 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4868 @opindex Wno-invalid-offsetof
4869 @opindex Winvalid-offsetof
4870 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4871 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4872 to a non-POD type is undefined.  In existing C++ implementations,
4873 however, @samp{offsetof} typically gives meaningful results even when
4874 applied to certain kinds of non-POD types (such as a simple
4875 @samp{struct} that fails to be a POD type only by virtue of having a
4876 constructor).  This flag is for users who are aware that they are
4877 writing nonportable code and who have deliberately chosen to ignore the
4878 warning about it.
4880 The restrictions on @samp{offsetof} may be relaxed in a future version
4881 of the C++ standard.
4883 @item -Wno-int-to-pointer-cast
4884 @opindex Wno-int-to-pointer-cast
4885 @opindex Wint-to-pointer-cast
4886 Suppress warnings from casts to pointer type of an integer of a
4887 different size. In C++, casting to a pointer type of smaller size is
4888 an error. @option{Wint-to-pointer-cast} is enabled by default.
4891 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4892 @opindex Wno-pointer-to-int-cast
4893 @opindex Wpointer-to-int-cast
4894 Suppress warnings from casts from a pointer to an integer type of a
4895 different size.
4897 @item -Winvalid-pch
4898 @opindex Winvalid-pch
4899 @opindex Wno-invalid-pch
4900 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4901 the search path but can't be used.
4903 @item -Wlong-long
4904 @opindex Wlong-long
4905 @opindex Wno-long-long
4906 Warn if @samp{long long} type is used.  This is enabled by either
4907 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4908 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4910 @item -Wvariadic-macros
4911 @opindex Wvariadic-macros
4912 @opindex Wno-variadic-macros
4913 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4914 alternate syntax when in pedantic ISO C99 mode.  This is default.
4915 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4917 @item -Wvarargs
4918 @opindex Wvarargs
4919 @opindex Wno-varargs
4920 Warn upon questionable usage of the macros used to handle variable
4921 arguments like @samp{va_start}.  This is default.  To inhibit the
4922 warning messages, use @option{-Wno-varargs}.
4924 @item -Wvector-operation-performance
4925 @opindex Wvector-operation-performance
4926 @opindex Wno-vector-operation-performance
4927 Warn if vector operation is not implemented via SIMD capabilities of the
4928 architecture.  Mainly useful for the performance tuning.
4929 Vector operation can be implemented @code{piecewise}, which means that the
4930 scalar operation is performed on every vector element; 
4931 @code{in parallel}, which means that the vector operation is implemented
4932 using scalars of wider type, which normally is more performance efficient;
4933 and @code{as a single scalar}, which means that vector fits into a
4934 scalar type.
4936 @item -Wno-virtual-move-assign
4937 @opindex Wvirtual-move-assign
4938 @opindex Wno-virtual-move-assign
4939 Suppress warnings about inheriting from a virtual base with a
4940 non-trivial C++11 move assignment operator.  This is dangerous because
4941 if the virtual base is reachable along more than one path, it will be
4942 moved multiple times, which can mean both objects end up in the
4943 moved-from state.  If the move assignment operator is written to avoid
4944 moving from a moved-from object, this warning can be disabled.
4946 @item -Wvla
4947 @opindex Wvla
4948 @opindex Wno-vla
4949 Warn if variable length array is used in the code.
4950 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4951 the variable length array.
4953 @item -Wvolatile-register-var
4954 @opindex Wvolatile-register-var
4955 @opindex Wno-volatile-register-var
4956 Warn if a register variable is declared volatile.  The volatile
4957 modifier does not inhibit all optimizations that may eliminate reads
4958 and/or writes to register variables.  This warning is enabled by
4959 @option{-Wall}.
4961 @item -Wdisabled-optimization
4962 @opindex Wdisabled-optimization
4963 @opindex Wno-disabled-optimization
4964 Warn if a requested optimization pass is disabled.  This warning does
4965 not generally indicate that there is anything wrong with your code; it
4966 merely indicates that GCC's optimizers are unable to handle the code
4967 effectively.  Often, the problem is that your code is too big or too
4968 complex; GCC refuses to optimize programs when the optimization
4969 itself is likely to take inordinate amounts of time.
4971 @item -Wpointer-sign @r{(C and Objective-C only)}
4972 @opindex Wpointer-sign
4973 @opindex Wno-pointer-sign
4974 Warn for pointer argument passing or assignment with different signedness.
4975 This option is only supported for C and Objective-C@.  It is implied by
4976 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4977 @option{-Wno-pointer-sign}.
4979 @item -Wstack-protector
4980 @opindex Wstack-protector
4981 @opindex Wno-stack-protector
4982 This option is only active when @option{-fstack-protector} is active.  It
4983 warns about functions that are not protected against stack smashing.
4985 @item -Wno-mudflap
4986 @opindex Wno-mudflap
4987 Suppress warnings about constructs that cannot be instrumented by
4988 @option{-fmudflap}.
4990 @item -Woverlength-strings
4991 @opindex Woverlength-strings
4992 @opindex Wno-overlength-strings
4993 Warn about string constants that are longer than the ``minimum
4994 maximum'' length specified in the C standard.  Modern compilers
4995 generally allow string constants that are much longer than the
4996 standard's minimum limit, but very portable programs should avoid
4997 using longer strings.
4999 The limit applies @emph{after} string constant concatenation, and does
5000 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5001 C99, it was raised to 4095.  C++98 does not specify a normative
5002 minimum maximum, so we do not diagnose overlength strings in C++@.
5004 This option is implied by @option{-Wpedantic}, and can be disabled with
5005 @option{-Wno-overlength-strings}.
5007 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5008 @opindex Wunsuffixed-float-constants
5010 Issue a warning for any floating constant that does not have
5011 a suffix.  When used together with @option{-Wsystem-headers} it
5012 warns about such constants in system header files.  This can be useful
5013 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5014 from the decimal floating-point extension to C99.
5015 @end table
5017 @node Debugging Options
5018 @section Options for Debugging Your Program or GCC
5019 @cindex options, debugging
5020 @cindex debugging information options
5022 GCC has various special options that are used for debugging
5023 either your program or GCC:
5025 @table @gcctabopt
5026 @item -g
5027 @opindex g
5028 Produce debugging information in the operating system's native format
5029 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5030 information.
5032 On most systems that use stabs format, @option{-g} enables use of extra
5033 debugging information that only GDB can use; this extra information
5034 makes debugging work better in GDB but probably makes other debuggers
5035 crash or
5036 refuse to read the program.  If you want to control for certain whether
5037 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5038 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5040 GCC allows you to use @option{-g} with
5041 @option{-O}.  The shortcuts taken by optimized code may occasionally
5042 produce surprising results: some variables you declared may not exist
5043 at all; flow of control may briefly move where you did not expect it;
5044 some statements may not be executed because they compute constant
5045 results or their values are already at hand; some statements may
5046 execute in different places because they have been moved out of loops.
5048 Nevertheless it proves possible to debug optimized output.  This makes
5049 it reasonable to use the optimizer for programs that might have bugs.
5051 The following options are useful when GCC is generated with the
5052 capability for more than one debugging format.
5054 @item -gsplit-dwarf
5055 @opindex gsplit-dwarf
5056 Separate as much dwarf debugging information as possible into a
5057 separate output file with the extension .dwo.  This option allows
5058 the build system to avoid linking files with debug information.  To
5059 be useful, this option requires a debugger capable of reading .dwo
5060 files.
5062 @item -ggdb
5063 @opindex ggdb
5064 Produce debugging information for use by GDB@.  This means to use the
5065 most expressive format available (DWARF 2, stabs, or the native format
5066 if neither of those are supported), including GDB extensions if at all
5067 possible.
5069 @item -gpubnames
5070 @opindex gpubnames
5071 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5073 @item -gstabs
5074 @opindex gstabs
5075 Produce debugging information in stabs format (if that is supported),
5076 without GDB extensions.  This is the format used by DBX on most BSD
5077 systems.  On MIPS, Alpha and System V Release 4 systems this option
5078 produces stabs debugging output that is not understood by DBX or SDB@.
5079 On System V Release 4 systems this option requires the GNU assembler.
5081 @item -feliminate-unused-debug-symbols
5082 @opindex feliminate-unused-debug-symbols
5083 Produce debugging information in stabs format (if that is supported),
5084 for only symbols that are actually used.
5086 @item -femit-class-debug-always
5087 Instead of emitting debugging information for a C++ class in only one
5088 object file, emit it in all object files using the class.  This option
5089 should be used only with debuggers that are unable to handle the way GCC
5090 normally emits debugging information for classes because using this
5091 option increases the size of debugging information by as much as a
5092 factor of two.
5094 @item -fdebug-types-section
5095 @opindex fdebug-types-section
5096 @opindex fno-debug-types-section
5097 When using DWARF Version 4 or higher, type DIEs can be put into
5098 their own @code{.debug_types} section instead of making them part of the
5099 @code{.debug_info} section.  It is more efficient to put them in a separate
5100 comdat sections since the linker can then remove duplicates.
5101 But not all DWARF consumers support @code{.debug_types} sections yet
5102 and on some objects @code{.debug_types} produces larger instead of smaller
5103 debugging information.
5105 @item -gstabs+
5106 @opindex gstabs+
5107 Produce debugging information in stabs format (if that is supported),
5108 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5109 use of these extensions is likely to make other debuggers crash or
5110 refuse to read the program.
5112 @item -gcoff
5113 @opindex gcoff
5114 Produce debugging information in COFF format (if that is supported).
5115 This is the format used by SDB on most System V systems prior to
5116 System V Release 4.
5118 @item -gxcoff
5119 @opindex gxcoff
5120 Produce debugging information in XCOFF format (if that is supported).
5121 This is the format used by the DBX debugger on IBM RS/6000 systems.
5123 @item -gxcoff+
5124 @opindex gxcoff+
5125 Produce debugging information in XCOFF format (if that is supported),
5126 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5127 use of these extensions is likely to make other debuggers crash or
5128 refuse to read the program, and may cause assemblers other than the GNU
5129 assembler (GAS) to fail with an error.
5131 @item -gdwarf-@var{version}
5132 @opindex gdwarf-@var{version}
5133 Produce debugging information in DWARF format (if that is supported).
5134 The value of @var{version} may be either 2, 3 or 4; the default version
5135 for most targets is 4.
5137 Note that with DWARF Version 2, some ports require and always
5138 use some non-conflicting DWARF 3 extensions in the unwind tables.
5140 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5141 for maximum benefit.
5143 @item -grecord-gcc-switches
5144 @opindex grecord-gcc-switches
5145 This switch causes the command-line options used to invoke the
5146 compiler that may affect code generation to be appended to the
5147 DW_AT_producer attribute in DWARF debugging information.  The options
5148 are concatenated with spaces separating them from each other and from
5149 the compiler version.  See also @option{-frecord-gcc-switches} for another
5150 way of storing compiler options into the object file.  This is the default.
5152 @item -gno-record-gcc-switches
5153 @opindex gno-record-gcc-switches
5154 Disallow appending command-line options to the DW_AT_producer attribute
5155 in DWARF debugging information.
5157 @item -gstrict-dwarf
5158 @opindex gstrict-dwarf
5159 Disallow using extensions of later DWARF standard version than selected
5160 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5161 DWARF extensions from later standard versions is allowed.
5163 @item -gno-strict-dwarf
5164 @opindex gno-strict-dwarf
5165 Allow using extensions of later DWARF standard version than selected with
5166 @option{-gdwarf-@var{version}}.
5168 @item -gvms
5169 @opindex gvms
5170 Produce debugging information in Alpha/VMS debug format (if that is
5171 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5173 @item -g@var{level}
5174 @itemx -ggdb@var{level}
5175 @itemx -gstabs@var{level}
5176 @itemx -gcoff@var{level}
5177 @itemx -gxcoff@var{level}
5178 @itemx -gvms@var{level}
5179 Request debugging information and also use @var{level} to specify how
5180 much information.  The default level is 2.
5182 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5183 @option{-g}.
5185 Level 1 produces minimal information, enough for making backtraces in
5186 parts of the program that you don't plan to debug.  This includes
5187 descriptions of functions and external variables, but no information
5188 about local variables and no line numbers.
5190 Level 3 includes extra information, such as all the macro definitions
5191 present in the program.  Some debuggers support macro expansion when
5192 you use @option{-g3}.
5194 @option{-gdwarf-2} does not accept a concatenated debug level, because
5195 GCC used to support an option @option{-gdwarf} that meant to generate
5196 debug information in version 1 of the DWARF format (which is very
5197 different from version 2), and it would have been too confusing.  That
5198 debug format is long obsolete, but the option cannot be changed now.
5199 Instead use an additional @option{-g@var{level}} option to change the
5200 debug level for DWARF.
5202 @item -gtoggle
5203 @opindex gtoggle
5204 Turn off generation of debug info, if leaving out this option
5205 generates it, or turn it on at level 2 otherwise.  The position of this
5206 argument in the command line does not matter; it takes effect after all
5207 other options are processed, and it does so only once, no matter how
5208 many times it is given.  This is mainly intended to be used with
5209 @option{-fcompare-debug}.
5211 @item -fsanitize=address
5212 Enable AddressSanitizer, a fast memory error detector.
5213 Memory access instructions will be instrumented to detect
5214 out-of-bounds and use-after-free bugs.
5215 See @uref{http://code.google.com/p/address-sanitizer/} for more details.
5217 @item -fsanitize=thread
5218 Enable ThreadSanitizer, a fast data race detector.
5219 Memory access instructions will be instrumented to detect
5220 data race bugs.
5221 See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for more details.
5223 @item -fsanitize=undefined
5224 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector
5225 Various computations will be instrumented to detect undefined behavior
5226 at runtime, e.g.@: division by zero or various overflows.
5227 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5228 @option{-fsanitize=undefined} gives a diagnostic message.
5229 This currently works only for the C family of languages.
5231 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5232 @opindex fdump-final-insns
5233 Dump the final internal representation (RTL) to @var{file}.  If the
5234 optional argument is omitted (or if @var{file} is @code{.}), the name
5235 of the dump file is determined by appending @code{.gkd} to the
5236 compilation output file name.
5238 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5239 @opindex fcompare-debug
5240 @opindex fno-compare-debug
5241 If no error occurs during compilation, run the compiler a second time,
5242 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5243 passed to the second compilation.  Dump the final internal
5244 representation in both compilations, and print an error if they differ.
5246 If the equal sign is omitted, the default @option{-gtoggle} is used.
5248 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5249 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5250 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5251 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5252 is used.
5254 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5255 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5256 of the final representation and the second compilation, preventing even
5257 @env{GCC_COMPARE_DEBUG} from taking effect.
5259 To verify full coverage during @option{-fcompare-debug} testing, set
5260 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5261 which GCC rejects as an invalid option in any actual compilation
5262 (rather than preprocessing, assembly or linking).  To get just a
5263 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5264 not overridden} will do.
5266 @item -fcompare-debug-second
5267 @opindex fcompare-debug-second
5268 This option is implicitly passed to the compiler for the second
5269 compilation requested by @option{-fcompare-debug}, along with options to
5270 silence warnings, and omitting other options that would cause
5271 side-effect compiler outputs to files or to the standard output.  Dump
5272 files and preserved temporary files are renamed so as to contain the
5273 @code{.gk} additional extension during the second compilation, to avoid
5274 overwriting those generated by the first.
5276 When this option is passed to the compiler driver, it causes the
5277 @emph{first} compilation to be skipped, which makes it useful for little
5278 other than debugging the compiler proper.
5280 @item -feliminate-dwarf2-dups
5281 @opindex feliminate-dwarf2-dups
5282 Compress DWARF 2 debugging information by eliminating duplicated
5283 information about each symbol.  This option only makes sense when
5284 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5286 @item -femit-struct-debug-baseonly
5287 Emit debug information for struct-like types
5288 only when the base name of the compilation source file
5289 matches the base name of file in which the struct is defined.
5291 This option substantially reduces the size of debugging information,
5292 but at significant potential loss in type information to the debugger.
5293 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5294 See @option{-femit-struct-debug-detailed} for more detailed control.
5296 This option works only with DWARF 2.
5298 @item -femit-struct-debug-reduced
5299 Emit debug information for struct-like types
5300 only when the base name of the compilation source file
5301 matches the base name of file in which the type is defined,
5302 unless the struct is a template or defined in a system header.
5304 This option significantly reduces the size of debugging information,
5305 with some potential loss in type information to the debugger.
5306 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5307 See @option{-femit-struct-debug-detailed} for more detailed control.
5309 This option works only with DWARF 2.
5311 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5312 Specify the struct-like types
5313 for which the compiler generates debug information.
5314 The intent is to reduce duplicate struct debug information
5315 between different object files within the same program.
5317 This option is a detailed version of
5318 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5319 which serves for most needs.
5321 A specification has the syntax@*
5322 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5324 The optional first word limits the specification to
5325 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5326 A struct type is used directly when it is the type of a variable, member.
5327 Indirect uses arise through pointers to structs.
5328 That is, when use of an incomplete struct is valid, the use is indirect.
5329 An example is
5330 @samp{struct one direct; struct two * indirect;}.
5332 The optional second word limits the specification to
5333 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5334 Generic structs are a bit complicated to explain.
5335 For C++, these are non-explicit specializations of template classes,
5336 or non-template classes within the above.
5337 Other programming languages have generics,
5338 but @option{-femit-struct-debug-detailed} does not yet implement them.
5340 The third word specifies the source files for those
5341 structs for which the compiler should emit debug information.
5342 The values @samp{none} and @samp{any} have the normal meaning.
5343 The value @samp{base} means that
5344 the base of name of the file in which the type declaration appears
5345 must match the base of the name of the main compilation file.
5346 In practice, this means that when compiling @file{foo.c}, debug information
5347 is generated for types declared in that file and @file{foo.h},
5348 but not other header files.
5349 The value @samp{sys} means those types satisfying @samp{base}
5350 or declared in system or compiler headers.
5352 You may need to experiment to determine the best settings for your application.
5354 The default is @option{-femit-struct-debug-detailed=all}.
5356 This option works only with DWARF 2.
5358 @item -fno-merge-debug-strings
5359 @opindex fmerge-debug-strings
5360 @opindex fno-merge-debug-strings
5361 Direct the linker to not merge together strings in the debugging
5362 information that are identical in different object files.  Merging is
5363 not supported by all assemblers or linkers.  Merging decreases the size
5364 of the debug information in the output file at the cost of increasing
5365 link processing time.  Merging is enabled by default.
5367 @item -fdebug-prefix-map=@var{old}=@var{new}
5368 @opindex fdebug-prefix-map
5369 When compiling files in directory @file{@var{old}}, record debugging
5370 information describing them as in @file{@var{new}} instead.
5372 @item -fno-dwarf2-cfi-asm
5373 @opindex fdwarf2-cfi-asm
5374 @opindex fno-dwarf2-cfi-asm
5375 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5376 instead of using GAS @code{.cfi_*} directives.
5378 @cindex @command{prof}
5379 @item -p
5380 @opindex p
5381 Generate extra code to write profile information suitable for the
5382 analysis program @command{prof}.  You must use this option when compiling
5383 the source files you want data about, and you must also use it when
5384 linking.
5386 @cindex @command{gprof}
5387 @item -pg
5388 @opindex pg
5389 Generate extra code to write profile information suitable for the
5390 analysis program @command{gprof}.  You must use this option when compiling
5391 the source files you want data about, and you must also use it when
5392 linking.
5394 @item -Q
5395 @opindex Q
5396 Makes the compiler print out each function name as it is compiled, and
5397 print some statistics about each pass when it finishes.
5399 @item -ftime-report
5400 @opindex ftime-report
5401 Makes the compiler print some statistics about the time consumed by each
5402 pass when it finishes.
5404 @item -fmem-report
5405 @opindex fmem-report
5406 Makes the compiler print some statistics about permanent memory
5407 allocation when it finishes.
5409 @item -fmem-report-wpa
5410 @opindex fmem-report-wpa
5411 Makes the compiler print some statistics about permanent memory
5412 allocation for the WPA phase only.
5414 @item -fpre-ipa-mem-report
5415 @opindex fpre-ipa-mem-report
5416 @item -fpost-ipa-mem-report
5417 @opindex fpost-ipa-mem-report
5418 Makes the compiler print some statistics about permanent memory
5419 allocation before or after interprocedural optimization.
5421 @item -fprofile-report
5422 @opindex fprofile-report
5423 Makes the compiler print some statistics about consistency of the
5424 (estimated) profile and effect of individual passes.
5426 @item -fstack-usage
5427 @opindex fstack-usage
5428 Makes the compiler output stack usage information for the program, on a
5429 per-function basis.  The filename for the dump is made by appending
5430 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5431 the output file, if explicitly specified and it is not an executable,
5432 otherwise it is the basename of the source file.  An entry is made up
5433 of three fields:
5435 @itemize
5436 @item
5437 The name of the function.
5438 @item
5439 A number of bytes.
5440 @item
5441 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5442 @end itemize
5444 The qualifier @code{static} means that the function manipulates the stack
5445 statically: a fixed number of bytes are allocated for the frame on function
5446 entry and released on function exit; no stack adjustments are otherwise made
5447 in the function.  The second field is this fixed number of bytes.
5449 The qualifier @code{dynamic} means that the function manipulates the stack
5450 dynamically: in addition to the static allocation described above, stack
5451 adjustments are made in the body of the function, for example to push/pop
5452 arguments around function calls.  If the qualifier @code{bounded} is also
5453 present, the amount of these adjustments is bounded at compile time and
5454 the second field is an upper bound of the total amount of stack used by
5455 the function.  If it is not present, the amount of these adjustments is
5456 not bounded at compile time and the second field only represents the
5457 bounded part.
5459 @item -fprofile-arcs
5460 @opindex fprofile-arcs
5461 Add code so that program flow @dfn{arcs} are instrumented.  During
5462 execution the program records how many times each branch and call is
5463 executed and how many times it is taken or returns.  When the compiled
5464 program exits it saves this data to a file called
5465 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5466 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5467 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5468 @var{auxname} is generated from the name of the output file, if
5469 explicitly specified and it is not the final executable, otherwise it is
5470 the basename of the source file.  In both cases any suffix is removed
5471 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5472 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5473 @xref{Cross-profiling}.
5475 @cindex @command{gcov}
5476 @item --coverage
5477 @opindex coverage
5479 This option is used to compile and link code instrumented for coverage
5480 analysis.  The option is a synonym for @option{-fprofile-arcs}
5481 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5482 linking).  See the documentation for those options for more details.
5484 @itemize
5486 @item
5487 Compile the source files with @option{-fprofile-arcs} plus optimization
5488 and code generation options.  For test coverage analysis, use the
5489 additional @option{-ftest-coverage} option.  You do not need to profile
5490 every source file in a program.
5492 @item
5493 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5494 (the latter implies the former).
5496 @item
5497 Run the program on a representative workload to generate the arc profile
5498 information.  This may be repeated any number of times.  You can run
5499 concurrent instances of your program, and provided that the file system
5500 supports locking, the data files will be correctly updated.  Also
5501 @code{fork} calls are detected and correctly handled (double counting
5502 will not happen).
5504 @item
5505 For profile-directed optimizations, compile the source files again with
5506 the same optimization and code generation options plus
5507 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5508 Control Optimization}).
5510 @item
5511 For test coverage analysis, use @command{gcov} to produce human readable
5512 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5513 @command{gcov} documentation for further information.
5515 @end itemize
5517 With @option{-fprofile-arcs}, for each function of your program GCC
5518 creates a program flow graph, then finds a spanning tree for the graph.
5519 Only arcs that are not on the spanning tree have to be instrumented: the
5520 compiler adds code to count the number of times that these arcs are
5521 executed.  When an arc is the only exit or only entrance to a block, the
5522 instrumentation code can be added to the block; otherwise, a new basic
5523 block must be created to hold the instrumentation code.
5525 @need 2000
5526 @item -ftest-coverage
5527 @opindex ftest-coverage
5528 Produce a notes file that the @command{gcov} code-coverage utility
5529 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5530 show program coverage.  Each source file's note file is called
5531 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5532 above for a description of @var{auxname} and instructions on how to
5533 generate test coverage data.  Coverage data matches the source files
5534 more closely if you do not optimize.
5536 @item -fdbg-cnt-list
5537 @opindex fdbg-cnt-list
5538 Print the name and the counter upper bound for all debug counters.
5541 @item -fdbg-cnt=@var{counter-value-list}
5542 @opindex fdbg-cnt
5543 Set the internal debug counter upper bound.  @var{counter-value-list}
5544 is a comma-separated list of @var{name}:@var{value} pairs
5545 which sets the upper bound of each debug counter @var{name} to @var{value}.
5546 All debug counters have the initial upper bound of @code{UINT_MAX};
5547 thus @code{dbg_cnt()} returns true always unless the upper bound
5548 is set by this option.
5549 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5550 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5552 @item -fenable-@var{kind}-@var{pass}
5553 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5554 @opindex fdisable-
5555 @opindex fenable-
5557 This is a set of options that are used to explicitly disable/enable
5558 optimization passes.  These options are intended for use for debugging GCC.
5559 Compiler users should use regular options for enabling/disabling
5560 passes instead.
5562 @table @gcctabopt
5564 @item -fdisable-ipa-@var{pass}
5565 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5566 statically invoked in the compiler multiple times, the pass name should be
5567 appended with a sequential number starting from 1.
5569 @item -fdisable-rtl-@var{pass}
5570 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5571 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5572 statically invoked in the compiler multiple times, the pass name should be
5573 appended with a sequential number starting from 1.  @var{range-list} is a 
5574 comma-separated list of function ranges or assembler names.  Each range is a number
5575 pair separated by a colon.  The range is inclusive in both ends.  If the range
5576 is trivial, the number pair can be simplified as a single number.  If the
5577 function's call graph node's @var{uid} falls within one of the specified ranges,
5578 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5579 function header of a dump file, and the pass names can be dumped by using
5580 option @option{-fdump-passes}.
5582 @item -fdisable-tree-@var{pass}
5583 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5584 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5585 option arguments.
5587 @item -fenable-ipa-@var{pass}
5588 Enable IPA 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.
5592 @item -fenable-rtl-@var{pass}
5593 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5594 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5595 description and examples.
5597 @item -fenable-tree-@var{pass}
5598 @itemx -fenable-tree-@var{pass}=@var{range-list}
5599 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5600 of option arguments.
5602 @end table
5604 Here are some examples showing uses of these options.
5606 @smallexample
5608 # disable ccp1 for all functions
5609    -fdisable-tree-ccp1
5610 # disable complete unroll for function whose cgraph node uid is 1
5611    -fenable-tree-cunroll=1
5612 # disable gcse2 for functions at the following ranges [1,1],
5613 # [300,400], and [400,1000]
5614 # disable gcse2 for functions foo and foo2
5615    -fdisable-rtl-gcse2=foo,foo2
5616 # disable early inlining
5617    -fdisable-tree-einline
5618 # disable ipa inlining
5619    -fdisable-ipa-inline
5620 # enable tree full unroll
5621    -fenable-tree-unroll
5623 @end smallexample
5625 @item -d@var{letters}
5626 @itemx -fdump-rtl-@var{pass}
5627 @itemx -fdump-rtl-@var{pass}=@var{filename}
5628 @opindex d
5629 Says to make debugging dumps during compilation at times specified by
5630 @var{letters}.  This is used for debugging the RTL-based passes of the
5631 compiler.  The file names for most of the dumps are made by appending
5632 a pass number and a word to the @var{dumpname}, and the files are
5633 created in the directory of the output file. In case of
5634 @option{=@var{filename}} option, the dump is output on the given file
5635 instead of the pass numbered dump files. Note that the pass number is
5636 computed statically as passes get registered into the pass manager.
5637 Thus the numbering is not related to the dynamic order of execution of
5638 passes.  In particular, a pass installed by a plugin could have a
5639 number over 200 even if it executed quite early.  @var{dumpname} is
5640 generated from the name of the output file, if explicitly specified
5641 and it is not an executable, otherwise it is the basename of the
5642 source file. These switches may have different effects when
5643 @option{-E} is used for preprocessing.
5645 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5646 @option{-d} option @var{letters}.  Here are the possible
5647 letters for use in @var{pass} and @var{letters}, and their meanings:
5649 @table @gcctabopt
5651 @item -fdump-rtl-alignments
5652 @opindex fdump-rtl-alignments
5653 Dump after branch alignments have been computed.
5655 @item -fdump-rtl-asmcons
5656 @opindex fdump-rtl-asmcons
5657 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5659 @item -fdump-rtl-auto_inc_dec
5660 @opindex fdump-rtl-auto_inc_dec
5661 Dump after auto-inc-dec discovery.  This pass is only run on
5662 architectures that have auto inc or auto dec instructions.
5664 @item -fdump-rtl-barriers
5665 @opindex fdump-rtl-barriers
5666 Dump after cleaning up the barrier instructions.
5668 @item -fdump-rtl-bbpart
5669 @opindex fdump-rtl-bbpart
5670 Dump after partitioning hot and cold basic blocks.
5672 @item -fdump-rtl-bbro
5673 @opindex fdump-rtl-bbro
5674 Dump after block reordering.
5676 @item -fdump-rtl-btl1
5677 @itemx -fdump-rtl-btl2
5678 @opindex fdump-rtl-btl2
5679 @opindex fdump-rtl-btl2
5680 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5681 after the two branch
5682 target load optimization passes.
5684 @item -fdump-rtl-bypass
5685 @opindex fdump-rtl-bypass
5686 Dump after jump bypassing and control flow optimizations.
5688 @item -fdump-rtl-combine
5689 @opindex fdump-rtl-combine
5690 Dump after the RTL instruction combination pass.
5692 @item -fdump-rtl-compgotos
5693 @opindex fdump-rtl-compgotos
5694 Dump after duplicating the computed gotos.
5696 @item -fdump-rtl-ce1
5697 @itemx -fdump-rtl-ce2
5698 @itemx -fdump-rtl-ce3
5699 @opindex fdump-rtl-ce1
5700 @opindex fdump-rtl-ce2
5701 @opindex fdump-rtl-ce3
5702 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5703 @option{-fdump-rtl-ce3} enable dumping after the three
5704 if conversion passes.
5706 @item -fdump-rtl-cprop_hardreg
5707 @opindex fdump-rtl-cprop_hardreg
5708 Dump after hard register copy propagation.
5710 @item -fdump-rtl-csa
5711 @opindex fdump-rtl-csa
5712 Dump after combining stack adjustments.
5714 @item -fdump-rtl-cse1
5715 @itemx -fdump-rtl-cse2
5716 @opindex fdump-rtl-cse1
5717 @opindex fdump-rtl-cse2
5718 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5719 the two common subexpression elimination passes.
5721 @item -fdump-rtl-dce
5722 @opindex fdump-rtl-dce
5723 Dump after the standalone dead code elimination passes.
5725 @item -fdump-rtl-dbr
5726 @opindex fdump-rtl-dbr
5727 Dump after delayed branch scheduling.
5729 @item -fdump-rtl-dce1
5730 @itemx -fdump-rtl-dce2
5731 @opindex fdump-rtl-dce1
5732 @opindex fdump-rtl-dce2
5733 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5734 the two dead store elimination passes.
5736 @item -fdump-rtl-eh
5737 @opindex fdump-rtl-eh
5738 Dump after finalization of EH handling code.
5740 @item -fdump-rtl-eh_ranges
5741 @opindex fdump-rtl-eh_ranges
5742 Dump after conversion of EH handling range regions.
5744 @item -fdump-rtl-expand
5745 @opindex fdump-rtl-expand
5746 Dump after RTL generation.
5748 @item -fdump-rtl-fwprop1
5749 @itemx -fdump-rtl-fwprop2
5750 @opindex fdump-rtl-fwprop1
5751 @opindex fdump-rtl-fwprop2
5752 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5753 dumping after the two forward propagation passes.
5755 @item -fdump-rtl-gcse1
5756 @itemx -fdump-rtl-gcse2
5757 @opindex fdump-rtl-gcse1
5758 @opindex fdump-rtl-gcse2
5759 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5760 after global common subexpression elimination.
5762 @item -fdump-rtl-init-regs
5763 @opindex fdump-rtl-init-regs
5764 Dump after the initialization of the registers.
5766 @item -fdump-rtl-initvals
5767 @opindex fdump-rtl-initvals
5768 Dump after the computation of the initial value sets.
5770 @item -fdump-rtl-into_cfglayout
5771 @opindex fdump-rtl-into_cfglayout
5772 Dump after converting to cfglayout mode.
5774 @item -fdump-rtl-ira
5775 @opindex fdump-rtl-ira
5776 Dump after iterated register allocation.
5778 @item -fdump-rtl-jump
5779 @opindex fdump-rtl-jump
5780 Dump after the second jump optimization.
5782 @item -fdump-rtl-loop2
5783 @opindex fdump-rtl-loop2
5784 @option{-fdump-rtl-loop2} enables dumping after the rtl
5785 loop optimization passes.
5787 @item -fdump-rtl-mach
5788 @opindex fdump-rtl-mach
5789 Dump after performing the machine dependent reorganization pass, if that
5790 pass exists.
5792 @item -fdump-rtl-mode_sw
5793 @opindex fdump-rtl-mode_sw
5794 Dump after removing redundant mode switches.
5796 @item -fdump-rtl-rnreg
5797 @opindex fdump-rtl-rnreg
5798 Dump after register renumbering.
5800 @item -fdump-rtl-outof_cfglayout
5801 @opindex fdump-rtl-outof_cfglayout
5802 Dump after converting from cfglayout mode.
5804 @item -fdump-rtl-peephole2
5805 @opindex fdump-rtl-peephole2
5806 Dump after the peephole pass.
5808 @item -fdump-rtl-postreload
5809 @opindex fdump-rtl-postreload
5810 Dump after post-reload optimizations.
5812 @item -fdump-rtl-pro_and_epilogue
5813 @opindex fdump-rtl-pro_and_epilogue
5814 Dump after generating the function prologues and epilogues.
5816 @item -fdump-rtl-regmove
5817 @opindex fdump-rtl-regmove
5818 Dump after the register move pass.
5820 @item -fdump-rtl-sched1
5821 @itemx -fdump-rtl-sched2
5822 @opindex fdump-rtl-sched1
5823 @opindex fdump-rtl-sched2
5824 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5825 after the basic block scheduling passes.
5827 @item -fdump-rtl-see
5828 @opindex fdump-rtl-see
5829 Dump after sign extension elimination.
5831 @item -fdump-rtl-seqabstr
5832 @opindex fdump-rtl-seqabstr
5833 Dump after common sequence discovery.
5835 @item -fdump-rtl-shorten
5836 @opindex fdump-rtl-shorten
5837 Dump after shortening branches.
5839 @item -fdump-rtl-sibling
5840 @opindex fdump-rtl-sibling
5841 Dump after sibling call optimizations.
5843 @item -fdump-rtl-split1
5844 @itemx -fdump-rtl-split2
5845 @itemx -fdump-rtl-split3
5846 @itemx -fdump-rtl-split4
5847 @itemx -fdump-rtl-split5
5848 @opindex fdump-rtl-split1
5849 @opindex fdump-rtl-split2
5850 @opindex fdump-rtl-split3
5851 @opindex fdump-rtl-split4
5852 @opindex fdump-rtl-split5
5853 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5854 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5855 @option{-fdump-rtl-split5} enable dumping after five rounds of
5856 instruction splitting.
5858 @item -fdump-rtl-sms
5859 @opindex fdump-rtl-sms
5860 Dump after modulo scheduling.  This pass is only run on some
5861 architectures.
5863 @item -fdump-rtl-stack
5864 @opindex fdump-rtl-stack
5865 Dump after conversion from GCC's ``flat register file'' registers to the
5866 x87's stack-like registers.  This pass is only run on x86 variants.
5868 @item -fdump-rtl-subreg1
5869 @itemx -fdump-rtl-subreg2
5870 @opindex fdump-rtl-subreg1
5871 @opindex fdump-rtl-subreg2
5872 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5873 the two subreg expansion passes.
5875 @item -fdump-rtl-unshare
5876 @opindex fdump-rtl-unshare
5877 Dump after all rtl has been unshared.
5879 @item -fdump-rtl-vartrack
5880 @opindex fdump-rtl-vartrack
5881 Dump after variable tracking.
5883 @item -fdump-rtl-vregs
5884 @opindex fdump-rtl-vregs
5885 Dump after converting virtual registers to hard registers.
5887 @item -fdump-rtl-web
5888 @opindex fdump-rtl-web
5889 Dump after live range splitting.
5891 @item -fdump-rtl-regclass
5892 @itemx -fdump-rtl-subregs_of_mode_init
5893 @itemx -fdump-rtl-subregs_of_mode_finish
5894 @itemx -fdump-rtl-dfinit
5895 @itemx -fdump-rtl-dfinish
5896 @opindex fdump-rtl-regclass
5897 @opindex fdump-rtl-subregs_of_mode_init
5898 @opindex fdump-rtl-subregs_of_mode_finish
5899 @opindex fdump-rtl-dfinit
5900 @opindex fdump-rtl-dfinish
5901 These dumps are defined but always produce empty files.
5903 @item -da
5904 @itemx -fdump-rtl-all
5905 @opindex da
5906 @opindex fdump-rtl-all
5907 Produce all the dumps listed above.
5909 @item -dA
5910 @opindex dA
5911 Annotate the assembler output with miscellaneous debugging information.
5913 @item -dD
5914 @opindex dD
5915 Dump all macro definitions, at the end of preprocessing, in addition to
5916 normal output.
5918 @item -dH
5919 @opindex dH
5920 Produce a core dump whenever an error occurs.
5922 @item -dp
5923 @opindex dp
5924 Annotate the assembler output with a comment indicating which
5925 pattern and alternative is used.  The length of each instruction is
5926 also printed.
5928 @item -dP
5929 @opindex dP
5930 Dump the RTL in the assembler output as a comment before each instruction.
5931 Also turns on @option{-dp} annotation.
5933 @item -dx
5934 @opindex dx
5935 Just generate RTL for a function instead of compiling it.  Usually used
5936 with @option{-fdump-rtl-expand}.
5937 @end table
5939 @item -fdump-noaddr
5940 @opindex fdump-noaddr
5941 When doing debugging dumps, suppress address output.  This makes it more
5942 feasible to use diff on debugging dumps for compiler invocations with
5943 different compiler binaries and/or different
5944 text / bss / data / heap / stack / dso start locations.
5946 @item -fdump-unnumbered
5947 @opindex fdump-unnumbered
5948 When doing debugging dumps, suppress instruction numbers and address output.
5949 This makes it more feasible to use diff on debugging dumps for compiler
5950 invocations with different options, in particular with and without
5951 @option{-g}.
5953 @item -fdump-unnumbered-links
5954 @opindex fdump-unnumbered-links
5955 When doing debugging dumps (see @option{-d} option above), suppress
5956 instruction numbers for the links to the previous and next instructions
5957 in a sequence.
5959 @item -fdump-translation-unit @r{(C++ only)}
5960 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5961 @opindex fdump-translation-unit
5962 Dump a representation of the tree structure for the entire translation
5963 unit to a file.  The file name is made by appending @file{.tu} to the
5964 source file name, and the file is created in the same directory as the
5965 output file.  If the @samp{-@var{options}} form is used, @var{options}
5966 controls the details of the dump as described for the
5967 @option{-fdump-tree} options.
5969 @item -fdump-class-hierarchy @r{(C++ only)}
5970 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5971 @opindex fdump-class-hierarchy
5972 Dump a representation of each class's hierarchy and virtual function
5973 table layout to a file.  The file name is made by appending
5974 @file{.class} to the source file name, and the file is created in the
5975 same directory as the output file.  If the @samp{-@var{options}} form
5976 is used, @var{options} controls the details of the dump as described
5977 for the @option{-fdump-tree} options.
5979 @item -fdump-ipa-@var{switch}
5980 @opindex fdump-ipa
5981 Control the dumping at various stages of inter-procedural analysis
5982 language tree to a file.  The file name is generated by appending a
5983 switch specific suffix to the source file name, and the file is created
5984 in the same directory as the output file.  The following dumps are
5985 possible:
5987 @table @samp
5988 @item all
5989 Enables all inter-procedural analysis dumps.
5991 @item cgraph
5992 Dumps information about call-graph optimization, unused function removal,
5993 and inlining decisions.
5995 @item inline
5996 Dump after function inlining.
5998 @end table
6000 @item -fdump-passes
6001 @opindex fdump-passes
6002 Dump the list of optimization passes that are turned on and off by
6003 the current command-line options.
6005 @item -fdump-statistics-@var{option}
6006 @opindex fdump-statistics
6007 Enable and control dumping of pass statistics in a separate file.  The
6008 file name is generated by appending a suffix ending in
6009 @samp{.statistics} to the source file name, and the file is created in
6010 the same directory as the output file.  If the @samp{-@var{option}}
6011 form is used, @samp{-stats} causes counters to be summed over the
6012 whole compilation unit while @samp{-details} dumps every event as
6013 the passes generate them.  The default with no option is to sum
6014 counters for each function compiled.
6016 @item -fdump-tree-@var{switch}
6017 @itemx -fdump-tree-@var{switch}-@var{options}
6018 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6019 @opindex fdump-tree
6020 Control the dumping at various stages of processing the intermediate
6021 language tree to a file.  The file name is generated by appending a
6022 switch-specific suffix to the source file name, and the file is
6023 created in the same directory as the output file. In case of
6024 @option{=@var{filename}} option, the dump is output on the given file
6025 instead of the auto named dump files.  If the @samp{-@var{options}}
6026 form is used, @var{options} is a list of @samp{-} separated options
6027 which control the details of the dump.  Not all options are applicable
6028 to all dumps; those that are not meaningful are ignored.  The
6029 following options are available
6031 @table @samp
6032 @item address
6033 Print the address of each node.  Usually this is not meaningful as it
6034 changes according to the environment and source file.  Its primary use
6035 is for tying up a dump file with a debug environment.
6036 @item asmname
6037 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6038 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6039 use working backward from mangled names in the assembly file.
6040 @item slim
6041 When dumping front-end intermediate representations, inhibit dumping
6042 of members of a scope or body of a function merely because that scope
6043 has been reached.  Only dump such items when they are directly reachable
6044 by some other path.
6046 When dumping pretty-printed trees, this option inhibits dumping the
6047 bodies of control structures.
6049 When dumping RTL, print the RTL in slim (condensed) form instead of
6050 the default LISP-like representation.
6051 @item raw
6052 Print a raw representation of the tree.  By default, trees are
6053 pretty-printed into a C-like representation.
6054 @item details
6055 Enable more detailed dumps (not honored by every dump option). Also
6056 include information from the optimization passes.
6057 @item stats
6058 Enable dumping various statistics about the pass (not honored by every dump
6059 option).
6060 @item blocks
6061 Enable showing basic block boundaries (disabled in raw dumps).
6062 @item graph
6063 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6064 dump a representation of the control flow graph suitable for viewing with
6065 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6066 the file is pretty-printed as a subgraph, so that GraphViz can render them
6067 all in a single plot.
6069 This option currently only works for RTL dumps, and the RTL is always
6070 dumped in slim form.
6071 @item vops
6072 Enable showing virtual operands for every statement.
6073 @item lineno
6074 Enable showing line numbers for statements.
6075 @item uid
6076 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6077 @item verbose
6078 Enable showing the tree dump for each statement.
6079 @item eh
6080 Enable showing the EH region number holding each statement.
6081 @item scev
6082 Enable showing scalar evolution analysis details.
6083 @item optimized
6084 Enable showing optimization information (only available in certain
6085 passes).
6086 @item missed
6087 Enable showing missed optimization information (only available in certain
6088 passes).
6089 @item notes
6090 Enable other detailed optimization information (only available in
6091 certain passes).
6092 @item =@var{filename}
6093 Instead of an auto named dump file, output into the given file
6094 name. The file names @file{stdout} and @file{stderr} are treated
6095 specially and are considered already open standard streams. For
6096 example,
6098 @smallexample
6099 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6100      -fdump-tree-pre=stderr file.c
6101 @end smallexample
6103 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6104 output on to @file{stderr}. If two conflicting dump filenames are
6105 given for the same pass, then the latter option overrides the earlier
6106 one.
6108 @item all
6109 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6110 and @option{lineno}.
6112 @item optall
6113 Turn on all optimization options, i.e., @option{optimized},
6114 @option{missed}, and @option{note}.
6115 @end table
6117 The following tree dumps are possible:
6118 @table @samp
6120 @item original
6121 @opindex fdump-tree-original
6122 Dump before any tree based optimization, to @file{@var{file}.original}.
6124 @item optimized
6125 @opindex fdump-tree-optimized
6126 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6128 @item gimple
6129 @opindex fdump-tree-gimple
6130 Dump each function before and after the gimplification pass to a file.  The
6131 file name is made by appending @file{.gimple} to the source file name.
6133 @item cfg
6134 @opindex fdump-tree-cfg
6135 Dump the control flow graph of each function to a file.  The file name is
6136 made by appending @file{.cfg} to the source file name.
6138 @item ch
6139 @opindex fdump-tree-ch
6140 Dump each function after copying loop headers.  The file name is made by
6141 appending @file{.ch} to the source file name.
6143 @item ssa
6144 @opindex fdump-tree-ssa
6145 Dump SSA related information to a file.  The file name is made by appending
6146 @file{.ssa} to the source file name.
6148 @item alias
6149 @opindex fdump-tree-alias
6150 Dump aliasing information for each function.  The file name is made by
6151 appending @file{.alias} to the source file name.
6153 @item ccp
6154 @opindex fdump-tree-ccp
6155 Dump each function after CCP@.  The file name is made by appending
6156 @file{.ccp} to the source file name.
6158 @item storeccp
6159 @opindex fdump-tree-storeccp
6160 Dump each function after STORE-CCP@.  The file name is made by appending
6161 @file{.storeccp} to the source file name.
6163 @item pre
6164 @opindex fdump-tree-pre
6165 Dump trees after partial redundancy elimination.  The file name is made
6166 by appending @file{.pre} to the source file name.
6168 @item fre
6169 @opindex fdump-tree-fre
6170 Dump trees after full redundancy elimination.  The file name is made
6171 by appending @file{.fre} to the source file name.
6173 @item copyprop
6174 @opindex fdump-tree-copyprop
6175 Dump trees after copy propagation.  The file name is made
6176 by appending @file{.copyprop} to the source file name.
6178 @item store_copyprop
6179 @opindex fdump-tree-store_copyprop
6180 Dump trees after store copy-propagation.  The file name is made
6181 by appending @file{.store_copyprop} to the source file name.
6183 @item dce
6184 @opindex fdump-tree-dce
6185 Dump each function after dead code elimination.  The file name is made by
6186 appending @file{.dce} to the source file name.
6188 @item mudflap
6189 @opindex fdump-tree-mudflap
6190 Dump each function after adding mudflap instrumentation.  The file name is
6191 made by appending @file{.mudflap} to the source file name.
6193 @item sra
6194 @opindex fdump-tree-sra
6195 Dump each function after performing scalar replacement of aggregates.  The
6196 file name is made by appending @file{.sra} to the source file name.
6198 @item sink
6199 @opindex fdump-tree-sink
6200 Dump each function after performing code sinking.  The file name is made
6201 by appending @file{.sink} to the source file name.
6203 @item dom
6204 @opindex fdump-tree-dom
6205 Dump each function after applying dominator tree optimizations.  The file
6206 name is made by appending @file{.dom} to the source file name.
6208 @item dse
6209 @opindex fdump-tree-dse
6210 Dump each function after applying dead store elimination.  The file
6211 name is made by appending @file{.dse} to the source file name.
6213 @item phiopt
6214 @opindex fdump-tree-phiopt
6215 Dump each function after optimizing PHI nodes into straightline code.  The file
6216 name is made by appending @file{.phiopt} to the source file name.
6218 @item forwprop
6219 @opindex fdump-tree-forwprop
6220 Dump each function after forward propagating single use variables.  The file
6221 name is made by appending @file{.forwprop} to the source file name.
6223 @item copyrename
6224 @opindex fdump-tree-copyrename
6225 Dump each function after applying the copy rename optimization.  The file
6226 name is made by appending @file{.copyrename} to the source file name.
6228 @item nrv
6229 @opindex fdump-tree-nrv
6230 Dump each function after applying the named return value optimization on
6231 generic trees.  The file name is made by appending @file{.nrv} to the source
6232 file name.
6234 @item vect
6235 @opindex fdump-tree-vect
6236 Dump each function after applying vectorization of loops.  The file name is
6237 made by appending @file{.vect} to the source file name.
6239 @item slp
6240 @opindex fdump-tree-slp
6241 Dump each function after applying vectorization of basic blocks.  The file name
6242 is made by appending @file{.slp} to the source file name.
6244 @item vrp
6245 @opindex fdump-tree-vrp
6246 Dump each function after Value Range Propagation (VRP).  The file name
6247 is made by appending @file{.vrp} to the source file name.
6249 @item all
6250 @opindex fdump-tree-all
6251 Enable all the available tree dumps with the flags provided in this option.
6252 @end table
6254 @item -fopt-info
6255 @itemx -fopt-info-@var{options}
6256 @itemx -fopt-info-@var{options}=@var{filename}
6257 @opindex fopt-info
6258 Controls optimization dumps from various optimization passes. If the
6259 @samp{-@var{options}} form is used, @var{options} is a list of
6260 @samp{-} separated options to select the dump details and
6261 optimizations.  If @var{options} is not specified, it defaults to
6262 @option{optimized} for details and @option{optall} for optimization
6263 groups. If the @var{filename} is not specified, it defaults to
6264 @file{stderr}. Note that the output @var{filename} will be overwritten
6265 in case of multiple translation units. If a combined output from
6266 multiple translation units is desired, @file{stderr} should be used
6267 instead.
6269 The options can be divided into two groups, 1) options describing the
6270 verbosity of the dump, and 2) options describing which optimizations
6271 should be included. The options from both the groups can be freely
6272 mixed as they are non-overlapping. However, in case of any conflicts,
6273 the latter options override the earlier options on the command
6274 line. Though multiple -fopt-info options are accepted, only one of
6275 them can have @option{=filename}. If other filenames are provided then
6276 all but the first one are ignored.
6278 The dump verbosity has the following options
6280 @table @samp
6281 @item optimized
6282 Print information when an optimization is successfully applied. It is
6283 up to a pass to decide which information is relevant. For example, the
6284 vectorizer passes print the source location of loops which got
6285 successfully vectorized.
6286 @item missed
6287 Print information about missed optimizations. Individual passes
6288 control which information to include in the output. For example,
6290 @smallexample
6291 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6292 @end smallexample
6294 will print information about missed optimization opportunities from
6295 vectorization passes on stderr.
6296 @item note
6297 Print verbose information about optimizations, such as certain
6298 transformations, more detailed messages about decisions etc.
6299 @item all
6300 Print detailed optimization information. This includes
6301 @var{optimized}, @var{missed}, and @var{note}.
6302 @end table
6304 The second set of options describes a group of optimizations and may
6305 include one or more of the following.
6307 @table @samp
6308 @item ipa
6309 Enable dumps from all interprocedural optimizations.
6310 @item loop
6311 Enable dumps from all loop optimizations.
6312 @item inline
6313 Enable dumps from all inlining optimizations.
6314 @item vec
6315 Enable dumps from all vectorization optimizations.
6316 @item optall
6317 Enable dumps from all optimizations. This is a superset of
6318 the optimization groups listed above.
6319 @end table
6321 For example,
6322 @smallexample
6323 gcc -O3 -fopt-info-missed=missed.all
6324 @end smallexample
6326 outputs missed optimization report from all the passes into
6327 @file{missed.all}.
6329 As another example,
6330 @smallexample
6331 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6332 @end smallexample
6334 will output information about missed optimizations as well as
6335 optimized locations from all the inlining passes into
6336 @file{inline.txt}.
6338 If the @var{filename} is provided, then the dumps from all the
6339 applicable optimizations are concatenated into the @file{filename}.
6340 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6341 omitted, it defaults to @option{all-optall}, which means dump all
6342 available optimization info from all the passes. In the following
6343 example, all optimization info is output on to @file{stderr}.
6345 @smallexample
6346 gcc -O3 -fopt-info
6347 @end smallexample
6349 Note that @option{-fopt-info-vec-missed} behaves the same as
6350 @option{-fopt-info-missed-vec}.
6352 As another example, consider
6354 @smallexample
6355 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6356 @end smallexample
6358 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6359 in conflict since only one output file is allowed. In this case, only
6360 the first option takes effect and the subsequent options are
6361 ignored. Thus only the @file{vec.miss} is produced which cotaints
6362 dumps from the vectorizer about missed opportunities.
6364 @item -ftree-vectorizer-verbose=@var{n}
6365 @opindex ftree-vectorizer-verbose
6366 This option is deprecated and is implemented in terms of
6367 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6368 instead, where @var{kind} is one of the valid opt-info options. It
6369 prints additional optimization information.  For @var{n}=0 no
6370 diagnostic information is reported.  If @var{n}=1 the vectorizer
6371 reports each loop that got vectorized, and the total number of loops
6372 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6373 which could not be vectorized and the reasons for those. For any
6374 higher verbosity levels all the analysis and transformation
6375 information from the vectorizer is reported.
6377 Note that the information output by @option{-ftree-vectorizer-verbose}
6378 option is sent to @file{stderr}. If the equivalent form
6379 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6380 output is sent into @var{filename} instead.
6382 @item -frandom-seed=@var{string}
6383 @opindex frandom-seed
6384 This option provides a seed that GCC uses in place of
6385 random numbers in generating certain symbol names
6386 that have to be different in every compiled file.  It is also used to
6387 place unique stamps in coverage data files and the object files that
6388 produce them.  You can use the @option{-frandom-seed} option to produce
6389 reproducibly identical object files.
6391 The @var{string} should be different for every file you compile.
6393 @item -fsched-verbose=@var{n}
6394 @opindex fsched-verbose
6395 On targets that use instruction scheduling, this option controls the
6396 amount of debugging output the scheduler prints.  This information is
6397 written to standard error, unless @option{-fdump-rtl-sched1} or
6398 @option{-fdump-rtl-sched2} is specified, in which case it is output
6399 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6400 respectively.  However for @var{n} greater than nine, the output is
6401 always printed to standard error.
6403 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6404 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6405 For @var{n} greater than one, it also output basic block probabilities,
6406 detailed ready list information and unit/insn info.  For @var{n} greater
6407 than two, it includes RTL at abort point, control-flow and regions info.
6408 And for @var{n} over four, @option{-fsched-verbose} also includes
6409 dependence info.
6411 @item -save-temps
6412 @itemx -save-temps=cwd
6413 @opindex save-temps
6414 Store the usual ``temporary'' intermediate files permanently; place them
6415 in the current directory and name them based on the source file.  Thus,
6416 compiling @file{foo.c} with @option{-c -save-temps} produces files
6417 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6418 preprocessed @file{foo.i} output file even though the compiler now
6419 normally uses an integrated preprocessor.
6421 When used in combination with the @option{-x} command-line option,
6422 @option{-save-temps} is sensible enough to avoid over writing an
6423 input source file with the same extension as an intermediate file.
6424 The corresponding intermediate file may be obtained by renaming the
6425 source file before using @option{-save-temps}.
6427 If you invoke GCC in parallel, compiling several different source
6428 files that share a common base name in different subdirectories or the
6429 same source file compiled for multiple output destinations, it is
6430 likely that the different parallel compilers will interfere with each
6431 other, and overwrite the temporary files.  For instance:
6433 @smallexample
6434 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6435 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6436 @end smallexample
6438 may result in @file{foo.i} and @file{foo.o} being written to
6439 simultaneously by both compilers.
6441 @item -save-temps=obj
6442 @opindex save-temps=obj
6443 Store the usual ``temporary'' intermediate files permanently.  If the
6444 @option{-o} option is used, the temporary files are based on the
6445 object file.  If the @option{-o} option is not used, the
6446 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6448 For example:
6450 @smallexample
6451 gcc -save-temps=obj -c foo.c
6452 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6453 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6454 @end smallexample
6456 @noindent
6457 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6458 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6459 @file{dir2/yfoobar.o}.
6461 @item -time@r{[}=@var{file}@r{]}
6462 @opindex time
6463 Report the CPU time taken by each subprocess in the compilation
6464 sequence.  For C source files, this is the compiler proper and assembler
6465 (plus the linker if linking is done).
6467 Without the specification of an output file, the output looks like this:
6469 @smallexample
6470 # cc1 0.12 0.01
6471 # as 0.00 0.01
6472 @end smallexample
6474 The first number on each line is the ``user time'', that is time spent
6475 executing the program itself.  The second number is ``system time'',
6476 time spent executing operating system routines on behalf of the program.
6477 Both numbers are in seconds.
6479 With the specification of an output file, the output is appended to the
6480 named file, and it looks like this:
6482 @smallexample
6483 0.12 0.01 cc1 @var{options}
6484 0.00 0.01 as @var{options}
6485 @end smallexample
6487 The ``user time'' and the ``system time'' are moved before the program
6488 name, and the options passed to the program are displayed, so that one
6489 can later tell what file was being compiled, and with which options.
6491 @item -fvar-tracking
6492 @opindex fvar-tracking
6493 Run variable tracking pass.  It computes where variables are stored at each
6494 position in code.  Better debugging information is then generated
6495 (if the debugging information format supports this information).
6497 It is enabled by default when compiling with optimization (@option{-Os},
6498 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6499 the debug info format supports it.
6501 @item -fvar-tracking-assignments
6502 @opindex fvar-tracking-assignments
6503 @opindex fno-var-tracking-assignments
6504 Annotate assignments to user variables early in the compilation and
6505 attempt to carry the annotations over throughout the compilation all the
6506 way to the end, in an attempt to improve debug information while
6507 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6509 It can be enabled even if var-tracking is disabled, in which case
6510 annotations are created and maintained, but discarded at the end.
6512 @item -fvar-tracking-assignments-toggle
6513 @opindex fvar-tracking-assignments-toggle
6514 @opindex fno-var-tracking-assignments-toggle
6515 Toggle @option{-fvar-tracking-assignments}, in the same way that
6516 @option{-gtoggle} toggles @option{-g}.
6518 @item -print-file-name=@var{library}
6519 @opindex print-file-name
6520 Print the full absolute name of the library file @var{library} that
6521 would be used when linking---and don't do anything else.  With this
6522 option, GCC does not compile or link anything; it just prints the
6523 file name.
6525 @item -print-multi-directory
6526 @opindex print-multi-directory
6527 Print the directory name corresponding to the multilib selected by any
6528 other switches present in the command line.  This directory is supposed
6529 to exist in @env{GCC_EXEC_PREFIX}.
6531 @item -print-multi-lib
6532 @opindex print-multi-lib
6533 Print the mapping from multilib directory names to compiler switches
6534 that enable them.  The directory name is separated from the switches by
6535 @samp{;}, and each switch starts with an @samp{@@} instead of the
6536 @samp{-}, without spaces between multiple switches.  This is supposed to
6537 ease shell processing.
6539 @item -print-multi-os-directory
6540 @opindex print-multi-os-directory
6541 Print the path to OS libraries for the selected
6542 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6543 present in the @file{lib} subdirectory and no multilibs are used, this is
6544 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6545 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6546 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6547 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6549 @item -print-multiarch
6550 @opindex print-multiarch
6551 Print the path to OS libraries for the selected multiarch,
6552 relative to some @file{lib} subdirectory.
6554 @item -print-prog-name=@var{program}
6555 @opindex print-prog-name
6556 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6558 @item -print-libgcc-file-name
6559 @opindex print-libgcc-file-name
6560 Same as @option{-print-file-name=libgcc.a}.
6562 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6563 but you do want to link with @file{libgcc.a}.  You can do:
6565 @smallexample
6566 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6567 @end smallexample
6569 @item -print-search-dirs
6570 @opindex print-search-dirs
6571 Print the name of the configured installation directory and a list of
6572 program and library directories @command{gcc} searches---and don't do anything else.
6574 This is useful when @command{gcc} prints the error message
6575 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6576 To resolve this you either need to put @file{cpp0} and the other compiler
6577 components where @command{gcc} expects to find them, or you can set the environment
6578 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6579 Don't forget the trailing @samp{/}.
6580 @xref{Environment Variables}.
6582 @item -print-sysroot
6583 @opindex print-sysroot
6584 Print the target sysroot directory that is used during
6585 compilation.  This is the target sysroot specified either at configure
6586 time or using the @option{--sysroot} option, possibly with an extra
6587 suffix that depends on compilation options.  If no target sysroot is
6588 specified, the option prints nothing.
6590 @item -print-sysroot-headers-suffix
6591 @opindex print-sysroot-headers-suffix
6592 Print the suffix added to the target sysroot when searching for
6593 headers, or give an error if the compiler is not configured with such
6594 a suffix---and don't do anything else.
6596 @item -dumpmachine
6597 @opindex dumpmachine
6598 Print the compiler's target machine (for example,
6599 @samp{i686-pc-linux-gnu})---and don't do anything else.
6601 @item -dumpversion
6602 @opindex dumpversion
6603 Print the compiler version (for example, @samp{3.0})---and don't do
6604 anything else.
6606 @item -dumpspecs
6607 @opindex dumpspecs
6608 Print the compiler's built-in specs---and don't do anything else.  (This
6609 is used when GCC itself is being built.)  @xref{Spec Files}.
6611 @item -fno-eliminate-unused-debug-types
6612 @opindex feliminate-unused-debug-types
6613 @opindex fno-eliminate-unused-debug-types
6614 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6615 output for types that are nowhere used in the source file being compiled.
6616 Sometimes it is useful to have GCC emit debugging
6617 information for all types declared in a compilation
6618 unit, regardless of whether or not they are actually used
6619 in that compilation unit, for example 
6620 if, in the debugger, you want to cast a value to a type that is
6621 not actually used in your program (but is declared).  More often,
6622 however, this results in a significant amount of wasted space.
6623 @end table
6625 @node Optimize Options
6626 @section Options That Control Optimization
6627 @cindex optimize options
6628 @cindex options, optimization
6630 These options control various sorts of optimizations.
6632 Without any optimization option, the compiler's goal is to reduce the
6633 cost of compilation and to make debugging produce the expected
6634 results.  Statements are independent: if you stop the program with a
6635 breakpoint between statements, you can then assign a new value to any
6636 variable or change the program counter to any other statement in the
6637 function and get exactly the results you expect from the source
6638 code.
6640 Turning on optimization flags makes the compiler attempt to improve
6641 the performance and/or code size at the expense of compilation time
6642 and possibly the ability to debug the program.
6644 The compiler performs optimization based on the knowledge it has of the
6645 program.  Compiling multiple files at once to a single output file mode allows
6646 the compiler to use information gained from all of the files when compiling
6647 each of them.
6649 Not all optimizations are controlled directly by a flag.  Only
6650 optimizations that have a flag are listed in this section.
6652 Most optimizations are only enabled if an @option{-O} level is set on
6653 the command line.  Otherwise they are disabled, even if individual
6654 optimization flags are specified.
6656 Depending on the target and how GCC was configured, a slightly different
6657 set of optimizations may be enabled at each @option{-O} level than
6658 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6659 to find out the exact set of optimizations that are enabled at each level.
6660 @xref{Overall Options}, for examples.
6662 @table @gcctabopt
6663 @item -O
6664 @itemx -O1
6665 @opindex O
6666 @opindex O1
6667 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6668 more memory for a large function.
6670 With @option{-O}, the compiler tries to reduce code size and execution
6671 time, without performing any optimizations that take a great deal of
6672 compilation time.
6674 @option{-O} turns on the following optimization flags:
6675 @gccoptlist{
6676 -fauto-inc-dec @gol
6677 -fcompare-elim @gol
6678 -fcprop-registers @gol
6679 -fdce @gol
6680 -fdefer-pop @gol
6681 -fdelayed-branch @gol
6682 -fdse @gol
6683 -fguess-branch-probability @gol
6684 -fif-conversion2 @gol
6685 -fif-conversion @gol
6686 -fipa-pure-const @gol
6687 -fipa-profile @gol
6688 -fipa-reference @gol
6689 -fmerge-constants
6690 -fsplit-wide-types @gol
6691 -ftree-bit-ccp @gol
6692 -ftree-builtin-call-dce @gol
6693 -ftree-ccp @gol
6694 -ftree-ch @gol
6695 -ftree-copyrename @gol
6696 -ftree-dce @gol
6697 -ftree-dominator-opts @gol
6698 -ftree-dse @gol
6699 -ftree-forwprop @gol
6700 -ftree-fre @gol
6701 -ftree-phiprop @gol
6702 -ftree-slsr @gol
6703 -ftree-sra @gol
6704 -ftree-pta @gol
6705 -ftree-ter @gol
6706 -funit-at-a-time}
6708 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6709 where doing so does not interfere with debugging.
6711 @item -O2
6712 @opindex O2
6713 Optimize even more.  GCC performs nearly all supported optimizations
6714 that do not involve a space-speed tradeoff.
6715 As compared to @option{-O}, this option increases both compilation time
6716 and the performance of the generated code.
6718 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6719 also turns on the following optimization flags:
6720 @gccoptlist{-fthread-jumps @gol
6721 -falign-functions  -falign-jumps @gol
6722 -falign-loops  -falign-labels @gol
6723 -fcaller-saves @gol
6724 -fcrossjumping @gol
6725 -fcse-follow-jumps  -fcse-skip-blocks @gol
6726 -fdelete-null-pointer-checks @gol
6727 -fdevirtualize -fdevirtualize-speculatively @gol
6728 -fexpensive-optimizations @gol
6729 -fgcse  -fgcse-lm  @gol
6730 -fhoist-adjacent-loads @gol
6731 -finline-small-functions @gol
6732 -findirect-inlining @gol
6733 -fipa-sra @gol
6734 -foptimize-sibling-calls @gol
6735 -fpartial-inlining @gol
6736 -fpeephole2 @gol
6737 -fregmove @gol
6738 -freorder-blocks  -freorder-functions @gol
6739 -frerun-cse-after-loop  @gol
6740 -fsched-interblock  -fsched-spec @gol
6741 -fschedule-insns  -fschedule-insns2 @gol
6742 -fstrict-aliasing -fstrict-overflow @gol
6743 -ftree-switch-conversion -ftree-tail-merge @gol
6744 -ftree-pre @gol
6745 -ftree-vrp}
6747 Please note the warning under @option{-fgcse} about
6748 invoking @option{-O2} on programs that use computed gotos.
6750 @item -O3
6751 @opindex O3
6752 Optimize yet more.  @option{-O3} turns on all optimizations specified
6753 by @option{-O2} and also turns on the @option{-finline-functions},
6754 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6755 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
6756 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
6757 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6759 @item -O0
6760 @opindex O0
6761 Reduce compilation time and make debugging produce the expected
6762 results.  This is the default.
6764 @item -Os
6765 @opindex Os
6766 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6767 do not typically increase code size.  It also performs further
6768 optimizations designed to reduce code size.
6770 @option{-Os} disables the following optimization flags:
6771 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6772 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6773 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6775 @item -Ofast
6776 @opindex Ofast
6777 Disregard strict standards compliance.  @option{-Ofast} enables all
6778 @option{-O3} optimizations.  It also enables optimizations that are not
6779 valid for all standard-compliant programs.
6780 It turns on @option{-ffast-math} and the Fortran-specific
6781 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6783 @item -Og
6784 @opindex Og
6785 Optimize debugging experience.  @option{-Og} enables optimizations
6786 that do not interfere with debugging. It should be the optimization
6787 level of choice for the standard edit-compile-debug cycle, offering
6788 a reasonable level of optimization while maintaining fast compilation
6789 and a good debugging experience.
6791 If you use multiple @option{-O} options, with or without level numbers,
6792 the last such option is the one that is effective.
6793 @end table
6795 Options of the form @option{-f@var{flag}} specify machine-independent
6796 flags.  Most flags have both positive and negative forms; the negative
6797 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6798 below, only one of the forms is listed---the one you typically 
6799 use.  You can figure out the other form by either removing @samp{no-}
6800 or adding it.
6802 The following options control specific optimizations.  They are either
6803 activated by @option{-O} options or are related to ones that are.  You
6804 can use the following flags in the rare cases when ``fine-tuning'' of
6805 optimizations to be performed is desired.
6807 @table @gcctabopt
6808 @item -fno-default-inline
6809 @opindex fno-default-inline
6810 Do not make member functions inline by default merely because they are
6811 defined inside the class scope (C++ only).  Otherwise, when you specify
6812 @w{@option{-O}}, member functions defined inside class scope are compiled
6813 inline by default; i.e., you don't need to add @samp{inline} in front of
6814 the member function name.
6816 @item -fno-defer-pop
6817 @opindex fno-defer-pop
6818 Always pop the arguments to each function call as soon as that function
6819 returns.  For machines that must pop arguments after a function call,
6820 the compiler normally lets arguments accumulate on the stack for several
6821 function calls and pops them all at once.
6823 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6825 @item -fforward-propagate
6826 @opindex fforward-propagate
6827 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6828 instructions and checks if the result can be simplified.  If loop unrolling
6829 is active, two passes are performed and the second is scheduled after
6830 loop unrolling.
6832 This option is enabled by default at optimization levels @option{-O},
6833 @option{-O2}, @option{-O3}, @option{-Os}.
6835 @item -ffp-contract=@var{style}
6836 @opindex ffp-contract
6837 @option{-ffp-contract=off} disables floating-point expression contraction.
6838 @option{-ffp-contract=fast} enables floating-point expression contraction
6839 such as forming of fused multiply-add operations if the target has
6840 native support for them.
6841 @option{-ffp-contract=on} enables floating-point expression contraction
6842 if allowed by the language standard.  This is currently not implemented
6843 and treated equal to @option{-ffp-contract=off}.
6845 The default is @option{-ffp-contract=fast}.
6847 @item -fomit-frame-pointer
6848 @opindex fomit-frame-pointer
6849 Don't keep the frame pointer in a register for functions that
6850 don't need one.  This avoids the instructions to save, set up and
6851 restore frame pointers; it also makes an extra register available
6852 in many functions.  @strong{It also makes debugging impossible on
6853 some machines.}
6855 On some machines, such as the VAX, this flag has no effect, because
6856 the standard calling sequence automatically handles the frame pointer
6857 and nothing is saved by pretending it doesn't exist.  The
6858 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6859 whether a target machine supports this flag.  @xref{Registers,,Register
6860 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6862 Starting with GCC version 4.6, the default setting (when not optimizing for
6863 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6864 @option{-fomit-frame-pointer}.  The default can be reverted to
6865 @option{-fno-omit-frame-pointer} by configuring GCC with the
6866 @option{--enable-frame-pointer} configure option.
6868 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6870 @item -foptimize-sibling-calls
6871 @opindex foptimize-sibling-calls
6872 Optimize sibling and tail recursive calls.
6874 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6876 @item -fno-inline
6877 @opindex fno-inline
6878 Do not expand any functions inline apart from those marked with
6879 the @code{always_inline} attribute.  This is the default when not
6880 optimizing.
6882 Single functions can be exempted from inlining by marking them
6883 with the @code{noinline} attribute.
6885 @item -finline-small-functions
6886 @opindex finline-small-functions
6887 Integrate functions into their callers when their body is smaller than expected
6888 function call code (so overall size of program gets smaller).  The compiler
6889 heuristically decides which functions are simple enough to be worth integrating
6890 in this way.  This inlining applies to all functions, even those not declared
6891 inline.
6893 Enabled at level @option{-O2}.
6895 @item -findirect-inlining
6896 @opindex findirect-inlining
6897 Inline also indirect calls that are discovered to be known at compile
6898 time thanks to previous inlining.  This option has any effect only
6899 when inlining itself is turned on by the @option{-finline-functions}
6900 or @option{-finline-small-functions} options.
6902 Enabled at level @option{-O2}.
6904 @item -finline-functions
6905 @opindex finline-functions
6906 Consider all functions for inlining, even if they are not declared inline.
6907 The compiler heuristically decides which functions are worth integrating
6908 in this way.
6910 If all calls to a given function are integrated, and the function is
6911 declared @code{static}, then the function is normally not output as
6912 assembler code in its own right.
6914 Enabled at level @option{-O3}.
6916 @item -finline-functions-called-once
6917 @opindex finline-functions-called-once
6918 Consider all @code{static} functions called once for inlining into their
6919 caller even if they are not marked @code{inline}.  If a call to a given
6920 function is integrated, then the function is not output as assembler code
6921 in its own right.
6923 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6925 @item -fearly-inlining
6926 @opindex fearly-inlining
6927 Inline functions marked by @code{always_inline} and functions whose body seems
6928 smaller than the function call overhead early before doing
6929 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6930 makes profiling significantly cheaper and usually inlining faster on programs
6931 having large chains of nested wrapper functions.
6933 Enabled by default.
6935 @item -fipa-sra
6936 @opindex fipa-sra
6937 Perform interprocedural scalar replacement of aggregates, removal of
6938 unused parameters and replacement of parameters passed by reference
6939 by parameters passed by value.
6941 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6943 @item -finline-limit=@var{n}
6944 @opindex finline-limit
6945 By default, GCC limits the size of functions that can be inlined.  This flag
6946 allows coarse control of this limit.  @var{n} is the size of functions that
6947 can be inlined in number of pseudo instructions.
6949 Inlining is actually controlled by a number of parameters, which may be
6950 specified individually by using @option{--param @var{name}=@var{value}}.
6951 The @option{-finline-limit=@var{n}} option sets some of these parameters
6952 as follows:
6954 @table @gcctabopt
6955 @item max-inline-insns-single
6956 is set to @var{n}/2.
6957 @item max-inline-insns-auto
6958 is set to @var{n}/2.
6959 @end table
6961 See below for a documentation of the individual
6962 parameters controlling inlining and for the defaults of these parameters.
6964 @emph{Note:} there may be no value to @option{-finline-limit} that results
6965 in default behavior.
6967 @emph{Note:} pseudo instruction represents, in this particular context, an
6968 abstract measurement of function's size.  In no way does it represent a count
6969 of assembly instructions and as such its exact meaning might change from one
6970 release to an another.
6972 @item -fno-keep-inline-dllexport
6973 @opindex -fno-keep-inline-dllexport
6974 This is a more fine-grained version of @option{-fkeep-inline-functions},
6975 which applies only to functions that are declared using the @code{dllexport}
6976 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6977 Functions}.)
6979 @item -fkeep-inline-functions
6980 @opindex fkeep-inline-functions
6981 In C, emit @code{static} functions that are declared @code{inline}
6982 into the object file, even if the function has been inlined into all
6983 of its callers.  This switch does not affect functions using the
6984 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6985 inline functions into the object file.
6987 @item -fkeep-static-consts
6988 @opindex fkeep-static-consts
6989 Emit variables declared @code{static const} when optimization isn't turned
6990 on, even if the variables aren't referenced.
6992 GCC enables this option by default.  If you want to force the compiler to
6993 check if a variable is referenced, regardless of whether or not
6994 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6996 @item -fmerge-constants
6997 @opindex fmerge-constants
6998 Attempt to merge identical constants (string constants and floating-point
6999 constants) across compilation units.
7001 This option is the default for optimized compilation if the assembler and
7002 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7003 behavior.
7005 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7007 @item -fmerge-all-constants
7008 @opindex fmerge-all-constants
7009 Attempt to merge identical constants and identical variables.
7011 This option implies @option{-fmerge-constants}.  In addition to
7012 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7013 arrays or initialized constant variables with integral or floating-point
7014 types.  Languages like C or C++ require each variable, including multiple
7015 instances of the same variable in recursive calls, to have distinct locations,
7016 so using this option results in non-conforming
7017 behavior.
7019 @item -fmodulo-sched
7020 @opindex fmodulo-sched
7021 Perform swing modulo scheduling immediately before the first scheduling
7022 pass.  This pass looks at innermost loops and reorders their
7023 instructions by overlapping different iterations.
7025 @item -fmodulo-sched-allow-regmoves
7026 @opindex fmodulo-sched-allow-regmoves
7027 Perform more aggressive SMS-based modulo scheduling with register moves
7028 allowed.  By setting this flag certain anti-dependences edges are
7029 deleted, which triggers the generation of reg-moves based on the
7030 life-range analysis.  This option is effective only with
7031 @option{-fmodulo-sched} enabled.
7033 @item -fno-branch-count-reg
7034 @opindex fno-branch-count-reg
7035 Do not use ``decrement and branch'' instructions on a count register,
7036 but instead generate a sequence of instructions that decrement a
7037 register, compare it against zero, then branch based upon the result.
7038 This option is only meaningful on architectures that support such
7039 instructions, which include x86, PowerPC, IA-64 and S/390.
7041 The default is @option{-fbranch-count-reg}.
7043 @item -fno-function-cse
7044 @opindex fno-function-cse
7045 Do not put function addresses in registers; make each instruction that
7046 calls a constant function contain the function's address explicitly.
7048 This option results in less efficient code, but some strange hacks
7049 that alter the assembler output may be confused by the optimizations
7050 performed when this option is not used.
7052 The default is @option{-ffunction-cse}
7054 @item -fno-zero-initialized-in-bss
7055 @opindex fno-zero-initialized-in-bss
7056 If the target supports a BSS section, GCC by default puts variables that
7057 are initialized to zero into BSS@.  This can save space in the resulting
7058 code.
7060 This option turns off this behavior because some programs explicitly
7061 rely on variables going to the data section---e.g., so that the
7062 resulting executable can find the beginning of that section and/or make
7063 assumptions based on that.
7065 The default is @option{-fzero-initialized-in-bss}.
7067 @item -fmudflap -fmudflapth -fmudflapir
7068 @opindex fmudflap
7069 @opindex fmudflapth
7070 @opindex fmudflapir
7071 @cindex bounds checking
7072 @cindex mudflap
7073 For front-ends that support it (C and C++), instrument all risky
7074 pointer/array dereferencing operations, some standard library
7075 string/heap functions, and some other associated constructs with
7076 range/validity tests.  Modules so instrumented should be immune to
7077 buffer overflows, invalid heap use, and some other classes of C/C++
7078 programming errors.  The instrumentation relies on a separate runtime
7079 library (@file{libmudflap}), which is linked into a program if
7080 @option{-fmudflap} is given at link time.  Run-time behavior of the
7081 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
7082 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
7083 for its options.
7085 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
7086 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
7087 addition to @option{-fmudflap} or @option{-fmudflapth}, if
7088 instrumentation should ignore pointer reads.  This produces less
7089 instrumentation (and therefore faster execution) and still provides
7090 some protection against outright memory corrupting writes, but allows
7091 erroneously read data to propagate within a program.
7093 @item -fthread-jumps
7094 @opindex fthread-jumps
7095 Perform optimizations that check to see if a jump branches to a
7096 location where another comparison subsumed by the first is found.  If
7097 so, the first branch is redirected to either the destination of the
7098 second branch or a point immediately following it, depending on whether
7099 the condition is known to be true or false.
7101 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7103 @item -fsplit-wide-types
7104 @opindex fsplit-wide-types
7105 When using a type that occupies multiple registers, such as @code{long
7106 long} on a 32-bit system, split the registers apart and allocate them
7107 independently.  This normally generates better code for those types,
7108 but may make debugging more difficult.
7110 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7111 @option{-Os}.
7113 @item -fcse-follow-jumps
7114 @opindex fcse-follow-jumps
7115 In common subexpression elimination (CSE), scan through jump instructions
7116 when the target of the jump is not reached by any other path.  For
7117 example, when CSE encounters an @code{if} statement with an
7118 @code{else} clause, CSE follows the jump when the condition
7119 tested is false.
7121 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7123 @item -fcse-skip-blocks
7124 @opindex fcse-skip-blocks
7125 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7126 follow jumps that conditionally skip over blocks.  When CSE
7127 encounters a simple @code{if} statement with no else clause,
7128 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7129 body of the @code{if}.
7131 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7133 @item -frerun-cse-after-loop
7134 @opindex frerun-cse-after-loop
7135 Re-run common subexpression elimination after loop optimizations are
7136 performed.
7138 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7140 @item -fgcse
7141 @opindex fgcse
7142 Perform a global common subexpression elimination pass.
7143 This pass also performs global constant and copy propagation.
7145 @emph{Note:} When compiling a program using computed gotos, a GCC
7146 extension, you may get better run-time performance if you disable
7147 the global common subexpression elimination pass by adding
7148 @option{-fno-gcse} to the command line.
7150 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7152 @item -fgcse-lm
7153 @opindex fgcse-lm
7154 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7155 attempts to move loads that are only killed by stores into themselves.  This
7156 allows a loop containing a load/store sequence to be changed to a load outside
7157 the loop, and a copy/store within the loop.
7159 Enabled by default when @option{-fgcse} is enabled.
7161 @item -fgcse-sm
7162 @opindex fgcse-sm
7163 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7164 global common subexpression elimination.  This pass attempts to move
7165 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7166 loops containing a load/store sequence can be changed to a load before
7167 the loop and a store after the loop.
7169 Not enabled at any optimization level.
7171 @item -fgcse-las
7172 @opindex fgcse-las
7173 When @option{-fgcse-las} is enabled, the global common subexpression
7174 elimination pass eliminates redundant loads that come after stores to the
7175 same memory location (both partial and full redundancies).
7177 Not enabled at any optimization level.
7179 @item -fgcse-after-reload
7180 @opindex fgcse-after-reload
7181 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7182 pass is performed after reload.  The purpose of this pass is to clean up
7183 redundant spilling.
7185 @item -faggressive-loop-optimizations
7186 @opindex faggressive-loop-optimizations
7187 This option tells the loop optimizer to use language constraints to
7188 derive bounds for the number of iterations of a loop.  This assumes that
7189 loop code does not invoke undefined behavior by for example causing signed
7190 integer overflows or out-of-bound array accesses.  The bounds for the
7191 number of iterations of a loop are used to guide loop unrolling and peeling
7192 and loop exit test optimizations.
7193 This option is enabled by default.
7195 @item -funsafe-loop-optimizations
7196 @opindex funsafe-loop-optimizations
7197 This option tells the loop optimizer to assume that loop indices do not
7198 overflow, and that loops with nontrivial exit condition are not
7199 infinite.  This enables a wider range of loop optimizations even if
7200 the loop optimizer itself cannot prove that these assumptions are valid.
7201 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7202 if it finds this kind of loop.
7204 @item -fcrossjumping
7205 @opindex fcrossjumping
7206 Perform cross-jumping transformation.
7207 This transformation unifies equivalent code and saves code size.  The
7208 resulting code may or may not perform better than without cross-jumping.
7210 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7212 @item -fauto-inc-dec
7213 @opindex fauto-inc-dec
7214 Combine increments or decrements of addresses with memory accesses.
7215 This pass is always skipped on architectures that do not have
7216 instructions to support this.  Enabled by default at @option{-O} and
7217 higher on architectures that support this.
7219 @item -fdce
7220 @opindex fdce
7221 Perform dead code elimination (DCE) on RTL@.
7222 Enabled by default at @option{-O} and higher.
7224 @item -fdse
7225 @opindex fdse
7226 Perform dead store elimination (DSE) on RTL@.
7227 Enabled by default at @option{-O} and higher.
7229 @item -fif-conversion
7230 @opindex fif-conversion
7231 Attempt to transform conditional jumps into branch-less equivalents.  This
7232 includes use of conditional moves, min, max, set flags and abs instructions, and
7233 some tricks doable by standard arithmetics.  The use of conditional execution
7234 on chips where it is available is controlled by @code{if-conversion2}.
7236 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7238 @item -fif-conversion2
7239 @opindex fif-conversion2
7240 Use conditional execution (where available) to transform conditional jumps into
7241 branch-less equivalents.
7243 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7245 @item -fdelete-null-pointer-checks
7246 @opindex fdelete-null-pointer-checks
7247 Assume that programs cannot safely dereference null pointers, and that
7248 no code or data element resides there.  This enables simple constant
7249 folding optimizations at all optimization levels.  In addition, other
7250 optimization passes in GCC use this flag to control global dataflow
7251 analyses that eliminate useless checks for null pointers; these assume
7252 that if a pointer is checked after it has already been dereferenced,
7253 it cannot be null.
7255 Note however that in some environments this assumption is not true.
7256 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7257 for programs that depend on that behavior.
7259 Some targets, especially embedded ones, disable this option at all levels.
7260 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7261 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7262 are enabled independently at different optimization levels.
7264 @item -fdevirtualize
7265 @opindex fdevirtualize
7266 Attempt to convert calls to virtual functions to direct calls.  This
7267 is done both within a procedure and interprocedurally as part of
7268 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7269 propagation (@option{-fipa-cp}).
7270 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7272 @item -fdevirtualize-speculatively
7273 @opindex fdevirtualize-speculatively
7274 Attempt to convert calls to virtual functions to speculative direct calls.
7275 Based on the analysis of the type inheritance graph, determine for a given call
7276 the set of likely targets. If the set is small, preferably of size 1, change
7277 the call into an conditional deciding on direct and indirect call.  The
7278 speculative calls enable more optimizations, such as inlining.  When they seem
7279 useless after further optimization, they are converted back into original form.
7281 @item -fexpensive-optimizations
7282 @opindex fexpensive-optimizations
7283 Perform a number of minor optimizations that are relatively expensive.
7285 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7287 @item -free
7288 @opindex free
7289 Attempt to remove redundant extension instructions.  This is especially
7290 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7291 registers after writing to their lower 32-bit half.
7293 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7295 @item -foptimize-register-move
7296 @itemx -fregmove
7297 @opindex foptimize-register-move
7298 @opindex fregmove
7299 Attempt to reassign register numbers in move instructions and as
7300 operands of other simple instructions in order to maximize the amount of
7301 register tying.  This is especially helpful on machines with two-operand
7302 instructions.
7304 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7305 optimization.
7307 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7309 @item -fira-algorithm=@var{algorithm}
7310 Use the specified coloring algorithm for the integrated register
7311 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7312 specifies Chow's priority coloring, or @samp{CB}, which specifies
7313 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7314 for all architectures, but for those targets that do support it, it is
7315 the default because it generates better code.
7317 @item -fira-region=@var{region}
7318 Use specified regions for the integrated register allocator.  The
7319 @var{region} argument should be one of the following:
7321 @table @samp
7323 @item all
7324 Use all loops as register allocation regions.
7325 This can give the best results for machines with a small and/or
7326 irregular register set.
7328 @item mixed
7329 Use all loops except for loops with small register pressure 
7330 as the regions.  This value usually gives
7331 the best results in most cases and for most architectures,
7332 and is enabled by default when compiling with optimization for speed
7333 (@option{-O}, @option{-O2}, @dots{}).
7335 @item one
7336 Use all functions as a single region.  
7337 This typically results in the smallest code size, and is enabled by default for
7338 @option{-Os} or @option{-O0}.
7340 @end table
7342 @item -fira-hoist-pressure
7343 @opindex fira-hoist-pressure
7344 Use IRA to evaluate register pressure in the code hoisting pass for
7345 decisions to hoist expressions.  This option usually results in smaller
7346 code, but it can slow the compiler down.
7348 This option is enabled at level @option{-Os} for all targets.
7350 @item -fira-loop-pressure
7351 @opindex fira-loop-pressure
7352 Use IRA to evaluate register pressure in loops for decisions to move
7353 loop invariants.  This option usually results in generation
7354 of faster and smaller code on machines with large register files (>= 32
7355 registers), but it can slow the compiler down.
7357 This option is enabled at level @option{-O3} for some targets.
7359 @item -fno-ira-share-save-slots
7360 @opindex fno-ira-share-save-slots
7361 Disable sharing of stack slots used for saving call-used hard
7362 registers living through a call.  Each hard register gets a
7363 separate stack slot, and as a result function stack frames are
7364 larger.
7366 @item -fno-ira-share-spill-slots
7367 @opindex fno-ira-share-spill-slots
7368 Disable sharing of stack slots allocated for pseudo-registers.  Each
7369 pseudo-register that does not get a hard register gets a separate
7370 stack slot, and as a result function stack frames are larger.
7372 @item -fira-verbose=@var{n}
7373 @opindex fira-verbose
7374 Control the verbosity of the dump file for the integrated register allocator.
7375 The default value is 5.  If the value @var{n} is greater or equal to 10,
7376 the dump output is sent to stderr using the same format as @var{n} minus 10.
7378 @item -fdelayed-branch
7379 @opindex fdelayed-branch
7380 If supported for the target machine, attempt to reorder instructions
7381 to exploit instruction slots available after delayed branch
7382 instructions.
7384 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7386 @item -fschedule-insns
7387 @opindex fschedule-insns
7388 If supported for the target machine, attempt to reorder instructions to
7389 eliminate execution stalls due to required data being unavailable.  This
7390 helps machines that have slow floating point or memory load instructions
7391 by allowing other instructions to be issued until the result of the load
7392 or floating-point instruction is required.
7394 Enabled at levels @option{-O2}, @option{-O3}.
7396 @item -fschedule-insns2
7397 @opindex fschedule-insns2
7398 Similar to @option{-fschedule-insns}, but requests an additional pass of
7399 instruction scheduling after register allocation has been done.  This is
7400 especially useful on machines with a relatively small number of
7401 registers and where memory load instructions take more than one cycle.
7403 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7405 @item -fno-sched-interblock
7406 @opindex fno-sched-interblock
7407 Don't schedule instructions across basic blocks.  This is normally
7408 enabled by default when scheduling before register allocation, i.e.@:
7409 with @option{-fschedule-insns} or at @option{-O2} or higher.
7411 @item -fno-sched-spec
7412 @opindex fno-sched-spec
7413 Don't allow speculative motion of non-load instructions.  This is normally
7414 enabled by default when scheduling before register allocation, i.e.@:
7415 with @option{-fschedule-insns} or at @option{-O2} or higher.
7417 @item -fsched-pressure
7418 @opindex fsched-pressure
7419 Enable register pressure sensitive insn scheduling before register
7420 allocation.  This only makes sense when scheduling before register
7421 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7422 @option{-O2} or higher.  Usage of this option can improve the
7423 generated code and decrease its size by preventing register pressure
7424 increase above the number of available hard registers and subsequent
7425 spills in register allocation.
7427 @item -fsched-spec-load
7428 @opindex fsched-spec-load
7429 Allow speculative motion of some load instructions.  This only makes
7430 sense when scheduling before register allocation, i.e.@: with
7431 @option{-fschedule-insns} or at @option{-O2} or higher.
7433 @item -fsched-spec-load-dangerous
7434 @opindex fsched-spec-load-dangerous
7435 Allow speculative motion of more load instructions.  This only makes
7436 sense when scheduling before register allocation, i.e.@: with
7437 @option{-fschedule-insns} or at @option{-O2} or higher.
7439 @item -fsched-stalled-insns
7440 @itemx -fsched-stalled-insns=@var{n}
7441 @opindex fsched-stalled-insns
7442 Define how many insns (if any) can be moved prematurely from the queue
7443 of stalled insns into the ready list during the second scheduling pass.
7444 @option{-fno-sched-stalled-insns} means that no insns are moved
7445 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7446 on how many queued insns can be moved prematurely.
7447 @option{-fsched-stalled-insns} without a value is equivalent to
7448 @option{-fsched-stalled-insns=1}.
7450 @item -fsched-stalled-insns-dep
7451 @itemx -fsched-stalled-insns-dep=@var{n}
7452 @opindex fsched-stalled-insns-dep
7453 Define how many insn groups (cycles) are examined for a dependency
7454 on a stalled insn that is a candidate for premature removal from the queue
7455 of stalled insns.  This has an effect only during the second scheduling pass,
7456 and only if @option{-fsched-stalled-insns} is used.
7457 @option{-fno-sched-stalled-insns-dep} is equivalent to
7458 @option{-fsched-stalled-insns-dep=0}.
7459 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7460 @option{-fsched-stalled-insns-dep=1}.
7462 @item -fsched2-use-superblocks
7463 @opindex fsched2-use-superblocks
7464 When scheduling after register allocation, use superblock scheduling.
7465 This allows motion across basic block boundaries,
7466 resulting in faster schedules.  This option is experimental, as not all machine
7467 descriptions used by GCC model the CPU closely enough to avoid unreliable
7468 results from the algorithm.
7470 This only makes sense when scheduling after register allocation, i.e.@: with
7471 @option{-fschedule-insns2} or at @option{-O2} or higher.
7473 @item -fsched-group-heuristic
7474 @opindex fsched-group-heuristic
7475 Enable the group heuristic in the scheduler.  This heuristic favors
7476 the instruction that belongs to a schedule group.  This is enabled
7477 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7478 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7480 @item -fsched-critical-path-heuristic
7481 @opindex fsched-critical-path-heuristic
7482 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7483 instructions on the critical path.  This is enabled by default when
7484 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7485 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7487 @item -fsched-spec-insn-heuristic
7488 @opindex fsched-spec-insn-heuristic
7489 Enable the speculative instruction heuristic in the scheduler.  This
7490 heuristic favors speculative instructions with greater dependency weakness.
7491 This is enabled by default when scheduling is enabled, i.e.@:
7492 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7493 or at @option{-O2} or higher.
7495 @item -fsched-rank-heuristic
7496 @opindex fsched-rank-heuristic
7497 Enable the rank heuristic in the scheduler.  This heuristic favors
7498 the instruction belonging to a basic block with greater size or frequency.
7499 This is enabled by default when scheduling is enabled, i.e.@:
7500 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7501 at @option{-O2} or higher.
7503 @item -fsched-last-insn-heuristic
7504 @opindex fsched-last-insn-heuristic
7505 Enable the last-instruction heuristic in the scheduler.  This heuristic
7506 favors the instruction that is less dependent on the last instruction
7507 scheduled.  This is enabled by default when scheduling is enabled,
7508 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7509 at @option{-O2} or higher.
7511 @item -fsched-dep-count-heuristic
7512 @opindex fsched-dep-count-heuristic
7513 Enable the dependent-count heuristic in the scheduler.  This heuristic
7514 favors the instruction that has more instructions depending on it.
7515 This is enabled by default when scheduling is enabled, i.e.@:
7516 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7517 at @option{-O2} or higher.
7519 @item -freschedule-modulo-scheduled-loops
7520 @opindex freschedule-modulo-scheduled-loops
7521 Modulo scheduling is performed before traditional scheduling.  If a loop
7522 is modulo scheduled, later scheduling passes may change its schedule.  
7523 Use this option to control that behavior.
7525 @item -fselective-scheduling
7526 @opindex fselective-scheduling
7527 Schedule instructions using selective scheduling algorithm.  Selective
7528 scheduling runs instead of the first scheduler pass.
7530 @item -fselective-scheduling2
7531 @opindex fselective-scheduling2
7532 Schedule instructions using selective scheduling algorithm.  Selective
7533 scheduling runs instead of the second scheduler pass.
7535 @item -fsel-sched-pipelining
7536 @opindex fsel-sched-pipelining
7537 Enable software pipelining of innermost loops during selective scheduling.
7538 This option has no effect unless one of @option{-fselective-scheduling} or
7539 @option{-fselective-scheduling2} is turned on.
7541 @item -fsel-sched-pipelining-outer-loops
7542 @opindex fsel-sched-pipelining-outer-loops
7543 When pipelining loops during selective scheduling, also pipeline outer loops.
7544 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7546 @item -fshrink-wrap
7547 @opindex fshrink-wrap
7548 Emit function prologues only before parts of the function that need it,
7549 rather than at the top of the function.  This flag is enabled by default at
7550 @option{-O} and higher.
7552 @item -fcaller-saves
7553 @opindex fcaller-saves
7554 Enable allocation of values to registers that are clobbered by
7555 function calls, by emitting extra instructions to save and restore the
7556 registers around such calls.  Such allocation is done only when it
7557 seems to result in better code.
7559 This option is always enabled by default on certain machines, usually
7560 those which have no call-preserved registers to use instead.
7562 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7564 @item -fcombine-stack-adjustments
7565 @opindex fcombine-stack-adjustments
7566 Tracks stack adjustments (pushes and pops) and stack memory references
7567 and then tries to find ways to combine them.
7569 Enabled by default at @option{-O1} and higher.
7571 @item -fconserve-stack
7572 @opindex fconserve-stack
7573 Attempt to minimize stack usage.  The compiler attempts to use less
7574 stack space, even if that makes the program slower.  This option
7575 implies setting the @option{large-stack-frame} parameter to 100
7576 and the @option{large-stack-frame-growth} parameter to 400.
7578 @item -ftree-reassoc
7579 @opindex ftree-reassoc
7580 Perform reassociation on trees.  This flag is enabled by default
7581 at @option{-O} and higher.
7583 @item -ftree-pre
7584 @opindex ftree-pre
7585 Perform partial redundancy elimination (PRE) on trees.  This flag is
7586 enabled by default at @option{-O2} and @option{-O3}.
7588 @item -ftree-partial-pre
7589 @opindex ftree-partial-pre
7590 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7591 enabled by default at @option{-O3}.
7593 @item -ftree-forwprop
7594 @opindex ftree-forwprop
7595 Perform forward propagation on trees.  This flag is enabled by default
7596 at @option{-O} and higher.
7598 @item -ftree-fre
7599 @opindex ftree-fre
7600 Perform full redundancy elimination (FRE) on trees.  The difference
7601 between FRE and PRE is that FRE only considers expressions
7602 that are computed on all paths leading to the redundant computation.
7603 This analysis is faster than PRE, though it exposes fewer redundancies.
7604 This flag is enabled by default at @option{-O} and higher.
7606 @item -ftree-phiprop
7607 @opindex ftree-phiprop
7608 Perform hoisting of loads from conditional pointers on trees.  This
7609 pass is enabled by default at @option{-O} and higher.
7611 @item -fhoist-adjacent-loads
7612 @opindex hoist-adjacent-loads
7613 Speculatively hoist loads from both branches of an if-then-else if the
7614 loads are from adjacent locations in the same structure and the target
7615 architecture has a conditional move instruction.  This flag is enabled
7616 by default at @option{-O2} and higher.
7618 @item -ftree-copy-prop
7619 @opindex ftree-copy-prop
7620 Perform copy propagation on trees.  This pass eliminates unnecessary
7621 copy operations.  This flag is enabled by default at @option{-O} and
7622 higher.
7624 @item -fipa-pure-const
7625 @opindex fipa-pure-const
7626 Discover which functions are pure or constant.
7627 Enabled by default at @option{-O} and higher.
7629 @item -fipa-reference
7630 @opindex fipa-reference
7631 Discover which static variables do not escape the
7632 compilation unit.
7633 Enabled by default at @option{-O} and higher.
7635 @item -fipa-pta
7636 @opindex fipa-pta
7637 Perform interprocedural pointer analysis and interprocedural modification
7638 and reference analysis.  This option can cause excessive memory and
7639 compile-time usage on large compilation units.  It is not enabled by
7640 default at any optimization level.
7642 @item -fipa-profile
7643 @opindex fipa-profile
7644 Perform interprocedural profile propagation.  The functions called only from
7645 cold functions are marked as cold. Also functions executed once (such as
7646 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7647 functions and loop less parts of functions executed once are then optimized for
7648 size.
7649 Enabled by default at @option{-O} and higher.
7651 @item -fipa-cp
7652 @opindex fipa-cp
7653 Perform interprocedural constant propagation.
7654 This optimization analyzes the program to determine when values passed
7655 to functions are constants and then optimizes accordingly.
7656 This optimization can substantially increase performance
7657 if the application has constants passed to functions.
7658 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7660 @item -fipa-cp-clone
7661 @opindex fipa-cp-clone
7662 Perform function cloning to make interprocedural constant propagation stronger.
7663 When enabled, interprocedural constant propagation performs function cloning
7664 when externally visible function can be called with constant arguments.
7665 Because this optimization can create multiple copies of functions,
7666 it may significantly increase code size
7667 (see @option{--param ipcp-unit-growth=@var{value}}).
7668 This flag is enabled by default at @option{-O3}.
7670 @item -ftree-sink
7671 @opindex ftree-sink
7672 Perform forward store motion  on trees.  This flag is
7673 enabled by default at @option{-O} and higher.
7675 @item -ftree-bit-ccp
7676 @opindex ftree-bit-ccp
7677 Perform sparse conditional bit constant propagation on trees and propagate
7678 pointer alignment information.
7679 This pass only operates on local scalar variables and is enabled by default
7680 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7682 @item -ftree-ccp
7683 @opindex ftree-ccp
7684 Perform sparse conditional constant propagation (CCP) on trees.  This
7685 pass only operates on local scalar variables and is enabled by default
7686 at @option{-O} and higher.
7688 @item -ftree-switch-conversion
7689 Perform conversion of simple initializations in a switch to
7690 initializations from a scalar array.  This flag is enabled by default
7691 at @option{-O2} and higher.
7693 @item -ftree-tail-merge
7694 Look for identical code sequences.  When found, replace one with a jump to the
7695 other.  This optimization is known as tail merging or cross jumping.  This flag
7696 is enabled by default at @option{-O2} and higher.  The compilation time
7697 in this pass can
7698 be limited using @option{max-tail-merge-comparisons} parameter and
7699 @option{max-tail-merge-iterations} parameter.
7701 @item -ftree-dce
7702 @opindex ftree-dce
7703 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7704 default at @option{-O} and higher.
7706 @item -ftree-builtin-call-dce
7707 @opindex ftree-builtin-call-dce
7708 Perform conditional dead code elimination (DCE) for calls to built-in functions
7709 that may set @code{errno} but are otherwise side-effect free.  This flag is
7710 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7711 specified.
7713 @item -ftree-dominator-opts
7714 @opindex ftree-dominator-opts
7715 Perform a variety of simple scalar cleanups (constant/copy
7716 propagation, redundancy elimination, range propagation and expression
7717 simplification) based on a dominator tree traversal.  This also
7718 performs jump threading (to reduce jumps to jumps). This flag is
7719 enabled by default at @option{-O} and higher.
7721 @item -ftree-dse
7722 @opindex ftree-dse
7723 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7724 a memory location that is later overwritten by another store without
7725 any intervening loads.  In this case the earlier store can be deleted.  This
7726 flag is enabled by default at @option{-O} and higher.
7728 @item -ftree-ch
7729 @opindex ftree-ch
7730 Perform loop header copying on trees.  This is beneficial since it increases
7731 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7732 is enabled by default at @option{-O} and higher.  It is not enabled
7733 for @option{-Os}, since it usually increases code size.
7735 @item -ftree-loop-optimize
7736 @opindex ftree-loop-optimize
7737 Perform loop optimizations on trees.  This flag is enabled by default
7738 at @option{-O} and higher.
7740 @item -ftree-loop-linear
7741 @opindex ftree-loop-linear
7742 Perform loop interchange transformations on tree.  Same as
7743 @option{-floop-interchange}.  To use this code transformation, GCC has
7744 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7745 enable the Graphite loop transformation infrastructure.
7747 @item -floop-interchange
7748 @opindex floop-interchange
7749 Perform loop interchange transformations on loops.  Interchanging two
7750 nested loops switches the inner and outer loops.  For example, given a
7751 loop like:
7752 @smallexample
7753 DO J = 1, M
7754   DO I = 1, N
7755     A(J, I) = A(J, I) * C
7756   ENDDO
7757 ENDDO
7758 @end smallexample
7759 loop interchange transforms the loop as if it were written:
7760 @smallexample
7761 DO I = 1, N
7762   DO J = 1, M
7763     A(J, I) = A(J, I) * C
7764   ENDDO
7765 ENDDO
7766 @end smallexample
7767 which can be beneficial when @code{N} is larger than the caches,
7768 because in Fortran, the elements of an array are stored in memory
7769 contiguously by column, and the original loop iterates over rows,
7770 potentially creating at each access a cache miss.  This optimization
7771 applies to all the languages supported by GCC and is not limited to
7772 Fortran.  To use this code transformation, GCC has to be configured
7773 with @option{--with-ppl} and @option{--with-cloog} to enable the
7774 Graphite loop transformation infrastructure.
7776 @item -floop-strip-mine
7777 @opindex floop-strip-mine
7778 Perform loop strip mining transformations on loops.  Strip mining
7779 splits a loop into two nested loops.  The outer loop has strides
7780 equal to the strip size and the inner loop has strides of the
7781 original loop within a strip.  The strip length can be changed
7782 using the @option{loop-block-tile-size} parameter.  For example,
7783 given a loop like:
7784 @smallexample
7785 DO I = 1, N
7786   A(I) = A(I) + C
7787 ENDDO
7788 @end smallexample
7789 loop strip mining transforms the loop as if it were written:
7790 @smallexample
7791 DO II = 1, N, 51
7792   DO I = II, min (II + 50, N)
7793     A(I) = A(I) + C
7794   ENDDO
7795 ENDDO
7796 @end smallexample
7797 This optimization applies to all the languages supported by GCC and is
7798 not limited to Fortran.  To use this code transformation, GCC has to
7799 be configured with @option{--with-ppl} and @option{--with-cloog} to
7800 enable the Graphite loop transformation infrastructure.
7802 @item -floop-block
7803 @opindex floop-block
7804 Perform loop blocking transformations on loops.  Blocking strip mines
7805 each loop in the loop nest such that the memory accesses of the
7806 element loops fit inside caches.  The strip length can be changed
7807 using the @option{loop-block-tile-size} parameter.  For example, given
7808 a loop like:
7809 @smallexample
7810 DO I = 1, N
7811   DO J = 1, M
7812     A(J, I) = B(I) + C(J)
7813   ENDDO
7814 ENDDO
7815 @end smallexample
7816 loop blocking transforms the loop as if it were written:
7817 @smallexample
7818 DO II = 1, N, 51
7819   DO JJ = 1, M, 51
7820     DO I = II, min (II + 50, N)
7821       DO J = JJ, min (JJ + 50, M)
7822         A(J, I) = B(I) + C(J)
7823       ENDDO
7824     ENDDO
7825   ENDDO
7826 ENDDO
7827 @end smallexample
7828 which can be beneficial when @code{M} is larger than the caches,
7829 because the innermost loop iterates over a smaller amount of data
7830 which can be kept in the caches.  This optimization applies to all the
7831 languages supported by GCC and is not limited to Fortran.  To use this
7832 code transformation, GCC has to be configured with @option{--with-ppl}
7833 and @option{--with-cloog} to enable the Graphite loop transformation
7834 infrastructure.
7836 @item -fgraphite-identity
7837 @opindex fgraphite-identity
7838 Enable the identity transformation for graphite.  For every SCoP we generate
7839 the polyhedral representation and transform it back to gimple.  Using
7840 @option{-fgraphite-identity} we can check the costs or benefits of the
7841 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7842 are also performed by the code generator CLooG, like index splitting and
7843 dead code elimination in loops.
7845 @item -floop-nest-optimize
7846 @opindex floop-nest-optimize
7847 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7848 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7849 structure optimized for data-locality and parallelism.  This option
7850 is experimental.
7852 @item -floop-parallelize-all
7853 @opindex floop-parallelize-all
7854 Use the Graphite data dependence analysis to identify loops that can
7855 be parallelized.  Parallelize all the loops that can be analyzed to
7856 not contain loop carried dependences without checking that it is
7857 profitable to parallelize the loops.
7859 @item -fcheck-data-deps
7860 @opindex fcheck-data-deps
7861 Compare the results of several data dependence analyzers.  This option
7862 is used for debugging the data dependence analyzers.
7864 @item -ftree-loop-if-convert
7865 Attempt to transform conditional jumps in the innermost loops to
7866 branch-less equivalents.  The intent is to remove control-flow from
7867 the innermost loops in order to improve the ability of the
7868 vectorization pass to handle these loops.  This is enabled by default
7869 if vectorization is enabled.
7871 @item -ftree-loop-if-convert-stores
7872 Attempt to also if-convert conditional jumps containing memory writes.
7873 This transformation can be unsafe for multi-threaded programs as it
7874 transforms conditional memory writes into unconditional memory writes.
7875 For example,
7876 @smallexample
7877 for (i = 0; i < N; i++)
7878   if (cond)
7879     A[i] = expr;
7880 @end smallexample
7881 is transformed to
7882 @smallexample
7883 for (i = 0; i < N; i++)
7884   A[i] = cond ? expr : A[i];
7885 @end smallexample
7886 potentially producing data races.
7888 @item -ftree-loop-distribution
7889 Perform loop distribution.  This flag can improve cache performance on
7890 big loop bodies and allow further loop optimizations, like
7891 parallelization or vectorization, to take place.  For example, the loop
7892 @smallexample
7893 DO I = 1, N
7894   A(I) = B(I) + C
7895   D(I) = E(I) * F
7896 ENDDO
7897 @end smallexample
7898 is transformed to
7899 @smallexample
7900 DO I = 1, N
7901    A(I) = B(I) + C
7902 ENDDO
7903 DO I = 1, N
7904    D(I) = E(I) * F
7905 ENDDO
7906 @end smallexample
7908 @item -ftree-loop-distribute-patterns
7909 Perform loop distribution of patterns that can be code generated with
7910 calls to a library.  This flag is enabled by default at @option{-O3}.
7912 This pass distributes the initialization loops and generates a call to
7913 memset zero.  For example, the loop
7914 @smallexample
7915 DO I = 1, N
7916   A(I) = 0
7917   B(I) = A(I) + I
7918 ENDDO
7919 @end smallexample
7920 is transformed to
7921 @smallexample
7922 DO I = 1, N
7923    A(I) = 0
7924 ENDDO
7925 DO I = 1, N
7926    B(I) = A(I) + I
7927 ENDDO
7928 @end smallexample
7929 and the initialization loop is transformed into a call to memset zero.
7931 @item -ftree-loop-im
7932 @opindex ftree-loop-im
7933 Perform loop invariant motion on trees.  This pass moves only invariants that
7934 are hard to handle at RTL level (function calls, operations that expand to
7935 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7936 operands of conditions that are invariant out of the loop, so that we can use
7937 just trivial invariantness analysis in loop unswitching.  The pass also includes
7938 store motion.
7940 @item -ftree-loop-ivcanon
7941 @opindex ftree-loop-ivcanon
7942 Create a canonical counter for number of iterations in loops for which
7943 determining number of iterations requires complicated analysis.  Later
7944 optimizations then may determine the number easily.  Useful especially
7945 in connection with unrolling.
7947 @item -fivopts
7948 @opindex fivopts
7949 Perform induction variable optimizations (strength reduction, induction
7950 variable merging and induction variable elimination) on trees.
7952 @item -ftree-parallelize-loops=n
7953 @opindex ftree-parallelize-loops
7954 Parallelize loops, i.e., split their iteration space to run in n threads.
7955 This is only possible for loops whose iterations are independent
7956 and can be arbitrarily reordered.  The optimization is only
7957 profitable on multiprocessor machines, for loops that are CPU-intensive,
7958 rather than constrained e.g.@: by memory bandwidth.  This option
7959 implies @option{-pthread}, and thus is only supported on targets
7960 that have support for @option{-pthread}.
7962 @item -ftree-pta
7963 @opindex ftree-pta
7964 Perform function-local points-to analysis on trees.  This flag is
7965 enabled by default at @option{-O} and higher.
7967 @item -ftree-sra
7968 @opindex ftree-sra
7969 Perform scalar replacement of aggregates.  This pass replaces structure
7970 references with scalars to prevent committing structures to memory too
7971 early.  This flag is enabled by default at @option{-O} and higher.
7973 @item -ftree-copyrename
7974 @opindex ftree-copyrename
7975 Perform copy renaming on trees.  This pass attempts to rename compiler
7976 temporaries to other variables at copy locations, usually resulting in
7977 variable names which more closely resemble the original variables.  This flag
7978 is enabled by default at @option{-O} and higher.
7980 @item -ftree-coalesce-inlined-vars
7981 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7982 combine small user-defined variables too, but only if they were inlined
7983 from other functions.  It is a more limited form of
7984 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7985 inlined variables, but it will keep variables of the inlined-into
7986 function apart from each other, such that they are more likely to
7987 contain the expected values in a debugging session.  This was the
7988 default in GCC versions older than 4.7.
7990 @item -ftree-coalesce-vars
7991 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7992 combine small user-defined variables too, instead of just compiler
7993 temporaries.  This may severely limit the ability to debug an optimized
7994 program compiled with @option{-fno-var-tracking-assignments}.  In the
7995 negated form, this flag prevents SSA coalescing of user variables,
7996 including inlined ones.  This option is enabled by default.
7998 @item -ftree-ter
7999 @opindex ftree-ter
8000 Perform temporary expression replacement during the SSA->normal phase.  Single
8001 use/single def temporaries are replaced at their use location with their
8002 defining expression.  This results in non-GIMPLE code, but gives the expanders
8003 much more complex trees to work on resulting in better RTL generation.  This is
8004 enabled by default at @option{-O} and higher.
8006 @item -ftree-slsr
8007 @opindex ftree-slsr
8008 Perform straight-line strength reduction on trees.  This recognizes related
8009 expressions involving multiplications and replaces them by less expensive
8010 calculations when possible.  This is enabled by default at @option{-O} and
8011 higher.
8013 @item -ftree-vectorize
8014 @opindex ftree-vectorize
8015 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8016 and @option{-ftree-slp-vectorize} if not explicitly specified.
8018 @item -ftree-loop-vectorize
8019 @opindex ftree-loop-vectorize
8020 Perform loop vectorization on trees. This flag is enabled by default at
8021 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8023 @item -ftree-slp-vectorize
8024 @opindex ftree-slp-vectorize
8025 Perform basic block vectorization on trees. This flag is enabled by default at
8026 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8028 @item -ftree-vect-loop-version
8029 @opindex ftree-vect-loop-version
8030 Perform loop versioning when doing loop vectorization on trees.  When a loop
8031 appears to be vectorizable except that data alignment or data dependence cannot
8032 be determined at compile time, then vectorized and non-vectorized versions of
8033 the loop are generated along with run-time checks for alignment or dependence
8034 to control which version is executed.  This option is enabled by default
8035 except at level @option{-Os} where it is disabled.
8037 @item -fvect-cost-model
8038 @opindex fvect-cost-model
8039 Enable cost model for vectorization.  This option is enabled by default at
8040 @option{-O3}.
8042 @item -ftree-vrp
8043 @opindex ftree-vrp
8044 Perform Value Range Propagation on trees.  This is similar to the
8045 constant propagation pass, but instead of values, ranges of values are
8046 propagated.  This allows the optimizers to remove unnecessary range
8047 checks like array bound checks and null pointer checks.  This is
8048 enabled by default at @option{-O2} and higher.  Null pointer check
8049 elimination is only done if @option{-fdelete-null-pointer-checks} is
8050 enabled.
8052 @item -ftracer
8053 @opindex ftracer
8054 Perform tail duplication to enlarge superblock size.  This transformation
8055 simplifies the control flow of the function allowing other optimizations to do
8056 a better job.
8058 @item -funroll-loops
8059 @opindex funroll-loops
8060 Unroll loops whose number of iterations can be determined at compile
8061 time or upon entry to the loop.  @option{-funroll-loops} implies
8062 @option{-frerun-cse-after-loop}.  This option makes code larger,
8063 and may or may not make it run faster.
8065 @item -funroll-all-loops
8066 @opindex funroll-all-loops
8067 Unroll all loops, even if their number of iterations is uncertain when
8068 the loop is entered.  This usually makes programs run more slowly.
8069 @option{-funroll-all-loops} implies the same options as
8070 @option{-funroll-loops},
8072 @item -fsplit-ivs-in-unroller
8073 @opindex fsplit-ivs-in-unroller
8074 Enables expression of values of induction variables in later iterations
8075 of the unrolled loop using the value in the first iteration.  This breaks
8076 long dependency chains, thus improving efficiency of the scheduling passes.
8078 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8079 same effect.  However, that is not reliable in cases where the loop body
8080 is more complicated than a single basic block.  It also does not work at all
8081 on some architectures due to restrictions in the CSE pass.
8083 This optimization is enabled by default.
8085 @item -fvariable-expansion-in-unroller
8086 @opindex fvariable-expansion-in-unroller
8087 With this option, the compiler creates multiple copies of some
8088 local variables when unrolling a loop, which can result in superior code.
8090 @item -fpartial-inlining
8091 @opindex fpartial-inlining
8092 Inline parts of functions.  This option has any effect only
8093 when inlining itself is turned on by the @option{-finline-functions}
8094 or @option{-finline-small-functions} options.
8096 Enabled at level @option{-O2}.
8098 @item -fpredictive-commoning
8099 @opindex fpredictive-commoning
8100 Perform predictive commoning optimization, i.e., reusing computations
8101 (especially memory loads and stores) performed in previous
8102 iterations of loops.
8104 This option is enabled at level @option{-O3}.
8106 @item -fprefetch-loop-arrays
8107 @opindex fprefetch-loop-arrays
8108 If supported by the target machine, generate instructions to prefetch
8109 memory to improve the performance of loops that access large arrays.
8111 This option may generate better or worse code; results are highly
8112 dependent on the structure of loops within the source code.
8114 Disabled at level @option{-Os}.
8116 @item -fno-peephole
8117 @itemx -fno-peephole2
8118 @opindex fno-peephole
8119 @opindex fno-peephole2
8120 Disable any machine-specific peephole optimizations.  The difference
8121 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8122 are implemented in the compiler; some targets use one, some use the
8123 other, a few use both.
8125 @option{-fpeephole} is enabled by default.
8126 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8128 @item -fno-guess-branch-probability
8129 @opindex fno-guess-branch-probability
8130 Do not guess branch probabilities using heuristics.
8132 GCC uses heuristics to guess branch probabilities if they are
8133 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8134 heuristics are based on the control flow graph.  If some branch probabilities
8135 are specified by @samp{__builtin_expect}, then the heuristics are
8136 used to guess branch probabilities for the rest of the control flow graph,
8137 taking the @samp{__builtin_expect} info into account.  The interactions
8138 between the heuristics and @samp{__builtin_expect} can be complex, and in
8139 some cases, it may be useful to disable the heuristics so that the effects
8140 of @samp{__builtin_expect} are easier to understand.
8142 The default is @option{-fguess-branch-probability} at levels
8143 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8145 @item -freorder-blocks
8146 @opindex freorder-blocks
8147 Reorder basic blocks in the compiled function in order to reduce number of
8148 taken branches and improve code locality.
8150 Enabled at levels @option{-O2}, @option{-O3}.
8152 @item -freorder-blocks-and-partition
8153 @opindex freorder-blocks-and-partition
8154 In addition to reordering basic blocks in the compiled function, in order
8155 to reduce number of taken branches, partitions hot and cold basic blocks
8156 into separate sections of the assembly and .o files, to improve
8157 paging and cache locality performance.
8159 This optimization is automatically turned off in the presence of
8160 exception handling, for linkonce sections, for functions with a user-defined
8161 section attribute and on any architecture that does not support named
8162 sections.
8164 @item -freorder-functions
8165 @opindex freorder-functions
8166 Reorder functions in the object file in order to
8167 improve code locality.  This is implemented by using special
8168 subsections @code{.text.hot} for most frequently executed functions and
8169 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8170 the linker so object file format must support named sections and linker must
8171 place them in a reasonable way.
8173 Also profile feedback must be available to make this option effective.  See
8174 @option{-fprofile-arcs} for details.
8176 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8178 @item -fstrict-aliasing
8179 @opindex fstrict-aliasing
8180 Allow the compiler to assume the strictest aliasing rules applicable to
8181 the language being compiled.  For C (and C++), this activates
8182 optimizations based on the type of expressions.  In particular, an
8183 object of one type is assumed never to reside at the same address as an
8184 object of a different type, unless the types are almost the same.  For
8185 example, an @code{unsigned int} can alias an @code{int}, but not a
8186 @code{void*} or a @code{double}.  A character type may alias any other
8187 type.
8189 @anchor{Type-punning}Pay special attention to code like this:
8190 @smallexample
8191 union a_union @{
8192   int i;
8193   double d;
8196 int f() @{
8197   union a_union t;
8198   t.d = 3.0;
8199   return t.i;
8201 @end smallexample
8202 The practice of reading from a different union member than the one most
8203 recently written to (called ``type-punning'') is common.  Even with
8204 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8205 is accessed through the union type.  So, the code above works as
8206 expected.  @xref{Structures unions enumerations and bit-fields
8207 implementation}.  However, this code might not:
8208 @smallexample
8209 int f() @{
8210   union a_union t;
8211   int* ip;
8212   t.d = 3.0;
8213   ip = &t.i;
8214   return *ip;
8216 @end smallexample
8218 Similarly, access by taking the address, casting the resulting pointer
8219 and dereferencing the result has undefined behavior, even if the cast
8220 uses a union type, e.g.:
8221 @smallexample
8222 int f() @{
8223   double d = 3.0;
8224   return ((union a_union *) &d)->i;
8226 @end smallexample
8228 The @option{-fstrict-aliasing} option is enabled at levels
8229 @option{-O2}, @option{-O3}, @option{-Os}.
8231 @item -fstrict-overflow
8232 @opindex fstrict-overflow
8233 Allow the compiler to assume strict signed overflow rules, depending
8234 on the language being compiled.  For C (and C++) this means that
8235 overflow when doing arithmetic with signed numbers is undefined, which
8236 means that the compiler may assume that it does not happen.  This
8237 permits various optimizations.  For example, the compiler assumes
8238 that an expression like @code{i + 10 > i} is always true for
8239 signed @code{i}.  This assumption is only valid if signed overflow is
8240 undefined, as the expression is false if @code{i + 10} overflows when
8241 using twos complement arithmetic.  When this option is in effect any
8242 attempt to determine whether an operation on signed numbers 
8243 overflows must be written carefully to not actually involve overflow.
8245 This option also allows the compiler to assume strict pointer
8246 semantics: given a pointer to an object, if adding an offset to that
8247 pointer does not produce a pointer to the same object, the addition is
8248 undefined.  This permits the compiler to conclude that @code{p + u >
8249 p} is always true for a pointer @code{p} and unsigned integer
8250 @code{u}.  This assumption is only valid because pointer wraparound is
8251 undefined, as the expression is false if @code{p + u} overflows using
8252 twos complement arithmetic.
8254 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8255 that integer signed overflow is fully defined: it wraps.  When
8256 @option{-fwrapv} is used, there is no difference between
8257 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8258 integers.  With @option{-fwrapv} certain types of overflow are
8259 permitted.  For example, if the compiler gets an overflow when doing
8260 arithmetic on constants, the overflowed value can still be used with
8261 @option{-fwrapv}, but not otherwise.
8263 The @option{-fstrict-overflow} option is enabled at levels
8264 @option{-O2}, @option{-O3}, @option{-Os}.
8266 @item -falign-functions
8267 @itemx -falign-functions=@var{n}
8268 @opindex falign-functions
8269 Align the start of functions to the next power-of-two greater than
8270 @var{n}, skipping up to @var{n} bytes.  For instance,
8271 @option{-falign-functions=32} aligns functions to the next 32-byte
8272 boundary, but @option{-falign-functions=24} aligns to the next
8273 32-byte boundary only if this can be done by skipping 23 bytes or less.
8275 @option{-fno-align-functions} and @option{-falign-functions=1} are
8276 equivalent and mean that functions are not aligned.
8278 Some assemblers only support this flag when @var{n} is a power of two;
8279 in that case, it is rounded up.
8281 If @var{n} is not specified or is zero, use a machine-dependent default.
8283 Enabled at levels @option{-O2}, @option{-O3}.
8285 @item -falign-labels
8286 @itemx -falign-labels=@var{n}
8287 @opindex falign-labels
8288 Align all branch targets to a power-of-two boundary, skipping up to
8289 @var{n} bytes like @option{-falign-functions}.  This option can easily
8290 make code slower, because it must insert dummy operations for when the
8291 branch target is reached in the usual flow of the code.
8293 @option{-fno-align-labels} and @option{-falign-labels=1} are
8294 equivalent and mean that labels are not aligned.
8296 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8297 are greater than this value, then their values are used instead.
8299 If @var{n} is not specified or is zero, use a machine-dependent default
8300 which is very likely to be @samp{1}, meaning no alignment.
8302 Enabled at levels @option{-O2}, @option{-O3}.
8304 @item -falign-loops
8305 @itemx -falign-loops=@var{n}
8306 @opindex falign-loops
8307 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8308 like @option{-falign-functions}.  If the loops are
8309 executed many times, this makes up for any execution of the dummy
8310 operations.
8312 @option{-fno-align-loops} and @option{-falign-loops=1} are
8313 equivalent and mean that loops are not aligned.
8315 If @var{n} is not specified or is zero, use a machine-dependent default.
8317 Enabled at levels @option{-O2}, @option{-O3}.
8319 @item -falign-jumps
8320 @itemx -falign-jumps=@var{n}
8321 @opindex falign-jumps
8322 Align branch targets to a power-of-two boundary, for branch targets
8323 where the targets can only be reached by jumping, skipping up to @var{n}
8324 bytes like @option{-falign-functions}.  In this case, no dummy operations
8325 need be executed.
8327 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8328 equivalent and mean that loops are not aligned.
8330 If @var{n} is not specified or is zero, use a machine-dependent default.
8332 Enabled at levels @option{-O2}, @option{-O3}.
8334 @item -funit-at-a-time
8335 @opindex funit-at-a-time
8336 This option is left for compatibility reasons. @option{-funit-at-a-time}
8337 has no effect, while @option{-fno-unit-at-a-time} implies
8338 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8340 Enabled by default.
8342 @item -fno-toplevel-reorder
8343 @opindex fno-toplevel-reorder
8344 Do not reorder top-level functions, variables, and @code{asm}
8345 statements.  Output them in the same order that they appear in the
8346 input file.  When this option is used, unreferenced static variables
8347 are not removed.  This option is intended to support existing code
8348 that relies on a particular ordering.  For new code, it is better to
8349 use attributes.
8351 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8352 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8353 targets.
8355 @item -fweb
8356 @opindex fweb
8357 Constructs webs as commonly used for register allocation purposes and assign
8358 each web individual pseudo register.  This allows the register allocation pass
8359 to operate on pseudos directly, but also strengthens several other optimization
8360 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8361 however, make debugging impossible, since variables no longer stay in a
8362 ``home register''.
8364 Enabled by default with @option{-funroll-loops}.
8366 @item -fwhole-program
8367 @opindex fwhole-program
8368 Assume that the current compilation unit represents the whole program being
8369 compiled.  All public functions and variables with the exception of @code{main}
8370 and those merged by attribute @code{externally_visible} become static functions
8371 and in effect are optimized more aggressively by interprocedural optimizers.
8373 This option should not be used in combination with @code{-flto}.
8374 Instead relying on a linker plugin should provide safer and more precise
8375 information.
8377 @item -flto[=@var{n}]
8378 @opindex flto
8379 This option runs the standard link-time optimizer.  When invoked
8380 with source code, it generates GIMPLE (one of GCC's internal
8381 representations) and writes it to special ELF sections in the object
8382 file.  When the object files are linked together, all the function
8383 bodies are read from these ELF sections and instantiated as if they
8384 had been part of the same translation unit.
8386 To use the link-time optimizer, @option{-flto} needs to be specified at
8387 compile time and during the final link.  For example:
8389 @smallexample
8390 gcc -c -O2 -flto foo.c
8391 gcc -c -O2 -flto bar.c
8392 gcc -o myprog -flto -O2 foo.o bar.o
8393 @end smallexample
8395 The first two invocations to GCC save a bytecode representation
8396 of GIMPLE into special ELF sections inside @file{foo.o} and
8397 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8398 @file{foo.o} and @file{bar.o}, merges the two files into a single
8399 internal image, and compiles the result as usual.  Since both
8400 @file{foo.o} and @file{bar.o} are merged into a single image, this
8401 causes all the interprocedural analyses and optimizations in GCC to
8402 work across the two files as if they were a single one.  This means,
8403 for example, that the inliner is able to inline functions in
8404 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8406 Another (simpler) way to enable link-time optimization is:
8408 @smallexample
8409 gcc -o myprog -flto -O2 foo.c bar.c
8410 @end smallexample
8412 The above generates bytecode for @file{foo.c} and @file{bar.c},
8413 merges them together into a single GIMPLE representation and optimizes
8414 them as usual to produce @file{myprog}.
8416 The only important thing to keep in mind is that to enable link-time
8417 optimizations the @option{-flto} flag needs to be passed to both the
8418 compile and the link commands.
8420 To make whole program optimization effective, it is necessary to make
8421 certain whole program assumptions.  The compiler needs to know
8422 what functions and variables can be accessed by libraries and runtime
8423 outside of the link-time optimized unit.  When supported by the linker,
8424 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8425 to the compiler about used and externally visible symbols.  When
8426 the linker plugin is not available, @option{-fwhole-program} should be
8427 used to allow the compiler to make these assumptions, which leads
8428 to more aggressive optimization decisions.
8430 Note that when a file is compiled with @option{-flto}, the generated
8431 object file is larger than a regular object file because it 
8432 contains GIMPLE bytecodes and the usual final code.  This means that
8433 object files with LTO information can be linked as normal object
8434 files; if @option{-flto} is not passed to the linker, no
8435 interprocedural optimizations are applied.
8437 Additionally, the optimization flags used to compile individual files
8438 are not necessarily related to those used at link time.  For instance,
8440 @smallexample
8441 gcc -c -O0 -flto foo.c
8442 gcc -c -O0 -flto bar.c
8443 gcc -o myprog -flto -O3 foo.o bar.o
8444 @end smallexample
8446 This produces individual object files with unoptimized assembler
8447 code, but the resulting binary @file{myprog} is optimized at
8448 @option{-O3}.  If, instead, the final binary is generated without
8449 @option{-flto}, then @file{myprog} is not optimized.
8451 When producing the final binary with @option{-flto}, GCC only
8452 applies link-time optimizations to those files that contain bytecode.
8453 Therefore, you can mix and match object files and libraries with
8454 GIMPLE bytecodes and final object code.  GCC automatically selects
8455 which files to optimize in LTO mode and which files to link without
8456 further processing.
8458 There are some code generation flags preserved by GCC when
8459 generating bytecodes, as they need to be used during the final link
8460 stage.  Currently, the following options are saved into the GIMPLE
8461 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8462 @option{-m} target flags.
8464 At link time, these options are read in and reapplied.  Note that the
8465 current implementation makes no attempt to recognize conflicting
8466 values for these options.  If different files have conflicting option
8467 values (e.g., one file is compiled with @option{-fPIC} and another
8468 isn't), the compiler simply uses the last value read from the
8469 bytecode files.  It is recommended, then, that you compile all the files
8470 participating in the same link with the same options.
8472 If LTO encounters objects with C linkage declared with incompatible
8473 types in separate translation units to be linked together (undefined
8474 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8475 issued.  The behavior is still undefined at run time.
8477 Another feature of LTO is that it is possible to apply interprocedural
8478 optimizations on files written in different languages.  This requires
8479 support in the language front end.  Currently, the C, C++ and
8480 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8481 something like this should work:
8483 @smallexample
8484 gcc -c -flto foo.c
8485 g++ -c -flto bar.cc
8486 gfortran -c -flto baz.f90
8487 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8488 @end smallexample
8490 Notice that the final link is done with @command{g++} to get the C++
8491 runtime libraries and @option{-lgfortran} is added to get the Fortran
8492 runtime libraries.  In general, when mixing languages in LTO mode, you
8493 should use the same link command options as when mixing languages in a
8494 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8495 all the compile and link commands.
8497 If object files containing GIMPLE bytecode are stored in a library archive, say
8498 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8499 are using a linker with plugin support.  To enable this feature, use
8500 the flag @option{-fuse-linker-plugin} at link time:
8502 @smallexample
8503 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8504 @end smallexample
8506 With the linker plugin enabled, the linker extracts the needed
8507 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8508 to make them part of the aggregated GIMPLE image to be optimized.
8510 If you are not using a linker with plugin support and/or do not
8511 enable the linker plugin, then the objects inside @file{libfoo.a}
8512 are extracted and linked as usual, but they do not participate
8513 in the LTO optimization process.
8515 Link-time optimizations do not require the presence of the whole program to
8516 operate.  If the program does not require any symbols to be exported, it is
8517 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8518 the interprocedural optimizers to use more aggressive assumptions which may
8519 lead to improved optimization opportunities.
8520 Use of @option{-fwhole-program} is not needed when linker plugin is
8521 active (see @option{-fuse-linker-plugin}).
8523 The current implementation of LTO makes no
8524 attempt to generate bytecode that is portable between different
8525 types of hosts.  The bytecode files are versioned and there is a
8526 strict version check, so bytecode files generated in one version of
8527 GCC will not work with an older/newer version of GCC@.
8529 Link-time optimization does not work well with generation of debugging
8530 information.  Combining @option{-flto} with
8531 @option{-g} is currently experimental and expected to produce wrong
8532 results.
8534 If you specify the optional @var{n}, the optimization and code
8535 generation done at link time is executed in parallel using @var{n}
8536 parallel jobs by utilizing an installed @command{make} program.  The
8537 environment variable @env{MAKE} may be used to override the program
8538 used.  The default value for @var{n} is 1.
8540 You can also specify @option{-flto=jobserver} to use GNU make's
8541 job server mode to determine the number of parallel jobs. This
8542 is useful when the Makefile calling GCC is already executing in parallel.
8543 You must prepend a @samp{+} to the command recipe in the parent Makefile
8544 for this to work.  This option likely only works if @env{MAKE} is
8545 GNU make.
8547 This option is disabled by default.
8549 @item -flto-partition=@var{alg}
8550 @opindex flto-partition
8551 Specify the partitioning algorithm used by the link-time optimizer.
8552 The value is either @code{1to1} to specify a partitioning mirroring
8553 the original source files or @code{balanced} to specify partitioning
8554 into equally sized chunks (whenever possible) or @code{max} to create
8555 new partition for every symbol where possible.  Specifying @code{none}
8556 as an algorithm disables partitioning and streaming completely. 
8557 The default value is @code{balanced}. While @code{1to1} can be used
8558 as an workaround for various code ordering issues, the @code{max}
8559 partitioning is intended for internal testing only.
8561 @item -flto-compression-level=@var{n}
8562 This option specifies the level of compression used for intermediate
8563 language written to LTO object files, and is only meaningful in
8564 conjunction with LTO mode (@option{-flto}).  Valid
8565 values are 0 (no compression) to 9 (maximum compression).  Values
8566 outside this range are clamped to either 0 or 9.  If the option is not
8567 given, a default balanced compression setting is used.
8569 @item -flto-report
8570 Prints a report with internal details on the workings of the link-time
8571 optimizer.  The contents of this report vary from version to version.
8572 It is meant to be useful to GCC developers when processing object
8573 files in LTO mode (via @option{-flto}).
8575 Disabled by default.
8577 @item -flto-report-wpa
8578 Like @option{-flto-report}, but only print for the WPA phase of Link
8579 Time Optimization.
8581 @item -fuse-linker-plugin
8582 Enables the use of a linker plugin during link-time optimization.  This
8583 option relies on plugin support in the linker, which is available in gold
8584 or in GNU ld 2.21 or newer.
8586 This option enables the extraction of object files with GIMPLE bytecode out
8587 of library archives. This improves the quality of optimization by exposing
8588 more code to the link-time optimizer.  This information specifies what
8589 symbols can be accessed externally (by non-LTO object or during dynamic
8590 linking).  Resulting code quality improvements on binaries (and shared
8591 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8592 See @option{-flto} for a description of the effect of this flag and how to
8593 use it.
8595 This option is enabled by default when LTO support in GCC is enabled
8596 and GCC was configured for use with
8597 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8599 @item -ffat-lto-objects
8600 @opindex ffat-lto-objects
8601 Fat LTO objects are object files that contain both the intermediate language
8602 and the object code. This makes them usable for both LTO linking and normal
8603 linking. This option is effective only when compiling with @option{-flto}
8604 and is ignored at link time.
8606 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8607 requires the complete toolchain to be aware of LTO. It requires a linker with
8608 linker plugin support for basic functionality.  Additionally,
8609 @command{nm}, @command{ar} and @command{ranlib}
8610 need to support linker plugins to allow a full-featured build environment
8611 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8612 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8613 to these tools. With non fat LTO makefiles need to be modified to use them.
8615 The default is @option{-ffat-lto-objects} but this default is intended to
8616 change in future releases when linker plugin enabled environments become more
8617 common.
8619 @item -fcompare-elim
8620 @opindex fcompare-elim
8621 After register allocation and post-register allocation instruction splitting,
8622 identify arithmetic instructions that compute processor flags similar to a
8623 comparison operation based on that arithmetic.  If possible, eliminate the
8624 explicit comparison operation.
8626 This pass only applies to certain targets that cannot explicitly represent
8627 the comparison operation before register allocation is complete.
8629 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8631 @item -fuse-ld=bfd
8632 Use the @command{bfd} linker instead of the default linker.
8634 @item -fuse-ld=gold
8635 Use the @command{gold} linker instead of the default linker.
8637 @item -fcprop-registers
8638 @opindex fcprop-registers
8639 After register allocation and post-register allocation instruction splitting,
8640 perform a copy-propagation pass to try to reduce scheduling dependencies
8641 and occasionally eliminate the copy.
8643 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8645 @item -fprofile-correction
8646 @opindex fprofile-correction
8647 Profiles collected using an instrumented binary for multi-threaded programs may
8648 be inconsistent due to missed counter updates. When this option is specified,
8649 GCC uses heuristics to correct or smooth out such inconsistencies. By
8650 default, GCC emits an error message when an inconsistent profile is detected.
8652 @item -fprofile-dir=@var{path}
8653 @opindex fprofile-dir
8655 Set the directory to search for the profile data files in to @var{path}.
8656 This option affects only the profile data generated by
8657 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8658 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8659 and its related options.  Both absolute and relative paths can be used.
8660 By default, GCC uses the current directory as @var{path}, thus the
8661 profile data file appears in the same directory as the object file.
8663 @item -fprofile-generate
8664 @itemx -fprofile-generate=@var{path}
8665 @opindex fprofile-generate
8667 Enable options usually used for instrumenting application to produce
8668 profile useful for later recompilation with profile feedback based
8669 optimization.  You must use @option{-fprofile-generate} both when
8670 compiling and when linking your program.
8672 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8674 If @var{path} is specified, GCC looks at the @var{path} to find
8675 the profile feedback data files. See @option{-fprofile-dir}.
8677 @item -fprofile-use
8678 @itemx -fprofile-use=@var{path}
8679 @opindex fprofile-use
8680 Enable profile feedback directed optimizations, and optimizations
8681 generally profitable only with profile feedback available.
8683 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8684 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8685 @code{ftree-loop-distribute-patterns}
8687 By default, GCC emits an error message if the feedback profiles do not
8688 match the source code.  This error can be turned into a warning by using
8689 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8690 code.
8692 If @var{path} is specified, GCC looks at the @var{path} to find
8693 the profile feedback data files. See @option{-fprofile-dir}.
8694 @end table
8696 The following options control compiler behavior regarding floating-point 
8697 arithmetic.  These options trade off between speed and
8698 correctness.  All must be specifically enabled.
8700 @table @gcctabopt
8701 @item -ffloat-store
8702 @opindex ffloat-store
8703 Do not store floating-point variables in registers, and inhibit other
8704 options that might change whether a floating-point value is taken from a
8705 register or memory.
8707 @cindex floating-point precision
8708 This option prevents undesirable excess precision on machines such as
8709 the 68000 where the floating registers (of the 68881) keep more
8710 precision than a @code{double} is supposed to have.  Similarly for the
8711 x86 architecture.  For most programs, the excess precision does only
8712 good, but a few programs rely on the precise definition of IEEE floating
8713 point.  Use @option{-ffloat-store} for such programs, after modifying
8714 them to store all pertinent intermediate computations into variables.
8716 @item -fexcess-precision=@var{style}
8717 @opindex fexcess-precision
8718 This option allows further control over excess precision on machines
8719 where floating-point registers have more precision than the IEEE
8720 @code{float} and @code{double} types and the processor does not
8721 support operations rounding to those types.  By default,
8722 @option{-fexcess-precision=fast} is in effect; this means that
8723 operations are carried out in the precision of the registers and that
8724 it is unpredictable when rounding to the types specified in the source
8725 code takes place.  When compiling C, if
8726 @option{-fexcess-precision=standard} is specified then excess
8727 precision follows the rules specified in ISO C99; in particular,
8728 both casts and assignments cause values to be rounded to their
8729 semantic types (whereas @option{-ffloat-store} only affects
8730 assignments).  This option is enabled by default for C if a strict
8731 conformance option such as @option{-std=c99} is used.
8733 @opindex mfpmath
8734 @option{-fexcess-precision=standard} is not implemented for languages
8735 other than C, and has no effect if
8736 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8737 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8738 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8739 semantics apply without excess precision, and in the latter, rounding
8740 is unpredictable.
8742 @item -ffast-math
8743 @opindex ffast-math
8744 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8745 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8746 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8748 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8750 This option is not turned on by any @option{-O} option besides
8751 @option{-Ofast} since it can result in incorrect output for programs
8752 that depend on an exact implementation of IEEE or ISO rules/specifications
8753 for math functions. It may, however, yield faster code for programs
8754 that do not require the guarantees of these specifications.
8756 @item -fno-math-errno
8757 @opindex fno-math-errno
8758 Do not set @code{errno} after calling math functions that are executed
8759 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8760 IEEE exceptions for math error handling may want to use this flag
8761 for speed while maintaining IEEE arithmetic compatibility.
8763 This option is not turned on by any @option{-O} option since
8764 it can result in incorrect output for programs that depend on
8765 an exact implementation of IEEE or ISO rules/specifications for
8766 math functions. It may, however, yield faster code for programs
8767 that do not require the guarantees of these specifications.
8769 The default is @option{-fmath-errno}.
8771 On Darwin systems, the math library never sets @code{errno}.  There is
8772 therefore no reason for the compiler to consider the possibility that
8773 it might, and @option{-fno-math-errno} is the default.
8775 @item -funsafe-math-optimizations
8776 @opindex funsafe-math-optimizations
8778 Allow optimizations for floating-point arithmetic that (a) assume
8779 that arguments and results are valid and (b) may violate IEEE or
8780 ANSI standards.  When used at link-time, it may include libraries
8781 or startup files that change the default FPU control word or other
8782 similar optimizations.
8784 This option is not turned on by any @option{-O} option since
8785 it can result in incorrect output for programs that depend on
8786 an exact implementation of IEEE or ISO rules/specifications for
8787 math functions. It may, however, yield faster code for programs
8788 that do not require the guarantees of these specifications.
8789 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8790 @option{-fassociative-math} and @option{-freciprocal-math}.
8792 The default is @option{-fno-unsafe-math-optimizations}.
8794 @item -fassociative-math
8795 @opindex fassociative-math
8797 Allow re-association of operands in series of floating-point operations.
8798 This violates the ISO C and C++ language standard by possibly changing
8799 computation result.  NOTE: re-ordering may change the sign of zero as
8800 well as ignore NaNs and inhibit or create underflow or overflow (and
8801 thus cannot be used on code that relies on rounding behavior like
8802 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8803 and thus may not be used when ordered comparisons are required.
8804 This option requires that both @option{-fno-signed-zeros} and
8805 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8806 much sense with @option{-frounding-math}. For Fortran the option
8807 is automatically enabled when both @option{-fno-signed-zeros} and
8808 @option{-fno-trapping-math} are in effect.
8810 The default is @option{-fno-associative-math}.
8812 @item -freciprocal-math
8813 @opindex freciprocal-math
8815 Allow the reciprocal of a value to be used instead of dividing by
8816 the value if this enables optimizations.  For example @code{x / y}
8817 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8818 is subject to common subexpression elimination.  Note that this loses
8819 precision and increases the number of flops operating on the value.
8821 The default is @option{-fno-reciprocal-math}.
8823 @item -ffinite-math-only
8824 @opindex ffinite-math-only
8825 Allow optimizations for floating-point arithmetic that assume
8826 that arguments and results are not NaNs or +-Infs.
8828 This option is not turned on by any @option{-O} option since
8829 it can result in incorrect output for programs that depend on
8830 an exact implementation of IEEE or ISO rules/specifications for
8831 math functions. It may, however, yield faster code for programs
8832 that do not require the guarantees of these specifications.
8834 The default is @option{-fno-finite-math-only}.
8836 @item -fno-signed-zeros
8837 @opindex fno-signed-zeros
8838 Allow optimizations for floating-point arithmetic that ignore the
8839 signedness of zero.  IEEE arithmetic specifies the behavior of
8840 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8841 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8842 This option implies that the sign of a zero result isn't significant.
8844 The default is @option{-fsigned-zeros}.
8846 @item -fno-trapping-math
8847 @opindex fno-trapping-math
8848 Compile code assuming that floating-point operations cannot generate
8849 user-visible traps.  These traps include division by zero, overflow,
8850 underflow, inexact result and invalid operation.  This option requires
8851 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8852 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8854 This option should never be turned on by any @option{-O} option since
8855 it can result in incorrect output for programs that depend on
8856 an exact implementation of IEEE or ISO rules/specifications for
8857 math functions.
8859 The default is @option{-ftrapping-math}.
8861 @item -frounding-math
8862 @opindex frounding-math
8863 Disable transformations and optimizations that assume default floating-point
8864 rounding behavior.  This is round-to-zero for all floating point
8865 to integer conversions, and round-to-nearest for all other arithmetic
8866 truncations.  This option should be specified for programs that change
8867 the FP rounding mode dynamically, or that may be executed with a
8868 non-default rounding mode.  This option disables constant folding of
8869 floating-point expressions at compile time (which may be affected by
8870 rounding mode) and arithmetic transformations that are unsafe in the
8871 presence of sign-dependent rounding modes.
8873 The default is @option{-fno-rounding-math}.
8875 This option is experimental and does not currently guarantee to
8876 disable all GCC optimizations that are affected by rounding mode.
8877 Future versions of GCC may provide finer control of this setting
8878 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8879 will be used to specify the default state for @code{FENV_ACCESS}.
8881 @item -fsignaling-nans
8882 @opindex fsignaling-nans
8883 Compile code assuming that IEEE signaling NaNs may generate user-visible
8884 traps during floating-point operations.  Setting this option disables
8885 optimizations that may change the number of exceptions visible with
8886 signaling NaNs.  This option implies @option{-ftrapping-math}.
8888 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8889 be defined.
8891 The default is @option{-fno-signaling-nans}.
8893 This option is experimental and does not currently guarantee to
8894 disable all GCC optimizations that affect signaling NaN behavior.
8896 @item -fsingle-precision-constant
8897 @opindex fsingle-precision-constant
8898 Treat floating-point constants as single precision instead of
8899 implicitly converting them to double-precision constants.
8901 @item -fcx-limited-range
8902 @opindex fcx-limited-range
8903 When enabled, this option states that a range reduction step is not
8904 needed when performing complex division.  Also, there is no checking
8905 whether the result of a complex multiplication or division is @code{NaN
8906 + I*NaN}, with an attempt to rescue the situation in that case.  The
8907 default is @option{-fno-cx-limited-range}, but is enabled by
8908 @option{-ffast-math}.
8910 This option controls the default setting of the ISO C99
8911 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8912 all languages.
8914 @item -fcx-fortran-rules
8915 @opindex fcx-fortran-rules
8916 Complex multiplication and division follow Fortran rules.  Range
8917 reduction is done as part of complex division, but there is no checking
8918 whether the result of a complex multiplication or division is @code{NaN
8919 + I*NaN}, with an attempt to rescue the situation in that case.
8921 The default is @option{-fno-cx-fortran-rules}.
8923 @end table
8925 The following options control optimizations that may improve
8926 performance, but are not enabled by any @option{-O} options.  This
8927 section includes experimental options that may produce broken code.
8929 @table @gcctabopt
8930 @item -fbranch-probabilities
8931 @opindex fbranch-probabilities
8932 After running a program compiled with @option{-fprofile-arcs}
8933 (@pxref{Debugging Options,, Options for Debugging Your Program or
8934 @command{gcc}}), you can compile it a second time using
8935 @option{-fbranch-probabilities}, to improve optimizations based on
8936 the number of times each branch was taken.  When a program
8937 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8938 counts to a file called @file{@var{sourcename}.gcda} for each source
8939 file.  The information in this data file is very dependent on the
8940 structure of the generated code, so you must use the same source code
8941 and the same optimization options for both compilations.
8943 With @option{-fbranch-probabilities}, GCC puts a
8944 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8945 These can be used to improve optimization.  Currently, they are only
8946 used in one place: in @file{reorg.c}, instead of guessing which path a
8947 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8948 exactly determine which path is taken more often.
8950 @item -fprofile-values
8951 @opindex fprofile-values
8952 If combined with @option{-fprofile-arcs}, it adds code so that some
8953 data about values of expressions in the program is gathered.
8955 With @option{-fbranch-probabilities}, it reads back the data gathered
8956 from profiling values of expressions for usage in optimizations.
8958 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8960 @item -fvpt
8961 @opindex fvpt
8962 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8963 to add code to gather information about values of expressions.
8965 With @option{-fbranch-probabilities}, it reads back the data gathered
8966 and actually performs the optimizations based on them.
8967 Currently the optimizations include specialization of division operations
8968 using the knowledge about the value of the denominator.
8970 @item -frename-registers
8971 @opindex frename-registers
8972 Attempt to avoid false dependencies in scheduled code by making use
8973 of registers left over after register allocation.  This optimization
8974 most benefits processors with lots of registers.  Depending on the
8975 debug information format adopted by the target, however, it can
8976 make debugging impossible, since variables no longer stay in
8977 a ``home register''.
8979 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8981 @item -ftracer
8982 @opindex ftracer
8983 Perform tail duplication to enlarge superblock size.  This transformation
8984 simplifies the control flow of the function allowing other optimizations to do
8985 a better job.
8987 Enabled with @option{-fprofile-use}.
8989 @item -funroll-loops
8990 @opindex funroll-loops
8991 Unroll loops whose number of iterations can be determined at compile time or
8992 upon entry to the loop.  @option{-funroll-loops} implies
8993 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8994 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8995 a small constant number of iterations).  This option makes code larger, and may
8996 or may not make it run faster.
8998 Enabled with @option{-fprofile-use}.
9000 @item -funroll-all-loops
9001 @opindex funroll-all-loops
9002 Unroll all loops, even if their number of iterations is uncertain when
9003 the loop is entered.  This usually makes programs run more slowly.
9004 @option{-funroll-all-loops} implies the same options as
9005 @option{-funroll-loops}.
9007 @item -fpeel-loops
9008 @opindex fpeel-loops
9009 Peels loops for which there is enough information that they do not
9010 roll much (from profile feedback).  It also turns on complete loop peeling
9011 (i.e.@: complete removal of loops with small constant number of iterations).
9013 Enabled with @option{-fprofile-use}.
9015 @item -fmove-loop-invariants
9016 @opindex fmove-loop-invariants
9017 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9018 at level @option{-O1}
9020 @item -funswitch-loops
9021 @opindex funswitch-loops
9022 Move branches with loop invariant conditions out of the loop, with duplicates
9023 of the loop on both branches (modified according to result of the condition).
9025 @item -ffunction-sections
9026 @itemx -fdata-sections
9027 @opindex ffunction-sections
9028 @opindex fdata-sections
9029 Place each function or data item into its own section in the output
9030 file if the target supports arbitrary sections.  The name of the
9031 function or the name of the data item determines the section's name
9032 in the output file.
9034 Use these options on systems where the linker can perform optimizations
9035 to improve locality of reference in the instruction space.  Most systems
9036 using the ELF object format and SPARC processors running Solaris 2 have
9037 linkers with such optimizations.  AIX may have these optimizations in
9038 the future.
9040 Only use these options when there are significant benefits from doing
9041 so.  When you specify these options, the assembler and linker
9042 create larger object and executable files and are also slower.
9043 You cannot use @code{gprof} on all systems if you
9044 specify this option, and you may have problems with debugging if
9045 you specify both this option and @option{-g}.
9047 @item -fbranch-target-load-optimize
9048 @opindex fbranch-target-load-optimize
9049 Perform branch target register load optimization before prologue / epilogue
9050 threading.
9051 The use of target registers can typically be exposed only during reload,
9052 thus hoisting loads out of loops and doing inter-block scheduling needs
9053 a separate optimization pass.
9055 @item -fbranch-target-load-optimize2
9056 @opindex fbranch-target-load-optimize2
9057 Perform branch target register load optimization after prologue / epilogue
9058 threading.
9060 @item -fbtr-bb-exclusive
9061 @opindex fbtr-bb-exclusive
9062 When performing branch target register load optimization, don't reuse
9063 branch target registers within any basic block.
9065 @item -fstack-protector
9066 @opindex fstack-protector
9067 Emit extra code to check for buffer overflows, such as stack smashing
9068 attacks.  This is done by adding a guard variable to functions with
9069 vulnerable objects.  This includes functions that call @code{alloca}, and
9070 functions with buffers larger than 8 bytes.  The guards are initialized
9071 when a function is entered and then checked when the function exits.
9072 If a guard check fails, an error message is printed and the program exits.
9074 @item -fstack-protector-all
9075 @opindex fstack-protector-all
9076 Like @option{-fstack-protector} except that all functions are protected.
9078 @item -fstack-protector-strong
9079 @opindex fstack-protector-strong
9080 Like @option{-fstack-protector} but includes additional functions to
9081 be protected --- those that have local array definitions, or have
9082 references to local frame addresses.
9084 @item -fsection-anchors
9085 @opindex fsection-anchors
9086 Try to reduce the number of symbolic address calculations by using
9087 shared ``anchor'' symbols to address nearby objects.  This transformation
9088 can help to reduce the number of GOT entries and GOT accesses on some
9089 targets.
9091 For example, the implementation of the following function @code{foo}:
9093 @smallexample
9094 static int a, b, c;
9095 int foo (void) @{ return a + b + c; @}
9096 @end smallexample
9098 @noindent
9099 usually calculates the addresses of all three variables, but if you
9100 compile it with @option{-fsection-anchors}, it accesses the variables
9101 from a common anchor point instead.  The effect is similar to the
9102 following pseudocode (which isn't valid C):
9104 @smallexample
9105 int foo (void)
9107   register int *xr = &x;
9108   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9110 @end smallexample
9112 Not all targets support this option.
9114 @item --param @var{name}=@var{value}
9115 @opindex param
9116 In some places, GCC uses various constants to control the amount of
9117 optimization that is done.  For example, GCC does not inline functions
9118 that contain more than a certain number of instructions.  You can
9119 control some of these constants on the command line using the
9120 @option{--param} option.
9122 The names of specific parameters, and the meaning of the values, are
9123 tied to the internals of the compiler, and are subject to change
9124 without notice in future releases.
9126 In each case, the @var{value} is an integer.  The allowable choices for
9127 @var{name} are:
9129 @table @gcctabopt
9130 @item predictable-branch-outcome
9131 When branch is predicted to be taken with probability lower than this threshold
9132 (in percent), then it is considered well predictable. The default is 10.
9134 @item max-crossjump-edges
9135 The maximum number of incoming edges to consider for cross-jumping.
9136 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9137 the number of edges incoming to each block.  Increasing values mean
9138 more aggressive optimization, making the compilation time increase with
9139 probably small improvement in executable size.
9141 @item min-crossjump-insns
9142 The minimum number of instructions that must be matched at the end
9143 of two blocks before cross-jumping is performed on them.  This
9144 value is ignored in the case where all instructions in the block being
9145 cross-jumped from are matched.  The default value is 5.
9147 @item max-grow-copy-bb-insns
9148 The maximum code size expansion factor when copying basic blocks
9149 instead of jumping.  The expansion is relative to a jump instruction.
9150 The default value is 8.
9152 @item max-goto-duplication-insns
9153 The maximum number of instructions to duplicate to a block that jumps
9154 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9155 passes, GCC factors computed gotos early in the compilation process,
9156 and unfactors them as late as possible.  Only computed jumps at the
9157 end of a basic blocks with no more than max-goto-duplication-insns are
9158 unfactored.  The default value is 8.
9160 @item max-delay-slot-insn-search
9161 The maximum number of instructions to consider when looking for an
9162 instruction to fill a delay slot.  If more than this arbitrary number of
9163 instructions are searched, the time savings from filling the delay slot
9164 are minimal, so stop searching.  Increasing values mean more
9165 aggressive optimization, making the compilation time increase with probably
9166 small improvement in execution time.
9168 @item max-delay-slot-live-search
9169 When trying to fill delay slots, the maximum number of instructions to
9170 consider when searching for a block with valid live register
9171 information.  Increasing this arbitrarily chosen value means more
9172 aggressive optimization, increasing the compilation time.  This parameter
9173 should be removed when the delay slot code is rewritten to maintain the
9174 control-flow graph.
9176 @item max-gcse-memory
9177 The approximate maximum amount of memory that can be allocated in
9178 order to perform the global common subexpression elimination
9179 optimization.  If more memory than specified is required, the
9180 optimization is not done.
9182 @item max-gcse-insertion-ratio
9183 If the ratio of expression insertions to deletions is larger than this value
9184 for any expression, then RTL PRE inserts or removes the expression and thus
9185 leaves partially redundant computations in the instruction stream.  The default value is 20.
9187 @item max-pending-list-length
9188 The maximum number of pending dependencies scheduling allows
9189 before flushing the current state and starting over.  Large functions
9190 with few branches or calls can create excessively large lists which
9191 needlessly consume memory and resources.
9193 @item max-modulo-backtrack-attempts
9194 The maximum number of backtrack attempts the scheduler should make
9195 when modulo scheduling a loop.  Larger values can exponentially increase
9196 compilation time.
9198 @item max-inline-insns-single
9199 Several parameters control the tree inliner used in GCC@.
9200 This number sets the maximum number of instructions (counted in GCC's
9201 internal representation) in a single function that the tree inliner
9202 considers for inlining.  This only affects functions declared
9203 inline and methods implemented in a class declaration (C++).
9204 The default value is 400.
9206 @item max-inline-insns-auto
9207 When you use @option{-finline-functions} (included in @option{-O3}),
9208 a lot of functions that would otherwise not be considered for inlining
9209 by the compiler are investigated.  To those functions, a different
9210 (more restrictive) limit compared to functions declared inline can
9211 be applied.
9212 The default value is 40.
9214 @item inline-min-speedup
9215 When estimated performance improvement of caller + callee runtime exceeds this
9216 threshold (in precent), the function can be inlined regardless the limit on
9217 @option{--param max-inline-insns-single} and @option{--param
9218 max-inline-insns-auto}.
9220 @item large-function-insns
9221 The limit specifying really large functions.  For functions larger than this
9222 limit after inlining, inlining is constrained by
9223 @option{--param large-function-growth}.  This parameter is useful primarily
9224 to avoid extreme compilation time caused by non-linear algorithms used by the
9225 back end.
9226 The default value is 2700.
9228 @item large-function-growth
9229 Specifies maximal growth of large function caused by inlining in percents.
9230 The default value is 100 which limits large function growth to 2.0 times
9231 the original size.
9233 @item large-unit-insns
9234 The limit specifying large translation unit.  Growth caused by inlining of
9235 units larger than this limit is limited by @option{--param inline-unit-growth}.
9236 For small units this might be too tight.
9237 For example, consider a unit consisting of function A
9238 that is inline and B that just calls A three times.  If B is small relative to
9239 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9240 large units consisting of small inlineable functions, however, the overall unit
9241 growth limit is needed to avoid exponential explosion of code size.  Thus for
9242 smaller units, the size is increased to @option{--param large-unit-insns}
9243 before applying @option{--param inline-unit-growth}.  The default is 10000.
9245 @item inline-unit-growth
9246 Specifies maximal overall growth of the compilation unit caused by inlining.
9247 The default value is 30 which limits unit growth to 1.3 times the original
9248 size.
9250 @item ipcp-unit-growth
9251 Specifies maximal overall growth of the compilation unit caused by
9252 interprocedural constant propagation.  The default value is 10 which limits
9253 unit growth to 1.1 times the original size.
9255 @item large-stack-frame
9256 The limit specifying large stack frames.  While inlining the algorithm is trying
9257 to not grow past this limit too much.  The default value is 256 bytes.
9259 @item large-stack-frame-growth
9260 Specifies maximal growth of large stack frames caused by inlining in percents.
9261 The default value is 1000 which limits large stack frame growth to 11 times
9262 the original size.
9264 @item max-inline-insns-recursive
9265 @itemx max-inline-insns-recursive-auto
9266 Specifies the maximum number of instructions an out-of-line copy of a
9267 self-recursive inline
9268 function can grow into by performing recursive inlining.
9270 For functions declared inline, @option{--param max-inline-insns-recursive} is
9271 taken into account.  For functions not declared inline, recursive inlining
9272 happens only when @option{-finline-functions} (included in @option{-O3}) is
9273 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9274 default value is 450.
9276 @item max-inline-recursive-depth
9277 @itemx max-inline-recursive-depth-auto
9278 Specifies the maximum recursion depth used for recursive inlining.
9280 For functions declared inline, @option{--param max-inline-recursive-depth} is
9281 taken into account.  For functions not declared inline, recursive inlining
9282 happens only when @option{-finline-functions} (included in @option{-O3}) is
9283 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9284 default value is 8.
9286 @item min-inline-recursive-probability
9287 Recursive inlining is profitable only for function having deep recursion
9288 in average and can hurt for function having little recursion depth by
9289 increasing the prologue size or complexity of function body to other
9290 optimizers.
9292 When profile feedback is available (see @option{-fprofile-generate}) the actual
9293 recursion depth can be guessed from probability that function recurses via a
9294 given call expression.  This parameter limits inlining only to call expressions
9295 whose probability exceeds the given threshold (in percents).
9296 The default value is 10.
9298 @item early-inlining-insns
9299 Specify growth that the early inliner can make.  In effect it increases
9300 the amount of inlining for code having a large abstraction penalty.
9301 The default value is 10.
9303 @item max-early-inliner-iterations
9304 @itemx max-early-inliner-iterations
9305 Limit of iterations of the early inliner.  This basically bounds
9306 the number of nested indirect calls the early inliner can resolve.
9307 Deeper chains are still handled by late inlining.
9309 @item comdat-sharing-probability
9310 @itemx comdat-sharing-probability
9311 Probability (in percent) that C++ inline function with comdat visibility
9312 are shared across multiple compilation units.  The default value is 20.
9314 @item min-vect-loop-bound
9315 The minimum number of iterations under which loops are not vectorized
9316 when @option{-ftree-vectorize} is used.  The number of iterations after
9317 vectorization needs to be greater than the value specified by this option
9318 to allow vectorization.  The default value is 0.
9320 @item gcse-cost-distance-ratio
9321 Scaling factor in calculation of maximum distance an expression
9322 can be moved by GCSE optimizations.  This is currently supported only in the
9323 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9324 is with simple expressions, i.e., the expressions that have cost
9325 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9326 hoisting of simple expressions.  The default value is 10.
9328 @item gcse-unrestricted-cost
9329 Cost, roughly measured as the cost of a single typical machine
9330 instruction, at which GCSE optimizations do not constrain
9331 the distance an expression can travel.  This is currently
9332 supported only in the code hoisting pass.  The lesser the cost,
9333 the more aggressive code hoisting is.  Specifying 0 
9334 allows all expressions to travel unrestricted distances.
9335 The default value is 3.
9337 @item max-hoist-depth
9338 The depth of search in the dominator tree for expressions to hoist.
9339 This is used to avoid quadratic behavior in hoisting algorithm.
9340 The value of 0 does not limit on the search, but may slow down compilation
9341 of huge functions.  The default value is 30.
9343 @item max-tail-merge-comparisons
9344 The maximum amount of similar bbs to compare a bb with.  This is used to
9345 avoid quadratic behavior in tree tail merging.  The default value is 10.
9347 @item max-tail-merge-iterations
9348 The maximum amount of iterations of the pass over the function.  This is used to
9349 limit compilation time in tree tail merging.  The default value is 2.
9351 @item max-unrolled-insns
9352 The maximum number of instructions that a loop may have to be unrolled.
9353 If a loop is unrolled, this parameter also determines how many times
9354 the loop code is unrolled.
9356 @item max-average-unrolled-insns
9357 The maximum number of instructions biased by probabilities of their execution
9358 that a loop may have to be unrolled.  If a loop is unrolled,
9359 this parameter also determines how many times the loop code is unrolled.
9361 @item max-unroll-times
9362 The maximum number of unrollings of a single loop.
9364 @item max-peeled-insns
9365 The maximum number of instructions that a loop may have to be peeled.
9366 If a loop is peeled, this parameter also determines how many times
9367 the loop code is peeled.
9369 @item max-peel-times
9370 The maximum number of peelings of a single loop.
9372 @item max-peel-branches
9373 The maximum number of branches on the hot path through the peeled sequence.
9375 @item max-completely-peeled-insns
9376 The maximum number of insns of a completely peeled loop.
9378 @item max-completely-peel-times
9379 The maximum number of iterations of a loop to be suitable for complete peeling.
9381 @item max-completely-peel-loop-nest-depth
9382 The maximum depth of a loop nest suitable for complete peeling.
9384 @item max-unswitch-insns
9385 The maximum number of insns of an unswitched loop.
9387 @item max-unswitch-level
9388 The maximum number of branches unswitched in a single loop.
9390 @item lim-expensive
9391 The minimum cost of an expensive expression in the loop invariant motion.
9393 @item iv-consider-all-candidates-bound
9394 Bound on number of candidates for induction variables, below which
9395 all candidates are considered for each use in induction variable
9396 optimizations.  If there are more candidates than this,
9397 only the most relevant ones are considered to avoid quadratic time complexity.
9399 @item iv-max-considered-uses
9400 The induction variable optimizations give up on loops that contain more
9401 induction variable uses.
9403 @item iv-always-prune-cand-set-bound
9404 If the number of candidates in the set is smaller than this value,
9405 always try to remove unnecessary ivs from the set
9406 when adding a new one.
9408 @item scev-max-expr-size
9409 Bound on size of expressions used in the scalar evolutions analyzer.
9410 Large expressions slow the analyzer.
9412 @item scev-max-expr-complexity
9413 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9414 Complex expressions slow the analyzer.
9416 @item omega-max-vars
9417 The maximum number of variables in an Omega constraint system.
9418 The default value is 128.
9420 @item omega-max-geqs
9421 The maximum number of inequalities in an Omega constraint system.
9422 The default value is 256.
9424 @item omega-max-eqs
9425 The maximum number of equalities in an Omega constraint system.
9426 The default value is 128.
9428 @item omega-max-wild-cards
9429 The maximum number of wildcard variables that the Omega solver is
9430 able to insert.  The default value is 18.
9432 @item omega-hash-table-size
9433 The size of the hash table in the Omega solver.  The default value is
9434 550.
9436 @item omega-max-keys
9437 The maximal number of keys used by the Omega solver.  The default
9438 value is 500.
9440 @item omega-eliminate-redundant-constraints
9441 When set to 1, use expensive methods to eliminate all redundant
9442 constraints.  The default value is 0.
9444 @item vect-max-version-for-alignment-checks
9445 The maximum number of run-time checks that can be performed when
9446 doing loop versioning for alignment in the vectorizer.  See option
9447 @option{-ftree-vect-loop-version} for more information.
9449 @item vect-max-version-for-alias-checks
9450 The maximum number of run-time checks that can be performed when
9451 doing loop versioning for alias in the vectorizer.  See option
9452 @option{-ftree-vect-loop-version} for more information.
9454 @item vect-max-peeling-for-alignment
9455 The maximum number of loop peels to enhance access alignment
9456 for vectorizer. Value -1 means 'no limit'.
9458 @item max-iterations-to-track
9459 The maximum number of iterations of a loop the brute-force algorithm
9460 for analysis of the number of iterations of the loop tries to evaluate.
9462 @item hot-bb-count-ws-permille
9463 A basic block profile count is considered hot if it contributes to 
9464 the given permillage (i.e. 0...1000) of the entire profiled execution.
9466 @item hot-bb-frequency-fraction
9467 Select fraction of the entry block frequency of executions of basic block in
9468 function given basic block needs to have to be considered hot.
9470 @item max-predicted-iterations
9471 The maximum number of loop iterations we predict statically.  This is useful
9472 in cases where a function contains a single loop with known bound and
9473 another loop with unknown bound.
9474 The known number of iterations is predicted correctly, while
9475 the unknown number of iterations average to roughly 10.  This means that the
9476 loop without bounds appears artificially cold relative to the other one.
9478 @item align-threshold
9480 Select fraction of the maximal frequency of executions of a basic block in
9481 a function to align the basic block.
9483 @item align-loop-iterations
9485 A loop expected to iterate at least the selected number of iterations is
9486 aligned.
9488 @item tracer-dynamic-coverage
9489 @itemx tracer-dynamic-coverage-feedback
9491 This value is used to limit superblock formation once the given percentage of
9492 executed instructions is covered.  This limits unnecessary code size
9493 expansion.
9495 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9496 feedback is available.  The real profiles (as opposed to statically estimated
9497 ones) are much less balanced allowing the threshold to be larger value.
9499 @item tracer-max-code-growth
9500 Stop tail duplication once code growth has reached given percentage.  This is
9501 a rather artificial limit, as most of the duplicates are eliminated later in
9502 cross jumping, so it may be set to much higher values than is the desired code
9503 growth.
9505 @item tracer-min-branch-ratio
9507 Stop reverse growth when the reverse probability of best edge is less than this
9508 threshold (in percent).
9510 @item tracer-min-branch-ratio
9511 @itemx tracer-min-branch-ratio-feedback
9513 Stop forward growth if the best edge has probability lower than this
9514 threshold.
9516 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9517 compilation for profile feedback and one for compilation without.  The value
9518 for compilation with profile feedback needs to be more conservative (higher) in
9519 order to make tracer effective.
9521 @item max-cse-path-length
9523 The maximum number of basic blocks on path that CSE considers.
9524 The default is 10.
9526 @item max-cse-insns
9527 The maximum number of instructions CSE processes before flushing.
9528 The default is 1000.
9530 @item ggc-min-expand
9532 GCC uses a garbage collector to manage its own memory allocation.  This
9533 parameter specifies the minimum percentage by which the garbage
9534 collector's heap should be allowed to expand between collections.
9535 Tuning this may improve compilation speed; it has no effect on code
9536 generation.
9538 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9539 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9540 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9541 GCC is not able to calculate RAM on a particular platform, the lower
9542 bound of 30% is used.  Setting this parameter and
9543 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9544 every opportunity.  This is extremely slow, but can be useful for
9545 debugging.
9547 @item ggc-min-heapsize
9549 Minimum size of the garbage collector's heap before it begins bothering
9550 to collect garbage.  The first collection occurs after the heap expands
9551 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9552 tuning this may improve compilation speed, and has no effect on code
9553 generation.
9555 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9556 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9557 with a lower bound of 4096 (four megabytes) and an upper bound of
9558 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9559 particular platform, the lower bound is used.  Setting this parameter
9560 very large effectively disables garbage collection.  Setting this
9561 parameter and @option{ggc-min-expand} to zero causes a full collection
9562 to occur at every opportunity.
9564 @item max-reload-search-insns
9565 The maximum number of instruction reload should look backward for equivalent
9566 register.  Increasing values mean more aggressive optimization, making the
9567 compilation time increase with probably slightly better performance.
9568 The default value is 100.
9570 @item max-cselib-memory-locations
9571 The maximum number of memory locations cselib should take into account.
9572 Increasing values mean more aggressive optimization, making the compilation time
9573 increase with probably slightly better performance.  The default value is 500.
9575 @item reorder-blocks-duplicate
9576 @itemx reorder-blocks-duplicate-feedback
9578 Used by the basic block reordering pass to decide whether to use unconditional
9579 branch or duplicate the code on its destination.  Code is duplicated when its
9580 estimated size is smaller than this value multiplied by the estimated size of
9581 unconditional jump in the hot spots of the program.
9583 The @option{reorder-block-duplicate-feedback} is used only when profile
9584 feedback is available.  It may be set to higher values than
9585 @option{reorder-block-duplicate} since information about the hot spots is more
9586 accurate.
9588 @item max-sched-ready-insns
9589 The maximum number of instructions ready to be issued the scheduler should
9590 consider at any given time during the first scheduling pass.  Increasing
9591 values mean more thorough searches, making the compilation time increase
9592 with probably little benefit.  The default value is 100.
9594 @item max-sched-region-blocks
9595 The maximum number of blocks in a region to be considered for
9596 interblock scheduling.  The default value is 10.
9598 @item max-pipeline-region-blocks
9599 The maximum number of blocks in a region to be considered for
9600 pipelining in the selective scheduler.  The default value is 15.
9602 @item max-sched-region-insns
9603 The maximum number of insns in a region to be considered for
9604 interblock scheduling.  The default value is 100.
9606 @item max-pipeline-region-insns
9607 The maximum number of insns in a region to be considered for
9608 pipelining in the selective scheduler.  The default value is 200.
9610 @item min-spec-prob
9611 The minimum probability (in percents) of reaching a source block
9612 for interblock speculative scheduling.  The default value is 40.
9614 @item max-sched-extend-regions-iters
9615 The maximum number of iterations through CFG to extend regions.
9616 A value of 0 (the default) disables region extensions.
9618 @item max-sched-insn-conflict-delay
9619 The maximum conflict delay for an insn to be considered for speculative motion.
9620 The default value is 3.
9622 @item sched-spec-prob-cutoff
9623 The minimal probability of speculation success (in percents), so that
9624 speculative insns are scheduled.
9625 The default value is 40.
9627 @item sched-spec-state-edge-prob-cutoff
9628 The minimum probability an edge must have for the scheduler to save its
9629 state across it.
9630 The default value is 10.
9632 @item sched-mem-true-dep-cost
9633 Minimal distance (in CPU cycles) between store and load targeting same
9634 memory locations.  The default value is 1.
9636 @item selsched-max-lookahead
9637 The maximum size of the lookahead window of selective scheduling.  It is a
9638 depth of search for available instructions.
9639 The default value is 50.
9641 @item selsched-max-sched-times
9642 The maximum number of times that an instruction is scheduled during
9643 selective scheduling.  This is the limit on the number of iterations
9644 through which the instruction may be pipelined.  The default value is 2.
9646 @item selsched-max-insns-to-rename
9647 The maximum number of best instructions in the ready list that are considered
9648 for renaming in the selective scheduler.  The default value is 2.
9650 @item sms-min-sc
9651 The minimum value of stage count that swing modulo scheduler
9652 generates.  The default value is 2.
9654 @item max-last-value-rtl
9655 The maximum size measured as number of RTLs that can be recorded in an expression
9656 in combiner for a pseudo register as last known value of that register.  The default
9657 is 10000.
9659 @item integer-share-limit
9660 Small integer constants can use a shared data structure, reducing the
9661 compiler's memory usage and increasing its speed.  This sets the maximum
9662 value of a shared integer constant.  The default value is 256.
9664 @item ssp-buffer-size
9665 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9666 protection when @option{-fstack-protection} is used.
9668 @item max-jump-thread-duplication-stmts
9669 Maximum number of statements allowed in a block that needs to be
9670 duplicated when threading jumps.
9672 @item max-fields-for-field-sensitive
9673 Maximum number of fields in a structure treated in
9674 a field sensitive manner during pointer analysis.  The default is zero
9675 for @option{-O0} and @option{-O1},
9676 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9678 @item prefetch-latency
9679 Estimate on average number of instructions that are executed before
9680 prefetch finishes.  The distance prefetched ahead is proportional
9681 to this constant.  Increasing this number may also lead to less
9682 streams being prefetched (see @option{simultaneous-prefetches}).
9684 @item simultaneous-prefetches
9685 Maximum number of prefetches that can run at the same time.
9687 @item l1-cache-line-size
9688 The size of cache line in L1 cache, in bytes.
9690 @item l1-cache-size
9691 The size of L1 cache, in kilobytes.
9693 @item l2-cache-size
9694 The size of L2 cache, in kilobytes.
9696 @item min-insn-to-prefetch-ratio
9697 The minimum ratio between the number of instructions and the
9698 number of prefetches to enable prefetching in a loop.
9700 @item prefetch-min-insn-to-mem-ratio
9701 The minimum ratio between the number of instructions and the
9702 number of memory references to enable prefetching in a loop.
9704 @item use-canonical-types
9705 Whether the compiler should use the ``canonical'' type system.  By
9706 default, this should always be 1, which uses a more efficient internal
9707 mechanism for comparing types in C++ and Objective-C++.  However, if
9708 bugs in the canonical type system are causing compilation failures,
9709 set this value to 0 to disable canonical types.
9711 @item switch-conversion-max-branch-ratio
9712 Switch initialization conversion refuses to create arrays that are
9713 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9714 branches in the switch.
9716 @item max-partial-antic-length
9717 Maximum length of the partial antic set computed during the tree
9718 partial redundancy elimination optimization (@option{-ftree-pre}) when
9719 optimizing at @option{-O3} and above.  For some sorts of source code
9720 the enhanced partial redundancy elimination optimization can run away,
9721 consuming all of the memory available on the host machine.  This
9722 parameter sets a limit on the length of the sets that are computed,
9723 which prevents the runaway behavior.  Setting a value of 0 for
9724 this parameter allows an unlimited set length.
9726 @item sccvn-max-scc-size
9727 Maximum size of a strongly connected component (SCC) during SCCVN
9728 processing.  If this limit is hit, SCCVN processing for the whole
9729 function is not done and optimizations depending on it are
9730 disabled.  The default maximum SCC size is 10000.
9732 @item sccvn-max-alias-queries-per-access
9733 Maximum number of alias-oracle queries we perform when looking for
9734 redundancies for loads and stores.  If this limit is hit the search
9735 is aborted and the load or store is not considered redundant.  The
9736 number of queries is algorithmically limited to the number of
9737 stores on all paths from the load to the function entry.
9738 The default maxmimum number of queries is 1000.
9740 @item ira-max-loops-num
9741 IRA uses regional register allocation by default.  If a function
9742 contains more loops than the number given by this parameter, only at most
9743 the given number of the most frequently-executed loops form regions
9744 for regional register allocation.  The default value of the
9745 parameter is 100.
9747 @item ira-max-conflict-table-size 
9748 Although IRA uses a sophisticated algorithm to compress the conflict
9749 table, the table can still require excessive amounts of memory for
9750 huge functions.  If the conflict table for a function could be more
9751 than the size in MB given by this parameter, the register allocator
9752 instead uses a faster, simpler, and lower-quality
9753 algorithm that does not require building a pseudo-register conflict table.  
9754 The default value of the parameter is 2000.
9756 @item ira-loop-reserved-regs
9757 IRA can be used to evaluate more accurate register pressure in loops
9758 for decisions to move loop invariants (see @option{-O3}).  The number
9759 of available registers reserved for some other purposes is given
9760 by this parameter.  The default value of the parameter is 2, which is
9761 the minimal number of registers needed by typical instructions.
9762 This value is the best found from numerous experiments.
9764 @item loop-invariant-max-bbs-in-loop
9765 Loop invariant motion can be very expensive, both in compilation time and
9766 in amount of needed compile-time memory, with very large loops.  Loops
9767 with more basic blocks than this parameter won't have loop invariant
9768 motion optimization performed on them.  The default value of the
9769 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9771 @item loop-max-datarefs-for-datadeps
9772 Building data dapendencies is expensive for very large loops.  This
9773 parameter limits the number of data references in loops that are
9774 considered for data dependence analysis.  These large loops are no
9775 handled by the optimizations using loop data dependencies.
9776 The default value is 1000.
9778 @item max-vartrack-size
9779 Sets a maximum number of hash table slots to use during variable
9780 tracking dataflow analysis of any function.  If this limit is exceeded
9781 with variable tracking at assignments enabled, analysis for that
9782 function is retried without it, after removing all debug insns from
9783 the function.  If the limit is exceeded even without debug insns, var
9784 tracking analysis is completely disabled for the function.  Setting
9785 the parameter to zero makes it unlimited.
9787 @item max-vartrack-expr-depth
9788 Sets a maximum number of recursion levels when attempting to map
9789 variable names or debug temporaries to value expressions.  This trades
9790 compilation time for more complete debug information.  If this is set too
9791 low, value expressions that are available and could be represented in
9792 debug information may end up not being used; setting this higher may
9793 enable the compiler to find more complex debug expressions, but compile
9794 time and memory use may grow.  The default is 12.
9796 @item min-nondebug-insn-uid
9797 Use uids starting at this parameter for nondebug insns.  The range below
9798 the parameter is reserved exclusively for debug insns created by
9799 @option{-fvar-tracking-assignments}, but debug insns may get
9800 (non-overlapping) uids above it if the reserved range is exhausted.
9802 @item ipa-sra-ptr-growth-factor
9803 IPA-SRA replaces a pointer to an aggregate with one or more new
9804 parameters only when their cumulative size is less or equal to
9805 @option{ipa-sra-ptr-growth-factor} times the size of the original
9806 pointer parameter.
9808 @item tm-max-aggregate-size
9809 When making copies of thread-local variables in a transaction, this
9810 parameter specifies the size in bytes after which variables are
9811 saved with the logging functions as opposed to save/restore code
9812 sequence pairs.  This option only applies when using
9813 @option{-fgnu-tm}.
9815 @item graphite-max-nb-scop-params
9816 To avoid exponential effects in the Graphite loop transforms, the
9817 number of parameters in a Static Control Part (SCoP) is bounded.  The
9818 default value is 10 parameters.  A variable whose value is unknown at
9819 compilation time and defined outside a SCoP is a parameter of the SCoP.
9821 @item graphite-max-bbs-per-function
9822 To avoid exponential effects in the detection of SCoPs, the size of
9823 the functions analyzed by Graphite is bounded.  The default value is
9824 100 basic blocks.
9826 @item loop-block-tile-size
9827 Loop blocking or strip mining transforms, enabled with
9828 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9829 loop in the loop nest by a given number of iterations.  The strip
9830 length can be changed using the @option{loop-block-tile-size}
9831 parameter.  The default value is 51 iterations.
9833 @item ipa-cp-value-list-size
9834 IPA-CP attempts to track all possible values and types passed to a function's
9835 parameter in order to propagate them and perform devirtualization.
9836 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9837 stores per one formal parameter of a function.
9839 @item lto-partitions
9840 Specify desired number of partitions produced during WHOPR compilation.
9841 The number of partitions should exceed the number of CPUs used for compilation.
9842 The default value is 32.
9844 @item lto-minpartition
9845 Size of minimal partition for WHOPR (in estimated instructions).
9846 This prevents expenses of splitting very small programs into too many
9847 partitions.
9849 @item cxx-max-namespaces-for-diagnostic-help
9850 The maximum number of namespaces to consult for suggestions when C++
9851 name lookup fails for an identifier.  The default is 1000.
9853 @item sink-frequency-threshold
9854 The maximum relative execution frequency (in percents) of the target block
9855 relative to a statement's original block to allow statement sinking of a
9856 statement.  Larger numbers result in more aggressive statement sinking.
9857 The default value is 75.  A small positive adjustment is applied for
9858 statements with memory operands as those are even more profitable so sink.
9860 @item max-stores-to-sink
9861 The maximum number of conditional stores paires that can be sunk.  Set to 0
9862 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9863 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9865 @item allow-load-data-races
9866 Allow optimizers to introduce new data races on loads.
9867 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9868 unless implicitly set by the @option{-fmemory-model=} option.
9870 @item allow-store-data-races
9871 Allow optimizers to introduce new data races on stores.
9872 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9873 unless implicitly set by the @option{-fmemory-model=} option.
9875 @item allow-packed-load-data-races
9876 Allow optimizers to introduce new data races on packed data loads.
9877 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9878 unless implicitly set by the @option{-fmemory-model=} option.
9880 @item allow-packed-store-data-races
9881 Allow optimizers to introduce new data races on packed data stores.
9882 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9883 unless implicitly set by the @option{-fmemory-model=} option.
9885 @item case-values-threshold
9886 The smallest number of different values for which it is best to use a
9887 jump-table instead of a tree of conditional branches.  If the value is
9888 0, use the default for the machine.  The default is 0.
9890 @item tree-reassoc-width
9891 Set the maximum number of instructions executed in parallel in
9892 reassociated tree. This parameter overrides target dependent
9893 heuristics used by default if has non zero value.
9895 @item sched-pressure-algorithm
9896 Choose between the two available implementations of
9897 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9898 and is the more likely to prevent instructions from being reordered.
9899 Algorithm 2 was designed to be a compromise between the relatively
9900 conservative approach taken by algorithm 1 and the rather aggressive
9901 approach taken by the default scheduler.  It relies more heavily on
9902 having a regular register file and accurate register pressure classes.
9903 See @file{haifa-sched.c} in the GCC sources for more details.
9905 The default choice depends on the target.
9907 @item max-slsr-cand-scan
9908 Set the maximum number of existing candidates that will be considered when
9909 seeking a basis for a new straight-line strength reduction candidate.
9911 @end table
9912 @end table
9914 @node Preprocessor Options
9915 @section Options Controlling the Preprocessor
9916 @cindex preprocessor options
9917 @cindex options, preprocessor
9919 These options control the C preprocessor, which is run on each C source
9920 file before actual compilation.
9922 If you use the @option{-E} option, nothing is done except preprocessing.
9923 Some of these options make sense only together with @option{-E} because
9924 they cause the preprocessor output to be unsuitable for actual
9925 compilation.
9927 @table @gcctabopt
9928 @item -Wp,@var{option}
9929 @opindex Wp
9930 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9931 and pass @var{option} directly through to the preprocessor.  If
9932 @var{option} contains commas, it is split into multiple options at the
9933 commas.  However, many options are modified, translated or interpreted
9934 by the compiler driver before being passed to the preprocessor, and
9935 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9936 interface is undocumented and subject to change, so whenever possible
9937 you should avoid using @option{-Wp} and let the driver handle the
9938 options instead.
9940 @item -Xpreprocessor @var{option}
9941 @opindex Xpreprocessor
9942 Pass @var{option} as an option to the preprocessor.  You can use this to
9943 supply system-specific preprocessor options that GCC does not 
9944 recognize.
9946 If you want to pass an option that takes an argument, you must use
9947 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9949 @item -no-integrated-cpp
9950 @opindex no-integrated-cpp
9951 Perform preprocessing as a separate pass before compilation.
9952 By default, GCC performs preprocessing as an integrated part of
9953 input tokenization and parsing.
9954 If this option is provided, the appropriate language front end
9955 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9956 and Objective-C, respectively) is instead invoked twice,
9957 once for preprocessing only and once for actual compilation
9958 of the preprocessed input.
9959 This option may be useful in conjunction with the @option{-B} or
9960 @option{-wrapper} options to specify an alternate preprocessor or
9961 perform additional processing of the program source between
9962 normal preprocessing and compilation.
9963 @end table
9965 @include cppopts.texi
9967 @node Assembler Options
9968 @section Passing Options to the Assembler
9970 @c prevent bad page break with this line
9971 You can pass options to the assembler.
9973 @table @gcctabopt
9974 @item -Wa,@var{option}
9975 @opindex Wa
9976 Pass @var{option} as an option to the assembler.  If @var{option}
9977 contains commas, it is split into multiple options at the commas.
9979 @item -Xassembler @var{option}
9980 @opindex Xassembler
9981 Pass @var{option} as an option to the assembler.  You can use this to
9982 supply system-specific assembler options that GCC does not
9983 recognize.
9985 If you want to pass an option that takes an argument, you must use
9986 @option{-Xassembler} twice, once for the option and once for the argument.
9988 @end table
9990 @node Link Options
9991 @section Options for Linking
9992 @cindex link options
9993 @cindex options, linking
9995 These options come into play when the compiler links object files into
9996 an executable output file.  They are meaningless if the compiler is
9997 not doing a link step.
9999 @table @gcctabopt
10000 @cindex file names
10001 @item @var{object-file-name}
10002 A file name that does not end in a special recognized suffix is
10003 considered to name an object file or library.  (Object files are
10004 distinguished from libraries by the linker according to the file
10005 contents.)  If linking is done, these object files are used as input
10006 to the linker.
10008 @item -c
10009 @itemx -S
10010 @itemx -E
10011 @opindex c
10012 @opindex S
10013 @opindex E
10014 If any of these options is used, then the linker is not run, and
10015 object file names should not be used as arguments.  @xref{Overall
10016 Options}.
10018 @cindex Libraries
10019 @item -l@var{library}
10020 @itemx -l @var{library}
10021 @opindex l
10022 Search the library named @var{library} when linking.  (The second
10023 alternative with the library as a separate argument is only for
10024 POSIX compliance and is not recommended.)
10026 It makes a difference where in the command you write this option; the
10027 linker searches and processes libraries and object files in the order they
10028 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10029 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10030 to functions in @samp{z}, those functions may not be loaded.
10032 The linker searches a standard list of directories for the library,
10033 which is actually a file named @file{lib@var{library}.a}.  The linker
10034 then uses this file as if it had been specified precisely by name.
10036 The directories searched include several standard system directories
10037 plus any that you specify with @option{-L}.
10039 Normally the files found this way are library files---archive files
10040 whose members are object files.  The linker handles an archive file by
10041 scanning through it for members which define symbols that have so far
10042 been referenced but not defined.  But if the file that is found is an
10043 ordinary object file, it is linked in the usual fashion.  The only
10044 difference between using an @option{-l} option and specifying a file name
10045 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10046 and searches several directories.
10048 @item -lobjc
10049 @opindex lobjc
10050 You need this special case of the @option{-l} option in order to
10051 link an Objective-C or Objective-C++ program.
10053 @item -nostartfiles
10054 @opindex nostartfiles
10055 Do not use the standard system startup files when linking.
10056 The standard system libraries are used normally, unless @option{-nostdlib}
10057 or @option{-nodefaultlibs} is used.
10059 @item -nodefaultlibs
10060 @opindex nodefaultlibs
10061 Do not use the standard system libraries when linking.
10062 Only the libraries you specify are passed to the linker, and options
10063 specifying linkage of the system libraries, such as @code{-static-libgcc}
10064 or @code{-shared-libgcc}, are ignored.  
10065 The standard startup files are used normally, unless @option{-nostartfiles}
10066 is used.  
10068 The compiler may generate calls to @code{memcmp},
10069 @code{memset}, @code{memcpy} and @code{memmove}.
10070 These entries are usually resolved by entries in
10071 libc.  These entry points should be supplied through some other
10072 mechanism when this option is specified.
10074 @item -nostdlib
10075 @opindex nostdlib
10076 Do not use the standard system startup files or libraries when linking.
10077 No startup files and only the libraries you specify are passed to
10078 the linker, and options specifying linkage of the system libraries, such as
10079 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10081 The compiler may generate calls to @code{memcmp}, @code{memset},
10082 @code{memcpy} and @code{memmove}.
10083 These entries are usually resolved by entries in
10084 libc.  These entry points should be supplied through some other
10085 mechanism when this option is specified.
10087 @cindex @option{-lgcc}, use with @option{-nostdlib}
10088 @cindex @option{-nostdlib} and unresolved references
10089 @cindex unresolved references and @option{-nostdlib}
10090 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10091 @cindex @option{-nodefaultlibs} and unresolved references
10092 @cindex unresolved references and @option{-nodefaultlibs}
10093 One of the standard libraries bypassed by @option{-nostdlib} and
10094 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10095 which GCC uses to overcome shortcomings of particular machines, or special
10096 needs for some languages.
10097 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10098 Collection (GCC) Internals},
10099 for more discussion of @file{libgcc.a}.)
10100 In most cases, you need @file{libgcc.a} even when you want to avoid
10101 other standard libraries.  In other words, when you specify @option{-nostdlib}
10102 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10103 This ensures that you have no unresolved references to internal GCC
10104 library subroutines.
10105 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10106 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10107 GNU Compiler Collection (GCC) Internals}.)
10109 @item -pie
10110 @opindex pie
10111 Produce a position independent executable on targets that support it.
10112 For predictable results, you must also specify the same set of options
10113 used for compilation (@option{-fpie}, @option{-fPIE},
10114 or model suboptions) when you specify this linker option.
10116 @item -rdynamic
10117 @opindex rdynamic
10118 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10119 that support it. This instructs the linker to add all symbols, not
10120 only used ones, to the dynamic symbol table. This option is needed
10121 for some uses of @code{dlopen} or to allow obtaining backtraces
10122 from within a program.
10124 @item -s
10125 @opindex s
10126 Remove all symbol table and relocation information from the executable.
10128 @item -static
10129 @opindex static
10130 On systems that support dynamic linking, this prevents linking with the shared
10131 libraries.  On other systems, this option has no effect.
10133 @item -shared
10134 @opindex shared
10135 Produce a shared object which can then be linked with other objects to
10136 form an executable.  Not all systems support this option.  For predictable
10137 results, you must also specify the same set of options used for compilation
10138 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10139 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10140 needs to build supplementary stub code for constructors to work.  On
10141 multi-libbed systems, @samp{gcc -shared} must select the correct support
10142 libraries to link against.  Failing to supply the correct flags may lead
10143 to subtle defects.  Supplying them in cases where they are not necessary
10144 is innocuous.}
10146 @item -shared-libgcc
10147 @itemx -static-libgcc
10148 @opindex shared-libgcc
10149 @opindex static-libgcc
10150 On systems that provide @file{libgcc} as a shared library, these options
10151 force the use of either the shared or static version, respectively.
10152 If no shared version of @file{libgcc} was built when the compiler was
10153 configured, these options have no effect.
10155 There are several situations in which an application should use the
10156 shared @file{libgcc} instead of the static version.  The most common
10157 of these is when the application wishes to throw and catch exceptions
10158 across different shared libraries.  In that case, each of the libraries
10159 as well as the application itself should use the shared @file{libgcc}.
10161 Therefore, the G++ and GCJ drivers automatically add
10162 @option{-shared-libgcc} whenever you build a shared library or a main
10163 executable, because C++ and Java programs typically use exceptions, so
10164 this is the right thing to do.
10166 If, instead, you use the GCC driver to create shared libraries, you may
10167 find that they are not always linked with the shared @file{libgcc}.
10168 If GCC finds, at its configuration time, that you have a non-GNU linker
10169 or a GNU linker that does not support option @option{--eh-frame-hdr},
10170 it links the shared version of @file{libgcc} into shared libraries
10171 by default.  Otherwise, it takes advantage of the linker and optimizes
10172 away the linking with the shared version of @file{libgcc}, linking with
10173 the static version of libgcc by default.  This allows exceptions to
10174 propagate through such shared libraries, without incurring relocation
10175 costs at library load time.
10177 However, if a library or main executable is supposed to throw or catch
10178 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10179 for the languages used in the program, or using the option
10180 @option{-shared-libgcc}, such that it is linked with the shared
10181 @file{libgcc}.
10183 @item -static-libasan
10184 When the @option{-fsanitize=address} option is used to link a program,
10185 the GCC driver automatically links against @option{libasan}.  If
10186 @file{libasan} is available as a shared library, and the @option{-static}
10187 option is not used, then this links against the shared version of
10188 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10189 driver to link @file{libasan} statically, without necessarily linking
10190 other libraries statically.
10192 @item -static-libtsan
10193 When the @option{-fsanitize=thread} option is used to link a program,
10194 the GCC driver automatically links against @option{libtsan}.  If
10195 @file{libtsan} is available as a shared library, and the @option{-static}
10196 option is not used, then this links against the shared version of
10197 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10198 driver to link @file{libtsan} statically, without necessarily linking
10199 other libraries statically.
10201 @item -static-libubsan
10202 When the @option{-fsanitize=undefined} option is used to link a program,
10203 the GCC driver automatically links against @option{libubsan}.  If
10204 @file{libubsan} is available as a shared library, and the @option{-static}
10205 option is not used, then this links against the shared version of
10206 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10207 driver to link @file{libubsan} statically, without necessarily linking
10208 other libraries statically.
10210 @item -static-libstdc++
10211 When the @command{g++} program is used to link a C++ program, it
10212 normally automatically links against @option{libstdc++}.  If
10213 @file{libstdc++} is available as a shared library, and the
10214 @option{-static} option is not used, then this links against the
10215 shared version of @file{libstdc++}.  That is normally fine.  However, it
10216 is sometimes useful to freeze the version of @file{libstdc++} used by
10217 the program without going all the way to a fully static link.  The
10218 @option{-static-libstdc++} option directs the @command{g++} driver to
10219 link @file{libstdc++} statically, without necessarily linking other
10220 libraries statically.
10222 @item -symbolic
10223 @opindex symbolic
10224 Bind references to global symbols when building a shared object.  Warn
10225 about any unresolved references (unless overridden by the link editor
10226 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10227 this option.
10229 @item -T @var{script}
10230 @opindex T
10231 @cindex linker script
10232 Use @var{script} as the linker script.  This option is supported by most
10233 systems using the GNU linker.  On some targets, such as bare-board
10234 targets without an operating system, the @option{-T} option may be required
10235 when linking to avoid references to undefined symbols.
10237 @item -Xlinker @var{option}
10238 @opindex Xlinker
10239 Pass @var{option} as an option to the linker.  You can use this to
10240 supply system-specific linker options that GCC does not recognize.
10242 If you want to pass an option that takes a separate argument, you must use
10243 @option{-Xlinker} twice, once for the option and once for the argument.
10244 For example, to pass @option{-assert definitions}, you must write
10245 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10246 @option{-Xlinker "-assert definitions"}, because this passes the entire
10247 string as a single argument, which is not what the linker expects.
10249 When using the GNU linker, it is usually more convenient to pass
10250 arguments to linker options using the @option{@var{option}=@var{value}}
10251 syntax than as separate arguments.  For example, you can specify
10252 @option{-Xlinker -Map=output.map} rather than
10253 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10254 this syntax for command-line options.
10256 @item -Wl,@var{option}
10257 @opindex Wl
10258 Pass @var{option} as an option to the linker.  If @var{option} contains
10259 commas, it is split into multiple options at the commas.  You can use this
10260 syntax to pass an argument to the option.
10261 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10262 linker.  When using the GNU linker, you can also get the same effect with
10263 @option{-Wl,-Map=output.map}.
10265 @item -u @var{symbol}
10266 @opindex u
10267 Pretend the symbol @var{symbol} is undefined, to force linking of
10268 library modules to define it.  You can use @option{-u} multiple times with
10269 different symbols to force loading of additional library modules.
10270 @end table
10272 @node Directory Options
10273 @section Options for Directory Search
10274 @cindex directory options
10275 @cindex options, directory search
10276 @cindex search path
10278 These options specify directories to search for header files, for
10279 libraries and for parts of the compiler:
10281 @table @gcctabopt
10282 @item -I@var{dir}
10283 @opindex I
10284 Add the directory @var{dir} to the head of the list of directories to be
10285 searched for header files.  This can be used to override a system header
10286 file, substituting your own version, since these directories are
10287 searched before the system header file directories.  However, you should
10288 not use this option to add directories that contain vendor-supplied
10289 system header files (use @option{-isystem} for that).  If you use more than
10290 one @option{-I} option, the directories are scanned in left-to-right
10291 order; the standard system directories come after.
10293 If a standard system include directory, or a directory specified with
10294 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10295 option is ignored.  The directory is still searched but as a
10296 system directory at its normal position in the system include chain.
10297 This is to ensure that GCC's procedure to fix buggy system headers and
10298 the ordering for the @code{include_next} directive are not inadvertently changed.
10299 If you really need to change the search order for system directories,
10300 use the @option{-nostdinc} and/or @option{-isystem} options.
10302 @item -iplugindir=@var{dir}
10303 Set the directory to search for plugins that are passed
10304 by @option{-fplugin=@var{name}} instead of
10305 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10306 to be used by the user, but only passed by the driver.
10308 @item -iquote@var{dir}
10309 @opindex iquote
10310 Add the directory @var{dir} to the head of the list of directories to
10311 be searched for header files only for the case of @samp{#include
10312 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10313 otherwise just like @option{-I}.
10315 @item -L@var{dir}
10316 @opindex L
10317 Add directory @var{dir} to the list of directories to be searched
10318 for @option{-l}.
10320 @item -B@var{prefix}
10321 @opindex B
10322 This option specifies where to find the executables, libraries,
10323 include files, and data files of the compiler itself.
10325 The compiler driver program runs one or more of the subprograms
10326 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10327 @var{prefix} as a prefix for each program it tries to run, both with and
10328 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10330 For each subprogram to be run, the compiler driver first tries the
10331 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10332 is not specified, the driver tries two standard prefixes, 
10333 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10334 those results in a file name that is found, the unmodified program
10335 name is searched for using the directories specified in your
10336 @env{PATH} environment variable.
10338 The compiler checks to see if the path provided by the @option{-B}
10339 refers to a directory, and if necessary it adds a directory
10340 separator character at the end of the path.
10342 @option{-B} prefixes that effectively specify directory names also apply
10343 to libraries in the linker, because the compiler translates these
10344 options into @option{-L} options for the linker.  They also apply to
10345 includes files in the preprocessor, because the compiler translates these
10346 options into @option{-isystem} options for the preprocessor.  In this case,
10347 the compiler appends @samp{include} to the prefix.
10349 The runtime support file @file{libgcc.a} can also be searched for using
10350 the @option{-B} prefix, if needed.  If it is not found there, the two
10351 standard prefixes above are tried, and that is all.  The file is left
10352 out of the link if it is not found by those means.
10354 Another way to specify a prefix much like the @option{-B} prefix is to use
10355 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10356 Variables}.
10358 As a special kludge, if the path provided by @option{-B} is
10359 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10360 9, then it is replaced by @file{[dir/]include}.  This is to help
10361 with boot-strapping the compiler.
10363 @item -specs=@var{file}
10364 @opindex specs
10365 Process @var{file} after the compiler reads in the standard @file{specs}
10366 file, in order to override the defaults which the @command{gcc} driver
10367 program uses when determining what switches to pass to @command{cc1},
10368 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10369 @option{-specs=@var{file}} can be specified on the command line, and they
10370 are processed in order, from left to right.
10372 @item --sysroot=@var{dir}
10373 @opindex sysroot
10374 Use @var{dir} as the logical root directory for headers and libraries.
10375 For example, if the compiler normally searches for headers in
10376 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10377 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10379 If you use both this option and the @option{-isysroot} option, then
10380 the @option{--sysroot} option applies to libraries, but the
10381 @option{-isysroot} option applies to header files.
10383 The GNU linker (beginning with version 2.16) has the necessary support
10384 for this option.  If your linker does not support this option, the
10385 header file aspect of @option{--sysroot} still works, but the
10386 library aspect does not.
10388 @item --no-sysroot-suffix
10389 @opindex no-sysroot-suffix
10390 For some targets, a suffix is added to the root directory specified
10391 with @option{--sysroot}, depending on the other options used, so that
10392 headers may for example be found in
10393 @file{@var{dir}/@var{suffix}/usr/include} instead of
10394 @file{@var{dir}/usr/include}.  This option disables the addition of
10395 such a suffix.
10397 @item -I-
10398 @opindex I-
10399 This option has been deprecated.  Please use @option{-iquote} instead for
10400 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10401 Any directories you specify with @option{-I} options before the @option{-I-}
10402 option are searched only for the case of @samp{#include "@var{file}"};
10403 they are not searched for @samp{#include <@var{file}>}.
10405 If additional directories are specified with @option{-I} options after
10406 the @option{-I-}, these directories are searched for all @samp{#include}
10407 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10408 this way.)
10410 In addition, the @option{-I-} option inhibits the use of the current
10411 directory (where the current input file came from) as the first search
10412 directory for @samp{#include "@var{file}"}.  There is no way to
10413 override this effect of @option{-I-}.  With @option{-I.} you can specify
10414 searching the directory that is current when the compiler is
10415 invoked.  That is not exactly the same as what the preprocessor does
10416 by default, but it is often satisfactory.
10418 @option{-I-} does not inhibit the use of the standard system directories
10419 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10420 independent.
10421 @end table
10423 @c man end
10425 @node Spec Files
10426 @section Specifying subprocesses and the switches to pass to them
10427 @cindex Spec Files
10429 @command{gcc} is a driver program.  It performs its job by invoking a
10430 sequence of other programs to do the work of compiling, assembling and
10431 linking.  GCC interprets its command-line parameters and uses these to
10432 deduce which programs it should invoke, and which command-line options
10433 it ought to place on their command lines.  This behavior is controlled
10434 by @dfn{spec strings}.  In most cases there is one spec string for each
10435 program that GCC can invoke, but a few programs have multiple spec
10436 strings to control their behavior.  The spec strings built into GCC can
10437 be overridden by using the @option{-specs=} command-line switch to specify
10438 a spec file.
10440 @dfn{Spec files} are plaintext files that are used to construct spec
10441 strings.  They consist of a sequence of directives separated by blank
10442 lines.  The type of directive is determined by the first non-whitespace
10443 character on the line, which can be one of the following:
10445 @table @code
10446 @item %@var{command}
10447 Issues a @var{command} to the spec file processor.  The commands that can
10448 appear here are:
10450 @table @code
10451 @item %include <@var{file}>
10452 @cindex @code{%include}
10453 Search for @var{file} and insert its text at the current point in the
10454 specs file.
10456 @item %include_noerr <@var{file}>
10457 @cindex @code{%include_noerr}
10458 Just like @samp{%include}, but do not generate an error message if the include
10459 file cannot be found.
10461 @item %rename @var{old_name} @var{new_name}
10462 @cindex @code{%rename}
10463 Rename the spec string @var{old_name} to @var{new_name}.
10465 @end table
10467 @item *[@var{spec_name}]:
10468 This tells the compiler to create, override or delete the named spec
10469 string.  All lines after this directive up to the next directive or
10470 blank line are considered to be the text for the spec string.  If this
10471 results in an empty string then the spec is deleted.  (Or, if the
10472 spec did not exist, then nothing happens.)  Otherwise, if the spec
10473 does not currently exist a new spec is created.  If the spec does
10474 exist then its contents are overridden by the text of this
10475 directive, unless the first character of that text is the @samp{+}
10476 character, in which case the text is appended to the spec.
10478 @item [@var{suffix}]:
10479 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10480 and up to the next directive or blank line are considered to make up the
10481 spec string for the indicated suffix.  When the compiler encounters an
10482 input file with the named suffix, it processes the spec string in
10483 order to work out how to compile that file.  For example:
10485 @smallexample
10486 .ZZ:
10487 z-compile -input %i
10488 @end smallexample
10490 This says that any input file whose name ends in @samp{.ZZ} should be
10491 passed to the program @samp{z-compile}, which should be invoked with the
10492 command-line switch @option{-input} and with the result of performing the
10493 @samp{%i} substitution.  (See below.)
10495 As an alternative to providing a spec string, the text following a
10496 suffix directive can be one of the following:
10498 @table @code
10499 @item @@@var{language}
10500 This says that the suffix is an alias for a known @var{language}.  This is
10501 similar to using the @option{-x} command-line switch to GCC to specify a
10502 language explicitly.  For example:
10504 @smallexample
10505 .ZZ:
10506 @@c++
10507 @end smallexample
10509 Says that .ZZ files are, in fact, C++ source files.
10511 @item #@var{name}
10512 This causes an error messages saying:
10514 @smallexample
10515 @var{name} compiler not installed on this system.
10516 @end smallexample
10517 @end table
10519 GCC already has an extensive list of suffixes built into it.
10520 This directive adds an entry to the end of the list of suffixes, but
10521 since the list is searched from the end backwards, it is effectively
10522 possible to override earlier entries using this technique.
10524 @end table
10526 GCC has the following spec strings built into it.  Spec files can
10527 override these strings or create their own.  Note that individual
10528 targets can also add their own spec strings to this list.
10530 @smallexample
10531 asm          Options to pass to the assembler
10532 asm_final    Options to pass to the assembler post-processor
10533 cpp          Options to pass to the C preprocessor
10534 cc1          Options to pass to the C compiler
10535 cc1plus      Options to pass to the C++ compiler
10536 endfile      Object files to include at the end of the link
10537 link         Options to pass to the linker
10538 lib          Libraries to include on the command line to the linker
10539 libgcc       Decides which GCC support library to pass to the linker
10540 linker       Sets the name of the linker
10541 predefines   Defines to be passed to the C preprocessor
10542 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10543              by default
10544 startfile    Object files to include at the start of the link
10545 @end smallexample
10547 Here is a small example of a spec file:
10549 @smallexample
10550 %rename lib                 old_lib
10552 *lib:
10553 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10554 @end smallexample
10556 This example renames the spec called @samp{lib} to @samp{old_lib} and
10557 then overrides the previous definition of @samp{lib} with a new one.
10558 The new definition adds in some extra command-line options before
10559 including the text of the old definition.
10561 @dfn{Spec strings} are a list of command-line options to be passed to their
10562 corresponding program.  In addition, the spec strings can contain
10563 @samp{%}-prefixed sequences to substitute variable text or to
10564 conditionally insert text into the command line.  Using these constructs
10565 it is possible to generate quite complex command lines.
10567 Here is a table of all defined @samp{%}-sequences for spec
10568 strings.  Note that spaces are not generated automatically around the
10569 results of expanding these sequences.  Therefore you can concatenate them
10570 together or combine them with constant text in a single argument.
10572 @table @code
10573 @item %%
10574 Substitute one @samp{%} into the program name or argument.
10576 @item %i
10577 Substitute the name of the input file being processed.
10579 @item %b
10580 Substitute the basename of the input file being processed.
10581 This is the substring up to (and not including) the last period
10582 and not including the directory.
10584 @item %B
10585 This is the same as @samp{%b}, but include the file suffix (text after
10586 the last period).
10588 @item %d
10589 Marks the argument containing or following the @samp{%d} as a
10590 temporary file name, so that that file is deleted if GCC exits
10591 successfully.  Unlike @samp{%g}, this contributes no text to the
10592 argument.
10594 @item %g@var{suffix}
10595 Substitute a file name that has suffix @var{suffix} and is chosen
10596 once per compilation, and mark the argument in the same way as
10597 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10598 name is now chosen in a way that is hard to predict even when previously
10599 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10600 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10601 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10602 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10603 was simply substituted with a file name chosen once per compilation,
10604 without regard to any appended suffix (which was therefore treated
10605 just like ordinary text), making such attacks more likely to succeed.
10607 @item %u@var{suffix}
10608 Like @samp{%g}, but generates a new temporary file name
10609 each time it appears instead of once per compilation.
10611 @item %U@var{suffix}
10612 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10613 new one if there is no such last file name.  In the absence of any
10614 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10615 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10616 involves the generation of two distinct file names, one
10617 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10618 simply substituted with a file name chosen for the previous @samp{%u},
10619 without regard to any appended suffix.
10621 @item %j@var{suffix}
10622 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10623 writable, and if @option{-save-temps} is not used; 
10624 otherwise, substitute the name
10625 of a temporary file, just like @samp{%u}.  This temporary file is not
10626 meant for communication between processes, but rather as a junk
10627 disposal mechanism.
10629 @item %|@var{suffix}
10630 @itemx %m@var{suffix}
10631 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10632 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10633 all.  These are the two most common ways to instruct a program that it
10634 should read from standard input or write to standard output.  If you
10635 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10636 construct: see for example @file{f/lang-specs.h}.
10638 @item %.@var{SUFFIX}
10639 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10640 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10641 terminated by the next space or %.
10643 @item %w
10644 Marks the argument containing or following the @samp{%w} as the
10645 designated output file of this compilation.  This puts the argument
10646 into the sequence of arguments that @samp{%o} substitutes.
10648 @item %o
10649 Substitutes the names of all the output files, with spaces
10650 automatically placed around them.  You should write spaces
10651 around the @samp{%o} as well or the results are undefined.
10652 @samp{%o} is for use in the specs for running the linker.
10653 Input files whose names have no recognized suffix are not compiled
10654 at all, but they are included among the output files, so they are
10655 linked.
10657 @item %O
10658 Substitutes the suffix for object files.  Note that this is
10659 handled specially when it immediately follows @samp{%g, %u, or %U},
10660 because of the need for those to form complete file names.  The
10661 handling is such that @samp{%O} is treated exactly as if it had already
10662 been substituted, except that @samp{%g, %u, and %U} do not currently
10663 support additional @var{suffix} characters following @samp{%O} as they do
10664 following, for example, @samp{.o}.
10666 @item %p
10667 Substitutes the standard macro predefinitions for the
10668 current target machine.  Use this when running @code{cpp}.
10670 @item %P
10671 Like @samp{%p}, but puts @samp{__} before and after the name of each
10672 predefined macro, except for macros that start with @samp{__} or with
10673 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10676 @item %I
10677 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10678 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10679 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10680 and @option{-imultilib} as necessary.
10682 @item %s
10683 Current argument is the name of a library or startup file of some sort.
10684 Search for that file in a standard list of directories and substitute
10685 the full name found.  The current working directory is included in the
10686 list of directories scanned.
10688 @item %T
10689 Current argument is the name of a linker script.  Search for that file
10690 in the current list of directories to scan for libraries. If the file
10691 is located insert a @option{--script} option into the command line
10692 followed by the full path name found.  If the file is not found then
10693 generate an error message.  Note: the current working directory is not
10694 searched.
10696 @item %e@var{str}
10697 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10698 Use this when inconsistent options are detected.
10700 @item %(@var{name})
10701 Substitute the contents of spec string @var{name} at this point.
10703 @item %x@{@var{option}@}
10704 Accumulate an option for @samp{%X}.
10706 @item %X
10707 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10708 spec string.
10710 @item %Y
10711 Output the accumulated assembler options specified by @option{-Wa}.
10713 @item %Z
10714 Output the accumulated preprocessor options specified by @option{-Wp}.
10716 @item %a
10717 Process the @code{asm} spec.  This is used to compute the
10718 switches to be passed to the assembler.
10720 @item %A
10721 Process the @code{asm_final} spec.  This is a spec string for
10722 passing switches to an assembler post-processor, if such a program is
10723 needed.
10725 @item %l
10726 Process the @code{link} spec.  This is the spec for computing the
10727 command line passed to the linker.  Typically it makes use of the
10728 @samp{%L %G %S %D and %E} sequences.
10730 @item %D
10731 Dump out a @option{-L} option for each directory that GCC believes might
10732 contain startup files.  If the target supports multilibs then the
10733 current multilib directory is prepended to each of these paths.
10735 @item %L
10736 Process the @code{lib} spec.  This is a spec string for deciding which
10737 libraries are included on the command line to the linker.
10739 @item %G
10740 Process the @code{libgcc} spec.  This is a spec string for deciding
10741 which GCC support library is included on the command line to the linker.
10743 @item %S
10744 Process the @code{startfile} spec.  This is a spec for deciding which
10745 object files are the first ones passed to the linker.  Typically
10746 this might be a file named @file{crt0.o}.
10748 @item %E
10749 Process the @code{endfile} spec.  This is a spec string that specifies
10750 the last object files that are passed to the linker.
10752 @item %C
10753 Process the @code{cpp} spec.  This is used to construct the arguments
10754 to be passed to the C preprocessor.
10756 @item %1
10757 Process the @code{cc1} spec.  This is used to construct the options to be
10758 passed to the actual C compiler (@samp{cc1}).
10760 @item %2
10761 Process the @code{cc1plus} spec.  This is used to construct the options to be
10762 passed to the actual C++ compiler (@samp{cc1plus}).
10764 @item %*
10765 Substitute the variable part of a matched option.  See below.
10766 Note that each comma in the substituted string is replaced by
10767 a single space.
10769 @item %<@code{S}
10770 Remove all occurrences of @code{-S} from the command line.  Note---this
10771 command is position dependent.  @samp{%} commands in the spec string
10772 before this one see @code{-S}, @samp{%} commands in the spec string
10773 after this one do not.
10775 @item %:@var{function}(@var{args})
10776 Call the named function @var{function}, passing it @var{args}.
10777 @var{args} is first processed as a nested spec string, then split
10778 into an argument vector in the usual fashion.  The function returns
10779 a string which is processed as if it had appeared literally as part
10780 of the current spec.
10782 The following built-in spec functions are provided:
10784 @table @code
10785 @item @code{getenv}
10786 The @code{getenv} spec function takes two arguments: an environment
10787 variable name and a string.  If the environment variable is not
10788 defined, a fatal error is issued.  Otherwise, the return value is the
10789 value of the environment variable concatenated with the string.  For
10790 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10792 @smallexample
10793 %:getenv(TOPDIR /include)
10794 @end smallexample
10796 expands to @file{/path/to/top/include}.
10798 @item @code{if-exists}
10799 The @code{if-exists} spec function takes one argument, an absolute
10800 pathname to a file.  If the file exists, @code{if-exists} returns the
10801 pathname.  Here is a small example of its usage:
10803 @smallexample
10804 *startfile:
10805 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10806 @end smallexample
10808 @item @code{if-exists-else}
10809 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10810 spec function, except that it takes two arguments.  The first argument is
10811 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10812 returns the pathname.  If it does not exist, it returns the second argument.
10813 This way, @code{if-exists-else} can be used to select one file or another,
10814 based on the existence of the first.  Here is a small example of its usage:
10816 @smallexample
10817 *startfile:
10818 crt0%O%s %:if-exists(crti%O%s) \
10819 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10820 @end smallexample
10822 @item @code{replace-outfile}
10823 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10824 first argument in the outfiles array and replaces it with the second argument.  Here
10825 is a small example of its usage:
10827 @smallexample
10828 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10829 @end smallexample
10831 @item @code{remove-outfile}
10832 The @code{remove-outfile} spec function takes one argument.  It looks for the
10833 first argument in the outfiles array and removes it.  Here is a small example
10834 its usage:
10836 @smallexample
10837 %:remove-outfile(-lm)
10838 @end smallexample
10840 @item @code{pass-through-libs}
10841 The @code{pass-through-libs} spec function takes any number of arguments.  It
10842 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10843 assumes are the names of linker input library archive files) and returns a
10844 result containing all the found arguments each prepended by
10845 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10846 intended to be passed to the LTO linker plugin.
10848 @smallexample
10849 %:pass-through-libs(%G %L %G)
10850 @end smallexample
10852 @item @code{print-asm-header}
10853 The @code{print-asm-header} function takes no arguments and simply
10854 prints a banner like:
10856 @smallexample
10857 Assembler options
10858 =================
10860 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10861 @end smallexample
10863 It is used to separate compiler options from assembler options
10864 in the @option{--target-help} output.
10865 @end table
10867 @item %@{@code{S}@}
10868 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10869 If that switch is not specified, this substitutes nothing.  Note that
10870 the leading dash is omitted when specifying this option, and it is
10871 automatically inserted if the substitution is performed.  Thus the spec
10872 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10873 and outputs the command-line option @option{-foo}.
10875 @item %W@{@code{S}@}
10876 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10877 deleted on failure.
10879 @item %@{@code{S}*@}
10880 Substitutes all the switches specified to GCC whose names start
10881 with @code{-S}, but which also take an argument.  This is used for
10882 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10883 GCC considers @option{-o foo} as being
10884 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10885 text, including the space.  Thus two arguments are generated.
10887 @item %@{@code{S}*&@code{T}*@}
10888 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10889 (the order of @code{S} and @code{T} in the spec is not significant).
10890 There can be any number of ampersand-separated variables; for each the
10891 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10893 @item %@{@code{S}:@code{X}@}
10894 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10896 @item %@{!@code{S}:@code{X}@}
10897 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10899 @item %@{@code{S}*:@code{X}@}
10900 Substitutes @code{X} if one or more switches whose names start with
10901 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10902 once, no matter how many such switches appeared.  However, if @code{%*}
10903 appears somewhere in @code{X}, then @code{X} is substituted once
10904 for each matching switch, with the @code{%*} replaced by the part of
10905 that switch matching the @code{*}.
10907 @item %@{.@code{S}:@code{X}@}
10908 Substitutes @code{X}, if processing a file with suffix @code{S}.
10910 @item %@{!.@code{S}:@code{X}@}
10911 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10913 @item %@{,@code{S}:@code{X}@}
10914 Substitutes @code{X}, if processing a file for language @code{S}.
10916 @item %@{!,@code{S}:@code{X}@}
10917 Substitutes @code{X}, if not processing a file for language @code{S}.
10919 @item %@{@code{S}|@code{P}:@code{X}@}
10920 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10921 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10922 @code{*} sequences as well, although they have a stronger binding than
10923 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10924 alternatives must be starred, and only the first matching alternative
10925 is substituted.
10927 For example, a spec string like this:
10929 @smallexample
10930 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10931 @end smallexample
10933 @noindent
10934 outputs the following command-line options from the following input
10935 command-line options:
10937 @smallexample
10938 fred.c        -foo -baz
10939 jim.d         -bar -boggle
10940 -d fred.c     -foo -baz -boggle
10941 -d jim.d      -bar -baz -boggle
10942 @end smallexample
10944 @item %@{S:X; T:Y; :D@}
10946 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10947 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10948 be as many clauses as you need.  This may be combined with @code{.},
10949 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10952 @end table
10954 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10955 construct may contain other nested @samp{%} constructs or spaces, or
10956 even newlines.  They are processed as usual, as described above.
10957 Trailing white space in @code{X} is ignored.  White space may also
10958 appear anywhere on the left side of the colon in these constructs,
10959 except between @code{.} or @code{*} and the corresponding word.
10961 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10962 handled specifically in these constructs.  If another value of
10963 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10964 @option{-W} switch is found later in the command line, the earlier
10965 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10966 just one letter, which passes all matching options.
10968 The character @samp{|} at the beginning of the predicate text is used to
10969 indicate that a command should be piped to the following command, but
10970 only if @option{-pipe} is specified.
10972 It is built into GCC which switches take arguments and which do not.
10973 (You might think it would be useful to generalize this to allow each
10974 compiler's spec to say which switches take arguments.  But this cannot
10975 be done in a consistent fashion.  GCC cannot even decide which input
10976 files have been specified without knowing which switches take arguments,
10977 and it must know which input files to compile in order to tell which
10978 compilers to run).
10980 GCC also knows implicitly that arguments starting in @option{-l} are to be
10981 treated as compiler output files, and passed to the linker in their
10982 proper position among the other output files.
10984 @c man begin OPTIONS
10986 @node Target Options
10987 @section Specifying Target Machine and Compiler Version
10988 @cindex target options
10989 @cindex cross compiling
10990 @cindex specifying machine version
10991 @cindex specifying compiler version and target machine
10992 @cindex compiler version, specifying
10993 @cindex target machine, specifying
10995 The usual way to run GCC is to run the executable called @command{gcc}, or
10996 @command{@var{machine}-gcc} when cross-compiling, or
10997 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10998 one that was installed last.
11000 @node Submodel Options
11001 @section Hardware Models and Configurations
11002 @cindex submodel options
11003 @cindex specifying hardware config
11004 @cindex hardware models and configurations, specifying
11005 @cindex machine dependent options
11007 Each target machine types can have its own
11008 special options, starting with @samp{-m}, to choose among various
11009 hardware models or configurations---for example, 68010 vs 68020,
11010 floating coprocessor or none.  A single installed version of the
11011 compiler can compile for any model or configuration, according to the
11012 options specified.
11014 Some configurations of the compiler also support additional special
11015 options, usually for compatibility with other compilers on the same
11016 platform.
11018 @c This list is ordered alphanumerically by subsection name.
11019 @c It should be the same order and spelling as these options are listed
11020 @c in Machine Dependent Options
11022 @menu
11023 * AArch64 Options::
11024 * Adapteva Epiphany Options::
11025 * ARM Options::
11026 * AVR Options::
11027 * Blackfin Options::
11028 * C6X Options::
11029 * CRIS Options::
11030 * CR16 Options::
11031 * Darwin Options::
11032 * DEC Alpha Options::
11033 * FR30 Options::
11034 * FRV Options::
11035 * GNU/Linux Options::
11036 * H8/300 Options::
11037 * HPPA Options::
11038 * i386 and x86-64 Options::
11039 * i386 and x86-64 Windows Options::
11040 * IA-64 Options::
11041 * LM32 Options::
11042 * M32C Options::
11043 * M32R/D Options::
11044 * M680x0 Options::
11045 * MCore Options::
11046 * MeP Options::
11047 * MicroBlaze Options::
11048 * MIPS Options::
11049 * MMIX Options::
11050 * MN10300 Options::
11051 * Moxie Options::
11052 * MSP430 Options::
11053 * PDP-11 Options::
11054 * picoChip Options::
11055 * PowerPC Options::
11056 * RL78 Options::
11057 * RS/6000 and PowerPC Options::
11058 * RX Options::
11059 * S/390 and zSeries Options::
11060 * Score Options::
11061 * SH Options::
11062 * Solaris 2 Options::
11063 * SPARC Options::
11064 * SPU Options::
11065 * System V Options::
11066 * TILE-Gx Options::
11067 * TILEPro Options::
11068 * V850 Options::
11069 * VAX Options::
11070 * VMS Options::
11071 * VxWorks Options::
11072 * x86-64 Options::
11073 * Xstormy16 Options::
11074 * Xtensa Options::
11075 * zSeries Options::
11076 @end menu
11078 @node AArch64 Options
11079 @subsection AArch64 Options
11080 @cindex AArch64 Options
11082 These options are defined for AArch64 implementations:
11084 @table @gcctabopt
11086 @item -mabi=@var{name}
11087 @opindex mabi
11088 Generate code for the specified data model.  Permissible values
11089 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11090 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11091 but long int and pointer are 64-bit.
11093 The default depends on the specific target configuration.  Note that
11094 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11095 entire program with the same ABI, and link with a compatible set of libraries.
11097 @item -mbig-endian
11098 @opindex mbig-endian
11099 Generate big-endian code.  This is the default when GCC is configured for an
11100 @samp{aarch64_be-*-*} target.
11102 @item -mgeneral-regs-only
11103 @opindex mgeneral-regs-only
11104 Generate code which uses only the general registers.
11106 @item -mlittle-endian
11107 @opindex mlittle-endian
11108 Generate little-endian code.  This is the default when GCC is configured for an
11109 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11111 @item -mcmodel=tiny
11112 @opindex mcmodel=tiny
11113 Generate code for the tiny code model.  The program and its statically defined
11114 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11115 be statically or dynamically linked.  This model is not fully implemented and
11116 mostly treated as @samp{small}.
11118 @item -mcmodel=small
11119 @opindex mcmodel=small
11120 Generate code for the small code model.  The program and its statically defined
11121 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11122 be statically or dynamically linked.  This is the default code model.
11124 @item -mcmodel=large
11125 @opindex mcmodel=large
11126 Generate code for the large code model.  This makes no assumptions about
11127 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11128 statically linked only.
11130 @item -mstrict-align
11131 @opindex mstrict-align
11132 Do not assume that unaligned memory references will be handled by the system.
11134 @item -momit-leaf-frame-pointer
11135 @itemx -mno-omit-leaf-frame-pointer
11136 @opindex momit-leaf-frame-pointer
11137 @opindex mno-omit-leaf-frame-pointer
11138 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11139 default.
11141 @item -mtls-dialect=desc
11142 @opindex mtls-dialect=desc
11143 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11144 of TLS variables.  This is the default.
11146 @item -mtls-dialect=traditional
11147 @opindex mtls-dialect=traditional
11148 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11149 of TLS variables.
11151 @item -march=@var{name}
11152 @opindex march
11153 Specify the name of the target architecture, optionally suffixed by one or
11154 more feature modifiers.  This option has the form
11155 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11156 only value for @var{arch} is @samp{armv8-a}.  The possible values for
11157 @var{feature} are documented in the sub-section below.
11159 Where conflicting feature modifiers are specified, the right-most feature is
11160 used.
11162 GCC uses this name to determine what kind of instructions it can emit when
11163 generating assembly code.  This option can be used in conjunction with or
11164 instead of the @option{-mcpu=} option.
11166 @item -mcpu=@var{name}
11167 @opindex mcpu
11168 Specify the name of the target processor, optionally suffixed by one or more
11169 feature modifiers.  This option has the form
11170 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11171 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
11172 possible values for @var{feature} are documented in the sub-section
11173 below.
11175 Where conflicting feature modifiers are specified, the right-most feature is
11176 used.
11178 GCC uses this name to determine what kind of instructions it can emit when
11179 generating assembly code.
11181 @item -mtune=@var{name}
11182 @opindex mtune
11183 Specify the name of the processor to tune the performance for.  The code will
11184 be tuned as if the target processor were of the type specified in this option,
11185 but still using instructions compatible with the target processor specified
11186 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
11187 modifiers.
11189 @end table
11191 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11192 @cindex @option{-march} feature modifiers
11193 @cindex @option{-mcpu} feature modifiers
11194 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11195 the following:
11197 @table @samp
11198 @item crc
11199 Enable CRC extension.
11200 @item crypto
11201 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11202 @item fp
11203 Enable floating-point instructions.
11204 @item simd
11205 Enable Advanced SIMD instructions.  This implies floating-point instructions
11206 are enabled.  This is the default for all current possible values for options
11207 @option{-march} and @option{-mcpu=}.
11208 @end table
11210 @node Adapteva Epiphany Options
11211 @subsection Adapteva Epiphany Options
11213 These @samp{-m} options are defined for Adapteva Epiphany:
11215 @table @gcctabopt
11216 @item -mhalf-reg-file
11217 @opindex mhalf-reg-file
11218 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11219 That allows code to run on hardware variants that lack these registers.
11221 @item -mprefer-short-insn-regs
11222 @opindex mprefer-short-insn-regs
11223 Preferrentially allocate registers that allow short instruction generation.
11224 This can result in increased instruction count, so this may either reduce or
11225 increase overall code size.
11227 @item -mbranch-cost=@var{num}
11228 @opindex mbranch-cost
11229 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11230 This cost is only a heuristic and is not guaranteed to produce
11231 consistent results across releases.
11233 @item -mcmove
11234 @opindex mcmove
11235 Enable the generation of conditional moves.
11237 @item -mnops=@var{num}
11238 @opindex mnops
11239 Emit @var{num} NOPs before every other generated instruction.
11241 @item -mno-soft-cmpsf
11242 @opindex mno-soft-cmpsf
11243 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11244 and test the flags.  This is faster than a software comparison, but can
11245 get incorrect results in the presence of NaNs, or when two different small
11246 numbers are compared such that their difference is calculated as zero.
11247 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11248 software comparisons.
11250 @item -mstack-offset=@var{num}
11251 @opindex mstack-offset
11252 Set the offset between the top of the stack and the stack pointer.
11253 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11254 can be used by leaf functions without stack allocation.
11255 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11256 Note also that this option changes the ABI; compiling a program with a
11257 different stack offset than the libraries have been compiled with
11258 generally does not work.
11259 This option can be useful if you want to evaluate if a different stack
11260 offset would give you better code, but to actually use a different stack
11261 offset to build working programs, it is recommended to configure the
11262 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11264 @item -mno-round-nearest
11265 @opindex mno-round-nearest
11266 Make the scheduler assume that the rounding mode has been set to
11267 truncating.  The default is @option{-mround-nearest}.
11269 @item -mlong-calls
11270 @opindex mlong-calls
11271 If not otherwise specified by an attribute, assume all calls might be beyond
11272 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11273 function address into a register before performing a (otherwise direct) call.
11274 This is the default.
11276 @item -mshort-calls
11277 @opindex short-calls
11278 If not otherwise specified by an attribute, assume all direct calls are
11279 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11280 for direct calls.  The default is @option{-mlong-calls}.
11282 @item -msmall16
11283 @opindex msmall16
11284 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11285 apply to function addresses for which @option{-mlong-calls} semantics
11286 are in effect.
11288 @item -mfp-mode=@var{mode}
11289 @opindex mfp-mode
11290 Set the prevailing mode of the floating-point unit.
11291 This determines the floating-point mode that is provided and expected
11292 at function call and return time.  Making this mode match the mode you
11293 predominantly need at function start can make your programs smaller and
11294 faster by avoiding unnecessary mode switches.
11296 @var{mode} can be set to one the following values:
11298 @table @samp
11299 @item caller
11300 Any mode at function entry is valid, and retained or restored when
11301 the function returns, and when it calls other functions.
11302 This mode is useful for compiling libraries or other compilation units
11303 you might want to incorporate into different programs with different
11304 prevailing FPU modes, and the convenience of being able to use a single
11305 object file outweighs the size and speed overhead for any extra
11306 mode switching that might be needed, compared with what would be needed
11307 with a more specific choice of prevailing FPU mode.
11309 @item truncate
11310 This is the mode used for floating-point calculations with
11311 truncating (i.e.@: round towards zero) rounding mode.  That includes
11312 conversion from floating point to integer.
11314 @item round-nearest
11315 This is the mode used for floating-point calculations with
11316 round-to-nearest-or-even rounding mode.
11318 @item int
11319 This is the mode used to perform integer calculations in the FPU, e.g.@:
11320 integer multiply, or integer multiply-and-accumulate.
11321 @end table
11323 The default is @option{-mfp-mode=caller}
11325 @item -mnosplit-lohi
11326 @itemx -mno-postinc
11327 @itemx -mno-postmodify
11328 @opindex mnosplit-lohi
11329 @opindex mno-postinc
11330 @opindex mno-postmodify
11331 Code generation tweaks that disable, respectively, splitting of 32-bit
11332 loads, generation of post-increment addresses, and generation of
11333 post-modify addresses.  The defaults are @option{msplit-lohi},
11334 @option{-mpost-inc}, and @option{-mpost-modify}.
11336 @item -mnovect-double
11337 @opindex mno-vect-double
11338 Change the preferred SIMD mode to SImode.  The default is
11339 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11341 @item -max-vect-align=@var{num}
11342 @opindex max-vect-align
11343 The maximum alignment for SIMD vector mode types.
11344 @var{num} may be 4 or 8.  The default is 8.
11345 Note that this is an ABI change, even though many library function
11346 interfaces are unaffected if they don't use SIMD vector modes
11347 in places that affect size and/or alignment of relevant types.
11349 @item -msplit-vecmove-early
11350 @opindex msplit-vecmove-early
11351 Split vector moves into single word moves before reload.  In theory this
11352 can give better register allocation, but so far the reverse seems to be
11353 generally the case.
11355 @item -m1reg-@var{reg}
11356 @opindex m1reg-
11357 Specify a register to hold the constant @minus{}1, which makes loading small negative
11358 constants and certain bitmasks faster.
11359 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11360 which specify use of that register as a fixed register,
11361 and @samp{none}, which means that no register is used for this
11362 purpose.  The default is @option{-m1reg-none}.
11364 @end table
11366 @node ARM Options
11367 @subsection ARM Options
11368 @cindex ARM options
11370 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11371 architectures:
11373 @table @gcctabopt
11374 @item -mabi=@var{name}
11375 @opindex mabi
11376 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11377 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11379 @item -mapcs-frame
11380 @opindex mapcs-frame
11381 Generate a stack frame that is compliant with the ARM Procedure Call
11382 Standard for all functions, even if this is not strictly necessary for
11383 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11384 with this option causes the stack frames not to be generated for
11385 leaf functions.  The default is @option{-mno-apcs-frame}.
11387 @item -mapcs
11388 @opindex mapcs
11389 This is a synonym for @option{-mapcs-frame}.
11391 @ignore
11392 @c not currently implemented
11393 @item -mapcs-stack-check
11394 @opindex mapcs-stack-check
11395 Generate code to check the amount of stack space available upon entry to
11396 every function (that actually uses some stack space).  If there is
11397 insufficient space available then either the function
11398 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11399 called, depending upon the amount of stack space required.  The runtime
11400 system is required to provide these functions.  The default is
11401 @option{-mno-apcs-stack-check}, since this produces smaller code.
11403 @c not currently implemented
11404 @item -mapcs-float
11405 @opindex mapcs-float
11406 Pass floating-point arguments using the floating-point registers.  This is
11407 one of the variants of the APCS@.  This option is recommended if the
11408 target hardware has a floating-point unit or if a lot of floating-point
11409 arithmetic is going to be performed by the code.  The default is
11410 @option{-mno-apcs-float}, since the size of integer-only code is 
11411 slightly increased if @option{-mapcs-float} is used.
11413 @c not currently implemented
11414 @item -mapcs-reentrant
11415 @opindex mapcs-reentrant
11416 Generate reentrant, position-independent code.  The default is
11417 @option{-mno-apcs-reentrant}.
11418 @end ignore
11420 @item -mthumb-interwork
11421 @opindex mthumb-interwork
11422 Generate code that supports calling between the ARM and Thumb
11423 instruction sets.  Without this option, on pre-v5 architectures, the
11424 two instruction sets cannot be reliably used inside one program.  The
11425 default is @option{-mno-thumb-interwork}, since slightly larger code
11426 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11427 configurations this option is meaningless.
11429 @item -mno-sched-prolog
11430 @opindex mno-sched-prolog
11431 Prevent the reordering of instructions in the function prologue, or the
11432 merging of those instruction with the instructions in the function's
11433 body.  This means that all functions start with a recognizable set
11434 of instructions (or in fact one of a choice from a small set of
11435 different function prologues), and this information can be used to
11436 locate the start of functions inside an executable piece of code.  The
11437 default is @option{-msched-prolog}.
11439 @item -mfloat-abi=@var{name}
11440 @opindex mfloat-abi
11441 Specifies which floating-point ABI to use.  Permissible values
11442 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11444 Specifying @samp{soft} causes GCC to generate output containing
11445 library calls for floating-point operations.
11446 @samp{softfp} allows the generation of code using hardware floating-point
11447 instructions, but still uses the soft-float calling conventions.
11448 @samp{hard} allows generation of floating-point instructions
11449 and uses FPU-specific calling conventions.
11451 The default depends on the specific target configuration.  Note that
11452 the hard-float and soft-float ABIs are not link-compatible; you must
11453 compile your entire program with the same ABI, and link with a
11454 compatible set of libraries.
11456 @item -mlittle-endian
11457 @opindex mlittle-endian
11458 Generate code for a processor running in little-endian mode.  This is
11459 the default for all standard configurations.
11461 @item -mbig-endian
11462 @opindex mbig-endian
11463 Generate code for a processor running in big-endian mode; the default is
11464 to compile code for a little-endian processor.
11466 @item -mwords-little-endian
11467 @opindex mwords-little-endian
11468 This option only applies when generating code for big-endian processors.
11469 Generate code for a little-endian word order but a big-endian byte
11470 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11471 option should only be used if you require compatibility with code for
11472 big-endian ARM processors generated by versions of the compiler prior to
11473 2.8.  This option is now deprecated.
11475 @item -mcpu=@var{name}
11476 @opindex mcpu
11477 This specifies the name of the target ARM processor.  GCC uses this name
11478 to determine what kind of instructions it can emit when generating
11479 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
11480 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
11481 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
11482 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
11483 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
11484 @samp{arm720},
11485 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
11486 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
11487 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
11488 @samp{strongarm1110},
11489 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
11490 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
11491 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
11492 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
11493 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
11494 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
11495 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
11496 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
11497 @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-r4}, @samp{cortex-r4f},
11498 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
11499 @samp{cortex-m1},
11500 @samp{cortex-m0},
11501 @samp{cortex-m0plus},
11502 @samp{marvell-pj4},
11503 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
11504 @samp{fa526}, @samp{fa626},
11505 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
11508 @option{-mcpu=generic-@var{arch}} is also permissible, and is
11509 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
11510 See @option{-mtune} for more information.
11512 @option{-mcpu=native} causes the compiler to auto-detect the CPU
11513 of the build computer.  At present, this feature is only supported on
11514 Linux, and not all architectures are recognized.  If the auto-detect is
11515 unsuccessful the option has no effect.
11517 @item -mtune=@var{name}
11518 @opindex mtune
11519 This option is very similar to the @option{-mcpu=} option, except that
11520 instead of specifying the actual target processor type, and hence
11521 restricting which instructions can be used, it specifies that GCC should
11522 tune the performance of the code as if the target were of the type
11523 specified in this option, but still choosing the instructions it
11524 generates based on the CPU specified by a @option{-mcpu=} option.
11525 For some ARM implementations better performance can be obtained by using
11526 this option.
11528 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
11529 performance for a blend of processors within architecture @var{arch}.
11530 The aim is to generate code that run well on the current most popular
11531 processors, balancing between optimizations that benefit some CPUs in the
11532 range, and avoiding performance pitfalls of other CPUs.  The effects of
11533 this option may change in future GCC versions as CPU models come and go.
11535 @option{-mtune=native} causes the compiler to auto-detect the CPU
11536 of the build computer.  At present, this feature is only supported on
11537 Linux, and not all architectures are recognized.  If the auto-detect is
11538 unsuccessful the option has no effect.
11540 @item -march=@var{name}
11541 @opindex march
11542 This specifies the name of the target ARM architecture.  GCC uses this
11543 name to determine what kind of instructions it can emit when generating
11544 assembly code.  This option can be used in conjunction with or instead
11545 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
11546 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
11547 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
11548 @samp{armv6}, @samp{armv6j},
11549 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
11550 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
11551 @samp{armv8-a},
11552 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
11554 @option{-march=native} causes the compiler to auto-detect the architecture
11555 of the build computer.  At present, this feature is only supported on
11556 Linux, and not all architectures are recognized.  If the auto-detect is
11557 unsuccessful the option has no effect.
11559 @item -mfpu=@var{name}
11560 @opindex mfpu
11561 This specifies what floating-point hardware (or hardware emulation) is
11562 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
11563 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
11564 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
11565 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
11566 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
11568 If @option{-msoft-float} is specified this specifies the format of
11569 floating-point values.
11571 If the selected floating-point hardware includes the NEON extension
11572 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
11573 operations are not generated by GCC's auto-vectorization pass unless
11574 @option{-funsafe-math-optimizations} is also specified.  This is
11575 because NEON hardware does not fully implement the IEEE 754 standard for
11576 floating-point arithmetic (in particular denormal values are treated as
11577 zero), so the use of NEON instructions may lead to a loss of precision.
11579 @item -mfp16-format=@var{name}
11580 @opindex mfp16-format
11581 Specify the format of the @code{__fp16} half-precision floating-point type.
11582 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
11583 the default is @samp{none}, in which case the @code{__fp16} type is not
11584 defined.  @xref{Half-Precision}, for more information.
11586 @item -mstructure-size-boundary=@var{n}
11587 @opindex mstructure-size-boundary
11588 The sizes of all structures and unions are rounded up to a multiple
11589 of the number of bits set by this option.  Permissible values are 8, 32
11590 and 64.  The default value varies for different toolchains.  For the COFF
11591 targeted toolchain the default value is 8.  A value of 64 is only allowed
11592 if the underlying ABI supports it.
11594 Specifying a larger number can produce faster, more efficient code, but
11595 can also increase the size of the program.  Different values are potentially
11596 incompatible.  Code compiled with one value cannot necessarily expect to
11597 work with code or libraries compiled with another value, if they exchange
11598 information using structures or unions.
11600 @item -mabort-on-noreturn
11601 @opindex mabort-on-noreturn
11602 Generate a call to the function @code{abort} at the end of a
11603 @code{noreturn} function.  It is executed if the function tries to
11604 return.
11606 @item -mlong-calls
11607 @itemx -mno-long-calls
11608 @opindex mlong-calls
11609 @opindex mno-long-calls
11610 Tells the compiler to perform function calls by first loading the
11611 address of the function into a register and then performing a subroutine
11612 call on this register.  This switch is needed if the target function
11613 lies outside of the 64-megabyte addressing range of the offset-based
11614 version of subroutine call instruction.
11616 Even if this switch is enabled, not all function calls are turned
11617 into long calls.  The heuristic is that static functions, functions
11618 that have the @samp{short-call} attribute, functions that are inside
11619 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
11620 definitions have already been compiled within the current compilation
11621 unit are not turned into long calls.  The exceptions to this rule are
11622 that weak function definitions, functions with the @samp{long-call}
11623 attribute or the @samp{section} attribute, and functions that are within
11624 the scope of a @samp{#pragma long_calls} directive are always
11625 turned into long calls.
11627 This feature is not enabled by default.  Specifying
11628 @option{-mno-long-calls} restores the default behavior, as does
11629 placing the function calls within the scope of a @samp{#pragma
11630 long_calls_off} directive.  Note these switches have no effect on how
11631 the compiler generates code to handle function calls via function
11632 pointers.
11634 @item -msingle-pic-base
11635 @opindex msingle-pic-base
11636 Treat the register used for PIC addressing as read-only, rather than
11637 loading it in the prologue for each function.  The runtime system is
11638 responsible for initializing this register with an appropriate value
11639 before execution begins.
11641 @item -mpic-register=@var{reg}
11642 @opindex mpic-register
11643 Specify the register to be used for PIC addressing.  The default is R10
11644 unless stack-checking is enabled, when R9 is used.
11646 @item -mpoke-function-name
11647 @opindex mpoke-function-name
11648 Write the name of each function into the text section, directly
11649 preceding the function prologue.  The generated code is similar to this:
11651 @smallexample
11652      t0
11653          .ascii "arm_poke_function_name", 0
11654          .align
11655      t1
11656          .word 0xff000000 + (t1 - t0)
11657      arm_poke_function_name
11658          mov     ip, sp
11659          stmfd   sp!, @{fp, ip, lr, pc@}
11660          sub     fp, ip, #4
11661 @end smallexample
11663 When performing a stack backtrace, code can inspect the value of
11664 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11665 location @code{pc - 12} and the top 8 bits are set, then we know that
11666 there is a function name embedded immediately preceding this location
11667 and has length @code{((pc[-3]) & 0xff000000)}.
11669 @item -mthumb
11670 @itemx -marm
11671 @opindex marm
11672 @opindex mthumb
11674 Select between generating code that executes in ARM and Thumb
11675 states.  The default for most configurations is to generate code
11676 that executes in ARM state, but the default can be changed by
11677 configuring GCC with the @option{--with-mode=}@var{state}
11678 configure option.
11680 @item -mtpcs-frame
11681 @opindex mtpcs-frame
11682 Generate a stack frame that is compliant with the Thumb Procedure Call
11683 Standard for all non-leaf functions.  (A leaf function is one that does
11684 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11686 @item -mtpcs-leaf-frame
11687 @opindex mtpcs-leaf-frame
11688 Generate a stack frame that is compliant with the Thumb Procedure Call
11689 Standard for all leaf functions.  (A leaf function is one that does
11690 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11692 @item -mcallee-super-interworking
11693 @opindex mcallee-super-interworking
11694 Gives all externally visible functions in the file being compiled an ARM
11695 instruction set header which switches to Thumb mode before executing the
11696 rest of the function.  This allows these functions to be called from
11697 non-interworking code.  This option is not valid in AAPCS configurations
11698 because interworking is enabled by default.
11700 @item -mcaller-super-interworking
11701 @opindex mcaller-super-interworking
11702 Allows calls via function pointers (including virtual functions) to
11703 execute correctly regardless of whether the target code has been
11704 compiled for interworking or not.  There is a small overhead in the cost
11705 of executing a function pointer if this option is enabled.  This option
11706 is not valid in AAPCS configurations because interworking is enabled
11707 by default.
11709 @item -mtp=@var{name}
11710 @opindex mtp
11711 Specify the access model for the thread local storage pointer.  The valid
11712 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11713 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11714 (supported in the arm6k architecture), and @option{auto}, which uses the
11715 best available method for the selected processor.  The default setting is
11716 @option{auto}.
11718 @item -mtls-dialect=@var{dialect}
11719 @opindex mtls-dialect
11720 Specify the dialect to use for accessing thread local storage.  Two
11721 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11722 @samp{gnu} dialect selects the original GNU scheme for supporting
11723 local and global dynamic TLS models.  The @samp{gnu2} dialect
11724 selects the GNU descriptor scheme, which provides better performance
11725 for shared libraries.  The GNU descriptor scheme is compatible with
11726 the original scheme, but does require new assembler, linker and
11727 library support.  Initial and local exec TLS models are unaffected by
11728 this option and always use the original scheme.
11730 @item -mword-relocations
11731 @opindex mword-relocations
11732 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11733 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11734 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11735 is specified.
11737 @item -mfix-cortex-m3-ldrd
11738 @opindex mfix-cortex-m3-ldrd
11739 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11740 with overlapping destination and base registers are used.  This option avoids
11741 generating these instructions.  This option is enabled by default when
11742 @option{-mcpu=cortex-m3} is specified.
11744 @item -munaligned-access
11745 @itemx -mno-unaligned-access
11746 @opindex munaligned-access
11747 @opindex mno-unaligned-access
11748 Enables (or disables) reading and writing of 16- and 32- bit values
11749 from addresses that are not 16- or 32- bit aligned.  By default
11750 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11751 architectures, and enabled for all other architectures.  If unaligned
11752 access is not enabled then words in packed data structures will be
11753 accessed a byte at a time.
11755 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11756 generated object file to either true or false, depending upon the
11757 setting of this option.  If unaligned access is enabled then the
11758 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11759 defined.
11761 @item -mneon-for-64bits
11762 @opindex mneon-for-64bits
11763 Enables using Neon to handle scalar 64-bits operations. This is
11764 disabled by default since the cost of moving data from core registers
11765 to Neon is high.
11767 @item -mrestrict-it
11768 @opindex mrestrict-it
11769 Restricts generation of IT blocks to conform to the rules of ARMv8.
11770 IT blocks can only contain a single 16-bit instruction from a select
11771 set of instructions. This option is on by default for ARMv8 Thumb mode.
11772 @end table
11774 @node AVR Options
11775 @subsection AVR Options
11776 @cindex AVR Options
11778 These options are defined for AVR implementations:
11780 @table @gcctabopt
11781 @item -mmcu=@var{mcu}
11782 @opindex mmcu
11783 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11785 The default for this option is@tie{}@code{avr2}.
11787 GCC supports the following AVR devices and ISAs:
11789 @include avr-mmcu.texi
11791 @item -maccumulate-args
11792 @opindex maccumulate-args
11793 Accumulate outgoing function arguments and acquire/release the needed
11794 stack space for outgoing function arguments once in function
11795 prologue/epilogue.  Without this option, outgoing arguments are pushed
11796 before calling a function and popped afterwards.
11798 Popping the arguments after the function call can be expensive on
11799 AVR so that accumulating the stack space might lead to smaller
11800 executables because arguments need not to be removed from the
11801 stack after such a function call.
11803 This option can lead to reduced code size for functions that perform
11804 several calls to functions that get their arguments on the stack like
11805 calls to printf-like functions.
11807 @item -mbranch-cost=@var{cost}
11808 @opindex mbranch-cost
11809 Set the branch costs for conditional branch instructions to
11810 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11811 integers. The default branch cost is 0.
11813 @item -mcall-prologues
11814 @opindex mcall-prologues
11815 Functions prologues/epilogues are expanded as calls to appropriate
11816 subroutines.  Code size is smaller.
11818 @item -mint8
11819 @opindex mint8
11820 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11821 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11822 and @code{long long} is 4 bytes.  Please note that this option does not
11823 conform to the C standards, but it results in smaller code
11824 size.
11826 @item -mno-interrupts
11827 @opindex mno-interrupts
11828 Generated code is not compatible with hardware interrupts.
11829 Code size is smaller.
11831 @item -mrelax
11832 @opindex mrelax
11833 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11834 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11835 Setting @code{-mrelax} just adds the @code{--relax} option to the
11836 linker command line when the linker is called.
11838 Jump relaxing is performed by the linker because jump offsets are not
11839 known before code is located. Therefore, the assembler code generated by the
11840 compiler is the same, but the instructions in the executable may
11841 differ from instructions in the assembler code.
11843 Relaxing must be turned on if linker stubs are needed, see the
11844 section on @code{EIND} and linker stubs below.
11846 @item -msp8
11847 @opindex msp8
11848 Treat the stack pointer register as an 8-bit register,
11849 i.e.@: assume the high byte of the stack pointer is zero.
11850 In general, you don't need to set this option by hand.
11852 This option is used internally by the compiler to select and
11853 build multilibs for architectures @code{avr2} and @code{avr25}.
11854 These architectures mix devices with and without @code{SPH}.
11855 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11856 the compiler driver will add or remove this option from the compiler
11857 proper's command line, because the compiler then knows if the device
11858 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11859 register or not.
11861 @item -mstrict-X
11862 @opindex mstrict-X
11863 Use address register @code{X} in a way proposed by the hardware.  This means
11864 that @code{X} is only used in indirect, post-increment or
11865 pre-decrement addressing.
11867 Without this option, the @code{X} register may be used in the same way
11868 as @code{Y} or @code{Z} which then is emulated by additional
11869 instructions.  
11870 For example, loading a value with @code{X+const} addressing with a
11871 small non-negative @code{const < 64} to a register @var{Rn} is
11872 performed as
11874 @example
11875 adiw r26, const   ; X += const
11876 ld   @var{Rn}, X        ; @var{Rn} = *X
11877 sbiw r26, const   ; X -= const
11878 @end example
11880 @item -mtiny-stack
11881 @opindex mtiny-stack
11882 Only change the lower 8@tie{}bits of the stack pointer.
11884 @item -Waddr-space-convert
11885 @opindex Waddr-space-convert
11886 Warn about conversions between address spaces in the case where the
11887 resulting address space is not contained in the incoming address space.
11888 @end table
11890 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11891 @cindex @code{EIND}
11892 Pointers in the implementation are 16@tie{}bits wide.
11893 The address of a function or label is represented as word address so
11894 that indirect jumps and calls can target any code address in the
11895 range of 64@tie{}Ki words.
11897 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11898 bytes of program memory space, there is a special function register called
11899 @code{EIND} that serves as most significant part of the target address
11900 when @code{EICALL} or @code{EIJMP} instructions are used.
11902 Indirect jumps and calls on these devices are handled as follows by
11903 the compiler and are subject to some limitations:
11905 @itemize @bullet
11907 @item
11908 The compiler never sets @code{EIND}.
11910 @item
11911 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11912 instructions or might read @code{EIND} directly in order to emulate an
11913 indirect call/jump by means of a @code{RET} instruction.
11915 @item
11916 The compiler assumes that @code{EIND} never changes during the startup
11917 code or during the application. In particular, @code{EIND} is not
11918 saved/restored in function or interrupt service routine
11919 prologue/epilogue.
11921 @item
11922 For indirect calls to functions and computed goto, the linker
11923 generates @emph{stubs}. Stubs are jump pads sometimes also called
11924 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11925 The stub contains a direct jump to the desired address.
11927 @item
11928 Linker relaxation must be turned on so that the linker will generate
11929 the stubs correctly an all situaltion. See the compiler option
11930 @code{-mrelax} and the linler option @code{--relax}.
11931 There are corner cases where the linker is supposed to generate stubs
11932 but aborts without relaxation and without a helpful error message.
11934 @item
11935 The default linker script is arranged for code with @code{EIND = 0}.
11936 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11937 linker script has to be used in order to place the sections whose
11938 name start with @code{.trampolines} into the segment where @code{EIND}
11939 points to.
11941 @item
11942 The startup code from libgcc never sets @code{EIND}.
11943 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11944 For the impact of AVR-LibC on @code{EIND}, see the
11945 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
11947 @item
11948 It is legitimate for user-specific startup code to set up @code{EIND}
11949 early, for example by means of initialization code located in
11950 section @code{.init3}. Such code runs prior to general startup code
11951 that initializes RAM and calls constructors, but after the bit
11952 of startup code from AVR-LibC that sets @code{EIND} to the segment
11953 where the vector table is located.
11954 @example
11955 #include <avr/io.h>
11957 static void
11958 __attribute__((section(".init3"),naked,used,no_instrument_function))
11959 init3_set_eind (void)
11961   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11962                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11964 @end example
11966 @noindent
11967 The @code{__trampolines_start} symbol is defined in the linker script.
11969 @item
11970 Stubs are generated automatically by the linker if
11971 the following two conditions are met:
11972 @itemize @minus
11974 @item The address of a label is taken by means of the @code{gs} modifier
11975 (short for @emph{generate stubs}) like so:
11976 @example
11977 LDI r24, lo8(gs(@var{func}))
11978 LDI r25, hi8(gs(@var{func}))
11979 @end example
11980 @item The final location of that label is in a code segment
11981 @emph{outside} the segment where the stubs are located.
11982 @end itemize
11984 @item
11985 The compiler emits such @code{gs} modifiers for code labels in the
11986 following situations:
11987 @itemize @minus
11988 @item Taking address of a function or code label.
11989 @item Computed goto.
11990 @item If prologue-save function is used, see @option{-mcall-prologues}
11991 command-line option.
11992 @item Switch/case dispatch tables. If you do not want such dispatch
11993 tables you can specify the @option{-fno-jump-tables} command-line option.
11994 @item C and C++ constructors/destructors called during startup/shutdown.
11995 @item If the tools hit a @code{gs()} modifier explained above.
11996 @end itemize
11998 @item
11999 Jumping to non-symbolic addresses like so is @emph{not} supported:
12001 @example
12002 int main (void)
12004     /* Call function at word address 0x2 */
12005     return ((int(*)(void)) 0x2)();
12007 @end example
12009 Instead, a stub has to be set up, i.e.@: the function has to be called
12010 through a symbol (@code{func_4} in the example):
12012 @example
12013 int main (void)
12015     extern int func_4 (void);
12017     /* Call function at byte address 0x4 */
12018     return func_4();
12020 @end example
12022 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
12023 Alternatively, @code{func_4} can be defined in the linker script.
12024 @end itemize
12026 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
12027 @cindex @code{RAMPD}
12028 @cindex @code{RAMPX}
12029 @cindex @code{RAMPY}
12030 @cindex @code{RAMPZ}
12031 Some AVR devices support memories larger than the 64@tie{}KiB range
12032 that can be accessed with 16-bit pointers.  To access memory locations
12033 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
12034 register is used as high part of the address:
12035 The @code{X}, @code{Y}, @code{Z} address register is concatenated
12036 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
12037 register, respectively, to get a wide address. Similarly,
12038 @code{RAMPD} is used together with direct addressing.
12040 @itemize
12041 @item
12042 The startup code initializes the @code{RAMP} special function
12043 registers with zero.
12045 @item
12046 If a @ref{AVR Named Address Spaces,named address space} other than
12047 generic or @code{__flash} is used, then @code{RAMPZ} is set
12048 as needed before the operation.
12050 @item
12051 If the device supports RAM larger than 64@tie{KiB} and the compiler
12052 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
12053 is reset to zero after the operation.
12055 @item
12056 If the device comes with a specific @code{RAMP} register, the ISR
12057 prologue/epilogue saves/restores that SFR and initializes it with
12058 zero in case the ISR code might (implicitly) use it.
12060 @item
12061 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
12062 If you use inline assembler to read from locations outside the
12063 16-bit address range and change one of the @code{RAMP} registers,
12064 you must reset it to zero after the access.
12066 @end itemize
12068 @subsubsection AVR Built-in Macros
12070 GCC defines several built-in macros so that the user code can test
12071 for the presence or absence of features.  Almost any of the following
12072 built-in macros are deduced from device capabilities and thus
12073 triggered by the @code{-mmcu=} command-line option.
12075 For even more AVR-specific built-in macros see
12076 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
12078 @table @code
12080 @item __AVR_ARCH__
12081 Build-in macro that resolves to a decimal number that identifies the
12082 architecture and depends on the @code{-mmcu=@var{mcu}} option.
12083 Possible values are:
12085 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
12086 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
12087 @code{105}, @code{106}, @code{107}
12089 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
12090 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
12091 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
12092 @code{avrxmega6}, @code{avrxmega7}, respectively.
12093 If @var{mcu} specifies a device, this built-in macro is set
12094 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
12095 defined to @code{4}.
12097 @item __AVR_@var{Device}__
12098 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
12099 the device's name. For example, @code{-mmcu=atmega8} defines the
12100 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
12101 @code{__AVR_ATtiny261A__}, etc.
12103 The built-in macros' names follow
12104 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
12105 the device name as from the AVR user manual. The difference between
12106 @var{Device} in the built-in macro and @var{device} in
12107 @code{-mmcu=@var{device}} is that the latter is always lowercase.
12109 If @var{device} is not a device but only a core architecture like
12110 @code{avr51}, this macro will not be defined.
12112 @item __AVR_XMEGA__
12113 The device / architecture belongs to the XMEGA family of devices.
12115 @item __AVR_HAVE_ELPM__
12116 The device has the the @code{ELPM} instruction.
12118 @item __AVR_HAVE_ELPMX__
12119 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
12120 R@var{n},Z+} instructions.
12122 @item __AVR_HAVE_MOVW__
12123 The device has the @code{MOVW} instruction to perform 16-bit
12124 register-register moves.
12126 @item __AVR_HAVE_LPMX__
12127 The device has the @code{LPM R@var{n},Z} and
12128 @code{LPM R@var{n},Z+} instructions.
12130 @item __AVR_HAVE_MUL__
12131 The device has a hardware multiplier. 
12133 @item __AVR_HAVE_JMP_CALL__
12134 The device has the @code{JMP} and @code{CALL} instructions.
12135 This is the case for devices with at least 16@tie{}KiB of program
12136 memory.
12138 @item __AVR_HAVE_EIJMP_EICALL__
12139 @itemx __AVR_3_BYTE_PC__
12140 The device has the @code{EIJMP} and @code{EICALL} instructions.
12141 This is the case for devices with more than 128@tie{}KiB of program memory.
12142 This also means that the program counter
12143 (PC) is 3@tie{}bytes wide.
12145 @item __AVR_2_BYTE_PC__
12146 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
12147 with up to 128@tie{}KiB of program memory.
12149 @item __AVR_HAVE_8BIT_SP__
12150 @itemx __AVR_HAVE_16BIT_SP__
12151 The stack pointer (SP) register is treated as 8-bit respectively
12152 16-bit register by the compiler.
12153 The definition of these macros is affected by @code{-mtiny-stack}.
12155 @item __AVR_HAVE_SPH__
12156 @itemx __AVR_SP8__
12157 The device has the SPH (high part of stack pointer) special function
12158 register or has an 8-bit stack pointer, respectively.
12159 The definition of these macros is affected by @code{-mmcu=} and
12160 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
12161 by @code{-msp8}.
12163 @item __AVR_HAVE_RAMPD__
12164 @itemx __AVR_HAVE_RAMPX__
12165 @itemx __AVR_HAVE_RAMPY__
12166 @itemx __AVR_HAVE_RAMPZ__
12167 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
12168 @code{RAMPZ} special function register, respectively.
12170 @item __NO_INTERRUPTS__
12171 This macro reflects the @code{-mno-interrupts} command line option.
12173 @item __AVR_ERRATA_SKIP__
12174 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
12175 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
12176 instructions because of a hardware erratum.  Skip instructions are
12177 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
12178 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
12179 set.
12181 @item __AVR_SFR_OFFSET__=@var{offset}
12182 Instructions that can address I/O special function registers directly
12183 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
12184 address as if addressed by an instruction to access RAM like @code{LD}
12185 or @code{STS}. This offset depends on the device architecture and has
12186 to be subtracted from the RAM address in order to get the
12187 respective I/O@tie{}address.
12189 @item __WITH_AVRLIBC__
12190 The compiler is configured to be used together with AVR-Libc.
12191 See the @code{--with-avrlibc} configure option.
12193 @end table
12195 @node Blackfin Options
12196 @subsection Blackfin Options
12197 @cindex Blackfin Options
12199 @table @gcctabopt
12200 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
12201 @opindex mcpu=
12202 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
12203 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
12204 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
12205 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
12206 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
12207 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
12208 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
12209 @samp{bf561}, @samp{bf592}.
12211 The optional @var{sirevision} specifies the silicon revision of the target
12212 Blackfin processor.  Any workarounds available for the targeted silicon revision
12213 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
12214 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
12215 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
12216 hexadecimal digits representing the major and minor numbers in the silicon
12217 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
12218 is not defined.  If @var{sirevision} is @samp{any}, the
12219 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
12220 If this optional @var{sirevision} is not used, GCC assumes the latest known
12221 silicon revision of the targeted Blackfin processor.
12223 GCC defines a preprocessor macro for the specified @var{cpu}.
12224 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
12225 provided by libgloss to be linked in if @option{-msim} is not given.
12227 Without this option, @samp{bf532} is used as the processor by default.
12229 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
12230 only the preprocessor macro is defined.
12232 @item -msim
12233 @opindex msim
12234 Specifies that the program will be run on the simulator.  This causes
12235 the simulator BSP provided by libgloss to be linked in.  This option
12236 has effect only for @samp{bfin-elf} toolchain.
12237 Certain other options, such as @option{-mid-shared-library} and
12238 @option{-mfdpic}, imply @option{-msim}.
12240 @item -momit-leaf-frame-pointer
12241 @opindex momit-leaf-frame-pointer
12242 Don't keep the frame pointer in a register for leaf functions.  This
12243 avoids the instructions to save, set up and restore frame pointers and
12244 makes an extra register available in leaf functions.  The option
12245 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
12246 which might make debugging harder.
12248 @item -mspecld-anomaly
12249 @opindex mspecld-anomaly
12250 When enabled, the compiler ensures that the generated code does not
12251 contain speculative loads after jump instructions. If this option is used,
12252 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
12254 @item -mno-specld-anomaly
12255 @opindex mno-specld-anomaly
12256 Don't generate extra code to prevent speculative loads from occurring.
12258 @item -mcsync-anomaly
12259 @opindex mcsync-anomaly
12260 When enabled, the compiler ensures that the generated code does not
12261 contain CSYNC or SSYNC instructions too soon after conditional branches.
12262 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
12264 @item -mno-csync-anomaly
12265 @opindex mno-csync-anomaly
12266 Don't generate extra code to prevent CSYNC or SSYNC instructions from
12267 occurring too soon after a conditional branch.
12269 @item -mlow-64k
12270 @opindex mlow-64k
12271 When enabled, the compiler is free to take advantage of the knowledge that
12272 the entire program fits into the low 64k of memory.
12274 @item -mno-low-64k
12275 @opindex mno-low-64k
12276 Assume that the program is arbitrarily large.  This is the default.
12278 @item -mstack-check-l1
12279 @opindex mstack-check-l1
12280 Do stack checking using information placed into L1 scratchpad memory by the
12281 uClinux kernel.
12283 @item -mid-shared-library
12284 @opindex mid-shared-library
12285 Generate code that supports shared libraries via the library ID method.
12286 This allows for execute in place and shared libraries in an environment
12287 without virtual memory management.  This option implies @option{-fPIC}.
12288 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12290 @item -mno-id-shared-library
12291 @opindex mno-id-shared-library
12292 Generate code that doesn't assume ID-based shared libraries are being used.
12293 This is the default.
12295 @item -mleaf-id-shared-library
12296 @opindex mleaf-id-shared-library
12297 Generate code that supports shared libraries via the library ID method,
12298 but assumes that this library or executable won't link against any other
12299 ID shared libraries.  That allows the compiler to use faster code for jumps
12300 and calls.
12302 @item -mno-leaf-id-shared-library
12303 @opindex mno-leaf-id-shared-library
12304 Do not assume that the code being compiled won't link against any ID shared
12305 libraries.  Slower code is generated for jump and call insns.
12307 @item -mshared-library-id=n
12308 @opindex mshared-library-id
12309 Specifies the identification number of the ID-based shared library being
12310 compiled.  Specifying a value of 0 generates more compact code; specifying
12311 other values forces the allocation of that number to the current
12312 library but is no more space- or time-efficient than omitting this option.
12314 @item -msep-data
12315 @opindex msep-data
12316 Generate code that allows the data segment to be located in a different
12317 area of memory from the text segment.  This allows for execute in place in
12318 an environment without virtual memory management by eliminating relocations
12319 against the text section.
12321 @item -mno-sep-data
12322 @opindex mno-sep-data
12323 Generate code that assumes that the data segment follows the text segment.
12324 This is the default.
12326 @item -mlong-calls
12327 @itemx -mno-long-calls
12328 @opindex mlong-calls
12329 @opindex mno-long-calls
12330 Tells the compiler to perform function calls by first loading the
12331 address of the function into a register and then performing a subroutine
12332 call on this register.  This switch is needed if the target function
12333 lies outside of the 24-bit addressing range of the offset-based
12334 version of subroutine call instruction.
12336 This feature is not enabled by default.  Specifying
12337 @option{-mno-long-calls} restores the default behavior.  Note these
12338 switches have no effect on how the compiler generates code to handle
12339 function calls via function pointers.
12341 @item -mfast-fp
12342 @opindex mfast-fp
12343 Link with the fast floating-point library. This library relaxes some of
12344 the IEEE floating-point standard's rules for checking inputs against
12345 Not-a-Number (NAN), in the interest of performance.
12347 @item -minline-plt
12348 @opindex minline-plt
12349 Enable inlining of PLT entries in function calls to functions that are
12350 not known to bind locally.  It has no effect without @option{-mfdpic}.
12352 @item -mmulticore
12353 @opindex mmulticore
12354 Build a standalone application for multicore Blackfin processors. 
12355 This option causes proper start files and link scripts supporting 
12356 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12357 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12359 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12360 selects the one-application-per-core programming model.  Without
12361 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12362 programming model is used. In this model, the main function of Core B
12363 should be named as @code{coreb_main}.
12365 If this option is not used, the single-core application programming
12366 model is used.
12368 @item -mcorea
12369 @opindex mcorea
12370 Build a standalone application for Core A of BF561 when using
12371 the one-application-per-core programming model. Proper start files
12372 and link scripts are used to support Core A, and the macro
12373 @code{__BFIN_COREA} is defined.
12374 This option can only be used in conjunction with @option{-mmulticore}.
12376 @item -mcoreb
12377 @opindex mcoreb
12378 Build a standalone application for Core B of BF561 when using
12379 the one-application-per-core programming model. Proper start files
12380 and link scripts are used to support Core B, and the macro
12381 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12382 should be used instead of @code{main}. 
12383 This option can only be used in conjunction with @option{-mmulticore}.
12385 @item -msdram
12386 @opindex msdram
12387 Build a standalone application for SDRAM. Proper start files and
12388 link scripts are used to put the application into SDRAM, and the macro
12389 @code{__BFIN_SDRAM} is defined.
12390 The loader should initialize SDRAM before loading the application.
12392 @item -micplb
12393 @opindex micplb
12394 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12395 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12396 are enabled; for standalone applications the default is off.
12397 @end table
12399 @node C6X Options
12400 @subsection C6X Options
12401 @cindex C6X Options
12403 @table @gcctabopt
12404 @item -march=@var{name}
12405 @opindex march
12406 This specifies the name of the target architecture.  GCC uses this
12407 name to determine what kind of instructions it can emit when generating
12408 assembly code.  Permissible names are: @samp{c62x},
12409 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12411 @item -mbig-endian
12412 @opindex mbig-endian
12413 Generate code for a big-endian target.
12415 @item -mlittle-endian
12416 @opindex mlittle-endian
12417 Generate code for a little-endian target.  This is the default.
12419 @item -msim
12420 @opindex msim
12421 Choose startup files and linker script suitable for the simulator.
12423 @item -msdata=default
12424 @opindex msdata=default
12425 Put small global and static data in the @samp{.neardata} section,
12426 which is pointed to by register @code{B14}.  Put small uninitialized
12427 global and static data in the @samp{.bss} section, which is adjacent
12428 to the @samp{.neardata} section.  Put small read-only data into the
12429 @samp{.rodata} section.  The corresponding sections used for large
12430 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12432 @item -msdata=all
12433 @opindex msdata=all
12434 Put all data, not just small objects, into the sections reserved for
12435 small data, and use addressing relative to the @code{B14} register to
12436 access them.
12438 @item -msdata=none
12439 @opindex msdata=none
12440 Make no use of the sections reserved for small data, and use absolute
12441 addresses to access all data.  Put all initialized global and static
12442 data in the @samp{.fardata} section, and all uninitialized data in the
12443 @samp{.far} section.  Put all constant data into the @samp{.const}
12444 section.
12445 @end table
12447 @node CRIS Options
12448 @subsection CRIS Options
12449 @cindex CRIS Options
12451 These options are defined specifically for the CRIS ports.
12453 @table @gcctabopt
12454 @item -march=@var{architecture-type}
12455 @itemx -mcpu=@var{architecture-type}
12456 @opindex march
12457 @opindex mcpu
12458 Generate code for the specified architecture.  The choices for
12459 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12460 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12461 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12462 @samp{v10}.
12464 @item -mtune=@var{architecture-type}
12465 @opindex mtune
12466 Tune to @var{architecture-type} everything applicable about the generated
12467 code, except for the ABI and the set of available instructions.  The
12468 choices for @var{architecture-type} are the same as for
12469 @option{-march=@var{architecture-type}}.
12471 @item -mmax-stack-frame=@var{n}
12472 @opindex mmax-stack-frame
12473 Warn when the stack frame of a function exceeds @var{n} bytes.
12475 @item -metrax4
12476 @itemx -metrax100
12477 @opindex metrax4
12478 @opindex metrax100
12479 The options @option{-metrax4} and @option{-metrax100} are synonyms for
12480 @option{-march=v3} and @option{-march=v8} respectively.
12482 @item -mmul-bug-workaround
12483 @itemx -mno-mul-bug-workaround
12484 @opindex mmul-bug-workaround
12485 @opindex mno-mul-bug-workaround
12486 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
12487 models where it applies.  This option is active by default.
12489 @item -mpdebug
12490 @opindex mpdebug
12491 Enable CRIS-specific verbose debug-related information in the assembly
12492 code.  This option also has the effect of turning off the @samp{#NO_APP}
12493 formatted-code indicator to the assembler at the beginning of the
12494 assembly file.
12496 @item -mcc-init
12497 @opindex mcc-init
12498 Do not use condition-code results from previous instruction; always emit
12499 compare and test instructions before use of condition codes.
12501 @item -mno-side-effects
12502 @opindex mno-side-effects
12503 Do not emit instructions with side effects in addressing modes other than
12504 post-increment.
12506 @item -mstack-align
12507 @itemx -mno-stack-align
12508 @itemx -mdata-align
12509 @itemx -mno-data-align
12510 @itemx -mconst-align
12511 @itemx -mno-const-align
12512 @opindex mstack-align
12513 @opindex mno-stack-align
12514 @opindex mdata-align
12515 @opindex mno-data-align
12516 @opindex mconst-align
12517 @opindex mno-const-align
12518 These options (@samp{no-} options) arrange (eliminate arrangements) for the
12519 stack frame, individual data and constants to be aligned for the maximum
12520 single data access size for the chosen CPU model.  The default is to
12521 arrange for 32-bit alignment.  ABI details such as structure layout are
12522 not affected by these options.
12524 @item -m32-bit
12525 @itemx -m16-bit
12526 @itemx -m8-bit
12527 @opindex m32-bit
12528 @opindex m16-bit
12529 @opindex m8-bit
12530 Similar to the stack- data- and const-align options above, these options
12531 arrange for stack frame, writable data and constants to all be 32-bit,
12532 16-bit or 8-bit aligned.  The default is 32-bit alignment.
12534 @item -mno-prologue-epilogue
12535 @itemx -mprologue-epilogue
12536 @opindex mno-prologue-epilogue
12537 @opindex mprologue-epilogue
12538 With @option{-mno-prologue-epilogue}, the normal function prologue and
12539 epilogue which set up the stack frame are omitted and no return
12540 instructions or return sequences are generated in the code.  Use this
12541 option only together with visual inspection of the compiled code: no
12542 warnings or errors are generated when call-saved registers must be saved,
12543 or storage for local variables needs to be allocated.
12545 @item -mno-gotplt
12546 @itemx -mgotplt
12547 @opindex mno-gotplt
12548 @opindex mgotplt
12549 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
12550 instruction sequences that load addresses for functions from the PLT part
12551 of the GOT rather than (traditional on other architectures) calls to the
12552 PLT@.  The default is @option{-mgotplt}.
12554 @item -melf
12555 @opindex melf
12556 Legacy no-op option only recognized with the cris-axis-elf and
12557 cris-axis-linux-gnu targets.
12559 @item -mlinux
12560 @opindex mlinux
12561 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
12563 @item -sim
12564 @opindex sim
12565 This option, recognized for the cris-axis-elf, arranges
12566 to link with input-output functions from a simulator library.  Code,
12567 initialized data and zero-initialized data are allocated consecutively.
12569 @item -sim2
12570 @opindex sim2
12571 Like @option{-sim}, but pass linker options to locate initialized data at
12572 0x40000000 and zero-initialized data at 0x80000000.
12573 @end table
12575 @node CR16 Options
12576 @subsection CR16 Options
12577 @cindex CR16 Options
12579 These options are defined specifically for the CR16 ports.
12581 @table @gcctabopt
12583 @item -mmac
12584 @opindex mmac
12585 Enable the use of multiply-accumulate instructions. Disabled by default.
12587 @item -mcr16cplus
12588 @itemx -mcr16c
12589 @opindex mcr16cplus
12590 @opindex mcr16c
12591 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
12592 is default.
12594 @item -msim
12595 @opindex msim
12596 Links the library libsim.a which is in compatible with simulator. Applicable
12597 to ELF compiler only.
12599 @item -mint32
12600 @opindex mint32
12601 Choose integer type as 32-bit wide.
12603 @item -mbit-ops
12604 @opindex mbit-ops
12605 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
12607 @item -mdata-model=@var{model}
12608 @opindex mdata-model
12609 Choose a data model. The choices for @var{model} are @samp{near},
12610 @samp{far} or @samp{medium}. @samp{medium} is default.
12611 However, @samp{far} is not valid with @option{-mcr16c}, as the
12612 CR16C architecture does not support the far data model.
12613 @end table
12615 @node Darwin Options
12616 @subsection Darwin Options
12617 @cindex Darwin options
12619 These options are defined for all architectures running the Darwin operating
12620 system.
12622 FSF GCC on Darwin does not create ``fat'' object files; it creates
12623 an object file for the single architecture that GCC was built to
12624 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
12625 @option{-arch} options are used; it does so by running the compiler or
12626 linker multiple times and joining the results together with
12627 @file{lipo}.
12629 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
12630 @samp{i686}) is determined by the flags that specify the ISA
12631 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
12632 @option{-force_cpusubtype_ALL} option can be used to override this.
12634 The Darwin tools vary in their behavior when presented with an ISA
12635 mismatch.  The assembler, @file{as}, only permits instructions to
12636 be used that are valid for the subtype of the file it is generating,
12637 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
12638 The linker for shared libraries, @file{/usr/bin/libtool}, fails
12639 and prints an error if asked to create a shared library with a less
12640 restrictive subtype than its input files (for instance, trying to put
12641 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
12642 for executables, @command{ld}, quietly gives the executable the most
12643 restrictive subtype of any of its input files.
12645 @table @gcctabopt
12646 @item -F@var{dir}
12647 @opindex F
12648 Add the framework directory @var{dir} to the head of the list of
12649 directories to be searched for header files.  These directories are
12650 interleaved with those specified by @option{-I} options and are
12651 scanned in a left-to-right order.
12653 A framework directory is a directory with frameworks in it.  A
12654 framework is a directory with a @file{Headers} and/or
12655 @file{PrivateHeaders} directory contained directly in it that ends
12656 in @file{.framework}.  The name of a framework is the name of this
12657 directory excluding the @file{.framework}.  Headers associated with
12658 the framework are found in one of those two directories, with
12659 @file{Headers} being searched first.  A subframework is a framework
12660 directory that is in a framework's @file{Frameworks} directory.
12661 Includes of subframework headers can only appear in a header of a
12662 framework that contains the subframework, or in a sibling subframework
12663 header.  Two subframeworks are siblings if they occur in the same
12664 framework.  A subframework should not have the same name as a
12665 framework; a warning is issued if this is violated.  Currently a
12666 subframework cannot have subframeworks; in the future, the mechanism
12667 may be extended to support this.  The standard frameworks can be found
12668 in @file{/System/Library/Frameworks} and
12669 @file{/Library/Frameworks}.  An example include looks like
12670 @code{#include <Framework/header.h>}, where @file{Framework} denotes
12671 the name of the framework and @file{header.h} is found in the
12672 @file{PrivateHeaders} or @file{Headers} directory.
12674 @item -iframework@var{dir}
12675 @opindex iframework
12676 Like @option{-F} except the directory is a treated as a system
12677 directory.  The main difference between this @option{-iframework} and
12678 @option{-F} is that with @option{-iframework} the compiler does not
12679 warn about constructs contained within header files found via
12680 @var{dir}.  This option is valid only for the C family of languages.
12682 @item -gused
12683 @opindex gused
12684 Emit debugging information for symbols that are used.  For stabs
12685 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12686 This is by default ON@.
12688 @item -gfull
12689 @opindex gfull
12690 Emit debugging information for all symbols and types.
12692 @item -mmacosx-version-min=@var{version}
12693 The earliest version of MacOS X that this executable will run on
12694 is @var{version}.  Typical values of @var{version} include @code{10.1},
12695 @code{10.2}, and @code{10.3.9}.
12697 If the compiler was built to use the system's headers by default,
12698 then the default for this option is the system version on which the
12699 compiler is running, otherwise the default is to make choices that
12700 are compatible with as many systems and code bases as possible.
12702 @item -mkernel
12703 @opindex mkernel
12704 Enable kernel development mode.  The @option{-mkernel} option sets
12705 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12706 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12707 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12708 applicable.  This mode also sets @option{-mno-altivec},
12709 @option{-msoft-float}, @option{-fno-builtin} and
12710 @option{-mlong-branch} for PowerPC targets.
12712 @item -mone-byte-bool
12713 @opindex mone-byte-bool
12714 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12715 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12716 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12717 option has no effect on x86.
12719 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12720 to generate code that is not binary compatible with code generated
12721 without that switch.  Using this switch may require recompiling all
12722 other modules in a program, including system libraries.  Use this
12723 switch to conform to a non-default data model.
12725 @item -mfix-and-continue
12726 @itemx -ffix-and-continue
12727 @itemx -findirect-data
12728 @opindex mfix-and-continue
12729 @opindex ffix-and-continue
12730 @opindex findirect-data
12731 Generate code suitable for fast turnaround development, such as to
12732 allow GDB to dynamically load @code{.o} files into already-running
12733 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12734 are provided for backwards compatibility.
12736 @item -all_load
12737 @opindex all_load
12738 Loads all members of static archive libraries.
12739 See man ld(1) for more information.
12741 @item -arch_errors_fatal
12742 @opindex arch_errors_fatal
12743 Cause the errors having to do with files that have the wrong architecture
12744 to be fatal.
12746 @item -bind_at_load
12747 @opindex bind_at_load
12748 Causes the output file to be marked such that the dynamic linker will
12749 bind all undefined references when the file is loaded or launched.
12751 @item -bundle
12752 @opindex bundle
12753 Produce a Mach-o bundle format file.
12754 See man ld(1) for more information.
12756 @item -bundle_loader @var{executable}
12757 @opindex bundle_loader
12758 This option specifies the @var{executable} that will load the build
12759 output file being linked.  See man ld(1) for more information.
12761 @item -dynamiclib
12762 @opindex dynamiclib
12763 When passed this option, GCC produces a dynamic library instead of
12764 an executable when linking, using the Darwin @file{libtool} command.
12766 @item -force_cpusubtype_ALL
12767 @opindex force_cpusubtype_ALL
12768 This causes GCC's output file to have the @var{ALL} subtype, instead of
12769 one controlled by the @option{-mcpu} or @option{-march} option.
12771 @item -allowable_client  @var{client_name}
12772 @itemx -client_name
12773 @itemx -compatibility_version
12774 @itemx -current_version
12775 @itemx -dead_strip
12776 @itemx -dependency-file
12777 @itemx -dylib_file
12778 @itemx -dylinker_install_name
12779 @itemx -dynamic
12780 @itemx -exported_symbols_list
12781 @itemx -filelist
12782 @need 800
12783 @itemx -flat_namespace
12784 @itemx -force_flat_namespace
12785 @itemx -headerpad_max_install_names
12786 @itemx -image_base
12787 @itemx -init
12788 @itemx -install_name
12789 @itemx -keep_private_externs
12790 @itemx -multi_module
12791 @itemx -multiply_defined
12792 @itemx -multiply_defined_unused
12793 @need 800
12794 @itemx -noall_load
12795 @itemx -no_dead_strip_inits_and_terms
12796 @itemx -nofixprebinding
12797 @itemx -nomultidefs
12798 @itemx -noprebind
12799 @itemx -noseglinkedit
12800 @itemx -pagezero_size
12801 @itemx -prebind
12802 @itemx -prebind_all_twolevel_modules
12803 @itemx -private_bundle
12804 @need 800
12805 @itemx -read_only_relocs
12806 @itemx -sectalign
12807 @itemx -sectobjectsymbols
12808 @itemx -whyload
12809 @itemx -seg1addr
12810 @itemx -sectcreate
12811 @itemx -sectobjectsymbols
12812 @itemx -sectorder
12813 @itemx -segaddr
12814 @itemx -segs_read_only_addr
12815 @need 800
12816 @itemx -segs_read_write_addr
12817 @itemx -seg_addr_table
12818 @itemx -seg_addr_table_filename
12819 @itemx -seglinkedit
12820 @itemx -segprot
12821 @itemx -segs_read_only_addr
12822 @itemx -segs_read_write_addr
12823 @itemx -single_module
12824 @itemx -static
12825 @itemx -sub_library
12826 @need 800
12827 @itemx -sub_umbrella
12828 @itemx -twolevel_namespace
12829 @itemx -umbrella
12830 @itemx -undefined
12831 @itemx -unexported_symbols_list
12832 @itemx -weak_reference_mismatches
12833 @itemx -whatsloaded
12834 @opindex allowable_client
12835 @opindex client_name
12836 @opindex compatibility_version
12837 @opindex current_version
12838 @opindex dead_strip
12839 @opindex dependency-file
12840 @opindex dylib_file
12841 @opindex dylinker_install_name
12842 @opindex dynamic
12843 @opindex exported_symbols_list
12844 @opindex filelist
12845 @opindex flat_namespace
12846 @opindex force_flat_namespace
12847 @opindex headerpad_max_install_names
12848 @opindex image_base
12849 @opindex init
12850 @opindex install_name
12851 @opindex keep_private_externs
12852 @opindex multi_module
12853 @opindex multiply_defined
12854 @opindex multiply_defined_unused
12855 @opindex noall_load
12856 @opindex no_dead_strip_inits_and_terms
12857 @opindex nofixprebinding
12858 @opindex nomultidefs
12859 @opindex noprebind
12860 @opindex noseglinkedit
12861 @opindex pagezero_size
12862 @opindex prebind
12863 @opindex prebind_all_twolevel_modules
12864 @opindex private_bundle
12865 @opindex read_only_relocs
12866 @opindex sectalign
12867 @opindex sectobjectsymbols
12868 @opindex whyload
12869 @opindex seg1addr
12870 @opindex sectcreate
12871 @opindex sectobjectsymbols
12872 @opindex sectorder
12873 @opindex segaddr
12874 @opindex segs_read_only_addr
12875 @opindex segs_read_write_addr
12876 @opindex seg_addr_table
12877 @opindex seg_addr_table_filename
12878 @opindex seglinkedit
12879 @opindex segprot
12880 @opindex segs_read_only_addr
12881 @opindex segs_read_write_addr
12882 @opindex single_module
12883 @opindex static
12884 @opindex sub_library
12885 @opindex sub_umbrella
12886 @opindex twolevel_namespace
12887 @opindex umbrella
12888 @opindex undefined
12889 @opindex unexported_symbols_list
12890 @opindex weak_reference_mismatches
12891 @opindex whatsloaded
12892 These options are passed to the Darwin linker.  The Darwin linker man page
12893 describes them in detail.
12894 @end table
12896 @node DEC Alpha Options
12897 @subsection DEC Alpha Options
12899 These @samp{-m} options are defined for the DEC Alpha implementations:
12901 @table @gcctabopt
12902 @item -mno-soft-float
12903 @itemx -msoft-float
12904 @opindex mno-soft-float
12905 @opindex msoft-float
12906 Use (do not use) the hardware floating-point instructions for
12907 floating-point operations.  When @option{-msoft-float} is specified,
12908 functions in @file{libgcc.a} are used to perform floating-point
12909 operations.  Unless they are replaced by routines that emulate the
12910 floating-point operations, or compiled in such a way as to call such
12911 emulations routines, these routines issue floating-point
12912 operations.   If you are compiling for an Alpha without floating-point
12913 operations, you must ensure that the library is built so as not to call
12914 them.
12916 Note that Alpha implementations without floating-point operations are
12917 required to have floating-point registers.
12919 @item -mfp-reg
12920 @itemx -mno-fp-regs
12921 @opindex mfp-reg
12922 @opindex mno-fp-regs
12923 Generate code that uses (does not use) the floating-point register set.
12924 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12925 register set is not used, floating-point operands are passed in integer
12926 registers as if they were integers and floating-point results are passed
12927 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12928 so any function with a floating-point argument or return value called by code
12929 compiled with @option{-mno-fp-regs} must also be compiled with that
12930 option.
12932 A typical use of this option is building a kernel that does not use,
12933 and hence need not save and restore, any floating-point registers.
12935 @item -mieee
12936 @opindex mieee
12937 The Alpha architecture implements floating-point hardware optimized for
12938 maximum performance.  It is mostly compliant with the IEEE floating-point
12939 standard.  However, for full compliance, software assistance is
12940 required.  This option generates code fully IEEE-compliant code
12941 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12942 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12943 defined during compilation.  The resulting code is less efficient but is
12944 able to correctly support denormalized numbers and exceptional IEEE
12945 values such as not-a-number and plus/minus infinity.  Other Alpha
12946 compilers call this option @option{-ieee_with_no_inexact}.
12948 @item -mieee-with-inexact
12949 @opindex mieee-with-inexact
12950 This is like @option{-mieee} except the generated code also maintains
12951 the IEEE @var{inexact-flag}.  Turning on this option causes the
12952 generated code to implement fully-compliant IEEE math.  In addition to
12953 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12954 macro.  On some Alpha implementations the resulting code may execute
12955 significantly slower than the code generated by default.  Since there is
12956 very little code that depends on the @var{inexact-flag}, you should
12957 normally not specify this option.  Other Alpha compilers call this
12958 option @option{-ieee_with_inexact}.
12960 @item -mfp-trap-mode=@var{trap-mode}
12961 @opindex mfp-trap-mode
12962 This option controls what floating-point related traps are enabled.
12963 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12964 The trap mode can be set to one of four values:
12966 @table @samp
12967 @item n
12968 This is the default (normal) setting.  The only traps that are enabled
12969 are the ones that cannot be disabled in software (e.g., division by zero
12970 trap).
12972 @item u
12973 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12974 as well.
12976 @item su
12977 Like @samp{u}, but the instructions are marked to be safe for software
12978 completion (see Alpha architecture manual for details).
12980 @item sui
12981 Like @samp{su}, but inexact traps are enabled as well.
12982 @end table
12984 @item -mfp-rounding-mode=@var{rounding-mode}
12985 @opindex mfp-rounding-mode
12986 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12987 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12990 @table @samp
12991 @item n
12992 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12993 the nearest machine number or towards the even machine number in case
12994 of a tie.
12996 @item m
12997 Round towards minus infinity.
12999 @item c
13000 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
13002 @item d
13003 Dynamic rounding mode.  A field in the floating-point control register
13004 (@var{fpcr}, see Alpha architecture reference manual) controls the
13005 rounding mode in effect.  The C library initializes this register for
13006 rounding towards plus infinity.  Thus, unless your program modifies the
13007 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
13008 @end table
13010 @item -mtrap-precision=@var{trap-precision}
13011 @opindex mtrap-precision
13012 In the Alpha architecture, floating-point traps are imprecise.  This
13013 means without software assistance it is impossible to recover from a
13014 floating trap and program execution normally needs to be terminated.
13015 GCC can generate code that can assist operating system trap handlers
13016 in determining the exact location that caused a floating-point trap.
13017 Depending on the requirements of an application, different levels of
13018 precisions can be selected:
13020 @table @samp
13021 @item p
13022 Program precision.  This option is the default and means a trap handler
13023 can only identify which program caused a floating-point exception.
13025 @item f
13026 Function precision.  The trap handler can determine the function that
13027 caused a floating-point exception.
13029 @item i
13030 Instruction precision.  The trap handler can determine the exact
13031 instruction that caused a floating-point exception.
13032 @end table
13034 Other Alpha compilers provide the equivalent options called
13035 @option{-scope_safe} and @option{-resumption_safe}.
13037 @item -mieee-conformant
13038 @opindex mieee-conformant
13039 This option marks the generated code as IEEE conformant.  You must not
13040 use this option unless you also specify @option{-mtrap-precision=i} and either
13041 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
13042 is to emit the line @samp{.eflag 48} in the function prologue of the
13043 generated assembly file.
13045 @item -mbuild-constants
13046 @opindex mbuild-constants
13047 Normally GCC examines a 32- or 64-bit integer constant to
13048 see if it can construct it from smaller constants in two or three
13049 instructions.  If it cannot, it outputs the constant as a literal and
13050 generates code to load it from the data segment at run time.
13052 Use this option to require GCC to construct @emph{all} integer constants
13053 using code, even if it takes more instructions (the maximum is six).
13055 You typically use this option to build a shared library dynamic
13056 loader.  Itself a shared library, it must relocate itself in memory
13057 before it can find the variables and constants in its own data segment.
13059 @item -mbwx
13060 @itemx -mno-bwx
13061 @itemx -mcix
13062 @itemx -mno-cix
13063 @itemx -mfix
13064 @itemx -mno-fix
13065 @itemx -mmax
13066 @itemx -mno-max
13067 @opindex mbwx
13068 @opindex mno-bwx
13069 @opindex mcix
13070 @opindex mno-cix
13071 @opindex mfix
13072 @opindex mno-fix
13073 @opindex mmax
13074 @opindex mno-max
13075 Indicate whether GCC should generate code to use the optional BWX,
13076 CIX, FIX and MAX instruction sets.  The default is to use the instruction
13077 sets supported by the CPU type specified via @option{-mcpu=} option or that
13078 of the CPU on which GCC was built if none is specified.
13080 @item -mfloat-vax
13081 @itemx -mfloat-ieee
13082 @opindex mfloat-vax
13083 @opindex mfloat-ieee
13084 Generate code that uses (does not use) VAX F and G floating-point
13085 arithmetic instead of IEEE single and double precision.
13087 @item -mexplicit-relocs
13088 @itemx -mno-explicit-relocs
13089 @opindex mexplicit-relocs
13090 @opindex mno-explicit-relocs
13091 Older Alpha assemblers provided no way to generate symbol relocations
13092 except via assembler macros.  Use of these macros does not allow
13093 optimal instruction scheduling.  GNU binutils as of version 2.12
13094 supports a new syntax that allows the compiler to explicitly mark
13095 which relocations should apply to which instructions.  This option
13096 is mostly useful for debugging, as GCC detects the capabilities of
13097 the assembler when it is built and sets the default accordingly.
13099 @item -msmall-data
13100 @itemx -mlarge-data
13101 @opindex msmall-data
13102 @opindex mlarge-data
13103 When @option{-mexplicit-relocs} is in effect, static data is
13104 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
13105 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
13106 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
13107 16-bit relocations off of the @code{$gp} register.  This limits the
13108 size of the small data area to 64KB, but allows the variables to be
13109 directly accessed via a single instruction.
13111 The default is @option{-mlarge-data}.  With this option the data area
13112 is limited to just below 2GB@.  Programs that require more than 2GB of
13113 data must use @code{malloc} or @code{mmap} to allocate the data in the
13114 heap instead of in the program's data segment.
13116 When generating code for shared libraries, @option{-fpic} implies
13117 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
13119 @item -msmall-text
13120 @itemx -mlarge-text
13121 @opindex msmall-text
13122 @opindex mlarge-text
13123 When @option{-msmall-text} is used, the compiler assumes that the
13124 code of the entire program (or shared library) fits in 4MB, and is
13125 thus reachable with a branch instruction.  When @option{-msmall-data}
13126 is used, the compiler can assume that all local symbols share the
13127 same @code{$gp} value, and thus reduce the number of instructions
13128 required for a function call from 4 to 1.
13130 The default is @option{-mlarge-text}.
13132 @item -mcpu=@var{cpu_type}
13133 @opindex mcpu
13134 Set the instruction set and instruction scheduling parameters for
13135 machine type @var{cpu_type}.  You can specify either the @samp{EV}
13136 style name or the corresponding chip number.  GCC supports scheduling
13137 parameters for the EV4, EV5 and EV6 family of processors and
13138 chooses the default values for the instruction set from the processor
13139 you specify.  If you do not specify a processor type, GCC defaults
13140 to the processor on which the compiler was built.
13142 Supported values for @var{cpu_type} are
13144 @table @samp
13145 @item ev4
13146 @itemx ev45
13147 @itemx 21064
13148 Schedules as an EV4 and has no instruction set extensions.
13150 @item ev5
13151 @itemx 21164
13152 Schedules as an EV5 and has no instruction set extensions.
13154 @item ev56
13155 @itemx 21164a
13156 Schedules as an EV5 and supports the BWX extension.
13158 @item pca56
13159 @itemx 21164pc
13160 @itemx 21164PC
13161 Schedules as an EV5 and supports the BWX and MAX extensions.
13163 @item ev6
13164 @itemx 21264
13165 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
13167 @item ev67
13168 @itemx 21264a
13169 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
13170 @end table
13172 Native toolchains also support the value @samp{native},
13173 which selects the best architecture option for the host processor.
13174 @option{-mcpu=native} has no effect if GCC does not recognize
13175 the processor.
13177 @item -mtune=@var{cpu_type}
13178 @opindex mtune
13179 Set only the instruction scheduling parameters for machine type
13180 @var{cpu_type}.  The instruction set is not changed.
13182 Native toolchains also support the value @samp{native},
13183 which selects the best architecture option for the host processor.
13184 @option{-mtune=native} has no effect if GCC does not recognize
13185 the processor.
13187 @item -mmemory-latency=@var{time}
13188 @opindex mmemory-latency
13189 Sets the latency the scheduler should assume for typical memory
13190 references as seen by the application.  This number is highly
13191 dependent on the memory access patterns used by the application
13192 and the size of the external cache on the machine.
13194 Valid options for @var{time} are
13196 @table @samp
13197 @item @var{number}
13198 A decimal number representing clock cycles.
13200 @item L1
13201 @itemx L2
13202 @itemx L3
13203 @itemx main
13204 The compiler contains estimates of the number of clock cycles for
13205 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
13206 (also called Dcache, Scache, and Bcache), as well as to main memory.
13207 Note that L3 is only valid for EV5.
13209 @end table
13210 @end table
13212 @node FR30 Options
13213 @subsection FR30 Options
13214 @cindex FR30 Options
13216 These options are defined specifically for the FR30 port.
13218 @table @gcctabopt
13220 @item -msmall-model
13221 @opindex msmall-model
13222 Use the small address space model.  This can produce smaller code, but
13223 it does assume that all symbolic values and addresses fit into a
13224 20-bit range.
13226 @item -mno-lsim
13227 @opindex mno-lsim
13228 Assume that runtime support has been provided and so there is no need
13229 to include the simulator library (@file{libsim.a}) on the linker
13230 command line.
13232 @end table
13234 @node FRV Options
13235 @subsection FRV Options
13236 @cindex FRV Options
13238 @table @gcctabopt
13239 @item -mgpr-32
13240 @opindex mgpr-32
13242 Only use the first 32 general-purpose registers.
13244 @item -mgpr-64
13245 @opindex mgpr-64
13247 Use all 64 general-purpose registers.
13249 @item -mfpr-32
13250 @opindex mfpr-32
13252 Use only the first 32 floating-point registers.
13254 @item -mfpr-64
13255 @opindex mfpr-64
13257 Use all 64 floating-point registers.
13259 @item -mhard-float
13260 @opindex mhard-float
13262 Use hardware instructions for floating-point operations.
13264 @item -msoft-float
13265 @opindex msoft-float
13267 Use library routines for floating-point operations.
13269 @item -malloc-cc
13270 @opindex malloc-cc
13272 Dynamically allocate condition code registers.
13274 @item -mfixed-cc
13275 @opindex mfixed-cc
13277 Do not try to dynamically allocate condition code registers, only
13278 use @code{icc0} and @code{fcc0}.
13280 @item -mdword
13281 @opindex mdword
13283 Change ABI to use double word insns.
13285 @item -mno-dword
13286 @opindex mno-dword
13288 Do not use double word instructions.
13290 @item -mdouble
13291 @opindex mdouble
13293 Use floating-point double instructions.
13295 @item -mno-double
13296 @opindex mno-double
13298 Do not use floating-point double instructions.
13300 @item -mmedia
13301 @opindex mmedia
13303 Use media instructions.
13305 @item -mno-media
13306 @opindex mno-media
13308 Do not use media instructions.
13310 @item -mmuladd
13311 @opindex mmuladd
13313 Use multiply and add/subtract instructions.
13315 @item -mno-muladd
13316 @opindex mno-muladd
13318 Do not use multiply and add/subtract instructions.
13320 @item -mfdpic
13321 @opindex mfdpic
13323 Select the FDPIC ABI, which uses function descriptors to represent
13324 pointers to functions.  Without any PIC/PIE-related options, it
13325 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
13326 assumes GOT entries and small data are within a 12-bit range from the
13327 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
13328 are computed with 32 bits.
13329 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13331 @item -minline-plt
13332 @opindex minline-plt
13334 Enable inlining of PLT entries in function calls to functions that are
13335 not known to bind locally.  It has no effect without @option{-mfdpic}.
13336 It's enabled by default if optimizing for speed and compiling for
13337 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13338 optimization option such as @option{-O3} or above is present in the
13339 command line.
13341 @item -mTLS
13342 @opindex mTLS
13344 Assume a large TLS segment when generating thread-local code.
13346 @item -mtls
13347 @opindex mtls
13349 Do not assume a large TLS segment when generating thread-local code.
13351 @item -mgprel-ro
13352 @opindex mgprel-ro
13354 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13355 that is known to be in read-only sections.  It's enabled by default,
13356 except for @option{-fpic} or @option{-fpie}: even though it may help
13357 make the global offset table smaller, it trades 1 instruction for 4.
13358 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13359 one of which may be shared by multiple symbols, and it avoids the need
13360 for a GOT entry for the referenced symbol, so it's more likely to be a
13361 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13363 @item -multilib-library-pic
13364 @opindex multilib-library-pic
13366 Link with the (library, not FD) pic libraries.  It's implied by
13367 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13368 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13369 it explicitly.
13371 @item -mlinked-fp
13372 @opindex mlinked-fp
13374 Follow the EABI requirement of always creating a frame pointer whenever
13375 a stack frame is allocated.  This option is enabled by default and can
13376 be disabled with @option{-mno-linked-fp}.
13378 @item -mlong-calls
13379 @opindex mlong-calls
13381 Use indirect addressing to call functions outside the current
13382 compilation unit.  This allows the functions to be placed anywhere
13383 within the 32-bit address space.
13385 @item -malign-labels
13386 @opindex malign-labels
13388 Try to align labels to an 8-byte boundary by inserting NOPs into the
13389 previous packet.  This option only has an effect when VLIW packing
13390 is enabled.  It doesn't create new packets; it merely adds NOPs to
13391 existing ones.
13393 @item -mlibrary-pic
13394 @opindex mlibrary-pic
13396 Generate position-independent EABI code.
13398 @item -macc-4
13399 @opindex macc-4
13401 Use only the first four media accumulator registers.
13403 @item -macc-8
13404 @opindex macc-8
13406 Use all eight media accumulator registers.
13408 @item -mpack
13409 @opindex mpack
13411 Pack VLIW instructions.
13413 @item -mno-pack
13414 @opindex mno-pack
13416 Do not pack VLIW instructions.
13418 @item -mno-eflags
13419 @opindex mno-eflags
13421 Do not mark ABI switches in e_flags.
13423 @item -mcond-move
13424 @opindex mcond-move
13426 Enable the use of conditional-move instructions (default).
13428 This switch is mainly for debugging the compiler and will likely be removed
13429 in a future version.
13431 @item -mno-cond-move
13432 @opindex mno-cond-move
13434 Disable the use of conditional-move instructions.
13436 This switch is mainly for debugging the compiler and will likely be removed
13437 in a future version.
13439 @item -mscc
13440 @opindex mscc
13442 Enable the use of conditional set instructions (default).
13444 This switch is mainly for debugging the compiler and will likely be removed
13445 in a future version.
13447 @item -mno-scc
13448 @opindex mno-scc
13450 Disable the use of conditional set instructions.
13452 This switch is mainly for debugging the compiler and will likely be removed
13453 in a future version.
13455 @item -mcond-exec
13456 @opindex mcond-exec
13458 Enable the use of conditional execution (default).
13460 This switch is mainly for debugging the compiler and will likely be removed
13461 in a future version.
13463 @item -mno-cond-exec
13464 @opindex mno-cond-exec
13466 Disable the use of conditional execution.
13468 This switch is mainly for debugging the compiler and will likely be removed
13469 in a future version.
13471 @item -mvliw-branch
13472 @opindex mvliw-branch
13474 Run a pass to pack branches into VLIW instructions (default).
13476 This switch is mainly for debugging the compiler and will likely be removed
13477 in a future version.
13479 @item -mno-vliw-branch
13480 @opindex mno-vliw-branch
13482 Do not run a pass to pack branches into VLIW instructions.
13484 This switch is mainly for debugging the compiler and will likely be removed
13485 in a future version.
13487 @item -mmulti-cond-exec
13488 @opindex mmulti-cond-exec
13490 Enable optimization of @code{&&} and @code{||} in conditional execution
13491 (default).
13493 This switch is mainly for debugging the compiler and will likely be removed
13494 in a future version.
13496 @item -mno-multi-cond-exec
13497 @opindex mno-multi-cond-exec
13499 Disable optimization of @code{&&} and @code{||} in conditional execution.
13501 This switch is mainly for debugging the compiler and will likely be removed
13502 in a future version.
13504 @item -mnested-cond-exec
13505 @opindex mnested-cond-exec
13507 Enable nested conditional execution optimizations (default).
13509 This switch is mainly for debugging the compiler and will likely be removed
13510 in a future version.
13512 @item -mno-nested-cond-exec
13513 @opindex mno-nested-cond-exec
13515 Disable nested conditional execution optimizations.
13517 This switch is mainly for debugging the compiler and will likely be removed
13518 in a future version.
13520 @item -moptimize-membar
13521 @opindex moptimize-membar
13523 This switch removes redundant @code{membar} instructions from the
13524 compiler-generated code.  It is enabled by default.
13526 @item -mno-optimize-membar
13527 @opindex mno-optimize-membar
13529 This switch disables the automatic removal of redundant @code{membar}
13530 instructions from the generated code.
13532 @item -mtomcat-stats
13533 @opindex mtomcat-stats
13535 Cause gas to print out tomcat statistics.
13537 @item -mcpu=@var{cpu}
13538 @opindex mcpu
13540 Select the processor type for which to generate code.  Possible values are
13541 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
13542 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
13544 @end table
13546 @node GNU/Linux Options
13547 @subsection GNU/Linux Options
13549 These @samp{-m} options are defined for GNU/Linux targets:
13551 @table @gcctabopt
13552 @item -mglibc
13553 @opindex mglibc
13554 Use the GNU C library.  This is the default except
13555 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
13557 @item -muclibc
13558 @opindex muclibc
13559 Use uClibc C library.  This is the default on
13560 @samp{*-*-linux-*uclibc*} targets.
13562 @item -mbionic
13563 @opindex mbionic
13564 Use Bionic C library.  This is the default on
13565 @samp{*-*-linux-*android*} targets.
13567 @item -mandroid
13568 @opindex mandroid
13569 Compile code compatible with Android platform.  This is the default on
13570 @samp{*-*-linux-*android*} targets.
13572 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
13573 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
13574 this option makes the GCC driver pass Android-specific options to the linker.
13575 Finally, this option causes the preprocessor macro @code{__ANDROID__}
13576 to be defined.
13578 @item -tno-android-cc
13579 @opindex tno-android-cc
13580 Disable compilation effects of @option{-mandroid}, i.e., do not enable
13581 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
13582 @option{-fno-rtti} by default.
13584 @item -tno-android-ld
13585 @opindex tno-android-ld
13586 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
13587 linking options to the linker.
13589 @end table
13591 @node H8/300 Options
13592 @subsection H8/300 Options
13594 These @samp{-m} options are defined for the H8/300 implementations:
13596 @table @gcctabopt
13597 @item -mrelax
13598 @opindex mrelax
13599 Shorten some address references at link time, when possible; uses the
13600 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
13601 ld, Using ld}, for a fuller description.
13603 @item -mh
13604 @opindex mh
13605 Generate code for the H8/300H@.
13607 @item -ms
13608 @opindex ms
13609 Generate code for the H8S@.
13611 @item -mn
13612 @opindex mn
13613 Generate code for the H8S and H8/300H in the normal mode.  This switch
13614 must be used either with @option{-mh} or @option{-ms}.
13616 @item -ms2600
13617 @opindex ms2600
13618 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
13620 @item -mexr
13621 @opindex mexr
13622 Extended registers are stored on stack before execution of function
13623 with monitor attribute. Default option is @option{-mexr}.
13624 This option is valid only for H8S targets.
13626 @item -mno-exr
13627 @opindex mno-exr
13628 Extended registers are not stored on stack before execution of function 
13629 with monitor attribute. Default option is @option{-mno-exr}. 
13630 This option is valid only for H8S targets.
13632 @item -mint32
13633 @opindex mint32
13634 Make @code{int} data 32 bits by default.
13636 @item -malign-300
13637 @opindex malign-300
13638 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
13639 The default for the H8/300H and H8S is to align longs and floats on
13640 4-byte boundaries.
13641 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
13642 This option has no effect on the H8/300.
13643 @end table
13645 @node HPPA Options
13646 @subsection HPPA Options
13647 @cindex HPPA Options
13649 These @samp{-m} options are defined for the HPPA family of computers:
13651 @table @gcctabopt
13652 @item -march=@var{architecture-type}
13653 @opindex march
13654 Generate code for the specified architecture.  The choices for
13655 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
13656 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
13657 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
13658 architecture option for your machine.  Code compiled for lower numbered
13659 architectures runs on higher numbered architectures, but not the
13660 other way around.
13662 @item -mpa-risc-1-0
13663 @itemx -mpa-risc-1-1
13664 @itemx -mpa-risc-2-0
13665 @opindex mpa-risc-1-0
13666 @opindex mpa-risc-1-1
13667 @opindex mpa-risc-2-0
13668 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
13670 @item -mjump-in-delay
13671 @opindex mjump-in-delay
13672 Fill delay slots of function calls with unconditional jump instructions
13673 by modifying the return pointer for the function call to be the target
13674 of the conditional jump.
13676 @item -mdisable-fpregs
13677 @opindex mdisable-fpregs
13678 Prevent floating-point registers from being used in any manner.  This is
13679 necessary for compiling kernels that perform lazy context switching of
13680 floating-point registers.  If you use this option and attempt to perform
13681 floating-point operations, the compiler aborts.
13683 @item -mdisable-indexing
13684 @opindex mdisable-indexing
13685 Prevent the compiler from using indexing address modes.  This avoids some
13686 rather obscure problems when compiling MIG generated code under MACH@.
13688 @item -mno-space-regs
13689 @opindex mno-space-regs
13690 Generate code that assumes the target has no space registers.  This allows
13691 GCC to generate faster indirect calls and use unscaled index address modes.
13693 Such code is suitable for level 0 PA systems and kernels.
13695 @item -mfast-indirect-calls
13696 @opindex mfast-indirect-calls
13697 Generate code that assumes calls never cross space boundaries.  This
13698 allows GCC to emit code that performs faster indirect calls.
13700 This option does not work in the presence of shared libraries or nested
13701 functions.
13703 @item -mfixed-range=@var{register-range}
13704 @opindex mfixed-range
13705 Generate code treating the given register range as fixed registers.
13706 A fixed register is one that the register allocator cannot use.  This is
13707 useful when compiling kernel code.  A register range is specified as
13708 two registers separated by a dash.  Multiple register ranges can be
13709 specified separated by a comma.
13711 @item -mlong-load-store
13712 @opindex mlong-load-store
13713 Generate 3-instruction load and store sequences as sometimes required by
13714 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13715 the HP compilers.
13717 @item -mportable-runtime
13718 @opindex mportable-runtime
13719 Use the portable calling conventions proposed by HP for ELF systems.
13721 @item -mgas
13722 @opindex mgas
13723 Enable the use of assembler directives only GAS understands.
13725 @item -mschedule=@var{cpu-type}
13726 @opindex mschedule
13727 Schedule code according to the constraints for the machine type
13728 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13729 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13730 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13731 proper scheduling option for your machine.  The default scheduling is
13732 @samp{8000}.
13734 @item -mlinker-opt
13735 @opindex mlinker-opt
13736 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13737 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13738 linkers in which they give bogus error messages when linking some programs.
13740 @item -msoft-float
13741 @opindex msoft-float
13742 Generate output containing library calls for floating point.
13743 @strong{Warning:} the requisite libraries are not available for all HPPA
13744 targets.  Normally the facilities of the machine's usual C compiler are
13745 used, but this cannot be done directly in cross-compilation.  You must make
13746 your own arrangements to provide suitable library functions for
13747 cross-compilation.
13749 @option{-msoft-float} changes the calling convention in the output file;
13750 therefore, it is only useful if you compile @emph{all} of a program with
13751 this option.  In particular, you need to compile @file{libgcc.a}, the
13752 library that comes with GCC, with @option{-msoft-float} in order for
13753 this to work.
13755 @item -msio
13756 @opindex msio
13757 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13758 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13759 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13760 options are available under HP-UX and HI-UX@.
13762 @item -mgnu-ld
13763 @opindex mgnu-ld
13764 Use options specific to GNU @command{ld}.
13765 This passes @option{-shared} to @command{ld} when
13766 building a shared library.  It is the default when GCC is configured,
13767 explicitly or implicitly, with the GNU linker.  This option does not
13768 affect which @command{ld} is called; it only changes what parameters
13769 are passed to that @command{ld}.
13770 The @command{ld} that is called is determined by the
13771 @option{--with-ld} configure option, GCC's program search path, and
13772 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13773 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13774 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13776 @item -mhp-ld
13777 @opindex mhp-ld
13778 Use options specific to HP @command{ld}.
13779 This passes @option{-b} to @command{ld} when building
13780 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13781 links.  It is the default when GCC is configured, explicitly or
13782 implicitly, with the HP linker.  This option does not affect
13783 which @command{ld} is called; it only changes what parameters are passed to that
13784 @command{ld}.
13785 The @command{ld} that is called is determined by the @option{--with-ld}
13786 configure option, GCC's program search path, and finally by the user's
13787 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13788 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13789 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13791 @item -mlong-calls
13792 @opindex mno-long-calls
13793 Generate code that uses long call sequences.  This ensures that a call
13794 is always able to reach linker generated stubs.  The default is to generate
13795 long calls only when the distance from the call site to the beginning
13796 of the function or translation unit, as the case may be, exceeds a
13797 predefined limit set by the branch type being used.  The limits for
13798 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13799 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13800 240,000 bytes.
13802 Distances are measured from the beginning of functions when using the
13803 @option{-ffunction-sections} option, or when using the @option{-mgas}
13804 and @option{-mno-portable-runtime} options together under HP-UX with
13805 the SOM linker.
13807 It is normally not desirable to use this option as it degrades
13808 performance.  However, it may be useful in large applications,
13809 particularly when partial linking is used to build the application.
13811 The types of long calls used depends on the capabilities of the
13812 assembler and linker, and the type of code being generated.  The
13813 impact on systems that support long absolute calls, and long pic
13814 symbol-difference or pc-relative calls should be relatively small.
13815 However, an indirect call is used on 32-bit ELF systems in pic code
13816 and it is quite long.
13818 @item -munix=@var{unix-std}
13819 @opindex march
13820 Generate compiler predefines and select a startfile for the specified
13821 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13822 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13823 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13824 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13825 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13826 and later.
13828 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13829 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13830 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13831 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13832 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13833 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13835 It is @emph{important} to note that this option changes the interfaces
13836 for various library routines.  It also affects the operational behavior
13837 of the C library.  Thus, @emph{extreme} care is needed in using this
13838 option.
13840 Library code that is intended to operate with more than one UNIX
13841 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13842 as appropriate.  Most GNU software doesn't provide this capability.
13844 @item -nolibdld
13845 @opindex nolibdld
13846 Suppress the generation of link options to search libdld.sl when the
13847 @option{-static} option is specified on HP-UX 10 and later.
13849 @item -static
13850 @opindex static
13851 The HP-UX implementation of setlocale in libc has a dependency on
13852 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13853 when the @option{-static} option is specified, special link options
13854 are needed to resolve this dependency.
13856 On HP-UX 10 and later, the GCC driver adds the necessary options to
13857 link with libdld.sl when the @option{-static} option is specified.
13858 This causes the resulting binary to be dynamic.  On the 64-bit port,
13859 the linkers generate dynamic binaries by default in any case.  The
13860 @option{-nolibdld} option can be used to prevent the GCC driver from
13861 adding these link options.
13863 @item -threads
13864 @opindex threads
13865 Add support for multithreading with the @dfn{dce thread} library
13866 under HP-UX@.  This option sets flags for both the preprocessor and
13867 linker.
13868 @end table
13870 @node i386 and x86-64 Options
13871 @subsection Intel 386 and AMD x86-64 Options
13872 @cindex i386 Options
13873 @cindex x86-64 Options
13874 @cindex Intel 386 Options
13875 @cindex AMD x86-64 Options
13877 These @samp{-m} options are defined for the i386 and x86-64 family of
13878 computers:
13880 @table @gcctabopt
13882 @item -march=@var{cpu-type}
13883 @opindex march
13884 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13885 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13886 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13887 to generate code that may not run at all on processors other than the one
13888 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13889 @option{-mtune=@var{cpu-type}}.
13891 The choices for @var{cpu-type} are:
13893 @table @samp
13894 @item native
13895 This selects the CPU to generate code for at compilation time by determining
13896 the processor type of the compiling machine.  Using @option{-march=native}
13897 enables all instruction subsets supported by the local machine (hence
13898 the result might not run on different machines).  Using @option{-mtune=native}
13899 produces code optimized for the local machine under the constraints
13900 of the selected instruction set.  
13902 @item i386
13903 Original Intel i386 CPU@.
13905 @item i486
13906 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13908 @item i586
13909 @itemx pentium
13910 Intel Pentium CPU with no MMX support.
13912 @item pentium-mmx
13913 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13915 @item pentiumpro
13916 Intel Pentium Pro CPU@.
13918 @item i686
13919 When used with @option{-march}, the Pentium Pro
13920 instruction set is used, so the code runs on all i686 family chips.
13921 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13923 @item pentium2
13924 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13925 support.
13927 @item pentium3
13928 @itemx pentium3m
13929 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13930 set support.
13932 @item pentium-m
13933 Intel Pentium M; low-power version of Intel Pentium III CPU
13934 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13936 @item pentium4
13937 @itemx pentium4m
13938 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13940 @item prescott
13941 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13942 set support.
13944 @item nocona
13945 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13946 SSE2 and SSE3 instruction set support.
13948 @item core2
13949 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13950 instruction set support.
13952 @item corei7
13953 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13954 and SSE4.2 instruction set support.
13956 @item corei7-avx
13957 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13958 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13960 @item core-avx-i
13961 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13962 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13963 set support.
13965 @item core-avx2
13966 Intel Core CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
13967 SSE4.1, SSE4.2, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2
13968 and F16C instruction set support.
13970 @item atom
13971 Intel Atom CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
13972 instruction set support.
13974 @item slm
13975 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
13976 SSE4.1 and SSE4.2 instruction set support.
13978 @item k6
13979 AMD K6 CPU with MMX instruction set support.
13981 @item k6-2
13982 @itemx k6-3
13983 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13985 @item athlon
13986 @itemx athlon-tbird
13987 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13988 support.
13990 @item athlon-4
13991 @itemx athlon-xp
13992 @itemx athlon-mp
13993 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13994 instruction set support.
13996 @item k8
13997 @itemx opteron
13998 @itemx athlon64
13999 @itemx athlon-fx
14000 Processors based on the AMD K8 core with x86-64 instruction set support,
14001 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
14002 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
14003 instruction set extensions.)
14005 @item k8-sse3
14006 @itemx opteron-sse3
14007 @itemx athlon64-sse3
14008 Improved versions of AMD K8 cores with SSE3 instruction set support.
14010 @item amdfam10
14011 @itemx barcelona
14012 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
14013 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
14014 instruction set extensions.)
14016 @item bdver1
14017 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
14018 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
14019 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
14020 @item bdver2
14021 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14022 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
14023 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
14024 extensions.)
14025 @item bdver3
14026 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14027 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
14028 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
14029 extensions.
14031 @item btver1
14032 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
14033 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
14034 instruction set extensions.)
14036 @item btver2
14037 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
14038 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
14039 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
14041 @item winchip-c6
14042 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
14043 set support.
14045 @item winchip2
14046 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
14047 instruction set support.
14049 @item c3
14050 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
14051 implemented for this chip.)
14053 @item c3-2
14054 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
14055 (No scheduling is
14056 implemented for this chip.)
14058 @item geode
14059 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
14060 @end table
14062 @item -mtune=@var{cpu-type}
14063 @opindex mtune
14064 Tune to @var{cpu-type} everything applicable about the generated code, except
14065 for the ABI and the set of available instructions.  
14066 While picking a specific @var{cpu-type} schedules things appropriately
14067 for that particular chip, the compiler does not generate any code that
14068 cannot run on the default machine type unless you use a
14069 @option{-march=@var{cpu-type}} option.
14070 For example, if GCC is configured for i686-pc-linux-gnu
14071 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
14072 but still runs on i686 machines.
14074 The choices for @var{cpu-type} are the same as for @option{-march}.
14075 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
14077 @table @samp
14078 @item generic
14079 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
14080 If you know the CPU on which your code will run, then you should use
14081 the corresponding @option{-mtune} or @option{-march} option instead of
14082 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
14083 of your application will have, then you should use this option.
14085 As new processors are deployed in the marketplace, the behavior of this
14086 option will change.  Therefore, if you upgrade to a newer version of
14087 GCC, code generation controlled by this option will change to reflect
14088 the processors
14089 that are most common at the time that version of GCC is released.
14091 There is no @option{-march=generic} option because @option{-march}
14092 indicates the instruction set the compiler can use, and there is no
14093 generic instruction set applicable to all processors.  In contrast,
14094 @option{-mtune} indicates the processor (or, in this case, collection of
14095 processors) for which the code is optimized.
14096 @end table
14098 @item -mcpu=@var{cpu-type}
14099 @opindex mcpu
14100 A deprecated synonym for @option{-mtune}.
14102 @item -mfpmath=@var{unit}
14103 @opindex mfpmath
14104 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
14105 for @var{unit} are:
14107 @table @samp
14108 @item 387
14109 Use the standard 387 floating-point coprocessor present on the majority of chips and
14110 emulated otherwise.  Code compiled with this option runs almost everywhere.
14111 The temporary results are computed in 80-bit precision instead of the precision
14112 specified by the type, resulting in slightly different results compared to most
14113 of other chips.  See @option{-ffloat-store} for more detailed description.
14115 This is the default choice for i386 compiler.
14117 @item sse
14118 Use scalar floating-point instructions present in the SSE instruction set.
14119 This instruction set is supported by Pentium III and newer chips,
14120 and in the AMD line
14121 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
14122 instruction set supports only single-precision arithmetic, thus the double and
14123 extended-precision arithmetic are still done using 387.  A later version, present
14124 only in Pentium 4 and AMD x86-64 chips, supports double-precision
14125 arithmetic too.
14127 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
14128 or @option{-msse2} switches to enable SSE extensions and make this option
14129 effective.  For the x86-64 compiler, these extensions are enabled by default.
14131 The resulting code should be considerably faster in the majority of cases and avoid
14132 the numerical instability problems of 387 code, but may break some existing
14133 code that expects temporaries to be 80 bits.
14135 This is the default choice for the x86-64 compiler.
14137 @item sse,387
14138 @itemx sse+387
14139 @itemx both
14140 Attempt to utilize both instruction sets at once.  This effectively doubles the
14141 amount of available registers, and on chips with separate execution units for
14142 387 and SSE the execution resources too.  Use this option with care, as it is
14143 still experimental, because the GCC register allocator does not model separate
14144 functional units well, resulting in unstable performance.
14145 @end table
14147 @item -masm=@var{dialect}
14148 @opindex masm=@var{dialect}
14149 Output assembly instructions using selected @var{dialect}.  Supported
14150 choices are @samp{intel} or @samp{att} (the default).  Darwin does
14151 not support @samp{intel}.
14153 @item -mieee-fp
14154 @itemx -mno-ieee-fp
14155 @opindex mieee-fp
14156 @opindex mno-ieee-fp
14157 Control whether or not the compiler uses IEEE floating-point
14158 comparisons.  These correctly handle the case where the result of a
14159 comparison is unordered.
14161 @item -msoft-float
14162 @opindex msoft-float
14163 Generate output containing library calls for floating point.
14165 @strong{Warning:} the requisite libraries are not part of GCC@.
14166 Normally the facilities of the machine's usual C compiler are used, but
14167 this can't be done directly in cross-compilation.  You must make your
14168 own arrangements to provide suitable library functions for
14169 cross-compilation.
14171 On machines where a function returns floating-point results in the 80387
14172 register stack, some floating-point opcodes may be emitted even if
14173 @option{-msoft-float} is used.
14175 @item -mno-fp-ret-in-387
14176 @opindex mno-fp-ret-in-387
14177 Do not use the FPU registers for return values of functions.
14179 The usual calling convention has functions return values of types
14180 @code{float} and @code{double} in an FPU register, even if there
14181 is no FPU@.  The idea is that the operating system should emulate
14182 an FPU@.
14184 The option @option{-mno-fp-ret-in-387} causes such values to be returned
14185 in ordinary CPU registers instead.
14187 @item -mno-fancy-math-387
14188 @opindex mno-fancy-math-387
14189 Some 387 emulators do not support the @code{sin}, @code{cos} and
14190 @code{sqrt} instructions for the 387.  Specify this option to avoid
14191 generating those instructions.  This option is the default on FreeBSD,
14192 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
14193 indicates that the target CPU always has an FPU and so the
14194 instruction does not need emulation.  These
14195 instructions are not generated unless you also use the
14196 @option{-funsafe-math-optimizations} switch.
14198 @item -malign-double
14199 @itemx -mno-align-double
14200 @opindex malign-double
14201 @opindex mno-align-double
14202 Control whether GCC aligns @code{double}, @code{long double}, and
14203 @code{long long} variables on a two-word boundary or a one-word
14204 boundary.  Aligning @code{double} variables on a two-word boundary
14205 produces code that runs somewhat faster on a Pentium at the
14206 expense of more memory.
14208 On x86-64, @option{-malign-double} is enabled by default.
14210 @strong{Warning:} if you use the @option{-malign-double} switch,
14211 structures containing the above types are aligned differently than
14212 the published application binary interface specifications for the 386
14213 and are not binary compatible with structures in code compiled
14214 without that switch.
14216 @item -m96bit-long-double
14217 @itemx -m128bit-long-double
14218 @opindex m96bit-long-double
14219 @opindex m128bit-long-double
14220 These switches control the size of @code{long double} type.  The i386
14221 application binary interface specifies the size to be 96 bits,
14222 so @option{-m96bit-long-double} is the default in 32-bit mode.
14224 Modern architectures (Pentium and newer) prefer @code{long double}
14225 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
14226 conforming to the ABI, this is not possible.  So specifying
14227 @option{-m128bit-long-double} aligns @code{long double}
14228 to a 16-byte boundary by padding the @code{long double} with an additional
14229 32-bit zero.
14231 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
14232 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
14234 Notice that neither of these options enable any extra precision over the x87
14235 standard of 80 bits for a @code{long double}.
14237 @strong{Warning:} if you override the default value for your target ABI, this
14238 changes the size of 
14239 structures and arrays containing @code{long double} variables,
14240 as well as modifying the function calling convention for functions taking
14241 @code{long double}.  Hence they are not binary-compatible
14242 with code compiled without that switch.
14244 @item -mlong-double-64
14245 @itemx -mlong-double-80
14246 @opindex mlong-double-64
14247 @opindex mlong-double-80
14248 These switches control the size of @code{long double} type. A size
14249 of 64 bits makes the @code{long double} type equivalent to the @code{double}
14250 type. This is the default for Bionic C library.
14252 @strong{Warning:} if you override the default value for your target ABI, this
14253 changes the size of
14254 structures and arrays containing @code{long double} variables,
14255 as well as modifying the function calling convention for functions taking
14256 @code{long double}.  Hence they are not binary-compatible
14257 with code compiled without that switch.
14259 @item -mlarge-data-threshold=@var{threshold}
14260 @opindex mlarge-data-threshold
14261 When @option{-mcmodel=medium} is specified, data objects larger than
14262 @var{threshold} are placed in the large data section.  This value must be the
14263 same across all objects linked into the binary, and defaults to 65535.
14265 @item -mrtd
14266 @opindex mrtd
14267 Use a different function-calling convention, in which functions that
14268 take a fixed number of arguments return with the @code{ret @var{num}}
14269 instruction, which pops their arguments while returning.  This saves one
14270 instruction in the caller since there is no need to pop the arguments
14271 there.
14273 You can specify that an individual function is called with this calling
14274 sequence with the function attribute @samp{stdcall}.  You can also
14275 override the @option{-mrtd} option by using the function attribute
14276 @samp{cdecl}.  @xref{Function Attributes}.
14278 @strong{Warning:} this calling convention is incompatible with the one
14279 normally used on Unix, so you cannot use it if you need to call
14280 libraries compiled with the Unix compiler.
14282 Also, you must provide function prototypes for all functions that
14283 take variable numbers of arguments (including @code{printf});
14284 otherwise incorrect code is generated for calls to those
14285 functions.
14287 In addition, seriously incorrect code results if you call a
14288 function with too many arguments.  (Normally, extra arguments are
14289 harmlessly ignored.)
14291 @item -mregparm=@var{num}
14292 @opindex mregparm
14293 Control how many registers are used to pass integer arguments.  By
14294 default, no registers are used to pass arguments, and at most 3
14295 registers can be used.  You can control this behavior for a specific
14296 function by using the function attribute @samp{regparm}.
14297 @xref{Function Attributes}.
14299 @strong{Warning:} if you use this switch, and
14300 @var{num} is nonzero, then you must build all modules with the same
14301 value, including any libraries.  This includes the system libraries and
14302 startup modules.
14304 @item -msseregparm
14305 @opindex msseregparm
14306 Use SSE register passing conventions for float and double arguments
14307 and return values.  You can control this behavior for a specific
14308 function by using the function attribute @samp{sseregparm}.
14309 @xref{Function Attributes}.
14311 @strong{Warning:} if you use this switch then you must build all
14312 modules with the same value, including any libraries.  This includes
14313 the system libraries and startup modules.
14315 @item -mvect8-ret-in-mem
14316 @opindex mvect8-ret-in-mem
14317 Return 8-byte vectors in memory instead of MMX registers.  This is the
14318 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
14319 Studio compilers until version 12.  Later compiler versions (starting
14320 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
14321 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
14322 you need to remain compatible with existing code produced by those
14323 previous compiler versions or older versions of GCC@.
14325 @item -mpc32
14326 @itemx -mpc64
14327 @itemx -mpc80
14328 @opindex mpc32
14329 @opindex mpc64
14330 @opindex mpc80
14332 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
14333 is specified, the significands of results of floating-point operations are
14334 rounded to 24 bits (single precision); @option{-mpc64} rounds the
14335 significands of results of floating-point operations to 53 bits (double
14336 precision) and @option{-mpc80} rounds the significands of results of
14337 floating-point operations to 64 bits (extended double precision), which is
14338 the default.  When this option is used, floating-point operations in higher
14339 precisions are not available to the programmer without setting the FPU
14340 control word explicitly.
14342 Setting the rounding of floating-point operations to less than the default
14343 80 bits can speed some programs by 2% or more.  Note that some mathematical
14344 libraries assume that extended-precision (80-bit) floating-point operations
14345 are enabled by default; routines in such libraries could suffer significant
14346 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14347 when this option is used to set the precision to less than extended precision.
14349 @item -mstackrealign
14350 @opindex mstackrealign
14351 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14352 option generates an alternate prologue and epilogue that realigns the
14353 run-time stack if necessary.  This supports mixing legacy codes that keep
14354 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14355 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14356 applicable to individual functions.
14358 @item -mpreferred-stack-boundary=@var{num}
14359 @opindex mpreferred-stack-boundary
14360 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14361 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14362 the default is 4 (16 bytes or 128 bits).
14364 @strong{Warning:} When generating code for the x86-64 architecture with
14365 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14366 used to keep the stack boundary aligned to 8 byte boundary.  Since
14367 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14368 intended to be used in controlled environment where stack space is
14369 important limitation.  This option will lead to wrong code when functions
14370 compiled with 16 byte stack alignment (such as functions from a standard
14371 library) are called with misaligned stack.  In this case, SSE
14372 instructions may lead to misaligned memory access traps.  In addition,
14373 variable arguments will be handled incorrectly for 16 byte aligned
14374 objects (including x87 long double and __int128), leading to wrong
14375 results.  You must build all modules with
14376 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14377 includes the system libraries and startup modules.
14379 @item -mincoming-stack-boundary=@var{num}
14380 @opindex mincoming-stack-boundary
14381 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14382 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14383 the one specified by @option{-mpreferred-stack-boundary} is used.
14385 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14386 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14387 suffer significant run time performance penalties.  On Pentium III, the
14388 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14389 properly if it is not 16-byte aligned.
14391 To ensure proper alignment of this values on the stack, the stack boundary
14392 must be as aligned as that required by any value stored on the stack.
14393 Further, every function must be generated such that it keeps the stack
14394 aligned.  Thus calling a function compiled with a higher preferred
14395 stack boundary from a function compiled with a lower preferred stack
14396 boundary most likely misaligns the stack.  It is recommended that
14397 libraries that use callbacks always use the default setting.
14399 This extra alignment does consume extra stack space, and generally
14400 increases code size.  Code that is sensitive to stack space usage, such
14401 as embedded systems and operating system kernels, may want to reduce the
14402 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14404 @item -mmmx
14405 @itemx -mno-mmx
14406 @itemx -msse
14407 @itemx -mno-sse
14408 @itemx -msse2
14409 @itemx -mno-sse2
14410 @itemx -msse3
14411 @itemx -mno-sse3
14412 @itemx -mssse3
14413 @itemx -mno-ssse3
14414 @itemx -msse4.1
14415 @need 800
14416 @itemx -mno-sse4.1
14417 @itemx -msse4.2
14418 @itemx -mno-sse4.2
14419 @itemx -msse4
14420 @itemx -mno-sse4
14421 @itemx -mavx
14422 @itemx -mno-avx
14423 @itemx -mavx2
14424 @itemx -mno-avx2
14425 @itemx -mavx512f
14426 @itemx -mno-avx512f
14427 @need 800
14428 @itemx -mavx512pf
14429 @itemx -mno-avx512pf
14430 @itemx -mavx512er
14431 @itemx -mno-avx512er
14432 @itemx -mavx512cd
14433 @itemx -mno-avx512cd
14434 @itemx -maes
14435 @itemx -mno-aes
14436 @itemx -mpclmul
14437 @itemx -mno-pclmul
14438 @need 800
14439 @itemx -mfsgsbase
14440 @itemx -mno-fsgsbase
14441 @itemx -mrdrnd
14442 @itemx -mno-rdrnd
14443 @itemx -mf16c
14444 @itemx -mno-f16c
14445 @itemx -mfma
14446 @itemx -mno-fma
14447 @itemx -msse4a
14448 @itemx -mno-sse4a
14449 @itemx -mfma4
14450 @itemx -mno-fma4
14451 @need 800
14452 @itemx -mxop
14453 @itemx -mno-xop
14454 @itemx -mlwp
14455 @itemx -mno-lwp
14456 @itemx -m3dnow
14457 @itemx -mno-3dnow
14458 @itemx -mpopcnt
14459 @itemx -mno-popcnt
14460 @itemx -mabm
14461 @itemx -mno-abm
14462 @itemx -mbmi
14463 @itemx -mbmi2
14464 @itemx -mno-bmi
14465 @itemx -mno-bmi2
14466 @itemx -mlzcnt
14467 @itemx -mno-lzcnt
14468 @itemx -mfxsr
14469 @itemx -mxsave
14470 @itemx -mxsaveopt
14471 @itemx -mrtm
14472 @itemx -mtbm
14473 @itemx -mno-tbm
14474 @opindex mmmx
14475 @opindex mno-mmx
14476 @opindex msse
14477 @opindex mno-sse
14478 @opindex m3dnow
14479 @opindex mno-3dnow
14480 These switches enable or disable the use of instructions in the MMX, SSE,
14481 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
14482 AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2,
14483 FXSR, XSAVE, XSAVEOPT, LZCNT, RTM or 3DNow!@:
14484 extended instruction sets.
14485 These extensions are also available as built-in functions: see
14486 @ref{X86 Built-in Functions}, for details of the functions enabled and
14487 disabled by these switches.
14489 To generate SSE/SSE2 instructions automatically from floating-point
14490 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
14492 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
14493 generates new AVX instructions or AVX equivalence for all SSEx instructions
14494 when needed.
14496 These options enable GCC to use these extended instructions in
14497 generated code, even without @option{-mfpmath=sse}.  Applications that
14498 perform run-time CPU detection must compile separate files for each
14499 supported architecture, using the appropriate flags.  In particular,
14500 the file containing the CPU detection code should be compiled without
14501 these options.
14503 @item -mdump-tune-features
14504 @opindex mdump-tune-features
14505 This option instructs GCC to dump the names of the x86 performance 
14506 tuning features and default settings. The names can be used in 
14507 @option{-mtune-ctrl=@var{feature-list}}.
14509 @item -mtune-ctrl=@var{feature-list}
14510 @opindex mtune-ctrl=@var{feature-list}
14511 This option is used to do fine grain control of x86 code generation features.
14512 @var{feature-list} is a comma separated list of @var{feature} names. See also
14513 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
14514 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
14515 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
14516 developers. Using it may lead to code paths not covered by testing and can
14517 potentially result in compiler ICEs or runtime errors.
14519 @item -mno-default
14520 @opindex mno-default
14521 This option instructs GCC to turn off all tunable features. See also 
14522 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
14524 @item -mcld
14525 @opindex mcld
14526 This option instructs GCC to emit a @code{cld} instruction in the prologue
14527 of functions that use string instructions.  String instructions depend on
14528 the DF flag to select between autoincrement or autodecrement mode.  While the
14529 ABI specifies the DF flag to be cleared on function entry, some operating
14530 systems violate this specification by not clearing the DF flag in their
14531 exception dispatchers.  The exception handler can be invoked with the DF flag
14532 set, which leads to wrong direction mode when string instructions are used.
14533 This option can be enabled by default on 32-bit x86 targets by configuring
14534 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
14535 instructions can be suppressed with the @option{-mno-cld} compiler option
14536 in this case.
14538 @item -mvzeroupper
14539 @opindex mvzeroupper
14540 This option instructs GCC to emit a @code{vzeroupper} instruction
14541 before a transfer of control flow out of the function to minimize
14542 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
14543 intrinsics.
14545 @item -mprefer-avx128
14546 @opindex mprefer-avx128
14547 This option instructs GCC to use 128-bit AVX instructions instead of
14548 256-bit AVX instructions in the auto-vectorizer.
14550 @item -mcx16
14551 @opindex mcx16
14552 This option enables GCC to generate @code{CMPXCHG16B} instructions.
14553 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
14554 (or oword) data types.  
14555 This is useful for high-resolution counters that can be updated
14556 by multiple processors (or cores).  This instruction is generated as part of
14557 atomic built-in functions: see @ref{__sync Builtins} or
14558 @ref{__atomic Builtins} for details.
14560 @item -msahf
14561 @opindex msahf
14562 This option enables generation of @code{SAHF} instructions in 64-bit code.
14563 Early Intel Pentium 4 CPUs with Intel 64 support,
14564 prior to the introduction of Pentium 4 G1 step in December 2005,
14565 lacked the @code{LAHF} and @code{SAHF} instructions
14566 which were supported by AMD64.
14567 These are load and store instructions, respectively, for certain status flags.
14568 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
14569 @code{drem}, and @code{remainder} built-in functions;
14570 see @ref{Other Builtins} for details.
14572 @item -mmovbe
14573 @opindex mmovbe
14574 This option enables use of the @code{movbe} instruction to implement
14575 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
14577 @item -mcrc32
14578 @opindex mcrc32
14579 This option enables built-in functions @code{__builtin_ia32_crc32qi},
14580 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
14581 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
14583 @item -mrecip
14584 @opindex mrecip
14585 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
14586 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
14587 with an additional Newton-Raphson step
14588 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
14589 (and their vectorized
14590 variants) for single-precision floating-point arguments.  These instructions
14591 are generated only when @option{-funsafe-math-optimizations} is enabled
14592 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
14593 Note that while the throughput of the sequence is higher than the throughput
14594 of the non-reciprocal instruction, the precision of the sequence can be
14595 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
14597 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
14598 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
14599 combination), and doesn't need @option{-mrecip}.
14601 Also note that GCC emits the above sequence with additional Newton-Raphson step
14602 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
14603 already with @option{-ffast-math} (or the above option combination), and
14604 doesn't need @option{-mrecip}.
14606 @item -mrecip=@var{opt}
14607 @opindex mrecip=opt
14608 This option controls which reciprocal estimate instructions
14609 may be used.  @var{opt} is a comma-separated list of options, which may
14610 be preceded by a @samp{!} to invert the option:
14612 @table @samp
14613 @item all
14614 Enable all estimate instructions.
14616 @item default
14617 Enable the default instructions, equivalent to @option{-mrecip}.
14619 @item none
14620 Disable all estimate instructions, equivalent to @option{-mno-recip}.
14622 @item div
14623 Enable the approximation for scalar division.
14625 @item vec-div
14626 Enable the approximation for vectorized division.
14628 @item sqrt
14629 Enable the approximation for scalar square root.
14631 @item vec-sqrt
14632 Enable the approximation for vectorized square root.
14633 @end table
14635 So, for example, @option{-mrecip=all,!sqrt} enables
14636 all of the reciprocal approximations, except for square root.
14638 @item -mveclibabi=@var{type}
14639 @opindex mveclibabi
14640 Specifies the ABI type to use for vectorizing intrinsics using an
14641 external library.  Supported values for @var{type} are @samp{svml} 
14642 for the Intel short
14643 vector math library and @samp{acml} for the AMD math core library.
14644 To use this option, both @option{-ftree-vectorize} and
14645 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
14646 ABI-compatible library must be specified at link time.
14648 GCC currently emits calls to @code{vmldExp2},
14649 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
14650 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
14651 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
14652 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
14653 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
14654 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
14655 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
14656 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
14657 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
14658 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
14659 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
14660 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
14661 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
14662 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
14663 when @option{-mveclibabi=acml} is used.  
14665 @item -mabi=@var{name}
14666 @opindex mabi
14667 Generate code for the specified calling convention.  Permissible values
14668 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
14669 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
14670 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
14671 You can control this behavior for a specific function by
14672 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
14673 @xref{Function Attributes}.
14675 @item -mtls-dialect=@var{type}
14676 @opindex mtls-dialect
14677 Generate code to access thread-local storage using the @samp{gnu} or
14678 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
14679 @samp{gnu2} is more efficient, but it may add compile- and run-time
14680 requirements that cannot be satisfied on all systems.
14682 @item -mpush-args
14683 @itemx -mno-push-args
14684 @opindex mpush-args
14685 @opindex mno-push-args
14686 Use PUSH operations to store outgoing parameters.  This method is shorter
14687 and usually equally fast as method using SUB/MOV operations and is enabled
14688 by default.  In some cases disabling it may improve performance because of
14689 improved scheduling and reduced dependencies.
14691 @item -maccumulate-outgoing-args
14692 @opindex maccumulate-outgoing-args
14693 If enabled, the maximum amount of space required for outgoing arguments is
14694 computed in the function prologue.  This is faster on most modern CPUs
14695 because of reduced dependencies, improved scheduling and reduced stack usage
14696 when the preferred stack boundary is not equal to 2.  The drawback is a notable
14697 increase in code size.  This switch implies @option{-mno-push-args}.
14699 @item -mthreads
14700 @opindex mthreads
14701 Support thread-safe exception handling on MinGW.  Programs that rely
14702 on thread-safe exception handling must compile and link all code with the
14703 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
14704 @code{-D_MT}; when linking, it links in a special thread helper library
14705 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
14707 @item -mno-align-stringops
14708 @opindex mno-align-stringops
14709 Do not align the destination of inlined string operations.  This switch reduces
14710 code size and improves performance in case the destination is already aligned,
14711 but GCC doesn't know about it.
14713 @item -minline-all-stringops
14714 @opindex minline-all-stringops
14715 By default GCC inlines string operations only when the destination is 
14716 known to be aligned to least a 4-byte boundary.  
14717 This enables more inlining and increases code
14718 size, but may improve performance of code that depends on fast
14719 @code{memcpy}, @code{strlen},
14720 and @code{memset} for short lengths.
14722 @item -minline-stringops-dynamically
14723 @opindex minline-stringops-dynamically
14724 For string operations of unknown size, use run-time checks with
14725 inline code for small blocks and a library call for large blocks.
14727 @item -mstringop-strategy=@var{alg}
14728 @opindex mstringop-strategy=@var{alg}
14729 Override the internal decision heuristic for the particular algorithm to use
14730 for inlining string operations.  The allowed values for @var{alg} are:
14732 @table @samp
14733 @item rep_byte
14734 @itemx rep_4byte
14735 @itemx rep_8byte
14736 Expand using i386 @code{rep} prefix of the specified size.
14738 @item byte_loop
14739 @itemx loop
14740 @itemx unrolled_loop
14741 Expand into an inline loop.
14743 @item libcall
14744 Always use a library call.
14745 @end table
14747 @item -mmemcpy-strategy=@var{strategy}
14748 @opindex mmemcpy-strategy=@var{strategy}
14749 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
14750 should be inlined and what inline algorithm to use when the expected size
14751 of the copy operation is known. @var{strategy} 
14752 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
14753 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
14754 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
14755 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
14756 in the list must be specified in increasing order.  The minimal byte size for 
14757 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
14758 preceding range.
14760 @item -mmemset-strategy=@var{strategy}
14761 @opindex mmemset-strategy=@var{strategy}
14762 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
14763 @code{__builtin_memset} expansion.
14765 @item -momit-leaf-frame-pointer
14766 @opindex momit-leaf-frame-pointer
14767 Don't keep the frame pointer in a register for leaf functions.  This
14768 avoids the instructions to save, set up, and restore frame pointers and
14769 makes an extra register available in leaf functions.  The option
14770 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14771 which might make debugging harder.
14773 @item -mtls-direct-seg-refs
14774 @itemx -mno-tls-direct-seg-refs
14775 @opindex mtls-direct-seg-refs
14776 Controls whether TLS variables may be accessed with offsets from the
14777 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14778 or whether the thread base pointer must be added.  Whether or not this
14779 is valid depends on the operating system, and whether it maps the
14780 segment to cover the entire TLS area.
14782 For systems that use the GNU C Library, the default is on.
14784 @item -msse2avx
14785 @itemx -mno-sse2avx
14786 @opindex msse2avx
14787 Specify that the assembler should encode SSE instructions with VEX
14788 prefix.  The option @option{-mavx} turns this on by default.
14790 @item -mfentry
14791 @itemx -mno-fentry
14792 @opindex mfentry
14793 If profiling is active (@option{-pg}), put the profiling
14794 counter call before the prologue.
14795 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14796 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14798 @item -m8bit-idiv
14799 @itemx -mno-8bit-idiv
14800 @opindex 8bit-idiv
14801 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14802 much faster than 32-bit/64-bit integer divide.  This option generates a
14803 run-time check.  If both dividend and divisor are within range of 0
14804 to 255, 8-bit unsigned integer divide is used instead of
14805 32-bit/64-bit integer divide.
14807 @item -mavx256-split-unaligned-load
14808 @itemx -mavx256-split-unaligned-store
14809 @opindex avx256-split-unaligned-load
14810 @opindex avx256-split-unaligned-store
14811 Split 32-byte AVX unaligned load and store.
14813 @item -mstack-protector-guard=@var{guard}
14814 @opindex mstack-protector-guard=@var{guard}
14815 Generate stack protection code using canary at @var{guard}.  Supported
14816 locations are @samp{global} for global canary or @samp{tls} for per-thread
14817 canary in the TLS block (the default).  This option has effect only when
14818 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
14820 @end table
14822 These @samp{-m} switches are supported in addition to the above
14823 on x86-64 processors in 64-bit environments.
14825 @table @gcctabopt
14826 @item -m32
14827 @itemx -m64
14828 @itemx -mx32
14829 @opindex m32
14830 @opindex m64
14831 @opindex mx32
14832 Generate code for a 32-bit or 64-bit environment.
14833 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14834 to 32 bits, and
14835 generates code that runs on any i386 system.
14837 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14838 types to 64 bits, and generates code for the x86-64 architecture.
14839 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14840 and @option{-mdynamic-no-pic} options.
14842 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14843 to 32 bits, and
14844 generates code for the x86-64 architecture.
14846 @item -mno-red-zone
14847 @opindex mno-red-zone
14848 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14849 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14850 stack pointer that is not modified by signal or interrupt handlers
14851 and therefore can be used for temporary data without adjusting the stack
14852 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14854 @item -mcmodel=small
14855 @opindex mcmodel=small
14856 Generate code for the small code model: the program and its symbols must
14857 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14858 Programs can be statically or dynamically linked.  This is the default
14859 code model.
14861 @item -mcmodel=kernel
14862 @opindex mcmodel=kernel
14863 Generate code for the kernel code model.  The kernel runs in the
14864 negative 2 GB of the address space.
14865 This model has to be used for Linux kernel code.
14867 @item -mcmodel=medium
14868 @opindex mcmodel=medium
14869 Generate code for the medium model: the program is linked in the lower 2
14870 GB of the address space.  Small symbols are also placed there.  Symbols
14871 with sizes larger than @option{-mlarge-data-threshold} are put into
14872 large data or BSS sections and can be located above 2GB.  Programs can
14873 be statically or dynamically linked.
14875 @item -mcmodel=large
14876 @opindex mcmodel=large
14877 Generate code for the large model.  This model makes no assumptions
14878 about addresses and sizes of sections.
14880 @item -maddress-mode=long
14881 @opindex maddress-mode=long
14882 Generate code for long address mode.  This is only supported for 64-bit
14883 and x32 environments.  It is the default address mode for 64-bit
14884 environments.
14886 @item -maddress-mode=short
14887 @opindex maddress-mode=short
14888 Generate code for short address mode.  This is only supported for 32-bit
14889 and x32 environments.  It is the default address mode for 32-bit and
14890 x32 environments.
14891 @end table
14893 @node i386 and x86-64 Windows Options
14894 @subsection i386 and x86-64 Windows Options
14895 @cindex i386 and x86-64 Windows Options
14897 These additional options are available for Microsoft Windows targets:
14899 @table @gcctabopt
14900 @item -mconsole
14901 @opindex mconsole
14902 This option
14903 specifies that a console application is to be generated, by
14904 instructing the linker to set the PE header subsystem type
14905 required for console applications.
14906 This option is available for Cygwin and MinGW targets and is
14907 enabled by default on those targets.
14909 @item -mdll
14910 @opindex mdll
14911 This option is available for Cygwin and MinGW targets.  It
14912 specifies that a DLL---a dynamic link library---is to be
14913 generated, enabling the selection of the required runtime
14914 startup object and entry point.
14916 @item -mnop-fun-dllimport
14917 @opindex mnop-fun-dllimport
14918 This option is available for Cygwin and MinGW targets.  It
14919 specifies that the @code{dllimport} attribute should be ignored.
14921 @item -mthread
14922 @opindex mthread
14923 This option is available for MinGW targets. It specifies
14924 that MinGW-specific thread support is to be used.
14926 @item -municode
14927 @opindex municode
14928 This option is available for MinGW-w64 targets.  It causes
14929 the @code{UNICODE} preprocessor macro to be predefined, and
14930 chooses Unicode-capable runtime startup code.
14932 @item -mwin32
14933 @opindex mwin32
14934 This option is available for Cygwin and MinGW targets.  It
14935 specifies that the typical Microsoft Windows predefined macros are to
14936 be set in the pre-processor, but does not influence the choice
14937 of runtime library/startup code.
14939 @item -mwindows
14940 @opindex mwindows
14941 This option is available for Cygwin and MinGW targets.  It
14942 specifies that a GUI application is to be generated by
14943 instructing the linker to set the PE header subsystem type
14944 appropriately.
14946 @item -fno-set-stack-executable
14947 @opindex fno-set-stack-executable
14948 This option is available for MinGW targets. It specifies that
14949 the executable flag for the stack used by nested functions isn't
14950 set. This is necessary for binaries running in kernel mode of
14951 Microsoft Windows, as there the User32 API, which is used to set executable
14952 privileges, isn't available.
14954 @item -fwritable-relocated-rdata
14955 @opindex fno-writable-relocated-rdata
14956 This option is available for MinGW and Cygwin targets.  It specifies
14957 that relocated-data in read-only section is put into .data
14958 section.  This is a necessary for older runtimes not supporting
14959 modification of .rdata sections for pseudo-relocation.
14961 @item -mpe-aligned-commons
14962 @opindex mpe-aligned-commons
14963 This option is available for Cygwin and MinGW targets.  It
14964 specifies that the GNU extension to the PE file format that
14965 permits the correct alignment of COMMON variables should be
14966 used when generating code.  It is enabled by default if
14967 GCC detects that the target assembler found during configuration
14968 supports the feature.
14969 @end table
14971 See also under @ref{i386 and x86-64 Options} for standard options.
14973 @node IA-64 Options
14974 @subsection IA-64 Options
14975 @cindex IA-64 Options
14977 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14979 @table @gcctabopt
14980 @item -mbig-endian
14981 @opindex mbig-endian
14982 Generate code for a big-endian target.  This is the default for HP-UX@.
14984 @item -mlittle-endian
14985 @opindex mlittle-endian
14986 Generate code for a little-endian target.  This is the default for AIX5
14987 and GNU/Linux.
14989 @item -mgnu-as
14990 @itemx -mno-gnu-as
14991 @opindex mgnu-as
14992 @opindex mno-gnu-as
14993 Generate (or don't) code for the GNU assembler.  This is the default.
14994 @c Also, this is the default if the configure option @option{--with-gnu-as}
14995 @c is used.
14997 @item -mgnu-ld
14998 @itemx -mno-gnu-ld
14999 @opindex mgnu-ld
15000 @opindex mno-gnu-ld
15001 Generate (or don't) code for the GNU linker.  This is the default.
15002 @c Also, this is the default if the configure option @option{--with-gnu-ld}
15003 @c is used.
15005 @item -mno-pic
15006 @opindex mno-pic
15007 Generate code that does not use a global pointer register.  The result
15008 is not position independent code, and violates the IA-64 ABI@.
15010 @item -mvolatile-asm-stop
15011 @itemx -mno-volatile-asm-stop
15012 @opindex mvolatile-asm-stop
15013 @opindex mno-volatile-asm-stop
15014 Generate (or don't) a stop bit immediately before and after volatile asm
15015 statements.
15017 @item -mregister-names
15018 @itemx -mno-register-names
15019 @opindex mregister-names
15020 @opindex mno-register-names
15021 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
15022 the stacked registers.  This may make assembler output more readable.
15024 @item -mno-sdata
15025 @itemx -msdata
15026 @opindex mno-sdata
15027 @opindex msdata
15028 Disable (or enable) optimizations that use the small data section.  This may
15029 be useful for working around optimizer bugs.
15031 @item -mconstant-gp
15032 @opindex mconstant-gp
15033 Generate code that uses a single constant global pointer value.  This is
15034 useful when compiling kernel code.
15036 @item -mauto-pic
15037 @opindex mauto-pic
15038 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
15039 This is useful when compiling firmware code.
15041 @item -minline-float-divide-min-latency
15042 @opindex minline-float-divide-min-latency
15043 Generate code for inline divides of floating-point values
15044 using the minimum latency algorithm.
15046 @item -minline-float-divide-max-throughput
15047 @opindex minline-float-divide-max-throughput
15048 Generate code for inline divides of floating-point values
15049 using the maximum throughput algorithm.
15051 @item -mno-inline-float-divide
15052 @opindex mno-inline-float-divide
15053 Do not generate inline code for divides of floating-point values.
15055 @item -minline-int-divide-min-latency
15056 @opindex minline-int-divide-min-latency
15057 Generate code for inline divides of integer values
15058 using the minimum latency algorithm.
15060 @item -minline-int-divide-max-throughput
15061 @opindex minline-int-divide-max-throughput
15062 Generate code for inline divides of integer values
15063 using the maximum throughput algorithm.
15065 @item -mno-inline-int-divide
15066 @opindex mno-inline-int-divide
15067 Do not generate inline code for divides of integer values.
15069 @item -minline-sqrt-min-latency
15070 @opindex minline-sqrt-min-latency
15071 Generate code for inline square roots
15072 using the minimum latency algorithm.
15074 @item -minline-sqrt-max-throughput
15075 @opindex minline-sqrt-max-throughput
15076 Generate code for inline square roots
15077 using the maximum throughput algorithm.
15079 @item -mno-inline-sqrt
15080 @opindex mno-inline-sqrt
15081 Do not generate inline code for @code{sqrt}.
15083 @item -mfused-madd
15084 @itemx -mno-fused-madd
15085 @opindex mfused-madd
15086 @opindex mno-fused-madd
15087 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
15088 instructions.  The default is to use these instructions.
15090 @item -mno-dwarf2-asm
15091 @itemx -mdwarf2-asm
15092 @opindex mno-dwarf2-asm
15093 @opindex mdwarf2-asm
15094 Don't (or do) generate assembler code for the DWARF 2 line number debugging
15095 info.  This may be useful when not using the GNU assembler.
15097 @item -mearly-stop-bits
15098 @itemx -mno-early-stop-bits
15099 @opindex mearly-stop-bits
15100 @opindex mno-early-stop-bits
15101 Allow stop bits to be placed earlier than immediately preceding the
15102 instruction that triggered the stop bit.  This can improve instruction
15103 scheduling, but does not always do so.
15105 @item -mfixed-range=@var{register-range}
15106 @opindex mfixed-range
15107 Generate code treating the given register range as fixed registers.
15108 A fixed register is one that the register allocator cannot use.  This is
15109 useful when compiling kernel code.  A register range is specified as
15110 two registers separated by a dash.  Multiple register ranges can be
15111 specified separated by a comma.
15113 @item -mtls-size=@var{tls-size}
15114 @opindex mtls-size
15115 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
15118 @item -mtune=@var{cpu-type}
15119 @opindex mtune
15120 Tune the instruction scheduling for a particular CPU, Valid values are
15121 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
15122 and @samp{mckinley}.
15124 @item -milp32
15125 @itemx -mlp64
15126 @opindex milp32
15127 @opindex mlp64
15128 Generate code for a 32-bit or 64-bit environment.
15129 The 32-bit environment sets int, long and pointer to 32 bits.
15130 The 64-bit environment sets int to 32 bits and long and pointer
15131 to 64 bits.  These are HP-UX specific flags.
15133 @item -mno-sched-br-data-spec
15134 @itemx -msched-br-data-spec
15135 @opindex mno-sched-br-data-spec
15136 @opindex msched-br-data-spec
15137 (Dis/En)able data speculative scheduling before reload.
15138 This results in generation of @code{ld.a} instructions and
15139 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15140 The default is 'disable'.
15142 @item -msched-ar-data-spec
15143 @itemx -mno-sched-ar-data-spec
15144 @opindex msched-ar-data-spec
15145 @opindex mno-sched-ar-data-spec
15146 (En/Dis)able data speculative scheduling after reload.
15147 This results in generation of @code{ld.a} instructions and
15148 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15149 The default is 'enable'.
15151 @item -mno-sched-control-spec
15152 @itemx -msched-control-spec
15153 @opindex mno-sched-control-spec
15154 @opindex msched-control-spec
15155 (Dis/En)able control speculative scheduling.  This feature is
15156 available only during region scheduling (i.e.@: before reload).
15157 This results in generation of the @code{ld.s} instructions and
15158 the corresponding check instructions @code{chk.s}.
15159 The default is 'disable'.
15161 @item -msched-br-in-data-spec
15162 @itemx -mno-sched-br-in-data-spec
15163 @opindex msched-br-in-data-spec
15164 @opindex mno-sched-br-in-data-spec
15165 (En/Dis)able speculative scheduling of the instructions that
15166 are dependent on the data speculative loads before reload.
15167 This is effective only with @option{-msched-br-data-spec} enabled.
15168 The default is 'enable'.
15170 @item -msched-ar-in-data-spec
15171 @itemx -mno-sched-ar-in-data-spec
15172 @opindex msched-ar-in-data-spec
15173 @opindex mno-sched-ar-in-data-spec
15174 (En/Dis)able speculative scheduling of the instructions that
15175 are dependent on the data speculative loads after reload.
15176 This is effective only with @option{-msched-ar-data-spec} enabled.
15177 The default is 'enable'.
15179 @item -msched-in-control-spec
15180 @itemx -mno-sched-in-control-spec
15181 @opindex msched-in-control-spec
15182 @opindex mno-sched-in-control-spec
15183 (En/Dis)able speculative scheduling of the instructions that
15184 are dependent on the control speculative loads.
15185 This is effective only with @option{-msched-control-spec} enabled.
15186 The default is 'enable'.
15188 @item -mno-sched-prefer-non-data-spec-insns
15189 @itemx -msched-prefer-non-data-spec-insns
15190 @opindex mno-sched-prefer-non-data-spec-insns
15191 @opindex msched-prefer-non-data-spec-insns
15192 If enabled, data-speculative instructions are chosen for schedule
15193 only if there are no other choices at the moment.  This makes
15194 the use of the data speculation much more conservative.
15195 The default is 'disable'.
15197 @item -mno-sched-prefer-non-control-spec-insns
15198 @itemx -msched-prefer-non-control-spec-insns
15199 @opindex mno-sched-prefer-non-control-spec-insns
15200 @opindex msched-prefer-non-control-spec-insns
15201 If enabled, control-speculative instructions are chosen for schedule
15202 only if there are no other choices at the moment.  This makes
15203 the use of the control speculation much more conservative.
15204 The default is 'disable'.
15206 @item -mno-sched-count-spec-in-critical-path
15207 @itemx -msched-count-spec-in-critical-path
15208 @opindex mno-sched-count-spec-in-critical-path
15209 @opindex msched-count-spec-in-critical-path
15210 If enabled, speculative dependencies are considered during
15211 computation of the instructions priorities.  This makes the use of the
15212 speculation a bit more conservative.
15213 The default is 'disable'.
15215 @item -msched-spec-ldc
15216 @opindex msched-spec-ldc
15217 Use a simple data speculation check.  This option is on by default.
15219 @item -msched-control-spec-ldc
15220 @opindex msched-spec-ldc
15221 Use a simple check for control speculation.  This option is on by default.
15223 @item -msched-stop-bits-after-every-cycle
15224 @opindex msched-stop-bits-after-every-cycle
15225 Place a stop bit after every cycle when scheduling.  This option is on
15226 by default.
15228 @item -msched-fp-mem-deps-zero-cost
15229 @opindex msched-fp-mem-deps-zero-cost
15230 Assume that floating-point stores and loads are not likely to cause a conflict
15231 when placed into the same instruction group.  This option is disabled by
15232 default.
15234 @item -msel-sched-dont-check-control-spec
15235 @opindex msel-sched-dont-check-control-spec
15236 Generate checks for control speculation in selective scheduling.
15237 This flag is disabled by default.
15239 @item -msched-max-memory-insns=@var{max-insns}
15240 @opindex msched-max-memory-insns
15241 Limit on the number of memory insns per instruction group, giving lower
15242 priority to subsequent memory insns attempting to schedule in the same
15243 instruction group. Frequently useful to prevent cache bank conflicts.
15244 The default value is 1.
15246 @item -msched-max-memory-insns-hard-limit
15247 @opindex msched-max-memory-insns-hard-limit
15248 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
15249 disallowing more than that number in an instruction group.
15250 Otherwise, the limit is ``soft'', meaning that non-memory operations
15251 are preferred when the limit is reached, but memory operations may still
15252 be scheduled.
15254 @end table
15256 @node LM32 Options
15257 @subsection LM32 Options
15258 @cindex LM32 options
15260 These @option{-m} options are defined for the LatticeMico32 architecture:
15262 @table @gcctabopt
15263 @item -mbarrel-shift-enabled
15264 @opindex mbarrel-shift-enabled
15265 Enable barrel-shift instructions.
15267 @item -mdivide-enabled
15268 @opindex mdivide-enabled
15269 Enable divide and modulus instructions.
15271 @item -mmultiply-enabled
15272 @opindex multiply-enabled
15273 Enable multiply instructions.
15275 @item -msign-extend-enabled
15276 @opindex msign-extend-enabled
15277 Enable sign extend instructions.
15279 @item -muser-enabled
15280 @opindex muser-enabled
15281 Enable user-defined instructions.
15283 @end table
15285 @node M32C Options
15286 @subsection M32C Options
15287 @cindex M32C options
15289 @table @gcctabopt
15290 @item -mcpu=@var{name}
15291 @opindex mcpu=
15292 Select the CPU for which code is generated.  @var{name} may be one of
15293 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
15294 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
15295 the M32C/80 series.
15297 @item -msim
15298 @opindex msim
15299 Specifies that the program will be run on the simulator.  This causes
15300 an alternate runtime library to be linked in which supports, for
15301 example, file I/O@.  You must not use this option when generating
15302 programs that will run on real hardware; you must provide your own
15303 runtime library for whatever I/O functions are needed.
15305 @item -memregs=@var{number}
15306 @opindex memregs=
15307 Specifies the number of memory-based pseudo-registers GCC uses
15308 during code generation.  These pseudo-registers are used like real
15309 registers, so there is a tradeoff between GCC's ability to fit the
15310 code into available registers, and the performance penalty of using
15311 memory instead of registers.  Note that all modules in a program must
15312 be compiled with the same value for this option.  Because of that, you
15313 must not use this option with GCC's default runtime libraries.
15315 @end table
15317 @node M32R/D Options
15318 @subsection M32R/D Options
15319 @cindex M32R/D options
15321 These @option{-m} options are defined for Renesas M32R/D architectures:
15323 @table @gcctabopt
15324 @item -m32r2
15325 @opindex m32r2
15326 Generate code for the M32R/2@.
15328 @item -m32rx
15329 @opindex m32rx
15330 Generate code for the M32R/X@.
15332 @item -m32r
15333 @opindex m32r
15334 Generate code for the M32R@.  This is the default.
15336 @item -mmodel=small
15337 @opindex mmodel=small
15338 Assume all objects live in the lower 16MB of memory (so that their addresses
15339 can be loaded with the @code{ld24} instruction), and assume all subroutines
15340 are reachable with the @code{bl} instruction.
15341 This is the default.
15343 The addressability of a particular object can be set with the
15344 @code{model} attribute.
15346 @item -mmodel=medium
15347 @opindex mmodel=medium
15348 Assume objects may be anywhere in the 32-bit address space (the compiler
15349 generates @code{seth/add3} instructions to load their addresses), and
15350 assume all subroutines are reachable with the @code{bl} instruction.
15352 @item -mmodel=large
15353 @opindex mmodel=large
15354 Assume objects may be anywhere in the 32-bit address space (the compiler
15355 generates @code{seth/add3} instructions to load their addresses), and
15356 assume subroutines may not be reachable with the @code{bl} instruction
15357 (the compiler generates the much slower @code{seth/add3/jl}
15358 instruction sequence).
15360 @item -msdata=none
15361 @opindex msdata=none
15362 Disable use of the small data area.  Variables are put into
15363 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
15364 @code{section} attribute has been specified).
15365 This is the default.
15367 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
15368 Objects may be explicitly put in the small data area with the
15369 @code{section} attribute using one of these sections.
15371 @item -msdata=sdata
15372 @opindex msdata=sdata
15373 Put small global and static data in the small data area, but do not
15374 generate special code to reference them.
15376 @item -msdata=use
15377 @opindex msdata=use
15378 Put small global and static data in the small data area, and generate
15379 special instructions to reference them.
15381 @item -G @var{num}
15382 @opindex G
15383 @cindex smaller data references
15384 Put global and static objects less than or equal to @var{num} bytes
15385 into the small data or BSS sections instead of the normal data or BSS
15386 sections.  The default value of @var{num} is 8.
15387 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
15388 for this option to have any effect.
15390 All modules should be compiled with the same @option{-G @var{num}} value.
15391 Compiling with different values of @var{num} may or may not work; if it
15392 doesn't the linker gives an error message---incorrect code is not
15393 generated.
15395 @item -mdebug
15396 @opindex mdebug
15397 Makes the M32R-specific code in the compiler display some statistics
15398 that might help in debugging programs.
15400 @item -malign-loops
15401 @opindex malign-loops
15402 Align all loops to a 32-byte boundary.
15404 @item -mno-align-loops
15405 @opindex mno-align-loops
15406 Do not enforce a 32-byte alignment for loops.  This is the default.
15408 @item -missue-rate=@var{number}
15409 @opindex missue-rate=@var{number}
15410 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15411 or 2.
15413 @item -mbranch-cost=@var{number}
15414 @opindex mbranch-cost=@var{number}
15415 @var{number} can only be 1 or 2.  If it is 1 then branches are
15416 preferred over conditional code, if it is 2, then the opposite applies.
15418 @item -mflush-trap=@var{number}
15419 @opindex mflush-trap=@var{number}
15420 Specifies the trap number to use to flush the cache.  The default is
15421 12.  Valid numbers are between 0 and 15 inclusive.
15423 @item -mno-flush-trap
15424 @opindex mno-flush-trap
15425 Specifies that the cache cannot be flushed by using a trap.
15427 @item -mflush-func=@var{name}
15428 @opindex mflush-func=@var{name}
15429 Specifies the name of the operating system function to call to flush
15430 the cache.  The default is @emph{_flush_cache}, but a function call
15431 is only used if a trap is not available.
15433 @item -mno-flush-func
15434 @opindex mno-flush-func
15435 Indicates that there is no OS function for flushing the cache.
15437 @end table
15439 @node M680x0 Options
15440 @subsection M680x0 Options
15441 @cindex M680x0 options
15443 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15444 The default settings depend on which architecture was selected when
15445 the compiler was configured; the defaults for the most common choices
15446 are given below.
15448 @table @gcctabopt
15449 @item -march=@var{arch}
15450 @opindex march
15451 Generate code for a specific M680x0 or ColdFire instruction set
15452 architecture.  Permissible values of @var{arch} for M680x0
15453 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15454 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15455 architectures are selected according to Freescale's ISA classification
15456 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15457 @samp{isab} and @samp{isac}.
15459 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15460 code for a ColdFire target.  The @var{arch} in this macro is one of the
15461 @option{-march} arguments given above.
15463 When used together, @option{-march} and @option{-mtune} select code
15464 that runs on a family of similar processors but that is optimized
15465 for a particular microarchitecture.
15467 @item -mcpu=@var{cpu}
15468 @opindex mcpu
15469 Generate code for a specific M680x0 or ColdFire processor.
15470 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15471 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15472 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15473 below, which also classifies the CPUs into families:
15475 @multitable @columnfractions 0.20 0.80
15476 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15477 @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}
15478 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
15479 @item @samp{5206e} @tab @samp{5206e}
15480 @item @samp{5208} @tab @samp{5207} @samp{5208}
15481 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
15482 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
15483 @item @samp{5216} @tab @samp{5214} @samp{5216}
15484 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
15485 @item @samp{5225} @tab @samp{5224} @samp{5225}
15486 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
15487 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
15488 @item @samp{5249} @tab @samp{5249}
15489 @item @samp{5250} @tab @samp{5250}
15490 @item @samp{5271} @tab @samp{5270} @samp{5271}
15491 @item @samp{5272} @tab @samp{5272}
15492 @item @samp{5275} @tab @samp{5274} @samp{5275}
15493 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
15494 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
15495 @item @samp{5307} @tab @samp{5307}
15496 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
15497 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
15498 @item @samp{5407} @tab @samp{5407}
15499 @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}
15500 @end multitable
15502 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
15503 @var{arch} is compatible with @var{cpu}.  Other combinations of
15504 @option{-mcpu} and @option{-march} are rejected.
15506 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
15507 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
15508 where the value of @var{family} is given by the table above.
15510 @item -mtune=@var{tune}
15511 @opindex mtune
15512 Tune the code for a particular microarchitecture within the
15513 constraints set by @option{-march} and @option{-mcpu}.
15514 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
15515 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
15516 and @samp{cpu32}.  The ColdFire microarchitectures
15517 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
15519 You can also use @option{-mtune=68020-40} for code that needs
15520 to run relatively well on 68020, 68030 and 68040 targets.
15521 @option{-mtune=68020-60} is similar but includes 68060 targets
15522 as well.  These two options select the same tuning decisions as
15523 @option{-m68020-40} and @option{-m68020-60} respectively.
15525 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
15526 when tuning for 680x0 architecture @var{arch}.  It also defines
15527 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
15528 option is used.  If GCC is tuning for a range of architectures,
15529 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
15530 it defines the macros for every architecture in the range.
15532 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
15533 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
15534 of the arguments given above.
15536 @item -m68000
15537 @itemx -mc68000
15538 @opindex m68000
15539 @opindex mc68000
15540 Generate output for a 68000.  This is the default
15541 when the compiler is configured for 68000-based systems.
15542 It is equivalent to @option{-march=68000}.
15544 Use this option for microcontrollers with a 68000 or EC000 core,
15545 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15547 @item -m68010
15548 @opindex m68010
15549 Generate output for a 68010.  This is the default
15550 when the compiler is configured for 68010-based systems.
15551 It is equivalent to @option{-march=68010}.
15553 @item -m68020
15554 @itemx -mc68020
15555 @opindex m68020
15556 @opindex mc68020
15557 Generate output for a 68020.  This is the default
15558 when the compiler is configured for 68020-based systems.
15559 It is equivalent to @option{-march=68020}.
15561 @item -m68030
15562 @opindex m68030
15563 Generate output for a 68030.  This is the default when the compiler is
15564 configured for 68030-based systems.  It is equivalent to
15565 @option{-march=68030}.
15567 @item -m68040
15568 @opindex m68040
15569 Generate output for a 68040.  This is the default when the compiler is
15570 configured for 68040-based systems.  It is equivalent to
15571 @option{-march=68040}.
15573 This option inhibits the use of 68881/68882 instructions that have to be
15574 emulated by software on the 68040.  Use this option if your 68040 does not
15575 have code to emulate those instructions.
15577 @item -m68060
15578 @opindex m68060
15579 Generate output for a 68060.  This is the default when the compiler is
15580 configured for 68060-based systems.  It is equivalent to
15581 @option{-march=68060}.
15583 This option inhibits the use of 68020 and 68881/68882 instructions that
15584 have to be emulated by software on the 68060.  Use this option if your 68060
15585 does not have code to emulate those instructions.
15587 @item -mcpu32
15588 @opindex mcpu32
15589 Generate output for a CPU32.  This is the default
15590 when the compiler is configured for CPU32-based systems.
15591 It is equivalent to @option{-march=cpu32}.
15593 Use this option for microcontrollers with a
15594 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
15595 68336, 68340, 68341, 68349 and 68360.
15597 @item -m5200
15598 @opindex m5200
15599 Generate output for a 520X ColdFire CPU@.  This is the default
15600 when the compiler is configured for 520X-based systems.
15601 It is equivalent to @option{-mcpu=5206}, and is now deprecated
15602 in favor of that option.
15604 Use this option for microcontroller with a 5200 core, including
15605 the MCF5202, MCF5203, MCF5204 and MCF5206.
15607 @item -m5206e
15608 @opindex m5206e
15609 Generate output for a 5206e ColdFire CPU@.  The option is now
15610 deprecated in favor of the equivalent @option{-mcpu=5206e}.
15612 @item -m528x
15613 @opindex m528x
15614 Generate output for a member of the ColdFire 528X family.
15615 The option is now deprecated in favor of the equivalent
15616 @option{-mcpu=528x}.
15618 @item -m5307
15619 @opindex m5307
15620 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
15621 in favor of the equivalent @option{-mcpu=5307}.
15623 @item -m5407
15624 @opindex m5407
15625 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
15626 in favor of the equivalent @option{-mcpu=5407}.
15628 @item -mcfv4e
15629 @opindex mcfv4e
15630 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
15631 This includes use of hardware floating-point instructions.
15632 The option is equivalent to @option{-mcpu=547x}, and is now
15633 deprecated in favor of that option.
15635 @item -m68020-40
15636 @opindex m68020-40
15637 Generate output for a 68040, without using any of the new instructions.
15638 This results in code that can run relatively efficiently on either a
15639 68020/68881 or a 68030 or a 68040.  The generated code does use the
15640 68881 instructions that are emulated on the 68040.
15642 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
15644 @item -m68020-60
15645 @opindex m68020-60
15646 Generate output for a 68060, without using any of the new instructions.
15647 This results in code that can run relatively efficiently on either a
15648 68020/68881 or a 68030 or a 68040.  The generated code does use the
15649 68881 instructions that are emulated on the 68060.
15651 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
15653 @item -mhard-float
15654 @itemx -m68881
15655 @opindex mhard-float
15656 @opindex m68881
15657 Generate floating-point instructions.  This is the default for 68020
15658 and above, and for ColdFire devices that have an FPU@.  It defines the
15659 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
15660 on ColdFire targets.
15662 @item -msoft-float
15663 @opindex msoft-float
15664 Do not generate floating-point instructions; use library calls instead.
15665 This is the default for 68000, 68010, and 68832 targets.  It is also
15666 the default for ColdFire devices that have no FPU.
15668 @item -mdiv
15669 @itemx -mno-div
15670 @opindex mdiv
15671 @opindex mno-div
15672 Generate (do not generate) ColdFire hardware divide and remainder
15673 instructions.  If @option{-march} is used without @option{-mcpu},
15674 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
15675 architectures.  Otherwise, the default is taken from the target CPU
15676 (either the default CPU, or the one specified by @option{-mcpu}).  For
15677 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
15678 @option{-mcpu=5206e}.
15680 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
15682 @item -mshort
15683 @opindex mshort
15684 Consider type @code{int} to be 16 bits wide, like @code{short int}.
15685 Additionally, parameters passed on the stack are also aligned to a
15686 16-bit boundary even on targets whose API mandates promotion to 32-bit.
15688 @item -mno-short
15689 @opindex mno-short
15690 Do not consider type @code{int} to be 16 bits wide.  This is the default.
15692 @item -mnobitfield
15693 @itemx -mno-bitfield
15694 @opindex mnobitfield
15695 @opindex mno-bitfield
15696 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
15697 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
15699 @item -mbitfield
15700 @opindex mbitfield
15701 Do use the bit-field instructions.  The @option{-m68020} option implies
15702 @option{-mbitfield}.  This is the default if you use a configuration
15703 designed for a 68020.
15705 @item -mrtd
15706 @opindex mrtd
15707 Use a different function-calling convention, in which functions
15708 that take a fixed number of arguments return with the @code{rtd}
15709 instruction, which pops their arguments while returning.  This
15710 saves one instruction in the caller since there is no need to pop
15711 the arguments there.
15713 This calling convention is incompatible with the one normally
15714 used on Unix, so you cannot use it if you need to call libraries
15715 compiled with the Unix compiler.
15717 Also, you must provide function prototypes for all functions that
15718 take variable numbers of arguments (including @code{printf});
15719 otherwise incorrect code is generated for calls to those
15720 functions.
15722 In addition, seriously incorrect code results if you call a
15723 function with too many arguments.  (Normally, extra arguments are
15724 harmlessly ignored.)
15726 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
15727 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15729 @item -mno-rtd
15730 @opindex mno-rtd
15731 Do not use the calling conventions selected by @option{-mrtd}.
15732 This is the default.
15734 @item -malign-int
15735 @itemx -mno-align-int
15736 @opindex malign-int
15737 @opindex mno-align-int
15738 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
15739 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
15740 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
15741 Aligning variables on 32-bit boundaries produces code that runs somewhat
15742 faster on processors with 32-bit busses at the expense of more memory.
15744 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
15745 aligns structures containing the above types differently than
15746 most published application binary interface specifications for the m68k.
15748 @item -mpcrel
15749 @opindex mpcrel
15750 Use the pc-relative addressing mode of the 68000 directly, instead of
15751 using a global offset table.  At present, this option implies @option{-fpic},
15752 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
15753 not presently supported with @option{-mpcrel}, though this could be supported for
15754 68020 and higher processors.
15756 @item -mno-strict-align
15757 @itemx -mstrict-align
15758 @opindex mno-strict-align
15759 @opindex mstrict-align
15760 Do not (do) assume that unaligned memory references are handled by
15761 the system.
15763 @item -msep-data
15764 Generate code that allows the data segment to be located in a different
15765 area of memory from the text segment.  This allows for execute-in-place in
15766 an environment without virtual memory management.  This option implies
15767 @option{-fPIC}.
15769 @item -mno-sep-data
15770 Generate code that assumes that the data segment follows the text segment.
15771 This is the default.
15773 @item -mid-shared-library
15774 Generate code that supports shared libraries via the library ID method.
15775 This allows for execute-in-place and shared libraries in an environment
15776 without virtual memory management.  This option implies @option{-fPIC}.
15778 @item -mno-id-shared-library
15779 Generate code that doesn't assume ID-based shared libraries are being used.
15780 This is the default.
15782 @item -mshared-library-id=n
15783 Specifies the identification number of the ID-based shared library being
15784 compiled.  Specifying a value of 0 generates more compact code; specifying
15785 other values forces the allocation of that number to the current
15786 library, but is no more space- or time-efficient than omitting this option.
15788 @item -mxgot
15789 @itemx -mno-xgot
15790 @opindex mxgot
15791 @opindex mno-xgot
15792 When generating position-independent code for ColdFire, generate code
15793 that works if the GOT has more than 8192 entries.  This code is
15794 larger and slower than code generated without this option.  On M680x0
15795 processors, this option is not needed; @option{-fPIC} suffices.
15797 GCC normally uses a single instruction to load values from the GOT@.
15798 While this is relatively efficient, it only works if the GOT
15799 is smaller than about 64k.  Anything larger causes the linker
15800 to report an error such as:
15802 @cindex relocation truncated to fit (ColdFire)
15803 @smallexample
15804 relocation truncated to fit: R_68K_GOT16O foobar
15805 @end smallexample
15807 If this happens, you should recompile your code with @option{-mxgot}.
15808 It should then work with very large GOTs.  However, code generated with
15809 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15810 the value of a global symbol.
15812 Note that some linkers, including newer versions of the GNU linker,
15813 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15814 you should only need to use @option{-mxgot} when compiling a single
15815 object file that accesses more than 8192 GOT entries.  Very few do.
15817 These options have no effect unless GCC is generating
15818 position-independent code.
15820 @end table
15822 @node MCore Options
15823 @subsection MCore Options
15824 @cindex MCore options
15826 These are the @samp{-m} options defined for the Motorola M*Core
15827 processors.
15829 @table @gcctabopt
15831 @item -mhardlit
15832 @itemx -mno-hardlit
15833 @opindex mhardlit
15834 @opindex mno-hardlit
15835 Inline constants into the code stream if it can be done in two
15836 instructions or less.
15838 @item -mdiv
15839 @itemx -mno-div
15840 @opindex mdiv
15841 @opindex mno-div
15842 Use the divide instruction.  (Enabled by default).
15844 @item -mrelax-immediate
15845 @itemx -mno-relax-immediate
15846 @opindex mrelax-immediate
15847 @opindex mno-relax-immediate
15848 Allow arbitrary-sized immediates in bit operations.
15850 @item -mwide-bitfields
15851 @itemx -mno-wide-bitfields
15852 @opindex mwide-bitfields
15853 @opindex mno-wide-bitfields
15854 Always treat bit-fields as @code{int}-sized.
15856 @item -m4byte-functions
15857 @itemx -mno-4byte-functions
15858 @opindex m4byte-functions
15859 @opindex mno-4byte-functions
15860 Force all functions to be aligned to a 4-byte boundary.
15862 @item -mcallgraph-data
15863 @itemx -mno-callgraph-data
15864 @opindex mcallgraph-data
15865 @opindex mno-callgraph-data
15866 Emit callgraph information.
15868 @item -mslow-bytes
15869 @itemx -mno-slow-bytes
15870 @opindex mslow-bytes
15871 @opindex mno-slow-bytes
15872 Prefer word access when reading byte quantities.
15874 @item -mlittle-endian
15875 @itemx -mbig-endian
15876 @opindex mlittle-endian
15877 @opindex mbig-endian
15878 Generate code for a little-endian target.
15880 @item -m210
15881 @itemx -m340
15882 @opindex m210
15883 @opindex m340
15884 Generate code for the 210 processor.
15886 @item -mno-lsim
15887 @opindex mno-lsim
15888 Assume that runtime support has been provided and so omit the
15889 simulator library (@file{libsim.a)} from the linker command line.
15891 @item -mstack-increment=@var{size}
15892 @opindex mstack-increment
15893 Set the maximum amount for a single stack increment operation.  Large
15894 values can increase the speed of programs that contain functions
15895 that need a large amount of stack space, but they can also trigger a
15896 segmentation fault if the stack is extended too much.  The default
15897 value is 0x1000.
15899 @end table
15901 @node MeP Options
15902 @subsection MeP Options
15903 @cindex MeP options
15905 @table @gcctabopt
15907 @item -mabsdiff
15908 @opindex mabsdiff
15909 Enables the @code{abs} instruction, which is the absolute difference
15910 between two registers.
15912 @item -mall-opts
15913 @opindex mall-opts
15914 Enables all the optional instructions---average, multiply, divide, bit
15915 operations, leading zero, absolute difference, min/max, clip, and
15916 saturation.
15919 @item -maverage
15920 @opindex maverage
15921 Enables the @code{ave} instruction, which computes the average of two
15922 registers.
15924 @item -mbased=@var{n}
15925 @opindex mbased=
15926 Variables of size @var{n} bytes or smaller are placed in the
15927 @code{.based} section by default.  Based variables use the @code{$tp}
15928 register as a base register, and there is a 128-byte limit to the
15929 @code{.based} section.
15931 @item -mbitops
15932 @opindex mbitops
15933 Enables the bit operation instructions---bit test (@code{btstm}), set
15934 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15935 test-and-set (@code{tas}).
15937 @item -mc=@var{name}
15938 @opindex mc=
15939 Selects which section constant data is placed in.  @var{name} may
15940 be @code{tiny}, @code{near}, or @code{far}.
15942 @item -mclip
15943 @opindex mclip
15944 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15945 useful unless you also provide @code{-mminmax}.
15947 @item -mconfig=@var{name}
15948 @opindex mconfig=
15949 Selects one of the built-in core configurations.  Each MeP chip has
15950 one or more modules in it; each module has a core CPU and a variety of
15951 coprocessors, optional instructions, and peripherals.  The
15952 @code{MeP-Integrator} tool, not part of GCC, provides these
15953 configurations through this option; using this option is the same as
15954 using all the corresponding command-line options.  The default
15955 configuration is @code{default}.
15957 @item -mcop
15958 @opindex mcop
15959 Enables the coprocessor instructions.  By default, this is a 32-bit
15960 coprocessor.  Note that the coprocessor is normally enabled via the
15961 @code{-mconfig=} option.
15963 @item -mcop32
15964 @opindex mcop32
15965 Enables the 32-bit coprocessor's instructions.
15967 @item -mcop64
15968 @opindex mcop64
15969 Enables the 64-bit coprocessor's instructions.
15971 @item -mivc2
15972 @opindex mivc2
15973 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15975 @item -mdc
15976 @opindex mdc
15977 Causes constant variables to be placed in the @code{.near} section.
15979 @item -mdiv
15980 @opindex mdiv
15981 Enables the @code{div} and @code{divu} instructions.
15983 @item -meb
15984 @opindex meb
15985 Generate big-endian code.
15987 @item -mel
15988 @opindex mel
15989 Generate little-endian code.
15991 @item -mio-volatile
15992 @opindex mio-volatile
15993 Tells the compiler that any variable marked with the @code{io}
15994 attribute is to be considered volatile.
15996 @item -ml
15997 @opindex ml
15998 Causes variables to be assigned to the @code{.far} section by default.
16000 @item -mleadz
16001 @opindex mleadz
16002 Enables the @code{leadz} (leading zero) instruction.
16004 @item -mm
16005 @opindex mm
16006 Causes variables to be assigned to the @code{.near} section by default.
16008 @item -mminmax
16009 @opindex mminmax
16010 Enables the @code{min} and @code{max} instructions.
16012 @item -mmult
16013 @opindex mmult
16014 Enables the multiplication and multiply-accumulate instructions.
16016 @item -mno-opts
16017 @opindex mno-opts
16018 Disables all the optional instructions enabled by @code{-mall-opts}.
16020 @item -mrepeat
16021 @opindex mrepeat
16022 Enables the @code{repeat} and @code{erepeat} instructions, used for
16023 low-overhead looping.
16025 @item -ms
16026 @opindex ms
16027 Causes all variables to default to the @code{.tiny} section.  Note
16028 that there is a 65536-byte limit to this section.  Accesses to these
16029 variables use the @code{%gp} base register.
16031 @item -msatur
16032 @opindex msatur
16033 Enables the saturation instructions.  Note that the compiler does not
16034 currently generate these itself, but this option is included for
16035 compatibility with other tools, like @code{as}.
16037 @item -msdram
16038 @opindex msdram
16039 Link the SDRAM-based runtime instead of the default ROM-based runtime.
16041 @item -msim
16042 @opindex msim
16043 Link the simulator run-time libraries.
16045 @item -msimnovec
16046 @opindex msimnovec
16047 Link the simulator runtime libraries, excluding built-in support
16048 for reset and exception vectors and tables.
16050 @item -mtf
16051 @opindex mtf
16052 Causes all functions to default to the @code{.far} section.  Without
16053 this option, functions default to the @code{.near} section.
16055 @item -mtiny=@var{n}
16056 @opindex mtiny=
16057 Variables that are @var{n} bytes or smaller are allocated to the
16058 @code{.tiny} section.  These variables use the @code{$gp} base
16059 register.  The default for this option is 4, but note that there's a
16060 65536-byte limit to the @code{.tiny} section.
16062 @end table
16064 @node MicroBlaze Options
16065 @subsection MicroBlaze Options
16066 @cindex MicroBlaze Options
16068 @table @gcctabopt
16070 @item -msoft-float
16071 @opindex msoft-float
16072 Use software emulation for floating point (default).
16074 @item -mhard-float
16075 @opindex mhard-float
16076 Use hardware floating-point instructions.
16078 @item -mmemcpy
16079 @opindex mmemcpy
16080 Do not optimize block moves, use @code{memcpy}.
16082 @item -mno-clearbss
16083 @opindex mno-clearbss
16084 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
16086 @item -mcpu=@var{cpu-type}
16087 @opindex mcpu=
16088 Use features of, and schedule code for, the given CPU.
16089 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
16090 where @var{X} is a major version, @var{YY} is the minor version, and
16091 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
16092 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
16094 @item -mxl-soft-mul
16095 @opindex mxl-soft-mul
16096 Use software multiply emulation (default).
16098 @item -mxl-soft-div
16099 @opindex mxl-soft-div
16100 Use software emulation for divides (default).
16102 @item -mxl-barrel-shift
16103 @opindex mxl-barrel-shift
16104 Use the hardware barrel shifter.
16106 @item -mxl-pattern-compare
16107 @opindex mxl-pattern-compare
16108 Use pattern compare instructions.
16110 @item -msmall-divides
16111 @opindex msmall-divides
16112 Use table lookup optimization for small signed integer divisions.
16114 @item -mxl-stack-check
16115 @opindex mxl-stack-check
16116 This option is deprecated.  Use @option{-fstack-check} instead.
16118 @item -mxl-gp-opt
16119 @opindex mxl-gp-opt
16120 Use GP-relative @code{.sdata}/@code{.sbss} sections.
16122 @item -mxl-multiply-high
16123 @opindex mxl-multiply-high
16124 Use multiply high instructions for high part of 32x32 multiply.
16126 @item -mxl-float-convert
16127 @opindex mxl-float-convert
16128 Use hardware floating-point conversion instructions.
16130 @item -mxl-float-sqrt
16131 @opindex mxl-float-sqrt
16132 Use hardware floating-point square root instruction.
16134 @item -mbig-endian
16135 @opindex mbig-endian
16136 Generate code for a big-endian target.
16138 @item -mlittle-endian
16139 @opindex mlittle-endian
16140 Generate code for a little-endian target.
16142 @item -mxl-reorder
16143 @opindex mxl-reorder
16144 Use reorder instructions (swap and byte reversed load/store).
16146 @item -mxl-mode-@var{app-model}
16147 Select application model @var{app-model}.  Valid models are
16148 @table @samp
16149 @item executable
16150 normal executable (default), uses startup code @file{crt0.o}.
16152 @item xmdstub
16153 for use with Xilinx Microprocessor Debugger (XMD) based
16154 software intrusive debug agent called xmdstub. This uses startup file
16155 @file{crt1.o} and sets the start address of the program to 0x800.
16157 @item bootstrap
16158 for applications that are loaded using a bootloader.
16159 This model uses startup file @file{crt2.o} which does not contain a processor
16160 reset vector handler. This is suitable for transferring control on a
16161 processor reset to the bootloader rather than the application.
16163 @item novectors
16164 for applications that do not require any of the
16165 MicroBlaze vectors. This option may be useful for applications running
16166 within a monitoring application. This model uses @file{crt3.o} as a startup file.
16167 @end table
16169 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
16170 @option{-mxl-mode-@var{app-model}}.
16172 @end table
16174 @node MIPS Options
16175 @subsection MIPS Options
16176 @cindex MIPS options
16178 @table @gcctabopt
16180 @item -EB
16181 @opindex EB
16182 Generate big-endian code.
16184 @item -EL
16185 @opindex EL
16186 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
16187 configurations.
16189 @item -march=@var{arch}
16190 @opindex march
16191 Generate code that runs on @var{arch}, which can be the name of a
16192 generic MIPS ISA, or the name of a particular processor.
16193 The ISA names are:
16194 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
16195 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
16196 The processor names are:
16197 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
16198 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
16199 @samp{5kc}, @samp{5kf},
16200 @samp{20kc},
16201 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
16202 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
16203 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
16204 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
16205 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
16206 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
16207 @samp{m4k},
16208 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
16209 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
16210 @samp{orion},
16211 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
16212 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
16213 @samp{rm7000}, @samp{rm9000},
16214 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
16215 @samp{sb1},
16216 @samp{sr71000},
16217 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
16218 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
16219 @samp{xlr} and @samp{xlp}.
16220 The special value @samp{from-abi} selects the
16221 most compatible architecture for the selected ABI (that is,
16222 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
16224 The native Linux/GNU toolchain also supports the value @samp{native},
16225 which selects the best architecture option for the host processor.
16226 @option{-march=native} has no effect if GCC does not recognize
16227 the processor.
16229 In processor names, a final @samp{000} can be abbreviated as @samp{k}
16230 (for example, @option{-march=r2k}).  Prefixes are optional, and
16231 @samp{vr} may be written @samp{r}.
16233 Names of the form @samp{@var{n}f2_1} refer to processors with
16234 FPUs clocked at half the rate of the core, names of the form
16235 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
16236 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
16237 processors with FPUs clocked a ratio of 3:2 with respect to the core.
16238 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
16239 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
16240 accepted as synonyms for @samp{@var{n}f1_1}.
16242 GCC defines two macros based on the value of this option.  The first
16243 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
16244 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
16245 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
16246 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
16247 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
16249 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
16250 above.  In other words, it has the full prefix and does not
16251 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
16252 the macro names the resolved architecture (either @samp{"mips1"} or
16253 @samp{"mips3"}).  It names the default architecture when no
16254 @option{-march} option is given.
16256 @item -mtune=@var{arch}
16257 @opindex mtune
16258 Optimize for @var{arch}.  Among other things, this option controls
16259 the way instructions are scheduled, and the perceived cost of arithmetic
16260 operations.  The list of @var{arch} values is the same as for
16261 @option{-march}.
16263 When this option is not used, GCC optimizes for the processor
16264 specified by @option{-march}.  By using @option{-march} and
16265 @option{-mtune} together, it is possible to generate code that
16266 runs on a family of processors, but optimize the code for one
16267 particular member of that family.
16269 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
16270 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
16271 @option{-march} ones described above.
16273 @item -mips1
16274 @opindex mips1
16275 Equivalent to @option{-march=mips1}.
16277 @item -mips2
16278 @opindex mips2
16279 Equivalent to @option{-march=mips2}.
16281 @item -mips3
16282 @opindex mips3
16283 Equivalent to @option{-march=mips3}.
16285 @item -mips4
16286 @opindex mips4
16287 Equivalent to @option{-march=mips4}.
16289 @item -mips32
16290 @opindex mips32
16291 Equivalent to @option{-march=mips32}.
16293 @item -mips32r2
16294 @opindex mips32r2
16295 Equivalent to @option{-march=mips32r2}.
16297 @item -mips64
16298 @opindex mips64
16299 Equivalent to @option{-march=mips64}.
16301 @item -mips64r2
16302 @opindex mips64r2
16303 Equivalent to @option{-march=mips64r2}.
16305 @item -mips16
16306 @itemx -mno-mips16
16307 @opindex mips16
16308 @opindex mno-mips16
16309 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16310 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16312 MIPS16 code generation can also be controlled on a per-function basis
16313 by means of @code{mips16} and @code{nomips16} attributes.
16314 @xref{Function Attributes}, for more information.
16316 @item -mflip-mips16
16317 @opindex mflip-mips16
16318 Generate MIPS16 code on alternating functions.  This option is provided
16319 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16320 not intended for ordinary use in compiling user code.
16322 @item -minterlink-compressed
16323 @item -mno-interlink-compressed
16324 @opindex minterlink-compressed
16325 @opindex mno-interlink-compressed
16326 Require (do not require) that code using the standard (uncompressed) MIPS ISA
16327 be link-compatible with MIPS16 and microMIPS code, and vice versa.
16329 For example, code using the standard ISA encoding cannot jump directly
16330 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
16331 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
16332 knows that the target of the jump is not compressed.
16334 @item -minterlink-mips16
16335 @itemx -mno-interlink-mips16
16336 @opindex minterlink-mips16
16337 @opindex mno-interlink-mips16
16338 Aliases of @option{-minterlink-compressed} and
16339 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
16340 and are retained for backwards compatibility.
16342 @item -mabi=32
16343 @itemx -mabi=o64
16344 @itemx -mabi=n32
16345 @itemx -mabi=64
16346 @itemx -mabi=eabi
16347 @opindex mabi=32
16348 @opindex mabi=o64
16349 @opindex mabi=n32
16350 @opindex mabi=64
16351 @opindex mabi=eabi
16352 Generate code for the given ABI@.
16354 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
16355 generates 64-bit code when you select a 64-bit architecture, but you
16356 can use @option{-mgp32} to get 32-bit code instead.
16358 For information about the O64 ABI, see
16359 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
16361 GCC supports a variant of the o32 ABI in which floating-point registers
16362 are 64 rather than 32 bits wide.  You can select this combination with
16363 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
16364 and @code{mfhc1} instructions and is therefore only supported for
16365 MIPS32R2 processors.
16367 The register assignments for arguments and return values remain the
16368 same, but each scalar value is passed in a single 64-bit register
16369 rather than a pair of 32-bit registers.  For example, scalar
16370 floating-point values are returned in @samp{$f0} only, not a
16371 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
16372 remains the same, but all 64 bits are saved.
16374 @item -mabicalls
16375 @itemx -mno-abicalls
16376 @opindex mabicalls
16377 @opindex mno-abicalls
16378 Generate (do not generate) code that is suitable for SVR4-style
16379 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
16380 systems.
16382 @item -mshared
16383 @itemx -mno-shared
16384 Generate (do not generate) code that is fully position-independent,
16385 and that can therefore be linked into shared libraries.  This option
16386 only affects @option{-mabicalls}.
16388 All @option{-mabicalls} code has traditionally been position-independent,
16389 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
16390 as an extension, the GNU toolchain allows executables to use absolute
16391 accesses for locally-binding symbols.  It can also use shorter GP
16392 initialization sequences and generate direct calls to locally-defined
16393 functions.  This mode is selected by @option{-mno-shared}.
16395 @option{-mno-shared} depends on binutils 2.16 or higher and generates
16396 objects that can only be linked by the GNU linker.  However, the option
16397 does not affect the ABI of the final executable; it only affects the ABI
16398 of relocatable objects.  Using @option{-mno-shared} generally makes
16399 executables both smaller and quicker.
16401 @option{-mshared} is the default.
16403 @item -mplt
16404 @itemx -mno-plt
16405 @opindex mplt
16406 @opindex mno-plt
16407 Assume (do not assume) that the static and dynamic linkers
16408 support PLTs and copy relocations.  This option only affects
16409 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
16410 has no effect without @option{-msym32}.
16412 You can make @option{-mplt} the default by configuring
16413 GCC with @option{--with-mips-plt}.  The default is
16414 @option{-mno-plt} otherwise.
16416 @item -mxgot
16417 @itemx -mno-xgot
16418 @opindex mxgot
16419 @opindex mno-xgot
16420 Lift (do not lift) the usual restrictions on the size of the global
16421 offset table.
16423 GCC normally uses a single instruction to load values from the GOT@.
16424 While this is relatively efficient, it only works if the GOT
16425 is smaller than about 64k.  Anything larger causes the linker
16426 to report an error such as:
16428 @cindex relocation truncated to fit (MIPS)
16429 @smallexample
16430 relocation truncated to fit: R_MIPS_GOT16 foobar
16431 @end smallexample
16433 If this happens, you should recompile your code with @option{-mxgot}.
16434 This works with very large GOTs, although the code is also
16435 less efficient, since it takes three instructions to fetch the
16436 value of a global symbol.
16438 Note that some linkers can create multiple GOTs.  If you have such a
16439 linker, you should only need to use @option{-mxgot} when a single object
16440 file accesses more than 64k's worth of GOT entries.  Very few do.
16442 These options have no effect unless GCC is generating position
16443 independent code.
16445 @item -mgp32
16446 @opindex mgp32
16447 Assume that general-purpose registers are 32 bits wide.
16449 @item -mgp64
16450 @opindex mgp64
16451 Assume that general-purpose registers are 64 bits wide.
16453 @item -mfp32
16454 @opindex mfp32
16455 Assume that floating-point registers are 32 bits wide.
16457 @item -mfp64
16458 @opindex mfp64
16459 Assume that floating-point registers are 64 bits wide.
16461 @item -mhard-float
16462 @opindex mhard-float
16463 Use floating-point coprocessor instructions.
16465 @item -msoft-float
16466 @opindex msoft-float
16467 Do not use floating-point coprocessor instructions.  Implement
16468 floating-point calculations using library calls instead.
16470 @item -mno-float
16471 @opindex mno-float
16472 Equivalent to @option{-msoft-float}, but additionally asserts that the
16473 program being compiled does not perform any floating-point operations.
16474 This option is presently supported only by some bare-metal MIPS
16475 configurations, where it may select a special set of libraries
16476 that lack all floating-point support (including, for example, the
16477 floating-point @code{printf} formats).  
16478 If code compiled with @code{-mno-float} accidentally contains
16479 floating-point operations, it is likely to suffer a link-time
16480 or run-time failure.
16482 @item -msingle-float
16483 @opindex msingle-float
16484 Assume that the floating-point coprocessor only supports single-precision
16485 operations.
16487 @item -mdouble-float
16488 @opindex mdouble-float
16489 Assume that the floating-point coprocessor supports double-precision
16490 operations.  This is the default.
16492 @item -mabs=2008
16493 @itemx -mabs=legacy
16494 @opindex mabs=2008
16495 @opindex mabs=legacy
16496 These options control the treatment of the special not-a-number (NaN)
16497 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
16498 @code{neg.@i{fmt}} machine instructions.
16500 By default or when the @option{-mabs=legacy} is used the legacy
16501 treatment is selected.  In this case these instructions are considered
16502 arithmetic and avoided where correct operation is required and the
16503 input operand might be a NaN.  A longer sequence of instructions that
16504 manipulate the sign bit of floating-point datum manually is used
16505 instead unless the @option{-ffinite-math-only} option has also been
16506 specified.
16508 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
16509 this case these instructions are considered non-arithmetic and therefore
16510 operating correctly in all cases, including in particular where the
16511 input operand is a NaN.  These instructions are therefore always used
16512 for the respective operations.
16514 @item -mnan=2008
16515 @itemx -mnan=legacy
16516 @opindex mnan=2008
16517 @opindex mnan=legacy
16518 These options control the encoding of the special not-a-number (NaN)
16519 IEEE 754 floating-point data.
16521 The @option{-mnan=legacy} option selects the legacy encoding.  In this
16522 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
16523 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
16524 by the first bit of their trailing significand field being 1.
16526 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
16527 this case qNaNs are denoted by the first bit of their trailing
16528 significand field being 1, whereas sNaNs are denoted by the first bit of
16529 their trailing significand field being 0.
16531 The default is @option{-mnan=legacy} unless GCC has been configured with
16532 @option{--with-nan=2008}.
16534 @item -mllsc
16535 @itemx -mno-llsc
16536 @opindex mllsc
16537 @opindex mno-llsc
16538 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
16539 implement atomic memory built-in functions.  When neither option is
16540 specified, GCC uses the instructions if the target architecture
16541 supports them.
16543 @option{-mllsc} is useful if the runtime environment can emulate the
16544 instructions and @option{-mno-llsc} can be useful when compiling for
16545 nonstandard ISAs.  You can make either option the default by
16546 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
16547 respectively.  @option{--with-llsc} is the default for some
16548 configurations; see the installation documentation for details.
16550 @item -mdsp
16551 @itemx -mno-dsp
16552 @opindex mdsp
16553 @opindex mno-dsp
16554 Use (do not use) revision 1 of the MIPS DSP ASE@.
16555 @xref{MIPS DSP Built-in Functions}.  This option defines the
16556 preprocessor macro @samp{__mips_dsp}.  It also defines
16557 @samp{__mips_dsp_rev} to 1.
16559 @item -mdspr2
16560 @itemx -mno-dspr2
16561 @opindex mdspr2
16562 @opindex mno-dspr2
16563 Use (do not use) revision 2 of the MIPS DSP ASE@.
16564 @xref{MIPS DSP Built-in Functions}.  This option defines the
16565 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
16566 It also defines @samp{__mips_dsp_rev} to 2.
16568 @item -msmartmips
16569 @itemx -mno-smartmips
16570 @opindex msmartmips
16571 @opindex mno-smartmips
16572 Use (do not use) the MIPS SmartMIPS ASE.
16574 @item -mpaired-single
16575 @itemx -mno-paired-single
16576 @opindex mpaired-single
16577 @opindex mno-paired-single
16578 Use (do not use) paired-single floating-point instructions.
16579 @xref{MIPS Paired-Single Support}.  This option requires
16580 hardware floating-point support to be enabled.
16582 @item -mdmx
16583 @itemx -mno-mdmx
16584 @opindex mdmx
16585 @opindex mno-mdmx
16586 Use (do not use) MIPS Digital Media Extension instructions.
16587 This option can only be used when generating 64-bit code and requires
16588 hardware floating-point support to be enabled.
16590 @item -mips3d
16591 @itemx -mno-mips3d
16592 @opindex mips3d
16593 @opindex mno-mips3d
16594 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
16595 The option @option{-mips3d} implies @option{-mpaired-single}.
16597 @item -mmicromips
16598 @itemx -mno-micromips
16599 @opindex mmicromips
16600 @opindex mno-mmicromips
16601 Generate (do not generate) microMIPS code.
16603 MicroMIPS code generation can also be controlled on a per-function basis
16604 by means of @code{micromips} and @code{nomicromips} attributes.
16605 @xref{Function Attributes}, for more information.
16607 @item -mmt
16608 @itemx -mno-mt
16609 @opindex mmt
16610 @opindex mno-mt
16611 Use (do not use) MT Multithreading instructions.
16613 @item -mmcu
16614 @itemx -mno-mcu
16615 @opindex mmcu
16616 @opindex mno-mcu
16617 Use (do not use) the MIPS MCU ASE instructions.
16619 @item -meva
16620 @itemx -mno-eva
16621 @opindex meva
16622 @opindex mno-eva
16623 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
16625 @item -mlong64
16626 @opindex mlong64
16627 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
16628 an explanation of the default and the way that the pointer size is
16629 determined.
16631 @item -mlong32
16632 @opindex mlong32
16633 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
16635 The default size of @code{int}s, @code{long}s and pointers depends on
16636 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
16637 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
16638 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
16639 or the same size as integer registers, whichever is smaller.
16641 @item -msym32
16642 @itemx -mno-sym32
16643 @opindex msym32
16644 @opindex mno-sym32
16645 Assume (do not assume) that all symbols have 32-bit values, regardless
16646 of the selected ABI@.  This option is useful in combination with
16647 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
16648 to generate shorter and faster references to symbolic addresses.
16650 @item -G @var{num}
16651 @opindex G
16652 Put definitions of externally-visible data in a small data section
16653 if that data is no bigger than @var{num} bytes.  GCC can then generate
16654 more efficient accesses to the data; see @option{-mgpopt} for details.
16656 The default @option{-G} option depends on the configuration.
16658 @item -mlocal-sdata
16659 @itemx -mno-local-sdata
16660 @opindex mlocal-sdata
16661 @opindex mno-local-sdata
16662 Extend (do not extend) the @option{-G} behavior to local data too,
16663 such as to static variables in C@.  @option{-mlocal-sdata} is the
16664 default for all configurations.
16666 If the linker complains that an application is using too much small data,
16667 you might want to try rebuilding the less performance-critical parts with
16668 @option{-mno-local-sdata}.  You might also want to build large
16669 libraries with @option{-mno-local-sdata}, so that the libraries leave
16670 more room for the main program.
16672 @item -mextern-sdata
16673 @itemx -mno-extern-sdata
16674 @opindex mextern-sdata
16675 @opindex mno-extern-sdata
16676 Assume (do not assume) that externally-defined data is in
16677 a small data section if the size of that data is within the @option{-G} limit.
16678 @option{-mextern-sdata} is the default for all configurations.
16680 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
16681 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
16682 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
16683 is placed in a small data section.  If @var{Var} is defined by another
16684 module, you must either compile that module with a high-enough
16685 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
16686 definition.  If @var{Var} is common, you must link the application
16687 with a high-enough @option{-G} setting.
16689 The easiest way of satisfying these restrictions is to compile
16690 and link every module with the same @option{-G} option.  However,
16691 you may wish to build a library that supports several different
16692 small data limits.  You can do this by compiling the library with
16693 the highest supported @option{-G} setting and additionally using
16694 @option{-mno-extern-sdata} to stop the library from making assumptions
16695 about externally-defined data.
16697 @item -mgpopt
16698 @itemx -mno-gpopt
16699 @opindex mgpopt
16700 @opindex mno-gpopt
16701 Use (do not use) GP-relative accesses for symbols that are known to be
16702 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
16703 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
16704 configurations.
16706 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
16707 might not hold the value of @code{_gp}.  For example, if the code is
16708 part of a library that might be used in a boot monitor, programs that
16709 call boot monitor routines pass an unknown value in @code{$gp}.
16710 (In such situations, the boot monitor itself is usually compiled
16711 with @option{-G0}.)
16713 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
16714 @option{-mno-extern-sdata}.
16716 @item -membedded-data
16717 @itemx -mno-embedded-data
16718 @opindex membedded-data
16719 @opindex mno-embedded-data
16720 Allocate variables to the read-only data section first if possible, then
16721 next in the small data section if possible, otherwise in data.  This gives
16722 slightly slower code than the default, but reduces the amount of RAM required
16723 when executing, and thus may be preferred for some embedded systems.
16725 @item -muninit-const-in-rodata
16726 @itemx -mno-uninit-const-in-rodata
16727 @opindex muninit-const-in-rodata
16728 @opindex mno-uninit-const-in-rodata
16729 Put uninitialized @code{const} variables in the read-only data section.
16730 This option is only meaningful in conjunction with @option{-membedded-data}.
16732 @item -mcode-readable=@var{setting}
16733 @opindex mcode-readable
16734 Specify whether GCC may generate code that reads from executable sections.
16735 There are three possible settings:
16737 @table @gcctabopt
16738 @item -mcode-readable=yes
16739 Instructions may freely access executable sections.  This is the
16740 default setting.
16742 @item -mcode-readable=pcrel
16743 MIPS16 PC-relative load instructions can access executable sections,
16744 but other instructions must not do so.  This option is useful on 4KSc
16745 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
16746 It is also useful on processors that can be configured to have a dual
16747 instruction/data SRAM interface and that, like the M4K, automatically
16748 redirect PC-relative loads to the instruction RAM.
16750 @item -mcode-readable=no
16751 Instructions must not access executable sections.  This option can be
16752 useful on targets that are configured to have a dual instruction/data
16753 SRAM interface but that (unlike the M4K) do not automatically redirect
16754 PC-relative loads to the instruction RAM.
16755 @end table
16757 @item -msplit-addresses
16758 @itemx -mno-split-addresses
16759 @opindex msplit-addresses
16760 @opindex mno-split-addresses
16761 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
16762 relocation operators.  This option has been superseded by
16763 @option{-mexplicit-relocs} but is retained for backwards compatibility.
16765 @item -mexplicit-relocs
16766 @itemx -mno-explicit-relocs
16767 @opindex mexplicit-relocs
16768 @opindex mno-explicit-relocs
16769 Use (do not use) assembler relocation operators when dealing with symbolic
16770 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
16771 is to use assembler macros instead.
16773 @option{-mexplicit-relocs} is the default if GCC was configured
16774 to use an assembler that supports relocation operators.
16776 @item -mcheck-zero-division
16777 @itemx -mno-check-zero-division
16778 @opindex mcheck-zero-division
16779 @opindex mno-check-zero-division
16780 Trap (do not trap) on integer division by zero.
16782 The default is @option{-mcheck-zero-division}.
16784 @item -mdivide-traps
16785 @itemx -mdivide-breaks
16786 @opindex mdivide-traps
16787 @opindex mdivide-breaks
16788 MIPS systems check for division by zero by generating either a
16789 conditional trap or a break instruction.  Using traps results in
16790 smaller code, but is only supported on MIPS II and later.  Also, some
16791 versions of the Linux kernel have a bug that prevents trap from
16792 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
16793 allow conditional traps on architectures that support them and
16794 @option{-mdivide-breaks} to force the use of breaks.
16796 The default is usually @option{-mdivide-traps}, but this can be
16797 overridden at configure time using @option{--with-divide=breaks}.
16798 Divide-by-zero checks can be completely disabled using
16799 @option{-mno-check-zero-division}.
16801 @item -mmemcpy
16802 @itemx -mno-memcpy
16803 @opindex mmemcpy
16804 @opindex mno-memcpy
16805 Force (do not force) the use of @code{memcpy()} for non-trivial block
16806 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
16807 most constant-sized copies.
16809 @item -mlong-calls
16810 @itemx -mno-long-calls
16811 @opindex mlong-calls
16812 @opindex mno-long-calls
16813 Disable (do not disable) use of the @code{jal} instruction.  Calling
16814 functions using @code{jal} is more efficient but requires the caller
16815 and callee to be in the same 256 megabyte segment.
16817 This option has no effect on abicalls code.  The default is
16818 @option{-mno-long-calls}.
16820 @item -mmad
16821 @itemx -mno-mad
16822 @opindex mmad
16823 @opindex mno-mad
16824 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
16825 instructions, as provided by the R4650 ISA@.
16827 @item -mimadd
16828 @itemx -mno-imadd
16829 @opindex mimadd
16830 @opindex mno-imadd
16831 Enable (disable) use of the @code{madd} and @code{msub} integer
16832 instructions.  The default is @option{-mimadd} on architectures
16833 that support @code{madd} and @code{msub} except for the 74k 
16834 architecture where it was found to generate slower code.
16836 @item -mfused-madd
16837 @itemx -mno-fused-madd
16838 @opindex mfused-madd
16839 @opindex mno-fused-madd
16840 Enable (disable) use of the floating-point multiply-accumulate
16841 instructions, when they are available.  The default is
16842 @option{-mfused-madd}.
16844 On the R8000 CPU when multiply-accumulate instructions are used,
16845 the intermediate product is calculated to infinite precision
16846 and is not subject to the FCSR Flush to Zero bit.  This may be
16847 undesirable in some circumstances.  On other processors the result
16848 is numerically identical to the equivalent computation using
16849 separate multiply, add, subtract and negate instructions.
16851 @item -nocpp
16852 @opindex nocpp
16853 Tell the MIPS assembler to not run its preprocessor over user
16854 assembler files (with a @samp{.s} suffix) when assembling them.
16856 @item -mfix-24k
16857 @item -mno-fix-24k
16858 @opindex mfix-24k
16859 @opindex mno-fix-24k
16860 Work around the 24K E48 (lost data on stores during refill) errata.
16861 The workarounds are implemented by the assembler rather than by GCC@.
16863 @item -mfix-r4000
16864 @itemx -mno-fix-r4000
16865 @opindex mfix-r4000
16866 @opindex mno-fix-r4000
16867 Work around certain R4000 CPU errata:
16868 @itemize @minus
16869 @item
16870 A double-word or a variable shift may give an incorrect result if executed
16871 immediately after starting an integer division.
16872 @item
16873 A double-word or a variable shift may give an incorrect result if executed
16874 while an integer multiplication is in progress.
16875 @item
16876 An integer division may give an incorrect result if started in a delay slot
16877 of a taken branch or a jump.
16878 @end itemize
16880 @item -mfix-r4400
16881 @itemx -mno-fix-r4400
16882 @opindex mfix-r4400
16883 @opindex mno-fix-r4400
16884 Work around certain R4400 CPU errata:
16885 @itemize @minus
16886 @item
16887 A double-word or a variable shift may give an incorrect result if executed
16888 immediately after starting an integer division.
16889 @end itemize
16891 @item -mfix-r10000
16892 @itemx -mno-fix-r10000
16893 @opindex mfix-r10000
16894 @opindex mno-fix-r10000
16895 Work around certain R10000 errata:
16896 @itemize @minus
16897 @item
16898 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16899 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16900 @end itemize
16902 This option can only be used if the target architecture supports
16903 branch-likely instructions.  @option{-mfix-r10000} is the default when
16904 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16905 otherwise.
16907 @item -mfix-vr4120
16908 @itemx -mno-fix-vr4120
16909 @opindex mfix-vr4120
16910 Work around certain VR4120 errata:
16911 @itemize @minus
16912 @item
16913 @code{dmultu} does not always produce the correct result.
16914 @item
16915 @code{div} and @code{ddiv} do not always produce the correct result if one
16916 of the operands is negative.
16917 @end itemize
16918 The workarounds for the division errata rely on special functions in
16919 @file{libgcc.a}.  At present, these functions are only provided by
16920 the @code{mips64vr*-elf} configurations.
16922 Other VR4120 errata require a NOP to be inserted between certain pairs of
16923 instructions.  These errata are handled by the assembler, not by GCC itself.
16925 @item -mfix-vr4130
16926 @opindex mfix-vr4130
16927 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16928 workarounds are implemented by the assembler rather than by GCC,
16929 although GCC avoids using @code{mflo} and @code{mfhi} if the
16930 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16931 instructions are available instead.
16933 @item -mfix-sb1
16934 @itemx -mno-fix-sb1
16935 @opindex mfix-sb1
16936 Work around certain SB-1 CPU core errata.
16937 (This flag currently works around the SB-1 revision 2
16938 ``F1'' and ``F2'' floating-point errata.)
16940 @item -mr10k-cache-barrier=@var{setting}
16941 @opindex mr10k-cache-barrier
16942 Specify whether GCC should insert cache barriers to avoid the
16943 side-effects of speculation on R10K processors.
16945 In common with many processors, the R10K tries to predict the outcome
16946 of a conditional branch and speculatively executes instructions from
16947 the ``taken'' branch.  It later aborts these instructions if the
16948 predicted outcome is wrong.  However, on the R10K, even aborted
16949 instructions can have side effects.
16951 This problem only affects kernel stores and, depending on the system,
16952 kernel loads.  As an example, a speculatively-executed store may load
16953 the target memory into cache and mark the cache line as dirty, even if
16954 the store itself is later aborted.  If a DMA operation writes to the
16955 same area of memory before the ``dirty'' line is flushed, the cached
16956 data overwrites the DMA-ed data.  See the R10K processor manual
16957 for a full description, including other potential problems.
16959 One workaround is to insert cache barrier instructions before every memory
16960 access that might be speculatively executed and that might have side
16961 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16962 controls GCC's implementation of this workaround.  It assumes that
16963 aborted accesses to any byte in the following regions does not have
16964 side effects:
16966 @enumerate
16967 @item
16968 the memory occupied by the current function's stack frame;
16970 @item
16971 the memory occupied by an incoming stack argument;
16973 @item
16974 the memory occupied by an object with a link-time-constant address.
16975 @end enumerate
16977 It is the kernel's responsibility to ensure that speculative
16978 accesses to these regions are indeed safe.
16980 If the input program contains a function declaration such as:
16982 @smallexample
16983 void foo (void);
16984 @end smallexample
16986 then the implementation of @code{foo} must allow @code{j foo} and
16987 @code{jal foo} to be executed speculatively.  GCC honors this
16988 restriction for functions it compiles itself.  It expects non-GCC
16989 functions (such as hand-written assembly code) to do the same.
16991 The option has three forms:
16993 @table @gcctabopt
16994 @item -mr10k-cache-barrier=load-store
16995 Insert a cache barrier before a load or store that might be
16996 speculatively executed and that might have side effects even
16997 if aborted.
16999 @item -mr10k-cache-barrier=store
17000 Insert a cache barrier before a store that might be speculatively
17001 executed and that might have side effects even if aborted.
17003 @item -mr10k-cache-barrier=none
17004 Disable the insertion of cache barriers.  This is the default setting.
17005 @end table
17007 @item -mflush-func=@var{func}
17008 @itemx -mno-flush-func
17009 @opindex mflush-func
17010 Specifies the function to call to flush the I and D caches, or to not
17011 call any such function.  If called, the function must take the same
17012 arguments as the common @code{_flush_func()}, that is, the address of the
17013 memory range for which the cache is being flushed, the size of the
17014 memory range, and the number 3 (to flush both caches).  The default
17015 depends on the target GCC was configured for, but commonly is either
17016 @samp{_flush_func} or @samp{__cpu_flush}.
17018 @item mbranch-cost=@var{num}
17019 @opindex mbranch-cost
17020 Set the cost of branches to roughly @var{num} ``simple'' instructions.
17021 This cost is only a heuristic and is not guaranteed to produce
17022 consistent results across releases.  A zero cost redundantly selects
17023 the default, which is based on the @option{-mtune} setting.
17025 @item -mbranch-likely
17026 @itemx -mno-branch-likely
17027 @opindex mbranch-likely
17028 @opindex mno-branch-likely
17029 Enable or disable use of Branch Likely instructions, regardless of the
17030 default for the selected architecture.  By default, Branch Likely
17031 instructions may be generated if they are supported by the selected
17032 architecture.  An exception is for the MIPS32 and MIPS64 architectures
17033 and processors that implement those architectures; for those, Branch
17034 Likely instructions are not be generated by default because the MIPS32
17035 and MIPS64 architectures specifically deprecate their use.
17037 @item -mfp-exceptions
17038 @itemx -mno-fp-exceptions
17039 @opindex mfp-exceptions
17040 Specifies whether FP exceptions are enabled.  This affects how
17041 FP instructions are scheduled for some processors.
17042 The default is that FP exceptions are
17043 enabled.
17045 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
17046 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
17047 FP pipe.
17049 @item -mvr4130-align
17050 @itemx -mno-vr4130-align
17051 @opindex mvr4130-align
17052 The VR4130 pipeline is two-way superscalar, but can only issue two
17053 instructions together if the first one is 8-byte aligned.  When this
17054 option is enabled, GCC aligns pairs of instructions that it
17055 thinks should execute in parallel.
17057 This option only has an effect when optimizing for the VR4130.
17058 It normally makes code faster, but at the expense of making it bigger.
17059 It is enabled by default at optimization level @option{-O3}.
17061 @item -msynci
17062 @itemx -mno-synci
17063 @opindex msynci
17064 Enable (disable) generation of @code{synci} instructions on
17065 architectures that support it.  The @code{synci} instructions (if
17066 enabled) are generated when @code{__builtin___clear_cache()} is
17067 compiled.
17069 This option defaults to @code{-mno-synci}, but the default can be
17070 overridden by configuring with @code{--with-synci}.
17072 When compiling code for single processor systems, it is generally safe
17073 to use @code{synci}.  However, on many multi-core (SMP) systems, it
17074 does not invalidate the instruction caches on all cores and may lead
17075 to undefined behavior.
17077 @item -mrelax-pic-calls
17078 @itemx -mno-relax-pic-calls
17079 @opindex mrelax-pic-calls
17080 Try to turn PIC calls that are normally dispatched via register
17081 @code{$25} into direct calls.  This is only possible if the linker can
17082 resolve the destination at link-time and if the destination is within
17083 range for a direct call.
17085 @option{-mrelax-pic-calls} is the default if GCC was configured to use
17086 an assembler and a linker that support the @code{.reloc} assembly
17087 directive and @code{-mexplicit-relocs} is in effect.  With
17088 @code{-mno-explicit-relocs}, this optimization can be performed by the
17089 assembler and the linker alone without help from the compiler.
17091 @item -mmcount-ra-address
17092 @itemx -mno-mcount-ra-address
17093 @opindex mmcount-ra-address
17094 @opindex mno-mcount-ra-address
17095 Emit (do not emit) code that allows @code{_mcount} to modify the
17096 calling function's return address.  When enabled, this option extends
17097 the usual @code{_mcount} interface with a new @var{ra-address}
17098 parameter, which has type @code{intptr_t *} and is passed in register
17099 @code{$12}.  @code{_mcount} can then modify the return address by
17100 doing both of the following:
17101 @itemize
17102 @item
17103 Returning the new address in register @code{$31}.
17104 @item
17105 Storing the new address in @code{*@var{ra-address}},
17106 if @var{ra-address} is nonnull.
17107 @end itemize
17109 The default is @option{-mno-mcount-ra-address}.
17111 @end table
17113 @node MMIX Options
17114 @subsection MMIX Options
17115 @cindex MMIX Options
17117 These options are defined for the MMIX:
17119 @table @gcctabopt
17120 @item -mlibfuncs
17121 @itemx -mno-libfuncs
17122 @opindex mlibfuncs
17123 @opindex mno-libfuncs
17124 Specify that intrinsic library functions are being compiled, passing all
17125 values in registers, no matter the size.
17127 @item -mepsilon
17128 @itemx -mno-epsilon
17129 @opindex mepsilon
17130 @opindex mno-epsilon
17131 Generate floating-point comparison instructions that compare with respect
17132 to the @code{rE} epsilon register.
17134 @item -mabi=mmixware
17135 @itemx -mabi=gnu
17136 @opindex mabi=mmixware
17137 @opindex mabi=gnu
17138 Generate code that passes function parameters and return values that (in
17139 the called function) are seen as registers @code{$0} and up, as opposed to
17140 the GNU ABI which uses global registers @code{$231} and up.
17142 @item -mzero-extend
17143 @itemx -mno-zero-extend
17144 @opindex mzero-extend
17145 @opindex mno-zero-extend
17146 When reading data from memory in sizes shorter than 64 bits, use (do not
17147 use) zero-extending load instructions by default, rather than
17148 sign-extending ones.
17150 @item -mknuthdiv
17151 @itemx -mno-knuthdiv
17152 @opindex mknuthdiv
17153 @opindex mno-knuthdiv
17154 Make the result of a division yielding a remainder have the same sign as
17155 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
17156 remainder follows the sign of the dividend.  Both methods are
17157 arithmetically valid, the latter being almost exclusively used.
17159 @item -mtoplevel-symbols
17160 @itemx -mno-toplevel-symbols
17161 @opindex mtoplevel-symbols
17162 @opindex mno-toplevel-symbols
17163 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
17164 code can be used with the @code{PREFIX} assembly directive.
17166 @item -melf
17167 @opindex melf
17168 Generate an executable in the ELF format, rather than the default
17169 @samp{mmo} format used by the @command{mmix} simulator.
17171 @item -mbranch-predict
17172 @itemx -mno-branch-predict
17173 @opindex mbranch-predict
17174 @opindex mno-branch-predict
17175 Use (do not use) the probable-branch instructions, when static branch
17176 prediction indicates a probable branch.
17178 @item -mbase-addresses
17179 @itemx -mno-base-addresses
17180 @opindex mbase-addresses
17181 @opindex mno-base-addresses
17182 Generate (do not generate) code that uses @emph{base addresses}.  Using a
17183 base address automatically generates a request (handled by the assembler
17184 and the linker) for a constant to be set up in a global register.  The
17185 register is used for one or more base address requests within the range 0
17186 to 255 from the value held in the register.  The generally leads to short
17187 and fast code, but the number of different data items that can be
17188 addressed is limited.  This means that a program that uses lots of static
17189 data may require @option{-mno-base-addresses}.
17191 @item -msingle-exit
17192 @itemx -mno-single-exit
17193 @opindex msingle-exit
17194 @opindex mno-single-exit
17195 Force (do not force) generated code to have a single exit point in each
17196 function.
17197 @end table
17199 @node MN10300 Options
17200 @subsection MN10300 Options
17201 @cindex MN10300 options
17203 These @option{-m} options are defined for Matsushita MN10300 architectures:
17205 @table @gcctabopt
17206 @item -mmult-bug
17207 @opindex mmult-bug
17208 Generate code to avoid bugs in the multiply instructions for the MN10300
17209 processors.  This is the default.
17211 @item -mno-mult-bug
17212 @opindex mno-mult-bug
17213 Do not generate code to avoid bugs in the multiply instructions for the
17214 MN10300 processors.
17216 @item -mam33
17217 @opindex mam33
17218 Generate code using features specific to the AM33 processor.
17220 @item -mno-am33
17221 @opindex mno-am33
17222 Do not generate code using features specific to the AM33 processor.  This
17223 is the default.
17225 @item -mam33-2
17226 @opindex mam33-2
17227 Generate code using features specific to the AM33/2.0 processor.
17229 @item -mam34
17230 @opindex mam34
17231 Generate code using features specific to the AM34 processor.
17233 @item -mtune=@var{cpu-type}
17234 @opindex mtune
17235 Use the timing characteristics of the indicated CPU type when
17236 scheduling instructions.  This does not change the targeted processor
17237 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
17238 @samp{am33-2} or @samp{am34}.
17240 @item -mreturn-pointer-on-d0
17241 @opindex mreturn-pointer-on-d0
17242 When generating a function that returns a pointer, return the pointer
17243 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
17244 only in @code{a0}, and attempts to call such functions without a prototype
17245 result in errors.  Note that this option is on by default; use
17246 @option{-mno-return-pointer-on-d0} to disable it.
17248 @item -mno-crt0
17249 @opindex mno-crt0
17250 Do not link in the C run-time initialization object file.
17252 @item -mrelax
17253 @opindex mrelax
17254 Indicate to the linker that it should perform a relaxation optimization pass
17255 to shorten branches, calls and absolute memory addresses.  This option only
17256 has an effect when used on the command line for the final link step.
17258 This option makes symbolic debugging impossible.
17260 @item -mliw
17261 @opindex mliw
17262 Allow the compiler to generate @emph{Long Instruction Word}
17263 instructions if the target is the @samp{AM33} or later.  This is the
17264 default.  This option defines the preprocessor macro @samp{__LIW__}.
17266 @item -mnoliw
17267 @opindex mnoliw
17268 Do not allow the compiler to generate @emph{Long Instruction Word}
17269 instructions.  This option defines the preprocessor macro
17270 @samp{__NO_LIW__}.
17272 @item -msetlb
17273 @opindex msetlb
17274 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
17275 instructions if the target is the @samp{AM33} or later.  This is the
17276 default.  This option defines the preprocessor macro @samp{__SETLB__}.
17278 @item -mnosetlb
17279 @opindex mnosetlb
17280 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
17281 instructions.  This option defines the preprocessor macro
17282 @samp{__NO_SETLB__}.
17284 @end table
17286 @node Moxie Options
17287 @subsection Moxie Options
17288 @cindex Moxie Options
17290 @table @gcctabopt
17292 @item -meb
17293 @opindex meb
17294 Generate big-endian code.  This is the default for @samp{moxie-*-*}
17295 configurations.
17297 @item -mel
17298 @opindex mel
17299 Generate little-endian code.
17301 @item -mno-crt0
17302 @opindex mno-crt0
17303 Do not link in the C run-time initialization object file.
17305 @end table
17307 @node MSP430 Options
17308 @subsection MSP430 Options
17309 @cindex MSP430 Options
17311 These options are defined for the MSP430:
17313 @table @gcctabopt
17315 @item -msim
17316 @opindex msim
17317 Link the simulator runtime libraries.
17319 @item -masm-hex
17320 @opindex masm-hex
17321 Force assembly output to always use hex constants.  Normally such
17322 constants are signed decimals, but this option is available for
17323 testsuite and/or aesthetic purposes.
17325 @item -mmcu=
17326 @opindex mmcu=
17327 Select the MCU to target.  Note that there are two ``generic'' MCUs,
17328 @code{msp430} and @code{msp430x}, which should be used most of the
17329 time.  This option is also passed to the assembler.
17331 @item -mlarge
17332 @opindex mlarge
17333 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
17335 @item -msmall
17336 @opindex msmall
17337 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
17339 @item -mrelax
17340 @opindex mrelax
17341 This option is passed to the assembler and linker, and allows the
17342 linker to perform certain optimizations that cannot be done until
17343 the final link.
17345 @end table
17347 @node PDP-11 Options
17348 @subsection PDP-11 Options
17349 @cindex PDP-11 Options
17351 These options are defined for the PDP-11:
17353 @table @gcctabopt
17354 @item -mfpu
17355 @opindex mfpu
17356 Use hardware FPP floating point.  This is the default.  (FIS floating
17357 point on the PDP-11/40 is not supported.)
17359 @item -msoft-float
17360 @opindex msoft-float
17361 Do not use hardware floating point.
17363 @item -mac0
17364 @opindex mac0
17365 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
17367 @item -mno-ac0
17368 @opindex mno-ac0
17369 Return floating-point results in memory.  This is the default.
17371 @item -m40
17372 @opindex m40
17373 Generate code for a PDP-11/40.
17375 @item -m45
17376 @opindex m45
17377 Generate code for a PDP-11/45.  This is the default.
17379 @item -m10
17380 @opindex m10
17381 Generate code for a PDP-11/10.
17383 @item -mbcopy-builtin
17384 @opindex mbcopy-builtin
17385 Use inline @code{movmemhi} patterns for copying memory.  This is the
17386 default.
17388 @item -mbcopy
17389 @opindex mbcopy
17390 Do not use inline @code{movmemhi} patterns for copying memory.
17392 @item -mint16
17393 @itemx -mno-int32
17394 @opindex mint16
17395 @opindex mno-int32
17396 Use 16-bit @code{int}.  This is the default.
17398 @item -mint32
17399 @itemx -mno-int16
17400 @opindex mint32
17401 @opindex mno-int16
17402 Use 32-bit @code{int}.
17404 @item -mfloat64
17405 @itemx -mno-float32
17406 @opindex mfloat64
17407 @opindex mno-float32
17408 Use 64-bit @code{float}.  This is the default.
17410 @item -mfloat32
17411 @itemx -mno-float64
17412 @opindex mfloat32
17413 @opindex mno-float64
17414 Use 32-bit @code{float}.
17416 @item -mabshi
17417 @opindex mabshi
17418 Use @code{abshi2} pattern.  This is the default.
17420 @item -mno-abshi
17421 @opindex mno-abshi
17422 Do not use @code{abshi2} pattern.
17424 @item -mbranch-expensive
17425 @opindex mbranch-expensive
17426 Pretend that branches are expensive.  This is for experimenting with
17427 code generation only.
17429 @item -mbranch-cheap
17430 @opindex mbranch-cheap
17431 Do not pretend that branches are expensive.  This is the default.
17433 @item -munix-asm
17434 @opindex munix-asm
17435 Use Unix assembler syntax.  This is the default when configured for
17436 @samp{pdp11-*-bsd}.
17438 @item -mdec-asm
17439 @opindex mdec-asm
17440 Use DEC assembler syntax.  This is the default when configured for any
17441 PDP-11 target other than @samp{pdp11-*-bsd}.
17442 @end table
17444 @node picoChip Options
17445 @subsection picoChip Options
17446 @cindex picoChip options
17448 These @samp{-m} options are defined for picoChip implementations:
17450 @table @gcctabopt
17452 @item -mae=@var{ae_type}
17453 @opindex mcpu
17454 Set the instruction set, register set, and instruction scheduling
17455 parameters for array element type @var{ae_type}.  Supported values
17456 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
17458 @option{-mae=ANY} selects a completely generic AE type.  Code
17459 generated with this option runs on any of the other AE types.  The
17460 code is not as efficient as it would be if compiled for a specific
17461 AE type, and some types of operation (e.g., multiplication) do not
17462 work properly on all types of AE.
17464 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
17465 for compiled code, and is the default.
17467 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
17468 option may suffer from poor performance of byte (char) manipulation,
17469 since the DSP AE does not provide hardware support for byte load/stores.
17471 @item -msymbol-as-address
17472 Enable the compiler to directly use a symbol name as an address in a
17473 load/store instruction, without first loading it into a
17474 register.  Typically, the use of this option generates larger
17475 programs, which run faster than when the option isn't used.  However, the
17476 results vary from program to program, so it is left as a user option,
17477 rather than being permanently enabled.
17479 @item -mno-inefficient-warnings
17480 Disables warnings about the generation of inefficient code.  These
17481 warnings can be generated, for example, when compiling code that
17482 performs byte-level memory operations on the MAC AE type.  The MAC AE has
17483 no hardware support for byte-level memory operations, so all byte
17484 load/stores must be synthesized from word load/store operations.  This is
17485 inefficient and a warning is generated to indicate
17486 that you should rewrite the code to avoid byte operations, or to target
17487 an AE type that has the necessary hardware support.  This option disables
17488 these warnings.
17490 @end table
17492 @node PowerPC Options
17493 @subsection PowerPC Options
17494 @cindex PowerPC options
17496 These are listed under @xref{RS/6000 and PowerPC Options}.
17498 @node RL78 Options
17499 @subsection RL78 Options
17500 @cindex RL78 Options
17502 @table @gcctabopt
17504 @item -msim
17505 @opindex msim
17506 Links in additional target libraries to support operation within a
17507 simulator.
17509 @item -mmul=none
17510 @itemx -mmul=g13
17511 @itemx -mmul=rl78
17512 @opindex mmul
17513 Specifies the type of hardware multiplication support to be used.  The
17514 default is @code{none}, which uses software multiplication functions.
17515 The @code{g13} option is for the hardware multiply/divide peripheral
17516 only on the RL78/G13 targets.  The @code{rl78} option is for the
17517 standard hardware multiplication defined in the RL78 software manual.
17519 @end table
17521 @node RS/6000 and PowerPC Options
17522 @subsection IBM RS/6000 and PowerPC Options
17523 @cindex RS/6000 and PowerPC Options
17524 @cindex IBM RS/6000 and PowerPC Options
17526 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
17527 @table @gcctabopt
17528 @item -mpowerpc-gpopt
17529 @itemx -mno-powerpc-gpopt
17530 @itemx -mpowerpc-gfxopt
17531 @itemx -mno-powerpc-gfxopt
17532 @need 800
17533 @itemx -mpowerpc64
17534 @itemx -mno-powerpc64
17535 @itemx -mmfcrf
17536 @itemx -mno-mfcrf
17537 @itemx -mpopcntb
17538 @itemx -mno-popcntb
17539 @itemx -mpopcntd
17540 @itemx -mno-popcntd
17541 @itemx -mfprnd
17542 @itemx -mno-fprnd
17543 @need 800
17544 @itemx -mcmpb
17545 @itemx -mno-cmpb
17546 @itemx -mmfpgpr
17547 @itemx -mno-mfpgpr
17548 @itemx -mhard-dfp
17549 @itemx -mno-hard-dfp
17550 @opindex mpowerpc-gpopt
17551 @opindex mno-powerpc-gpopt
17552 @opindex mpowerpc-gfxopt
17553 @opindex mno-powerpc-gfxopt
17554 @opindex mpowerpc64
17555 @opindex mno-powerpc64
17556 @opindex mmfcrf
17557 @opindex mno-mfcrf
17558 @opindex mpopcntb
17559 @opindex mno-popcntb
17560 @opindex mpopcntd
17561 @opindex mno-popcntd
17562 @opindex mfprnd
17563 @opindex mno-fprnd
17564 @opindex mcmpb
17565 @opindex mno-cmpb
17566 @opindex mmfpgpr
17567 @opindex mno-mfpgpr
17568 @opindex mhard-dfp
17569 @opindex mno-hard-dfp
17570 You use these options to specify which instructions are available on the
17571 processor you are using.  The default value of these options is
17572 determined when configuring GCC@.  Specifying the
17573 @option{-mcpu=@var{cpu_type}} overrides the specification of these
17574 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
17575 rather than the options listed above.
17577 Specifying @option{-mpowerpc-gpopt} allows
17578 GCC to use the optional PowerPC architecture instructions in the
17579 General Purpose group, including floating-point square root.  Specifying
17580 @option{-mpowerpc-gfxopt} allows GCC to
17581 use the optional PowerPC architecture instructions in the Graphics
17582 group, including floating-point select.
17584 The @option{-mmfcrf} option allows GCC to generate the move from
17585 condition register field instruction implemented on the POWER4
17586 processor and other processors that support the PowerPC V2.01
17587 architecture.
17588 The @option{-mpopcntb} option allows GCC to generate the popcount and
17589 double-precision FP reciprocal estimate instruction implemented on the
17590 POWER5 processor and other processors that support the PowerPC V2.02
17591 architecture.
17592 The @option{-mpopcntd} option allows GCC to generate the popcount
17593 instruction implemented on the POWER7 processor and other processors
17594 that support the PowerPC V2.06 architecture.
17595 The @option{-mfprnd} option allows GCC to generate the FP round to
17596 integer instructions implemented on the POWER5+ processor and other
17597 processors that support the PowerPC V2.03 architecture.
17598 The @option{-mcmpb} option allows GCC to generate the compare bytes
17599 instruction implemented on the POWER6 processor and other processors
17600 that support the PowerPC V2.05 architecture.
17601 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
17602 general-purpose register instructions implemented on the POWER6X
17603 processor and other processors that support the extended PowerPC V2.05
17604 architecture.
17605 The @option{-mhard-dfp} option allows GCC to generate the decimal
17606 floating-point instructions implemented on some POWER processors.
17608 The @option{-mpowerpc64} option allows GCC to generate the additional
17609 64-bit instructions that are found in the full PowerPC64 architecture
17610 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
17611 @option{-mno-powerpc64}.
17613 @item -mcpu=@var{cpu_type}
17614 @opindex mcpu
17615 Set architecture type, register usage, and
17616 instruction scheduling parameters for machine type @var{cpu_type}.
17617 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
17618 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
17619 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
17620 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
17621 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
17622 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
17623 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
17624 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
17625 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
17626 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
17627 @samp{powerpc64}, and @samp{rs64}.
17629 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
17630 PowerPC and 64-bit PowerPC architecture machine
17631 types, with an appropriate, generic processor model assumed for
17632 scheduling purposes.
17634 The other options specify a specific processor.  Code generated under
17635 those options runs best on that processor, and may not run at all on
17636 others.
17638 The @option{-mcpu} options automatically enable or disable the
17639 following options:
17641 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
17642 -mpopcntb -mpopcntd  -mpowerpc64 @gol
17643 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
17644 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
17645 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector -mquad-memory}
17647 The particular options set for any particular CPU varies between
17648 compiler versions, depending on what setting seems to produce optimal
17649 code for that CPU; it doesn't necessarily reflect the actual hardware's
17650 capabilities.  If you wish to set an individual option to a particular
17651 value, you may specify it after the @option{-mcpu} option, like
17652 @option{-mcpu=970 -mno-altivec}.
17654 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
17655 not enabled or disabled by the @option{-mcpu} option at present because
17656 AIX does not have full support for these options.  You may still
17657 enable or disable them individually if you're sure it'll work in your
17658 environment.
17660 @item -mtune=@var{cpu_type}
17661 @opindex mtune
17662 Set the instruction scheduling parameters for machine type
17663 @var{cpu_type}, but do not set the architecture type or register usage,
17664 as @option{-mcpu=@var{cpu_type}} does.  The same
17665 values for @var{cpu_type} are used for @option{-mtune} as for
17666 @option{-mcpu}.  If both are specified, the code generated uses the
17667 architecture and registers set by @option{-mcpu}, but the
17668 scheduling parameters set by @option{-mtune}.
17670 @item -mcmodel=small
17671 @opindex mcmodel=small
17672 Generate PowerPC64 code for the small model: The TOC is limited to
17673 64k.
17675 @item -mcmodel=medium
17676 @opindex mcmodel=medium
17677 Generate PowerPC64 code for the medium model: The TOC and other static
17678 data may be up to a total of 4G in size.
17680 @item -mcmodel=large
17681 @opindex mcmodel=large
17682 Generate PowerPC64 code for the large model: The TOC may be up to 4G
17683 in size.  Other data and code is only limited by the 64-bit address
17684 space.
17686 @item -maltivec
17687 @itemx -mno-altivec
17688 @opindex maltivec
17689 @opindex mno-altivec
17690 Generate code that uses (does not use) AltiVec instructions, and also
17691 enable the use of built-in functions that allow more direct access to
17692 the AltiVec instruction set.  You may also need to set
17693 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
17694 enhancements.
17696 @item -mvrsave
17697 @itemx -mno-vrsave
17698 @opindex mvrsave
17699 @opindex mno-vrsave
17700 Generate VRSAVE instructions when generating AltiVec code.
17702 @item -mgen-cell-microcode
17703 @opindex mgen-cell-microcode
17704 Generate Cell microcode instructions.
17706 @item -mwarn-cell-microcode
17707 @opindex mwarn-cell-microcode
17708 Warn when a Cell microcode instruction is emitted.  An example
17709 of a Cell microcode instruction is a variable shift.
17711 @item -msecure-plt
17712 @opindex msecure-plt
17713 Generate code that allows @command{ld} and @command{ld.so}
17714 to build executables and shared
17715 libraries with non-executable @code{.plt} and @code{.got} sections.
17716 This is a PowerPC
17717 32-bit SYSV ABI option.
17719 @item -mbss-plt
17720 @opindex mbss-plt
17721 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
17722 fills in, and
17723 requires @code{.plt} and @code{.got}
17724 sections that are both writable and executable.
17725 This is a PowerPC 32-bit SYSV ABI option.
17727 @item -misel
17728 @itemx -mno-isel
17729 @opindex misel
17730 @opindex mno-isel
17731 This switch enables or disables the generation of ISEL instructions.
17733 @item -misel=@var{yes/no}
17734 This switch has been deprecated.  Use @option{-misel} and
17735 @option{-mno-isel} instead.
17737 @item -mspe
17738 @itemx -mno-spe
17739 @opindex mspe
17740 @opindex mno-spe
17741 This switch enables or disables the generation of SPE simd
17742 instructions.
17744 @item -mpaired
17745 @itemx -mno-paired
17746 @opindex mpaired
17747 @opindex mno-paired
17748 This switch enables or disables the generation of PAIRED simd
17749 instructions.
17751 @item -mspe=@var{yes/no}
17752 This option has been deprecated.  Use @option{-mspe} and
17753 @option{-mno-spe} instead.
17755 @item -mvsx
17756 @itemx -mno-vsx
17757 @opindex mvsx
17758 @opindex mno-vsx
17759 Generate code that uses (does not use) vector/scalar (VSX)
17760 instructions, and also enable the use of built-in functions that allow
17761 more direct access to the VSX instruction set.
17763 @item -mcrypto
17764 @itemx -mno-crypto
17765 @opindex mcrypto
17766 @opindex mno-crypto
17767 Enable the use (disable) of the built-in functions that allow direct
17768 access to the cryptographic instructions that were added in version
17769 2.07 of the PowerPC ISA.
17771 @item -mdirect-move
17772 @itemx -mno-direct-move
17773 @opindex mdirect-move
17774 @opindex mno-direct-move
17775 Generate code that uses (does not use) the instructions to move data
17776 between the general purpose registers and the vector/scalar (VSX)
17777 registers that were added in version 2.07 of the PowerPC ISA.
17779 @item -mpower8-fusion
17780 @itemx -mno-power8-fusion
17781 @opindex mpower8-fusion
17782 @opindex mno-power8-fusion
17783 Generate code that keeps (does not keeps) some integer operations
17784 adjacent so that the instructions can be fused together on power8 and
17785 later processors.
17787 @item -mpower8-vector
17788 @itemx -mno-power8-vector
17789 @opindex mpower8-vector
17790 @opindex mno-power8-vector
17791 Generate code that uses (does not use) the vector and scalar
17792 instructions that were added in version 2.07 of the PowerPC ISA.  Also
17793 enable the use of built-in functions that allow more direct access to
17794 the vector instructions.
17796 @item -mquad-memory
17797 @itemx -mno-quad-memory
17798 @opindex mquad-memory
17799 @opindex mno-quad-memory
17800 Generate code that uses (does not use) the quad word memory
17801 instructions.  The @option{-mquad-memory} option requires use of
17802 64-bit mode.
17804 @item -mfloat-gprs=@var{yes/single/double/no}
17805 @itemx -mfloat-gprs
17806 @opindex mfloat-gprs
17807 This switch enables or disables the generation of floating-point
17808 operations on the general-purpose registers for architectures that
17809 support it.
17811 The argument @var{yes} or @var{single} enables the use of
17812 single-precision floating-point operations.
17814 The argument @var{double} enables the use of single and
17815 double-precision floating-point operations.
17817 The argument @var{no} disables floating-point operations on the
17818 general-purpose registers.
17820 This option is currently only available on the MPC854x.
17822 @item -m32
17823 @itemx -m64
17824 @opindex m32
17825 @opindex m64
17826 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
17827 targets (including GNU/Linux).  The 32-bit environment sets int, long
17828 and pointer to 32 bits and generates code that runs on any PowerPC
17829 variant.  The 64-bit environment sets int to 32 bits and long and
17830 pointer to 64 bits, and generates code for PowerPC64, as for
17831 @option{-mpowerpc64}.
17833 @item -mfull-toc
17834 @itemx -mno-fp-in-toc
17835 @itemx -mno-sum-in-toc
17836 @itemx -mminimal-toc
17837 @opindex mfull-toc
17838 @opindex mno-fp-in-toc
17839 @opindex mno-sum-in-toc
17840 @opindex mminimal-toc
17841 Modify generation of the TOC (Table Of Contents), which is created for
17842 every executable file.  The @option{-mfull-toc} option is selected by
17843 default.  In that case, GCC allocates at least one TOC entry for
17844 each unique non-automatic variable reference in your program.  GCC
17845 also places floating-point constants in the TOC@.  However, only
17846 16,384 entries are available in the TOC@.
17848 If you receive a linker error message that saying you have overflowed
17849 the available TOC space, you can reduce the amount of TOC space used
17850 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
17851 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
17852 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
17853 generate code to calculate the sum of an address and a constant at
17854 run time instead of putting that sum into the TOC@.  You may specify one
17855 or both of these options.  Each causes GCC to produce very slightly
17856 slower and larger code at the expense of conserving TOC space.
17858 If you still run out of space in the TOC even when you specify both of
17859 these options, specify @option{-mminimal-toc} instead.  This option causes
17860 GCC to make only one TOC entry for every file.  When you specify this
17861 option, GCC produces code that is slower and larger but which
17862 uses extremely little TOC space.  You may wish to use this option
17863 only on files that contain less frequently-executed code.
17865 @item -maix64
17866 @itemx -maix32
17867 @opindex maix64
17868 @opindex maix32
17869 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
17870 @code{long} type, and the infrastructure needed to support them.
17871 Specifying @option{-maix64} implies @option{-mpowerpc64},
17872 while @option{-maix32} disables the 64-bit ABI and
17873 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
17875 @item -mxl-compat
17876 @itemx -mno-xl-compat
17877 @opindex mxl-compat
17878 @opindex mno-xl-compat
17879 Produce code that conforms more closely to IBM XL compiler semantics
17880 when using AIX-compatible ABI@.  Pass floating-point arguments to
17881 prototyped functions beyond the register save area (RSA) on the stack
17882 in addition to argument FPRs.  Do not assume that most significant
17883 double in 128-bit long double value is properly rounded when comparing
17884 values and converting to double.  Use XL symbol names for long double
17885 support routines.
17887 The AIX calling convention was extended but not initially documented to
17888 handle an obscure K&R C case of calling a function that takes the
17889 address of its arguments with fewer arguments than declared.  IBM XL
17890 compilers access floating-point arguments that do not fit in the
17891 RSA from the stack when a subroutine is compiled without
17892 optimization.  Because always storing floating-point arguments on the
17893 stack is inefficient and rarely needed, this option is not enabled by
17894 default and only is necessary when calling subroutines compiled by IBM
17895 XL compilers without optimization.
17897 @item -mpe
17898 @opindex mpe
17899 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
17900 application written to use message passing with special startup code to
17901 enable the application to run.  The system must have PE installed in the
17902 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
17903 must be overridden with the @option{-specs=} option to specify the
17904 appropriate directory location.  The Parallel Environment does not
17905 support threads, so the @option{-mpe} option and the @option{-pthread}
17906 option are incompatible.
17908 @item -malign-natural
17909 @itemx -malign-power
17910 @opindex malign-natural
17911 @opindex malign-power
17912 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
17913 @option{-malign-natural} overrides the ABI-defined alignment of larger
17914 types, such as floating-point doubles, on their natural size-based boundary.
17915 The option @option{-malign-power} instructs GCC to follow the ABI-specified
17916 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
17918 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
17919 is not supported.
17921 @item -msoft-float
17922 @itemx -mhard-float
17923 @opindex msoft-float
17924 @opindex mhard-float
17925 Generate code that does not use (uses) the floating-point register set.
17926 Software floating-point emulation is provided if you use the
17927 @option{-msoft-float} option, and pass the option to GCC when linking.
17929 @item -msingle-float
17930 @itemx -mdouble-float
17931 @opindex msingle-float
17932 @opindex mdouble-float
17933 Generate code for single- or double-precision floating-point operations.
17934 @option{-mdouble-float} implies @option{-msingle-float}.
17936 @item -msimple-fpu
17937 @opindex msimple-fpu
17938 Do not generate @code{sqrt} and @code{div} instructions for hardware
17939 floating-point unit.
17941 @item -mfpu=@var{name}
17942 @opindex mfpu
17943 Specify type of floating-point unit.  Valid values for @var{name} are
17944 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
17945 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
17946 @samp{sp_full} (equivalent to @option{-msingle-float}),
17947 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17949 @item -mxilinx-fpu
17950 @opindex mxilinx-fpu
17951 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17953 @item -mmultiple
17954 @itemx -mno-multiple
17955 @opindex mmultiple
17956 @opindex mno-multiple
17957 Generate code that uses (does not use) the load multiple word
17958 instructions and the store multiple word instructions.  These
17959 instructions are generated by default on POWER systems, and not
17960 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17961 PowerPC systems, since those instructions do not work when the
17962 processor is in little-endian mode.  The exceptions are PPC740 and
17963 PPC750 which permit these instructions in little-endian mode.
17965 @item -mstring
17966 @itemx -mno-string
17967 @opindex mstring
17968 @opindex mno-string
17969 Generate code that uses (does not use) the load string instructions
17970 and the store string word instructions to save multiple registers and
17971 do small block moves.  These instructions are generated by default on
17972 POWER systems, and not generated on PowerPC systems.  Do not use
17973 @option{-mstring} on little-endian PowerPC systems, since those
17974 instructions do not work when the processor is in little-endian mode.
17975 The exceptions are PPC740 and PPC750 which permit these instructions
17976 in little-endian mode.
17978 @item -mupdate
17979 @itemx -mno-update
17980 @opindex mupdate
17981 @opindex mno-update
17982 Generate code that uses (does not use) the load or store instructions
17983 that update the base register to the address of the calculated memory
17984 location.  These instructions are generated by default.  If you use
17985 @option{-mno-update}, there is a small window between the time that the
17986 stack pointer is updated and the address of the previous frame is
17987 stored, which means code that walks the stack frame across interrupts or
17988 signals may get corrupted data.
17990 @item -mavoid-indexed-addresses
17991 @itemx -mno-avoid-indexed-addresses
17992 @opindex mavoid-indexed-addresses
17993 @opindex mno-avoid-indexed-addresses
17994 Generate code that tries to avoid (not avoid) the use of indexed load
17995 or store instructions. These instructions can incur a performance
17996 penalty on Power6 processors in certain situations, such as when
17997 stepping through large arrays that cross a 16M boundary.  This option
17998 is enabled by default when targeting Power6 and disabled otherwise.
18000 @item -mfused-madd
18001 @itemx -mno-fused-madd
18002 @opindex mfused-madd
18003 @opindex mno-fused-madd
18004 Generate code that uses (does not use) the floating-point multiply and
18005 accumulate instructions.  These instructions are generated by default
18006 if hardware floating point is used.  The machine-dependent
18007 @option{-mfused-madd} option is now mapped to the machine-independent
18008 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
18009 mapped to @option{-ffp-contract=off}.
18011 @item -mmulhw
18012 @itemx -mno-mulhw
18013 @opindex mmulhw
18014 @opindex mno-mulhw
18015 Generate code that uses (does not use) the half-word multiply and
18016 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
18017 These instructions are generated by default when targeting those
18018 processors.
18020 @item -mdlmzb
18021 @itemx -mno-dlmzb
18022 @opindex mdlmzb
18023 @opindex mno-dlmzb
18024 Generate code that uses (does not use) the string-search @samp{dlmzb}
18025 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
18026 generated by default when targeting those processors.
18028 @item -mno-bit-align
18029 @itemx -mbit-align
18030 @opindex mno-bit-align
18031 @opindex mbit-align
18032 On System V.4 and embedded PowerPC systems do not (do) force structures
18033 and unions that contain bit-fields to be aligned to the base type of the
18034 bit-field.
18036 For example, by default a structure containing nothing but 8
18037 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
18038 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
18039 the structure is aligned to a 1-byte boundary and is 1 byte in
18040 size.
18042 @item -mno-strict-align
18043 @itemx -mstrict-align
18044 @opindex mno-strict-align
18045 @opindex mstrict-align
18046 On System V.4 and embedded PowerPC systems do not (do) assume that
18047 unaligned memory references are handled by the system.
18049 @item -mrelocatable
18050 @itemx -mno-relocatable
18051 @opindex mrelocatable
18052 @opindex mno-relocatable
18053 Generate code that allows (does not allow) a static executable to be
18054 relocated to a different address at run time.  A simple embedded
18055 PowerPC system loader should relocate the entire contents of
18056 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
18057 a table of 32-bit addresses generated by this option.  For this to
18058 work, all objects linked together must be compiled with
18059 @option{-mrelocatable} or @option{-mrelocatable-lib}.
18060 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
18062 @item -mrelocatable-lib
18063 @itemx -mno-relocatable-lib
18064 @opindex mrelocatable-lib
18065 @opindex mno-relocatable-lib
18066 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
18067 @code{.fixup} section to allow static executables to be relocated at
18068 run time, but @option{-mrelocatable-lib} does not use the smaller stack
18069 alignment of @option{-mrelocatable}.  Objects compiled with
18070 @option{-mrelocatable-lib} may be linked with objects compiled with
18071 any combination of the @option{-mrelocatable} options.
18073 @item -mno-toc
18074 @itemx -mtoc
18075 @opindex mno-toc
18076 @opindex mtoc
18077 On System V.4 and embedded PowerPC systems do not (do) assume that
18078 register 2 contains a pointer to a global area pointing to the addresses
18079 used in the program.
18081 @item -mlittle
18082 @itemx -mlittle-endian
18083 @opindex mlittle
18084 @opindex mlittle-endian
18085 On System V.4 and embedded PowerPC systems compile code for the
18086 processor in little-endian mode.  The @option{-mlittle-endian} option is
18087 the same as @option{-mlittle}.
18089 @item -mbig
18090 @itemx -mbig-endian
18091 @opindex mbig
18092 @opindex mbig-endian
18093 On System V.4 and embedded PowerPC systems compile code for the
18094 processor in big-endian mode.  The @option{-mbig-endian} option is
18095 the same as @option{-mbig}.
18097 @item -mdynamic-no-pic
18098 @opindex mdynamic-no-pic
18099 On Darwin and Mac OS X systems, compile code so that it is not
18100 relocatable, but that its external references are relocatable.  The
18101 resulting code is suitable for applications, but not shared
18102 libraries.
18104 @item -msingle-pic-base
18105 @opindex msingle-pic-base
18106 Treat the register used for PIC addressing as read-only, rather than
18107 loading it in the prologue for each function.  The runtime system is
18108 responsible for initializing this register with an appropriate value
18109 before execution begins.
18111 @item -mprioritize-restricted-insns=@var{priority}
18112 @opindex mprioritize-restricted-insns
18113 This option controls the priority that is assigned to
18114 dispatch-slot restricted instructions during the second scheduling
18115 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
18116 or @samp{2} to assign no, highest, or second-highest (respectively) 
18117 priority to dispatch-slot restricted
18118 instructions.
18120 @item -msched-costly-dep=@var{dependence_type}
18121 @opindex msched-costly-dep
18122 This option controls which dependences are considered costly
18123 by the target during instruction scheduling.  The argument
18124 @var{dependence_type} takes one of the following values:
18126 @table @asis
18127 @item @samp{no}
18128 No dependence is costly.
18130 @item @samp{all}
18131 All dependences are costly.
18133 @item @samp{true_store_to_load}
18134 A true dependence from store to load is costly.
18136 @item @samp{store_to_load}
18137 Any dependence from store to load is costly.
18139 @item @var{number}
18140 Any dependence for which the latency is greater than or equal to 
18141 @var{number} is costly.
18142 @end table
18144 @item -minsert-sched-nops=@var{scheme}
18145 @opindex minsert-sched-nops
18146 This option controls which NOP insertion scheme is used during
18147 the second scheduling pass.  The argument @var{scheme} takes one of the
18148 following values:
18150 @table @asis
18151 @item @samp{no}
18152 Don't insert NOPs.
18154 @item @samp{pad}
18155 Pad with NOPs any dispatch group that has vacant issue slots,
18156 according to the scheduler's grouping.
18158 @item @samp{regroup_exact}
18159 Insert NOPs to force costly dependent insns into
18160 separate groups.  Insert exactly as many NOPs as needed to force an insn
18161 to a new group, according to the estimated processor grouping.
18163 @item @var{number}
18164 Insert NOPs to force costly dependent insns into
18165 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
18166 @end table
18168 @item -mcall-sysv
18169 @opindex mcall-sysv
18170 On System V.4 and embedded PowerPC systems compile code using calling
18171 conventions that adhere to the March 1995 draft of the System V
18172 Application Binary Interface, PowerPC processor supplement.  This is the
18173 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
18175 @item -mcall-sysv-eabi
18176 @itemx -mcall-eabi
18177 @opindex mcall-sysv-eabi
18178 @opindex mcall-eabi
18179 Specify both @option{-mcall-sysv} and @option{-meabi} options.
18181 @item -mcall-sysv-noeabi
18182 @opindex mcall-sysv-noeabi
18183 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
18185 @item -mcall-aixdesc
18186 @opindex m
18187 On System V.4 and embedded PowerPC systems compile code for the AIX
18188 operating system.
18190 @item -mcall-linux
18191 @opindex mcall-linux
18192 On System V.4 and embedded PowerPC systems compile code for the
18193 Linux-based GNU system.
18195 @item -mcall-freebsd
18196 @opindex mcall-freebsd
18197 On System V.4 and embedded PowerPC systems compile code for the
18198 FreeBSD operating system.
18200 @item -mcall-netbsd
18201 @opindex mcall-netbsd
18202 On System V.4 and embedded PowerPC systems compile code for the
18203 NetBSD operating system.
18205 @item -mcall-openbsd
18206 @opindex mcall-netbsd
18207 On System V.4 and embedded PowerPC systems compile code for the
18208 OpenBSD operating system.
18210 @item -maix-struct-return
18211 @opindex maix-struct-return
18212 Return all structures in memory (as specified by the AIX ABI)@.
18214 @item -msvr4-struct-return
18215 @opindex msvr4-struct-return
18216 Return structures smaller than 8 bytes in registers (as specified by the
18217 SVR4 ABI)@.
18219 @item -mabi=@var{abi-type}
18220 @opindex mabi
18221 Extend the current ABI with a particular extension, or remove such extension.
18222 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
18223 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
18225 @item -mabi=spe
18226 @opindex mabi=spe
18227 Extend the current ABI with SPE ABI extensions.  This does not change
18228 the default ABI, instead it adds the SPE ABI extensions to the current
18229 ABI@.
18231 @item -mabi=no-spe
18232 @opindex mabi=no-spe
18233 Disable Book-E SPE ABI extensions for the current ABI@.
18235 @item -mabi=ibmlongdouble
18236 @opindex mabi=ibmlongdouble
18237 Change the current ABI to use IBM extended-precision long double.
18238 This is a PowerPC 32-bit SYSV ABI option.
18240 @item -mabi=ieeelongdouble
18241 @opindex mabi=ieeelongdouble
18242 Change the current ABI to use IEEE extended-precision long double.
18243 This is a PowerPC 32-bit Linux ABI option.
18245 @item -mprototype
18246 @itemx -mno-prototype
18247 @opindex mprototype
18248 @opindex mno-prototype
18249 On System V.4 and embedded PowerPC systems assume that all calls to
18250 variable argument functions are properly prototyped.  Otherwise, the
18251 compiler must insert an instruction before every non-prototyped call to
18252 set or clear bit 6 of the condition code register (@var{CR}) to
18253 indicate whether floating-point values are passed in the floating-point
18254 registers in case the function takes variable arguments.  With
18255 @option{-mprototype}, only calls to prototyped variable argument functions
18256 set or clear the bit.
18258 @item -msim
18259 @opindex msim
18260 On embedded PowerPC systems, assume that the startup module is called
18261 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
18262 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
18263 configurations.
18265 @item -mmvme
18266 @opindex mmvme
18267 On embedded PowerPC systems, assume that the startup module is called
18268 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
18269 @file{libc.a}.
18271 @item -mads
18272 @opindex mads
18273 On embedded PowerPC systems, assume that the startup module is called
18274 @file{crt0.o} and the standard C libraries are @file{libads.a} and
18275 @file{libc.a}.
18277 @item -myellowknife
18278 @opindex myellowknife
18279 On embedded PowerPC systems, assume that the startup module is called
18280 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
18281 @file{libc.a}.
18283 @item -mvxworks
18284 @opindex mvxworks
18285 On System V.4 and embedded PowerPC systems, specify that you are
18286 compiling for a VxWorks system.
18288 @item -memb
18289 @opindex memb
18290 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
18291 header to indicate that @samp{eabi} extended relocations are used.
18293 @item -meabi
18294 @itemx -mno-eabi
18295 @opindex meabi
18296 @opindex mno-eabi
18297 On System V.4 and embedded PowerPC systems do (do not) adhere to the
18298 Embedded Applications Binary Interface (EABI), which is a set of
18299 modifications to the System V.4 specifications.  Selecting @option{-meabi}
18300 means that the stack is aligned to an 8-byte boundary, a function
18301 @code{__eabi} is called from @code{main} to set up the EABI
18302 environment, and the @option{-msdata} option can use both @code{r2} and
18303 @code{r13} to point to two separate small data areas.  Selecting
18304 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
18305 no EABI initialization function is called from @code{main}, and the
18306 @option{-msdata} option only uses @code{r13} to point to a single
18307 small data area.  The @option{-meabi} option is on by default if you
18308 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
18310 @item -msdata=eabi
18311 @opindex msdata=eabi
18312 On System V.4 and embedded PowerPC systems, put small initialized
18313 @code{const} global and static data in the @samp{.sdata2} section, which
18314 is pointed to by register @code{r2}.  Put small initialized
18315 non-@code{const} global and static data in the @samp{.sdata} section,
18316 which is pointed to by register @code{r13}.  Put small uninitialized
18317 global and static data in the @samp{.sbss} section, which is adjacent to
18318 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
18319 incompatible with the @option{-mrelocatable} option.  The
18320 @option{-msdata=eabi} option also sets the @option{-memb} option.
18322 @item -msdata=sysv
18323 @opindex msdata=sysv
18324 On System V.4 and embedded PowerPC systems, put small global and static
18325 data in the @samp{.sdata} section, which is pointed to by register
18326 @code{r13}.  Put small uninitialized global and static data in the
18327 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
18328 The @option{-msdata=sysv} option is incompatible with the
18329 @option{-mrelocatable} option.
18331 @item -msdata=default
18332 @itemx -msdata
18333 @opindex msdata=default
18334 @opindex msdata
18335 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
18336 compile code the same as @option{-msdata=eabi}, otherwise compile code the
18337 same as @option{-msdata=sysv}.
18339 @item -msdata=data
18340 @opindex msdata=data
18341 On System V.4 and embedded PowerPC systems, put small global
18342 data in the @samp{.sdata} section.  Put small uninitialized global
18343 data in the @samp{.sbss} section.  Do not use register @code{r13}
18344 to address small data however.  This is the default behavior unless
18345 other @option{-msdata} options are used.
18347 @item -msdata=none
18348 @itemx -mno-sdata
18349 @opindex msdata=none
18350 @opindex mno-sdata
18351 On embedded PowerPC systems, put all initialized global and static data
18352 in the @samp{.data} section, and all uninitialized data in the
18353 @samp{.bss} section.
18355 @item -mblock-move-inline-limit=@var{num}
18356 @opindex mblock-move-inline-limit
18357 Inline all block moves (such as calls to @code{memcpy} or structure
18358 copies) less than or equal to @var{num} bytes.  The minimum value for
18359 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
18360 targets.  The default value is target-specific.
18362 @item -G @var{num}
18363 @opindex G
18364 @cindex smaller data references (PowerPC)
18365 @cindex .sdata/.sdata2 references (PowerPC)
18366 On embedded PowerPC systems, put global and static items less than or
18367 equal to @var{num} bytes into the small data or BSS sections instead of
18368 the normal data or BSS section.  By default, @var{num} is 8.  The
18369 @option{-G @var{num}} switch is also passed to the linker.
18370 All modules should be compiled with the same @option{-G @var{num}} value.
18372 @item -mregnames
18373 @itemx -mno-regnames
18374 @opindex mregnames
18375 @opindex mno-regnames
18376 On System V.4 and embedded PowerPC systems do (do not) emit register
18377 names in the assembly language output using symbolic forms.
18379 @item -mlongcall
18380 @itemx -mno-longcall
18381 @opindex mlongcall
18382 @opindex mno-longcall
18383 By default assume that all calls are far away so that a longer and more
18384 expensive calling sequence is required.  This is required for calls
18385 farther than 32 megabytes (33,554,432 bytes) from the current location.
18386 A short call is generated if the compiler knows
18387 the call cannot be that far away.  This setting can be overridden by
18388 the @code{shortcall} function attribute, or by @code{#pragma
18389 longcall(0)}.
18391 Some linkers are capable of detecting out-of-range calls and generating
18392 glue code on the fly.  On these systems, long calls are unnecessary and
18393 generate slower code.  As of this writing, the AIX linker can do this,
18394 as can the GNU linker for PowerPC/64.  It is planned to add this feature
18395 to the GNU linker for 32-bit PowerPC systems as well.
18397 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
18398 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
18399 addresses represent the callee and the branch island.  The
18400 Darwin/PPC linker prefers the first address and generates a @code{bl
18401 callee} if the PPC @code{bl} instruction reaches the callee directly;
18402 otherwise, the linker generates @code{bl L42} to call the branch
18403 island.  The branch island is appended to the body of the
18404 calling function; it computes the full 32-bit address of the callee
18405 and jumps to it.
18407 On Mach-O (Darwin) systems, this option directs the compiler emit to
18408 the glue for every direct call, and the Darwin linker decides whether
18409 to use or discard it.
18411 In the future, GCC may ignore all longcall specifications
18412 when the linker is known to generate glue.
18414 @item -mtls-markers
18415 @itemx -mno-tls-markers
18416 @opindex mtls-markers
18417 @opindex mno-tls-markers
18418 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
18419 specifying the function argument.  The relocation allows the linker to
18420 reliably associate function call with argument setup instructions for
18421 TLS optimization, which in turn allows GCC to better schedule the
18422 sequence.
18424 @item -pthread
18425 @opindex pthread
18426 Adds support for multithreading with the @dfn{pthreads} library.
18427 This option sets flags for both the preprocessor and linker.
18429 @item -mrecip
18430 @itemx -mno-recip
18431 @opindex mrecip
18432 This option enables use of the reciprocal estimate and
18433 reciprocal square root estimate instructions with additional
18434 Newton-Raphson steps to increase precision instead of doing a divide or
18435 square root and divide for floating-point arguments.  You should use
18436 the @option{-ffast-math} option when using @option{-mrecip} (or at
18437 least @option{-funsafe-math-optimizations},
18438 @option{-finite-math-only}, @option{-freciprocal-math} and
18439 @option{-fno-trapping-math}).  Note that while the throughput of the
18440 sequence is generally higher than the throughput of the non-reciprocal
18441 instruction, the precision of the sequence can be decreased by up to 2
18442 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
18443 roots.
18445 @item -mrecip=@var{opt}
18446 @opindex mrecip=opt
18447 This option controls which reciprocal estimate instructions
18448 may be used.  @var{opt} is a comma-separated list of options, which may
18449 be preceded by a @code{!} to invert the option:
18450 @code{all}: enable all estimate instructions,
18451 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
18452 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
18453 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
18454 @code{divf}: enable the single-precision reciprocal approximation instructions;
18455 @code{divd}: enable the double-precision reciprocal approximation instructions;
18456 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
18457 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
18458 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
18460 So, for example, @option{-mrecip=all,!rsqrtd} enables
18461 all of the reciprocal estimate instructions, except for the
18462 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
18463 which handle the double-precision reciprocal square root calculations.
18465 @item -mrecip-precision
18466 @itemx -mno-recip-precision
18467 @opindex mrecip-precision
18468 Assume (do not assume) that the reciprocal estimate instructions
18469 provide higher-precision estimates than is mandated by the PowerPC
18470 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
18471 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
18472 The double-precision square root estimate instructions are not generated by
18473 default on low-precision machines, since they do not provide an
18474 estimate that converges after three steps.
18476 @item -mveclibabi=@var{type}
18477 @opindex mveclibabi
18478 Specifies the ABI type to use for vectorizing intrinsics using an
18479 external library.  The only type supported at present is @code{mass},
18480 which specifies to use IBM's Mathematical Acceleration Subsystem
18481 (MASS) libraries for vectorizing intrinsics using external libraries.
18482 GCC currently emits calls to @code{acosd2}, @code{acosf4},
18483 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
18484 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
18485 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
18486 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
18487 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
18488 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
18489 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
18490 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
18491 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
18492 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
18493 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
18494 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
18495 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
18496 for power7.  Both @option{-ftree-vectorize} and
18497 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
18498 libraries must be specified at link time.
18500 @item -mfriz
18501 @itemx -mno-friz
18502 @opindex mfriz
18503 Generate (do not generate) the @code{friz} instruction when the
18504 @option{-funsafe-math-optimizations} option is used to optimize
18505 rounding of floating-point values to 64-bit integer and back to floating
18506 point.  The @code{friz} instruction does not return the same value if
18507 the floating-point number is too large to fit in an integer.
18509 @item -mpointers-to-nested-functions
18510 @itemx -mno-pointers-to-nested-functions
18511 @opindex mpointers-to-nested-functions
18512 Generate (do not generate) code to load up the static chain register
18513 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
18514 systems where a function pointer points to a 3-word descriptor giving
18515 the function address, TOC value to be loaded in register @var{r2}, and
18516 static chain value to be loaded in register @var{r11}.  The
18517 @option{-mpointers-to-nested-functions} is on by default.  You cannot
18518 call through pointers to nested functions or pointers
18519 to functions compiled in other languages that use the static chain if
18520 you use the @option{-mno-pointers-to-nested-functions}.
18522 @item -msave-toc-indirect
18523 @itemx -mno-save-toc-indirect
18524 @opindex msave-toc-indirect
18525 Generate (do not generate) code to save the TOC value in the reserved
18526 stack location in the function prologue if the function calls through
18527 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
18528 saved in the prologue, it is saved just before the call through the
18529 pointer.  The @option{-mno-save-toc-indirect} option is the default.
18531 @item -mcompat-align-parm
18532 @itemx -mno-compat-align-parm
18533 @opindex mcompat-align-parm
18534 Generate (do not generate) code to pass structure parameters with a
18535 maximum alignment of 64 bits, for compatibility with older versions
18536 of GCC.
18538 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
18539 structure parameter on a 128-bit boundary when that structure contained
18540 a member requiring 128-bit alignment.  This is corrected in more
18541 recent versions of GCC.  This option may be used to generate code
18542 that is compatible with functions compiled with older versions of
18543 GCC.
18545 The @option{-mno-compat-align-parm} option is the default.
18546 @end table
18548 @node RX Options
18549 @subsection RX Options
18550 @cindex RX Options
18552 These command-line options are defined for RX targets:
18554 @table @gcctabopt
18555 @item -m64bit-doubles
18556 @itemx -m32bit-doubles
18557 @opindex m64bit-doubles
18558 @opindex m32bit-doubles
18559 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18560 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18561 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
18562 works on 32-bit values, which is why the default is
18563 @option{-m32bit-doubles}.
18565 @item -fpu
18566 @itemx -nofpu
18567 @opindex fpu
18568 @opindex nofpu
18569 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
18570 floating-point hardware.  The default is enabled for the @var{RX600}
18571 series and disabled for the @var{RX200} series.
18573 Floating-point instructions are only generated for 32-bit floating-point 
18574 values, however, so the FPU hardware is not used for doubles if the
18575 @option{-m64bit-doubles} option is used.
18577 @emph{Note} If the @option{-fpu} option is enabled then
18578 @option{-funsafe-math-optimizations} is also enabled automatically.
18579 This is because the RX FPU instructions are themselves unsafe.
18581 @item -mcpu=@var{name}
18582 @opindex -mcpu
18583 Selects the type of RX CPU to be targeted.  Currently three types are
18584 supported, the generic @var{RX600} and @var{RX200} series hardware and
18585 the specific @var{RX610} CPU.  The default is @var{RX600}.
18587 The only difference between @var{RX600} and @var{RX610} is that the
18588 @var{RX610} does not support the @code{MVTIPL} instruction.
18590 The @var{RX200} series does not have a hardware floating-point unit
18591 and so @option{-nofpu} is enabled by default when this type is
18592 selected.
18594 @item -mbig-endian-data
18595 @itemx -mlittle-endian-data
18596 @opindex mbig-endian-data
18597 @opindex mlittle-endian-data
18598 Store data (but not code) in the big-endian format.  The default is
18599 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
18600 format.
18602 @item -msmall-data-limit=@var{N}
18603 @opindex msmall-data-limit
18604 Specifies the maximum size in bytes of global and static variables
18605 which can be placed into the small data area.  Using the small data
18606 area can lead to smaller and faster code, but the size of area is
18607 limited and it is up to the programmer to ensure that the area does
18608 not overflow.  Also when the small data area is used one of the RX's
18609 registers (usually @code{r13}) is reserved for use pointing to this
18610 area, so it is no longer available for use by the compiler.  This
18611 could result in slower and/or larger code if variables are pushed onto
18612 the stack instead of being held in this register.
18614 Note, common variables (variables that have not been initialized) and
18615 constants are not placed into the small data area as they are assigned
18616 to other sections in the output executable.
18618 The default value is zero, which disables this feature.  Note, this
18619 feature is not enabled by default with higher optimization levels
18620 (@option{-O2} etc) because of the potentially detrimental effects of
18621 reserving a register.  It is up to the programmer to experiment and
18622 discover whether this feature is of benefit to their program.  See the
18623 description of the @option{-mpid} option for a description of how the
18624 actual register to hold the small data area pointer is chosen.
18626 @item -msim
18627 @itemx -mno-sim
18628 @opindex msim
18629 @opindex mno-sim
18630 Use the simulator runtime.  The default is to use the libgloss
18631 board-specific runtime.
18633 @item -mas100-syntax
18634 @itemx -mno-as100-syntax
18635 @opindex mas100-syntax
18636 @opindex mno-as100-syntax
18637 When generating assembler output use a syntax that is compatible with
18638 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
18639 assembler, but it has some restrictions so it is not generated by default.
18641 @item -mmax-constant-size=@var{N}
18642 @opindex mmax-constant-size
18643 Specifies the maximum size, in bytes, of a constant that can be used as
18644 an operand in a RX instruction.  Although the RX instruction set does
18645 allow constants of up to 4 bytes in length to be used in instructions,
18646 a longer value equates to a longer instruction.  Thus in some
18647 circumstances it can be beneficial to restrict the size of constants
18648 that are used in instructions.  Constants that are too big are instead
18649 placed into a constant pool and referenced via register indirection.
18651 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
18652 or 4 means that constants of any size are allowed.
18654 @item -mrelax
18655 @opindex mrelax
18656 Enable linker relaxation.  Linker relaxation is a process whereby the
18657 linker attempts to reduce the size of a program by finding shorter
18658 versions of various instructions.  Disabled by default.
18660 @item -mint-register=@var{N}
18661 @opindex mint-register
18662 Specify the number of registers to reserve for fast interrupt handler
18663 functions.  The value @var{N} can be between 0 and 4.  A value of 1
18664 means that register @code{r13} is reserved for the exclusive use
18665 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
18666 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
18667 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
18668 A value of 0, the default, does not reserve any registers.
18670 @item -msave-acc-in-interrupts
18671 @opindex msave-acc-in-interrupts
18672 Specifies that interrupt handler functions should preserve the
18673 accumulator register.  This is only necessary if normal code might use
18674 the accumulator register, for example because it performs 64-bit
18675 multiplications.  The default is to ignore the accumulator as this
18676 makes the interrupt handlers faster.
18678 @item -mpid
18679 @itemx -mno-pid
18680 @opindex mpid
18681 @opindex mno-pid
18682 Enables the generation of position independent data.  When enabled any
18683 access to constant data is done via an offset from a base address
18684 held in a register.  This allows the location of constant data to be
18685 determined at run time without requiring the executable to be
18686 relocated, which is a benefit to embedded applications with tight
18687 memory constraints.  Data that can be modified is not affected by this
18688 option.
18690 Note, using this feature reserves a register, usually @code{r13}, for
18691 the constant data base address.  This can result in slower and/or
18692 larger code, especially in complicated functions.
18694 The actual register chosen to hold the constant data base address
18695 depends upon whether the @option{-msmall-data-limit} and/or the
18696 @option{-mint-register} command-line options are enabled.  Starting
18697 with register @code{r13} and proceeding downwards, registers are
18698 allocated first to satisfy the requirements of @option{-mint-register},
18699 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
18700 is possible for the small data area register to be @code{r8} if both
18701 @option{-mint-register=4} and @option{-mpid} are specified on the
18702 command line.
18704 By default this feature is not enabled.  The default can be restored
18705 via the @option{-mno-pid} command-line option.
18707 @item -mno-warn-multiple-fast-interrupts
18708 @itemx -mwarn-multiple-fast-interrupts
18709 @opindex mno-warn-multiple-fast-interrupts
18710 @opindex mwarn-multiple-fast-interrupts
18711 Prevents GCC from issuing a warning message if it finds more than one
18712 fast interrupt handler when it is compiling a file.  The default is to
18713 issue a warning for each extra fast interrupt handler found, as the RX
18714 only supports one such interrupt.
18716 @end table
18718 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
18719 has special significance to the RX port when used with the
18720 @code{interrupt} function attribute.  This attribute indicates a
18721 function intended to process fast interrupts.  GCC ensures
18722 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
18723 and/or @code{r13} and only provided that the normal use of the
18724 corresponding registers have been restricted via the
18725 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
18726 options.
18728 @node S/390 and zSeries Options
18729 @subsection S/390 and zSeries Options
18730 @cindex S/390 and zSeries Options
18732 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
18734 @table @gcctabopt
18735 @item -mhard-float
18736 @itemx -msoft-float
18737 @opindex mhard-float
18738 @opindex msoft-float
18739 Use (do not use) the hardware floating-point instructions and registers
18740 for floating-point operations.  When @option{-msoft-float} is specified,
18741 functions in @file{libgcc.a} are used to perform floating-point
18742 operations.  When @option{-mhard-float} is specified, the compiler
18743 generates IEEE floating-point instructions.  This is the default.
18745 @item -mhard-dfp
18746 @itemx -mno-hard-dfp
18747 @opindex mhard-dfp
18748 @opindex mno-hard-dfp
18749 Use (do not use) the hardware decimal-floating-point instructions for
18750 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
18751 specified, functions in @file{libgcc.a} are used to perform
18752 decimal-floating-point operations.  When @option{-mhard-dfp} is
18753 specified, the compiler generates decimal-floating-point hardware
18754 instructions.  This is the default for @option{-march=z9-ec} or higher.
18756 @item -mlong-double-64
18757 @itemx -mlong-double-128
18758 @opindex mlong-double-64
18759 @opindex mlong-double-128
18760 These switches control the size of @code{long double} type. A size
18761 of 64 bits makes the @code{long double} type equivalent to the @code{double}
18762 type. This is the default.
18764 @item -mbackchain
18765 @itemx -mno-backchain
18766 @opindex mbackchain
18767 @opindex mno-backchain
18768 Store (do not store) the address of the caller's frame as backchain pointer
18769 into the callee's stack frame.
18770 A backchain may be needed to allow debugging using tools that do not understand
18771 DWARF 2 call frame information.
18772 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
18773 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
18774 the backchain is placed into the topmost word of the 96/160 byte register
18775 save area.
18777 In general, code compiled with @option{-mbackchain} is call-compatible with
18778 code compiled with @option{-mmo-backchain}; however, use of the backchain
18779 for debugging purposes usually requires that the whole binary is built with
18780 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
18781 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18782 to build a linux kernel use @option{-msoft-float}.
18784 The default is to not maintain the backchain.
18786 @item -mpacked-stack
18787 @itemx -mno-packed-stack
18788 @opindex mpacked-stack
18789 @opindex mno-packed-stack
18790 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
18791 specified, the compiler uses the all fields of the 96/160 byte register save
18792 area only for their default purpose; unused fields still take up stack space.
18793 When @option{-mpacked-stack} is specified, register save slots are densely
18794 packed at the top of the register save area; unused space is reused for other
18795 purposes, allowing for more efficient use of the available stack space.
18796 However, when @option{-mbackchain} is also in effect, the topmost word of
18797 the save area is always used to store the backchain, and the return address
18798 register is always saved two words below the backchain.
18800 As long as the stack frame backchain is not used, code generated with
18801 @option{-mpacked-stack} is call-compatible with code generated with
18802 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
18803 S/390 or zSeries generated code that uses the stack frame backchain at run
18804 time, not just for debugging purposes.  Such code is not call-compatible
18805 with code compiled with @option{-mpacked-stack}.  Also, note that the
18806 combination of @option{-mbackchain},
18807 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18808 to build a linux kernel use @option{-msoft-float}.
18810 The default is to not use the packed stack layout.
18812 @item -msmall-exec
18813 @itemx -mno-small-exec
18814 @opindex msmall-exec
18815 @opindex mno-small-exec
18816 Generate (or do not generate) code using the @code{bras} instruction
18817 to do subroutine calls.
18818 This only works reliably if the total executable size does not
18819 exceed 64k.  The default is to use the @code{basr} instruction instead,
18820 which does not have this limitation.
18822 @item -m64
18823 @itemx -m31
18824 @opindex m64
18825 @opindex m31
18826 When @option{-m31} is specified, generate code compliant to the
18827 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
18828 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
18829 particular to generate 64-bit instructions.  For the @samp{s390}
18830 targets, the default is @option{-m31}, while the @samp{s390x}
18831 targets default to @option{-m64}.
18833 @item -mzarch
18834 @itemx -mesa
18835 @opindex mzarch
18836 @opindex mesa
18837 When @option{-mzarch} is specified, generate code using the
18838 instructions available on z/Architecture.
18839 When @option{-mesa} is specified, generate code using the
18840 instructions available on ESA/390.  Note that @option{-mesa} is
18841 not possible with @option{-m64}.
18842 When generating code compliant to the GNU/Linux for S/390 ABI,
18843 the default is @option{-mesa}.  When generating code compliant
18844 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
18846 @item -mmvcle
18847 @itemx -mno-mvcle
18848 @opindex mmvcle
18849 @opindex mno-mvcle
18850 Generate (or do not generate) code using the @code{mvcle} instruction
18851 to perform block moves.  When @option{-mno-mvcle} is specified,
18852 use a @code{mvc} loop instead.  This is the default unless optimizing for
18853 size.
18855 @item -mdebug
18856 @itemx -mno-debug
18857 @opindex mdebug
18858 @opindex mno-debug
18859 Print (or do not print) additional debug information when compiling.
18860 The default is to not print debug information.
18862 @item -march=@var{cpu-type}
18863 @opindex march
18864 Generate code that runs on @var{cpu-type}, which is the name of a system
18865 representing a certain processor type.  Possible values for
18866 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
18867 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
18868 When generating code using the instructions available on z/Architecture,
18869 the default is @option{-march=z900}.  Otherwise, the default is
18870 @option{-march=g5}.
18872 @item -mtune=@var{cpu-type}
18873 @opindex mtune
18874 Tune to @var{cpu-type} everything applicable about the generated code,
18875 except for the ABI and the set of available instructions.
18876 The list of @var{cpu-type} values is the same as for @option{-march}.
18877 The default is the value used for @option{-march}.
18879 @item -mtpf-trace
18880 @itemx -mno-tpf-trace
18881 @opindex mtpf-trace
18882 @opindex mno-tpf-trace
18883 Generate code that adds (does not add) in TPF OS specific branches to trace
18884 routines in the operating system.  This option is off by default, even
18885 when compiling for the TPF OS@.
18887 @item -mfused-madd
18888 @itemx -mno-fused-madd
18889 @opindex mfused-madd
18890 @opindex mno-fused-madd
18891 Generate code that uses (does not use) the floating-point multiply and
18892 accumulate instructions.  These instructions are generated by default if
18893 hardware floating point is used.
18895 @item -mwarn-framesize=@var{framesize}
18896 @opindex mwarn-framesize
18897 Emit a warning if the current function exceeds the given frame size.  Because
18898 this is a compile-time check it doesn't need to be a real problem when the program
18899 runs.  It is intended to identify functions that most probably cause
18900 a stack overflow.  It is useful to be used in an environment with limited stack
18901 size e.g.@: the linux kernel.
18903 @item -mwarn-dynamicstack
18904 @opindex mwarn-dynamicstack
18905 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
18906 arrays.  This is generally a bad idea with a limited stack size.
18908 @item -mstack-guard=@var{stack-guard}
18909 @itemx -mstack-size=@var{stack-size}
18910 @opindex mstack-guard
18911 @opindex mstack-size
18912 If these options are provided the S/390 back end emits additional instructions in
18913 the function prologue that trigger a trap if the stack size is @var{stack-guard}
18914 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
18915 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
18916 the frame size of the compiled function is chosen.
18917 These options are intended to be used to help debugging stack overflow problems.
18918 The additionally emitted code causes only little overhead and hence can also be
18919 used in production-like systems without greater performance degradation.  The given
18920 values have to be exact powers of 2 and @var{stack-size} has to be greater than
18921 @var{stack-guard} without exceeding 64k.
18922 In order to be efficient the extra code makes the assumption that the stack starts
18923 at an address aligned to the value given by @var{stack-size}.
18924 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
18925 @end table
18927 @node Score Options
18928 @subsection Score Options
18929 @cindex Score Options
18931 These options are defined for Score implementations:
18933 @table @gcctabopt
18934 @item -meb
18935 @opindex meb
18936 Compile code for big-endian mode.  This is the default.
18938 @item -mel
18939 @opindex mel
18940 Compile code for little-endian mode.
18942 @item -mnhwloop
18943 @opindex mnhwloop
18944 Disable generation of @code{bcnz} instructions.
18946 @item -muls
18947 @opindex muls
18948 Enable generation of unaligned load and store instructions.
18950 @item -mmac
18951 @opindex mmac
18952 Enable the use of multiply-accumulate instructions. Disabled by default.
18954 @item -mscore5
18955 @opindex mscore5
18956 Specify the SCORE5 as the target architecture.
18958 @item -mscore5u
18959 @opindex mscore5u
18960 Specify the SCORE5U of the target architecture.
18962 @item -mscore7
18963 @opindex mscore7
18964 Specify the SCORE7 as the target architecture. This is the default.
18966 @item -mscore7d
18967 @opindex mscore7d
18968 Specify the SCORE7D as the target architecture.
18969 @end table
18971 @node SH Options
18972 @subsection SH Options
18974 These @samp{-m} options are defined for the SH implementations:
18976 @table @gcctabopt
18977 @item -m1
18978 @opindex m1
18979 Generate code for the SH1.
18981 @item -m2
18982 @opindex m2
18983 Generate code for the SH2.
18985 @item -m2e
18986 Generate code for the SH2e.
18988 @item -m2a-nofpu
18989 @opindex m2a-nofpu
18990 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18991 that the floating-point unit is not used.
18993 @item -m2a-single-only
18994 @opindex m2a-single-only
18995 Generate code for the SH2a-FPU, in such a way that no double-precision
18996 floating-point operations are used.
18998 @item -m2a-single
18999 @opindex m2a-single
19000 Generate code for the SH2a-FPU assuming the floating-point unit is in
19001 single-precision mode by default.
19003 @item -m2a
19004 @opindex m2a
19005 Generate code for the SH2a-FPU assuming the floating-point unit is in
19006 double-precision mode by default.
19008 @item -m3
19009 @opindex m3
19010 Generate code for the SH3.
19012 @item -m3e
19013 @opindex m3e
19014 Generate code for the SH3e.
19016 @item -m4-nofpu
19017 @opindex m4-nofpu
19018 Generate code for the SH4 without a floating-point unit.
19020 @item -m4-single-only
19021 @opindex m4-single-only
19022 Generate code for the SH4 with a floating-point unit that only
19023 supports single-precision arithmetic.
19025 @item -m4-single
19026 @opindex m4-single
19027 Generate code for the SH4 assuming the floating-point unit is in
19028 single-precision mode by default.
19030 @item -m4
19031 @opindex m4
19032 Generate code for the SH4.
19034 @item -m4a-nofpu
19035 @opindex m4a-nofpu
19036 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
19037 floating-point unit is not used.
19039 @item -m4a-single-only
19040 @opindex m4a-single-only
19041 Generate code for the SH4a, in such a way that no double-precision
19042 floating-point operations are used.
19044 @item -m4a-single
19045 @opindex m4a-single
19046 Generate code for the SH4a assuming the floating-point unit is in
19047 single-precision mode by default.
19049 @item -m4a
19050 @opindex m4a
19051 Generate code for the SH4a.
19053 @item -m4al
19054 @opindex m4al
19055 Same as @option{-m4a-nofpu}, except that it implicitly passes
19056 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
19057 instructions at the moment.
19059 @item -mb
19060 @opindex mb
19061 Compile code for the processor in big-endian mode.
19063 @item -ml
19064 @opindex ml
19065 Compile code for the processor in little-endian mode.
19067 @item -mdalign
19068 @opindex mdalign
19069 Align doubles at 64-bit boundaries.  Note that this changes the calling
19070 conventions, and thus some functions from the standard C library do
19071 not work unless you recompile it first with @option{-mdalign}.
19073 @item -mrelax
19074 @opindex mrelax
19075 Shorten some address references at link time, when possible; uses the
19076 linker option @option{-relax}.
19078 @item -mbigtable
19079 @opindex mbigtable
19080 Use 32-bit offsets in @code{switch} tables.  The default is to use
19081 16-bit offsets.
19083 @item -mbitops
19084 @opindex mbitops
19085 Enable the use of bit manipulation instructions on SH2A.
19087 @item -mfmovd
19088 @opindex mfmovd
19089 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
19090 alignment constraints.
19092 @item -mhitachi
19093 @opindex mhitachi
19094 Comply with the calling conventions defined by Renesas.
19096 @item -mrenesas
19097 @opindex mhitachi
19098 Comply with the calling conventions defined by Renesas.
19100 @item -mno-renesas
19101 @opindex mhitachi
19102 Comply with the calling conventions defined for GCC before the Renesas
19103 conventions were available.  This option is the default for all
19104 targets of the SH toolchain.
19106 @item -mnomacsave
19107 @opindex mnomacsave
19108 Mark the @code{MAC} register as call-clobbered, even if
19109 @option{-mhitachi} is given.
19111 @item -mieee
19112 @itemx -mno-ieee
19113 @opindex mieee
19114 @opindex mnoieee
19115 Control the IEEE compliance of floating-point comparisons, which affects the
19116 handling of cases where the result of a comparison is unordered.  By default
19117 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
19118 enabled @option{-mno-ieee} is implicitly set, which results in faster
19119 floating-point greater-equal and less-equal comparisons.  The implcit settings
19120 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
19122 @item -minline-ic_invalidate
19123 @opindex minline-ic_invalidate
19124 Inline code to invalidate instruction cache entries after setting up
19125 nested function trampolines.
19126 This option has no effect if @option{-musermode} is in effect and the selected
19127 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
19128 instruction.
19129 If the selected code generation option does not allow the use of the @code{icbi}
19130 instruction, and @option{-musermode} is not in effect, the inlined code
19131 manipulates the instruction cache address array directly with an associative
19132 write.  This not only requires privileged mode at run time, but it also
19133 fails if the cache line had been mapped via the TLB and has become unmapped.
19135 @item -misize
19136 @opindex misize
19137 Dump instruction size and location in the assembly code.
19139 @item -mpadstruct
19140 @opindex mpadstruct
19141 This option is deprecated.  It pads structures to multiple of 4 bytes,
19142 which is incompatible with the SH ABI@.
19144 @item -matomic-model=@var{model}
19145 @opindex matomic-model=@var{model}
19146 Sets the model of atomic operations and additional parameters as a comma
19147 separated list.  For details on the atomic built-in functions see
19148 @ref{__atomic Builtins}.  The following models and parameters are supported:
19150 @table @samp
19152 @item none
19153 Disable compiler generated atomic sequences and emit library calls for atomic
19154 operations.  This is the default if the target is not @code{sh-*-linux*}.
19156 @item soft-gusa
19157 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
19158 built-in functions.  The generated atomic sequences require additional support
19159 from the interrupt/exception handling code of the system and are only suitable
19160 for SH3* and SH4* single-core systems.  This option is enabled by default when
19161 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
19162 this option will also partially utilize the hardware atomic instructions
19163 @code{movli.l} and @code{movco.l} to create more efficient code, unless
19164 @samp{strict} is specified.  
19166 @item soft-tcb
19167 Generate software atomic sequences that use a variable in the thread control
19168 block.  This is a variation of the gUSA sequences which can also be used on
19169 SH1* and SH2* targets.  The generated atomic sequences require additional
19170 support from the interrupt/exception handling code of the system and are only
19171 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
19172 parameter has to be specified as well.
19174 @item soft-imask
19175 Generate software atomic sequences that temporarily disable interrupts by
19176 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
19177 in privileged mode and is only suitable for single-core systems.  Additional
19178 support from the interrupt/exception handling code of the system is not
19179 required.  This model is enabled by default when the target is
19180 @code{sh-*-linux*} and SH1* or SH2*.
19182 @item hard-llcs
19183 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
19184 instructions only.  This is only available on SH4A and is suitable for
19185 multi-core systems.  Since the hardware instructions support only 32 bit atomic
19186 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
19187 Code compiled with this option will also be compatible with other software
19188 atomic model interrupt/exception handling systems if executed on an SH4A
19189 system.  Additional support from the interrupt/exception handling code of the
19190 system is not required for this model.
19192 @item gbr-offset=
19193 This parameter specifies the offset in bytes of the variable in the thread
19194 control block structure that should be used by the generated atomic sequences
19195 when the @samp{soft-tcb} model has been selected.  For other models this
19196 parameter is ignored.  The specified value must be an integer multiple of four
19197 and in the range 0-1020.
19199 @item strict
19200 This parameter prevents mixed usage of multiple atomic models, even though they
19201 would be compatible, and will make the compiler generate atomic sequences of the
19202 specified model only.
19204 @end table
19206 @item -mtas
19207 @opindex mtas
19208 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
19209 Notice that depending on the particular hardware and software configuration
19210 this can degrade overall performance due to the operand cache line flushes
19211 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
19212 processors the @code{tas.b} instruction must be used with caution since it
19213 can result in data corruption for certain cache configurations.
19215 @item -mspace
19216 @opindex mspace
19217 Optimize for space instead of speed.  Implied by @option{-Os}.
19219 @item -mprefergot
19220 @opindex mprefergot
19221 When generating position-independent code, emit function calls using
19222 the Global Offset Table instead of the Procedure Linkage Table.
19224 @item -musermode
19225 @opindex musermode
19226 Don't generate privileged mode only code.  This option
19227 implies @option{-mno-inline-ic_invalidate}
19228 if the inlined code would not work in user mode.
19229 This is the default when the target is @code{sh-*-linux*}.
19231 @item -multcost=@var{number}
19232 @opindex multcost=@var{number}
19233 Set the cost to assume for a multiply insn.
19235 @item -mdiv=@var{strategy}
19236 @opindex mdiv=@var{strategy}
19237 Set the division strategy to be used for integer division operations.
19238 For SHmedia @var{strategy} can be one of: 
19240 @table @samp
19242 @item fp 
19243 Performs the operation in floating point.  This has a very high latency,
19244 but needs only a few instructions, so it might be a good choice if
19245 your code has enough easily-exploitable ILP to allow the compiler to
19246 schedule the floating-point instructions together with other instructions.
19247 Division by zero causes a floating-point exception.
19249 @item inv
19250 Uses integer operations to calculate the inverse of the divisor,
19251 and then multiplies the dividend with the inverse.  This strategy allows
19252 CSE and hoisting of the inverse calculation.  Division by zero calculates
19253 an unspecified result, but does not trap.
19255 @item inv:minlat
19256 A variant of @samp{inv} where, if no CSE or hoisting opportunities
19257 have been found, or if the entire operation has been hoisted to the same
19258 place, the last stages of the inverse calculation are intertwined with the
19259 final multiply to reduce the overall latency, at the expense of using a few
19260 more instructions, and thus offering fewer scheduling opportunities with
19261 other code.
19263 @item call
19264 Calls a library function that usually implements the @samp{inv:minlat}
19265 strategy.
19266 This gives high code density for @code{m5-*media-nofpu} compilations.
19268 @item call2
19269 Uses a different entry point of the same library function, where it
19270 assumes that a pointer to a lookup table has already been set up, which
19271 exposes the pointer load to CSE and code hoisting optimizations.
19273 @item inv:call
19274 @itemx inv:call2
19275 @itemx inv:fp
19276 Use the @samp{inv} algorithm for initial
19277 code generation, but if the code stays unoptimized, revert to the @samp{call},
19278 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
19279 potentially-trapping side effect of division by zero is carried by a
19280 separate instruction, so it is possible that all the integer instructions
19281 are hoisted out, but the marker for the side effect stays where it is.
19282 A recombination to floating-point operations or a call is not possible
19283 in that case.
19285 @item inv20u
19286 @itemx inv20l
19287 Variants of the @samp{inv:minlat} strategy.  In the case
19288 that the inverse calculation is not separated from the multiply, they speed
19289 up division where the dividend fits into 20 bits (plus sign where applicable)
19290 by inserting a test to skip a number of operations in this case; this test
19291 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
19292 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
19294 @end table
19296 For targets other than SHmedia @var{strategy} can be one of:
19298 @table @samp
19300 @item call-div1
19301 Calls a library function that uses the single-step division instruction
19302 @code{div1} to perform the operation.  Division by zero calculates an
19303 unspecified result and does not trap.  This is the default except for SH4,
19304 SH2A and SHcompact.
19306 @item call-fp
19307 Calls a library function that performs the operation in double precision
19308 floating point.  Division by zero causes a floating-point exception.  This is
19309 the default for SHcompact with FPU.  Specifying this for targets that do not
19310 have a double precision FPU will default to @code{call-div1}.
19312 @item call-table
19313 Calls a library function that uses a lookup table for small divisors and
19314 the @code{div1} instruction with case distinction for larger divisors.  Division
19315 by zero calculates an unspecified result and does not trap.  This is the default
19316 for SH4.  Specifying this for targets that do not have dynamic shift
19317 instructions will default to @code{call-div1}.
19319 @end table
19321 When a division strategy has not been specified the default strategy will be
19322 selected based on the current target.  For SH2A the default strategy is to
19323 use the @code{divs} and @code{divu} instructions instead of library function
19324 calls.
19326 @item -maccumulate-outgoing-args
19327 @opindex maccumulate-outgoing-args
19328 Reserve space once for outgoing arguments in the function prologue rather
19329 than around each call.  Generally beneficial for performance and size.  Also
19330 needed for unwinding to avoid changing the stack frame around conditional code.
19332 @item -mdivsi3_libfunc=@var{name}
19333 @opindex mdivsi3_libfunc=@var{name}
19334 Set the name of the library function used for 32-bit signed division to
19335 @var{name}.
19336 This only affects the name used in the @samp{call} and @samp{inv:call}
19337 division strategies, and the compiler still expects the same
19338 sets of input/output/clobbered registers as if this option were not present.
19340 @item -mfixed-range=@var{register-range}
19341 @opindex mfixed-range
19342 Generate code treating the given register range as fixed registers.
19343 A fixed register is one that the register allocator can not use.  This is
19344 useful when compiling kernel code.  A register range is specified as
19345 two registers separated by a dash.  Multiple register ranges can be
19346 specified separated by a comma.
19348 @item -mindexed-addressing
19349 @opindex mindexed-addressing
19350 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
19351 This is only safe if the hardware and/or OS implement 32-bit wrap-around
19352 semantics for the indexed addressing mode.  The architecture allows the
19353 implementation of processors with 64-bit MMU, which the OS could use to
19354 get 32-bit addressing, but since no current hardware implementation supports
19355 this or any other way to make the indexed addressing mode safe to use in
19356 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
19358 @item -mgettrcost=@var{number}
19359 @opindex mgettrcost=@var{number}
19360 Set the cost assumed for the @code{gettr} instruction to @var{number}.
19361 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
19363 @item -mpt-fixed
19364 @opindex mpt-fixed
19365 Assume @code{pt*} instructions won't trap.  This generally generates
19366 better-scheduled code, but is unsafe on current hardware.
19367 The current architecture
19368 definition says that @code{ptabs} and @code{ptrel} trap when the target 
19369 anded with 3 is 3.
19370 This has the unintentional effect of making it unsafe to schedule these
19371 instructions before a branch, or hoist them out of a loop.  For example,
19372 @code{__do_global_ctors}, a part of @file{libgcc}
19373 that runs constructors at program
19374 startup, calls functions in a list which is delimited by @minus{}1.  With the
19375 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
19376 That means that all the constructors run a bit more quickly, but when
19377 the loop comes to the end of the list, the program crashes because @code{ptabs}
19378 loads @minus{}1 into a target register.  
19380 Since this option is unsafe for any
19381 hardware implementing the current architecture specification, the default
19382 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
19383 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
19384 this deters register allocation from using target registers for storing
19385 ordinary integers.
19387 @item -minvalid-symbols
19388 @opindex minvalid-symbols
19389 Assume symbols might be invalid.  Ordinary function symbols generated by
19390 the compiler are always valid to load with
19391 @code{movi}/@code{shori}/@code{ptabs} or
19392 @code{movi}/@code{shori}/@code{ptrel},
19393 but with assembler and/or linker tricks it is possible
19394 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
19395 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
19396 It prevents cross-basic-block CSE, hoisting and most scheduling
19397 of symbol loads.  The default is @option{-mno-invalid-symbols}.
19399 @item -mbranch-cost=@var{num}
19400 @opindex mbranch-cost=@var{num}
19401 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
19402 make the compiler try to generate more branch-free code if possible.  
19403 If not specified the value is selected depending on the processor type that
19404 is being compiled for.
19406 @item -mzdcbranch
19407 @itemx -mno-zdcbranch
19408 @opindex mzdcbranch
19409 @opindex mno-zdcbranch
19410 Assume (do not assume) that zero displacement conditional branch instructions
19411 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
19412 compiler will try to prefer zero displacement branch code sequences.  This is
19413 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
19414 disabled by specifying @option{-mno-zdcbranch}.
19416 @item -mcbranchdi
19417 @opindex mcbranchdi
19418 Enable the @code{cbranchdi4} instruction pattern.
19420 @item -mcmpeqdi
19421 @opindex mcmpeqdi
19422 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
19423 is in effect.
19425 @item -mfused-madd
19426 @itemx -mno-fused-madd
19427 @opindex mfused-madd
19428 @opindex mno-fused-madd
19429 Generate code that uses (does not use) the floating-point multiply and
19430 accumulate instructions.  These instructions are generated by default
19431 if hardware floating point is used.  The machine-dependent
19432 @option{-mfused-madd} option is now mapped to the machine-independent
19433 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19434 mapped to @option{-ffp-contract=off}.
19436 @item -mfsca
19437 @itemx -mno-fsca
19438 @opindex mfsca
19439 @opindex mno-fsca
19440 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
19441 and cosine approximations.  The option @code{-mfsca} must be used in
19442 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
19443 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
19444 approximations even if @code{-funsafe-math-optimizations} is in effect.
19446 @item -mfsrra
19447 @itemx -mno-fsrra
19448 @opindex mfsrra
19449 @opindex mno-fsrra
19450 Allow or disallow the compiler to emit the @code{fsrra} instruction for
19451 reciprocal square root approximations.  The option @code{-mfsrra} must be used
19452 in combination with @code{-funsafe-math-optimizations} and
19453 @code{-ffinite-math-only}.  It is enabled by default when generating code for
19454 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
19455 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
19456 in effect.
19458 @item -mpretend-cmove
19459 @opindex mpretend-cmove
19460 Prefer zero-displacement conditional branches for conditional move instruction
19461 patterns.  This can result in faster code on the SH4 processor.
19463 @end table
19465 @node Solaris 2 Options
19466 @subsection Solaris 2 Options
19467 @cindex Solaris 2 options
19469 These @samp{-m} options are supported on Solaris 2:
19471 @table @gcctabopt
19472 @item -mimpure-text
19473 @opindex mimpure-text
19474 @option{-mimpure-text}, used in addition to @option{-shared}, tells
19475 the compiler to not pass @option{-z text} to the linker when linking a
19476 shared object.  Using this option, you can link position-dependent
19477 code into a shared object.
19479 @option{-mimpure-text} suppresses the ``relocations remain against
19480 allocatable but non-writable sections'' linker error message.
19481 However, the necessary relocations trigger copy-on-write, and the
19482 shared object is not actually shared across processes.  Instead of
19483 using @option{-mimpure-text}, you should compile all source code with
19484 @option{-fpic} or @option{-fPIC}.
19486 @end table
19488 These switches are supported in addition to the above on Solaris 2:
19490 @table @gcctabopt
19491 @item -pthreads
19492 @opindex pthreads
19493 Add support for multithreading using the POSIX threads library.  This
19494 option sets flags for both the preprocessor and linker.  This option does
19495 not affect the thread safety of object code produced  by the compiler or
19496 that of libraries supplied with it.
19498 @item -pthread
19499 @opindex pthread
19500 This is a synonym for @option{-pthreads}.
19501 @end table
19503 @node SPARC Options
19504 @subsection SPARC Options
19505 @cindex SPARC options
19507 These @samp{-m} options are supported on the SPARC:
19509 @table @gcctabopt
19510 @item -mno-app-regs
19511 @itemx -mapp-regs
19512 @opindex mno-app-regs
19513 @opindex mapp-regs
19514 Specify @option{-mapp-regs} to generate output using the global registers
19515 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
19516 is the default.
19518 To be fully SVR4 ABI-compliant at the cost of some performance loss,
19519 specify @option{-mno-app-regs}.  You should compile libraries and system
19520 software with this option.
19522 @item -mflat
19523 @itemx -mno-flat
19524 @opindex mflat
19525 @opindex mno-flat
19526 With @option{-mflat}, the compiler does not generate save/restore instructions
19527 and uses a ``flat'' or single register window model.  This model is compatible
19528 with the regular register window model.  The local registers and the input
19529 registers (0--5) are still treated as ``call-saved'' registers and are
19530 saved on the stack as needed.
19532 With @option{-mno-flat} (the default), the compiler generates save/restore
19533 instructions (except for leaf functions).  This is the normal operating mode.
19535 @item -mfpu
19536 @itemx -mhard-float
19537 @opindex mfpu
19538 @opindex mhard-float
19539 Generate output containing floating-point instructions.  This is the
19540 default.
19542 @item -mno-fpu
19543 @itemx -msoft-float
19544 @opindex mno-fpu
19545 @opindex msoft-float
19546 Generate output containing library calls for floating point.
19547 @strong{Warning:} the requisite libraries are not available for all SPARC
19548 targets.  Normally the facilities of the machine's usual C compiler are
19549 used, but this cannot be done directly in cross-compilation.  You must make
19550 your own arrangements to provide suitable library functions for
19551 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
19552 @samp{sparclite-*-*} do provide software floating-point support.
19554 @option{-msoft-float} changes the calling convention in the output file;
19555 therefore, it is only useful if you compile @emph{all} of a program with
19556 this option.  In particular, you need to compile @file{libgcc.a}, the
19557 library that comes with GCC, with @option{-msoft-float} in order for
19558 this to work.
19560 @item -mhard-quad-float
19561 @opindex mhard-quad-float
19562 Generate output containing quad-word (long double) floating-point
19563 instructions.
19565 @item -msoft-quad-float
19566 @opindex msoft-quad-float
19567 Generate output containing library calls for quad-word (long double)
19568 floating-point instructions.  The functions called are those specified
19569 in the SPARC ABI@.  This is the default.
19571 As of this writing, there are no SPARC implementations that have hardware
19572 support for the quad-word floating-point instructions.  They all invoke
19573 a trap handler for one of these instructions, and then the trap handler
19574 emulates the effect of the instruction.  Because of the trap handler overhead,
19575 this is much slower than calling the ABI library routines.  Thus the
19576 @option{-msoft-quad-float} option is the default.
19578 @item -mno-unaligned-doubles
19579 @itemx -munaligned-doubles
19580 @opindex mno-unaligned-doubles
19581 @opindex munaligned-doubles
19582 Assume that doubles have 8-byte alignment.  This is the default.
19584 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
19585 alignment only if they are contained in another type, or if they have an
19586 absolute address.  Otherwise, it assumes they have 4-byte alignment.
19587 Specifying this option avoids some rare compatibility problems with code
19588 generated by other compilers.  It is not the default because it results
19589 in a performance loss, especially for floating-point code.
19591 @item -mno-faster-structs
19592 @itemx -mfaster-structs
19593 @opindex mno-faster-structs
19594 @opindex mfaster-structs
19595 With @option{-mfaster-structs}, the compiler assumes that structures
19596 should have 8-byte alignment.  This enables the use of pairs of
19597 @code{ldd} and @code{std} instructions for copies in structure
19598 assignment, in place of twice as many @code{ld} and @code{st} pairs.
19599 However, the use of this changed alignment directly violates the SPARC
19600 ABI@.  Thus, it's intended only for use on targets where the developer
19601 acknowledges that their resulting code is not directly in line with
19602 the rules of the ABI@.
19604 @item -mcpu=@var{cpu_type}
19605 @opindex mcpu
19606 Set the instruction set, register set, and instruction scheduling parameters
19607 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
19608 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
19609 @samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934},
19610 @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
19611 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
19612 @samp{niagara3} and @samp{niagara4}.
19614 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
19615 which selects the best architecture option for the host processor.
19616 @option{-mcpu=native} has no effect if GCC does not recognize
19617 the processor.
19619 Default instruction scheduling parameters are used for values that select
19620 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
19621 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
19623 Here is a list of each supported architecture and their supported
19624 implementations.
19626 @table @asis
19627 @item v7
19628 cypress
19630 @item v8
19631 supersparc, hypersparc, leon, leon3
19633 @item sparclite
19634 f930, f934, sparclite86x
19636 @item sparclet
19637 tsc701
19639 @item v9
19640 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
19641 @end table
19643 By default (unless configured otherwise), GCC generates code for the V7
19644 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
19645 additionally optimizes it for the Cypress CY7C602 chip, as used in the
19646 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
19647 SPARCStation 1, 2, IPX etc.
19649 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
19650 architecture.  The only difference from V7 code is that the compiler emits
19651 the integer multiply and integer divide instructions which exist in SPARC-V8
19652 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
19653 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
19654 2000 series.
19656 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
19657 the SPARC architecture.  This adds the integer multiply, integer divide step
19658 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
19659 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
19660 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
19661 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
19662 MB86934 chip, which is the more recent SPARClite with FPU@.
19664 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
19665 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
19666 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
19667 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
19668 optimizes it for the TEMIC SPARClet chip.
19670 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
19671 architecture.  This adds 64-bit integer and floating-point move instructions,
19672 3 additional floating-point condition code registers and conditional move
19673 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
19674 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
19675 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
19676 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
19677 @option{-mcpu=niagara}, the compiler additionally optimizes it for
19678 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
19679 additionally optimizes it for Sun UltraSPARC T2 chips. With
19680 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
19681 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
19682 additionally optimizes it for Sun UltraSPARC T4 chips.
19684 @item -mtune=@var{cpu_type}
19685 @opindex mtune
19686 Set the instruction scheduling parameters for machine type
19687 @var{cpu_type}, but do not set the instruction set or register set that the
19688 option @option{-mcpu=@var{cpu_type}} does.
19690 The same values for @option{-mcpu=@var{cpu_type}} can be used for
19691 @option{-mtune=@var{cpu_type}}, but the only useful values are those
19692 that select a particular CPU implementation.  Those are @samp{cypress},
19693 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930},
19694 @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
19695 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and
19696 @samp{niagara4}.  With native Solaris and GNU/Linux toolchains, @samp{native}
19697 can also be used.
19699 @item -mv8plus
19700 @itemx -mno-v8plus
19701 @opindex mv8plus
19702 @opindex mno-v8plus
19703 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
19704 difference from the V8 ABI is that the global and out registers are
19705 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
19706 mode for all SPARC-V9 processors.
19708 @item -mvis
19709 @itemx -mno-vis
19710 @opindex mvis
19711 @opindex mno-vis
19712 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
19713 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
19715 @item -mvis2
19716 @itemx -mno-vis2
19717 @opindex mvis2
19718 @opindex mno-vis2
19719 With @option{-mvis2}, GCC generates code that takes advantage of
19720 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
19721 default is @option{-mvis2} when targeting a cpu that supports such
19722 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
19723 also sets @option{-mvis}.
19725 @item -mvis3
19726 @itemx -mno-vis3
19727 @opindex mvis3
19728 @opindex mno-vis3
19729 With @option{-mvis3}, GCC generates code that takes advantage of
19730 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
19731 default is @option{-mvis3} when targeting a cpu that supports such
19732 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
19733 also sets @option{-mvis2} and @option{-mvis}.
19735 @item -mcbcond
19736 @itemx -mno-cbcond
19737 @opindex mcbcond
19738 @opindex mno-cbcond
19739 With @option{-mcbcond}, GCC generates code that takes advantage of
19740 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
19741 The default is @option{-mcbcond} when targeting a cpu that supports such
19742 instructions, such as niagara-4 and later.
19744 @item -mpopc
19745 @itemx -mno-popc
19746 @opindex mpopc
19747 @opindex mno-popc
19748 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
19749 population count instruction.  The default is @option{-mpopc}
19750 when targeting a cpu that supports such instructions, such as Niagara-2 and
19751 later.
19753 @item -mfmaf
19754 @itemx -mno-fmaf
19755 @opindex mfmaf
19756 @opindex mno-fmaf
19757 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
19758 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
19759 when targeting a cpu that supports such instructions, such as Niagara-3 and
19760 later.
19762 @item -mfix-at697f
19763 @opindex mfix-at697f
19764 Enable the documented workaround for the single erratum of the Atmel AT697F
19765 processor (which corresponds to erratum #13 of the AT697E processor).
19767 @item -mfix-ut699
19768 @opindex mfix-ut699
19769 Enable the documented workarounds for the floating-point errata and the data
19770 cache nullify errata of the UT699 processor.
19771 @end table
19773 These @samp{-m} options are supported in addition to the above
19774 on SPARC-V9 processors in 64-bit environments:
19776 @table @gcctabopt
19777 @item -m32
19778 @itemx -m64
19779 @opindex m32
19780 @opindex m64
19781 Generate code for a 32-bit or 64-bit environment.
19782 The 32-bit environment sets int, long and pointer to 32 bits.
19783 The 64-bit environment sets int to 32 bits and long and pointer
19784 to 64 bits.
19786 @item -mcmodel=@var{which}
19787 @opindex mcmodel
19788 Set the code model to one of
19790 @table @samp
19791 @item medlow
19792 The Medium/Low code model: 64-bit addresses, programs
19793 must be linked in the low 32 bits of memory.  Programs can be statically
19794 or dynamically linked.
19796 @item medmid
19797 The Medium/Middle code model: 64-bit addresses, programs
19798 must be linked in the low 44 bits of memory, the text and data segments must
19799 be less than 2GB in size and the data segment must be located within 2GB of
19800 the text segment.
19802 @item medany
19803 The Medium/Anywhere code model: 64-bit addresses, programs
19804 may be linked anywhere in memory, the text and data segments must be less
19805 than 2GB in size and the data segment must be located within 2GB of the
19806 text segment.
19808 @item embmedany
19809 The Medium/Anywhere code model for embedded systems:
19810 64-bit addresses, the text and data segments must be less than 2GB in
19811 size, both starting anywhere in memory (determined at link time).  The
19812 global register %g4 points to the base of the data segment.  Programs
19813 are statically linked and PIC is not supported.
19814 @end table
19816 @item -mmemory-model=@var{mem-model}
19817 @opindex mmemory-model
19818 Set the memory model in force on the processor to one of
19820 @table @samp
19821 @item default
19822 The default memory model for the processor and operating system.
19824 @item rmo
19825 Relaxed Memory Order
19827 @item pso
19828 Partial Store Order
19830 @item tso
19831 Total Store Order
19833 @item sc
19834 Sequential Consistency
19835 @end table
19837 These memory models are formally defined in Appendix D of the Sparc V9
19838 architecture manual, as set in the processor's @code{PSTATE.MM} field.
19840 @item -mstack-bias
19841 @itemx -mno-stack-bias
19842 @opindex mstack-bias
19843 @opindex mno-stack-bias
19844 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
19845 frame pointer if present, are offset by @minus{}2047 which must be added back
19846 when making stack frame references.  This is the default in 64-bit mode.
19847 Otherwise, assume no such offset is present.
19848 @end table
19850 @node SPU Options
19851 @subsection SPU Options
19852 @cindex SPU options
19854 These @samp{-m} options are supported on the SPU:
19856 @table @gcctabopt
19857 @item -mwarn-reloc
19858 @itemx -merror-reloc
19859 @opindex mwarn-reloc
19860 @opindex merror-reloc
19862 The loader for SPU does not handle dynamic relocations.  By default, GCC
19863 gives an error when it generates code that requires a dynamic
19864 relocation.  @option{-mno-error-reloc} disables the error,
19865 @option{-mwarn-reloc} generates a warning instead.
19867 @item -msafe-dma
19868 @itemx -munsafe-dma
19869 @opindex msafe-dma
19870 @opindex munsafe-dma
19872 Instructions that initiate or test completion of DMA must not be
19873 reordered with respect to loads and stores of the memory that is being
19874 accessed.
19875 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
19876 memory accesses, but that can lead to inefficient code in places where the
19877 memory is known to not change.  Rather than mark the memory as volatile,
19878 you can use @option{-msafe-dma} to tell the compiler to treat
19879 the DMA instructions as potentially affecting all memory.  
19881 @item -mbranch-hints
19882 @opindex mbranch-hints
19884 By default, GCC generates a branch hint instruction to avoid
19885 pipeline stalls for always-taken or probably-taken branches.  A hint
19886 is not generated closer than 8 instructions away from its branch.
19887 There is little reason to disable them, except for debugging purposes,
19888 or to make an object a little bit smaller.
19890 @item -msmall-mem
19891 @itemx -mlarge-mem
19892 @opindex msmall-mem
19893 @opindex mlarge-mem
19895 By default, GCC generates code assuming that addresses are never larger
19896 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
19897 a full 32-bit address.
19899 @item -mstdmain
19900 @opindex mstdmain
19902 By default, GCC links against startup code that assumes the SPU-style
19903 main function interface (which has an unconventional parameter list).
19904 With @option{-mstdmain}, GCC links your program against startup
19905 code that assumes a C99-style interface to @code{main}, including a
19906 local copy of @code{argv} strings.
19908 @item -mfixed-range=@var{register-range}
19909 @opindex mfixed-range
19910 Generate code treating the given register range as fixed registers.
19911 A fixed register is one that the register allocator cannot use.  This is
19912 useful when compiling kernel code.  A register range is specified as
19913 two registers separated by a dash.  Multiple register ranges can be
19914 specified separated by a comma.
19916 @item -mea32
19917 @itemx -mea64
19918 @opindex mea32
19919 @opindex mea64
19920 Compile code assuming that pointers to the PPU address space accessed
19921 via the @code{__ea} named address space qualifier are either 32 or 64
19922 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
19923 all object code in an executable must be compiled with the same setting.
19925 @item -maddress-space-conversion
19926 @itemx -mno-address-space-conversion
19927 @opindex maddress-space-conversion
19928 @opindex mno-address-space-conversion
19929 Allow/disallow treating the @code{__ea} address space as superset
19930 of the generic address space.  This enables explicit type casts
19931 between @code{__ea} and generic pointer as well as implicit
19932 conversions of generic pointers to @code{__ea} pointers.  The
19933 default is to allow address space pointer conversions.
19935 @item -mcache-size=@var{cache-size}
19936 @opindex mcache-size
19937 This option controls the version of libgcc that the compiler links to an
19938 executable and selects a software-managed cache for accessing variables
19939 in the @code{__ea} address space with a particular cache size.  Possible
19940 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
19941 and @samp{128}.  The default cache size is 64KB.
19943 @item -matomic-updates
19944 @itemx -mno-atomic-updates
19945 @opindex matomic-updates
19946 @opindex mno-atomic-updates
19947 This option controls the version of libgcc that the compiler links to an
19948 executable and selects whether atomic updates to the software-managed
19949 cache of PPU-side variables are used.  If you use atomic updates, changes
19950 to a PPU variable from SPU code using the @code{__ea} named address space
19951 qualifier do not interfere with changes to other PPU variables residing
19952 in the same cache line from PPU code.  If you do not use atomic updates,
19953 such interference may occur; however, writing back cache lines is
19954 more efficient.  The default behavior is to use atomic updates.
19956 @item -mdual-nops
19957 @itemx -mdual-nops=@var{n}
19958 @opindex mdual-nops
19959 By default, GCC inserts nops to increase dual issue when it expects
19960 it to increase performance.  @var{n} can be a value from 0 to 10.  A
19961 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
19962 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
19964 @item -mhint-max-nops=@var{n}
19965 @opindex mhint-max-nops
19966 Maximum number of nops to insert for a branch hint.  A branch hint must
19967 be at least 8 instructions away from the branch it is affecting.  GCC
19968 inserts up to @var{n} nops to enforce this, otherwise it does not
19969 generate the branch hint.
19971 @item -mhint-max-distance=@var{n}
19972 @opindex mhint-max-distance
19973 The encoding of the branch hint instruction limits the hint to be within
19974 256 instructions of the branch it is affecting.  By default, GCC makes
19975 sure it is within 125.
19977 @item -msafe-hints
19978 @opindex msafe-hints
19979 Work around a hardware bug that causes the SPU to stall indefinitely.
19980 By default, GCC inserts the @code{hbrp} instruction to make sure
19981 this stall won't happen.
19983 @end table
19985 @node System V Options
19986 @subsection Options for System V
19988 These additional options are available on System V Release 4 for
19989 compatibility with other compilers on those systems:
19991 @table @gcctabopt
19992 @item -G
19993 @opindex G
19994 Create a shared object.
19995 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
19997 @item -Qy
19998 @opindex Qy
19999 Identify the versions of each tool used by the compiler, in a
20000 @code{.ident} assembler directive in the output.
20002 @item -Qn
20003 @opindex Qn
20004 Refrain from adding @code{.ident} directives to the output file (this is
20005 the default).
20007 @item -YP,@var{dirs}
20008 @opindex YP
20009 Search the directories @var{dirs}, and no others, for libraries
20010 specified with @option{-l}.
20012 @item -Ym,@var{dir}
20013 @opindex Ym
20014 Look in the directory @var{dir} to find the M4 preprocessor.
20015 The assembler uses this option.
20016 @c This is supposed to go with a -Yd for predefined M4 macro files, but
20017 @c the generic assembler that comes with Solaris takes just -Ym.
20018 @end table
20020 @node TILE-Gx Options
20021 @subsection TILE-Gx Options
20022 @cindex TILE-Gx options
20024 These @samp{-m} options are supported on the TILE-Gx:
20026 @table @gcctabopt
20027 @item -mcmodel=small
20028 @opindex mcmodel=small
20029 Generate code for the small model.  The distance for direct calls is
20030 limited to 500M in either direction.  PC-relative addresses are 32
20031 bits.  Absolute addresses support the full address range.
20033 @item -mcmodel=large
20034 @opindex mcmodel=large
20035 Generate code for the large model.  There is no limitation on call
20036 distance, pc-relative addresses, or absolute addresses.
20038 @item -mcpu=@var{name}
20039 @opindex mcpu
20040 Selects the type of CPU to be targeted.  Currently the only supported
20041 type is @samp{tilegx}.
20043 @item -m32
20044 @itemx -m64
20045 @opindex m32
20046 @opindex m64
20047 Generate code for a 32-bit or 64-bit environment.  The 32-bit
20048 environment sets int, long, and pointer to 32 bits.  The 64-bit
20049 environment sets int to 32 bits and long and pointer to 64 bits.
20050 @end table
20052 @node TILEPro Options
20053 @subsection TILEPro Options
20054 @cindex TILEPro options
20056 These @samp{-m} options are supported on the TILEPro:
20058 @table @gcctabopt
20059 @item -mcpu=@var{name}
20060 @opindex mcpu
20061 Selects the type of CPU to be targeted.  Currently the only supported
20062 type is @samp{tilepro}.
20064 @item -m32
20065 @opindex m32
20066 Generate code for a 32-bit environment, which sets int, long, and
20067 pointer to 32 bits.  This is the only supported behavior so the flag
20068 is essentially ignored.
20069 @end table
20071 @node V850 Options
20072 @subsection V850 Options
20073 @cindex V850 Options
20075 These @samp{-m} options are defined for V850 implementations:
20077 @table @gcctabopt
20078 @item -mlong-calls
20079 @itemx -mno-long-calls
20080 @opindex mlong-calls
20081 @opindex mno-long-calls
20082 Treat all calls as being far away (near).  If calls are assumed to be
20083 far away, the compiler always loads the function's address into a
20084 register, and calls indirect through the pointer.
20086 @item -mno-ep
20087 @itemx -mep
20088 @opindex mno-ep
20089 @opindex mep
20090 Do not optimize (do optimize) basic blocks that use the same index
20091 pointer 4 or more times to copy pointer into the @code{ep} register, and
20092 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
20093 option is on by default if you optimize.
20095 @item -mno-prolog-function
20096 @itemx -mprolog-function
20097 @opindex mno-prolog-function
20098 @opindex mprolog-function
20099 Do not use (do use) external functions to save and restore registers
20100 at the prologue and epilogue of a function.  The external functions
20101 are slower, but use less code space if more than one function saves
20102 the same number of registers.  The @option{-mprolog-function} option
20103 is on by default if you optimize.
20105 @item -mspace
20106 @opindex mspace
20107 Try to make the code as small as possible.  At present, this just turns
20108 on the @option{-mep} and @option{-mprolog-function} options.
20110 @item -mtda=@var{n}
20111 @opindex mtda
20112 Put static or global variables whose size is @var{n} bytes or less into
20113 the tiny data area that register @code{ep} points to.  The tiny data
20114 area can hold up to 256 bytes in total (128 bytes for byte references).
20116 @item -msda=@var{n}
20117 @opindex msda
20118 Put static or global variables whose size is @var{n} bytes or less into
20119 the small data area that register @code{gp} points to.  The small data
20120 area can hold up to 64 kilobytes.
20122 @item -mzda=@var{n}
20123 @opindex mzda
20124 Put static or global variables whose size is @var{n} bytes or less into
20125 the first 32 kilobytes of memory.
20127 @item -mv850
20128 @opindex mv850
20129 Specify that the target processor is the V850.
20131 @item -mv850e3v5
20132 @opindex mv850e3v5
20133 Specify that the target processor is the V850E3V5.  The preprocessor
20134 constant @samp{__v850e3v5__} is defined if this option is used.
20136 @item -mv850e2v4
20137 @opindex mv850e2v4
20138 Specify that the target processor is the V850E3V5.  This is an alias for
20139 the @option{-mv850e3v5} option.
20141 @item -mv850e2v3
20142 @opindex mv850e2v3
20143 Specify that the target processor is the V850E2V3.  The preprocessor
20144 constant @samp{__v850e2v3__} is defined if this option is used.
20146 @item -mv850e2
20147 @opindex mv850e2
20148 Specify that the target processor is the V850E2.  The preprocessor
20149 constant @samp{__v850e2__} is defined if this option is used.
20151 @item -mv850e1
20152 @opindex mv850e1
20153 Specify that the target processor is the V850E1.  The preprocessor
20154 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
20155 this option is used.
20157 @item -mv850es
20158 @opindex mv850es
20159 Specify that the target processor is the V850ES.  This is an alias for
20160 the @option{-mv850e1} option.
20162 @item -mv850e
20163 @opindex mv850e
20164 Specify that the target processor is the V850E@.  The preprocessor
20165 constant @samp{__v850e__} is defined if this option is used.
20167 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
20168 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
20169 are defined then a default target processor is chosen and the
20170 relevant @samp{__v850*__} preprocessor constant is defined.
20172 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
20173 defined, regardless of which processor variant is the target.
20175 @item -mdisable-callt
20176 @itemx -mno-disable-callt
20177 @opindex mdisable-callt
20178 @opindex mno-disable-callt
20179 This option suppresses generation of the @code{CALLT} instruction for the
20180 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
20181 architecture.
20183 This option is enabled by default when the RH850 ABI is
20184 in use (see @option{-mrh850-abi}), and disabled by default when the
20185 GCC ABI is in use.  If @code{CALLT} instructions are being generated
20186 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
20188 @item -mrelax
20189 @itemx -mno-relax
20190 @opindex mrelax
20191 @opindex mno-relax
20192 Pass on (or do not pass on) the @option{-mrelax} command line option
20193 to the assembler.
20195 @item -mlong-jumps
20196 @itemx -mno-long-jumps
20197 @opindex mlong-jumps
20198 @opindex mno-long-jumps
20199 Disable (or re-enable) the generation of PC-relative jump instructions.
20201 @item -msoft-float
20202 @itemx -mhard-float
20203 @opindex msoft-float
20204 @opindex mhard-float
20205 Disable (or re-enable) the generation of hardware floating point
20206 instructions.  This option is only significant when the target
20207 architecture is @samp{V850E2V3} or higher.  If hardware floating point
20208 instructions are being generated then the C preprocessor symbol
20209 @code{__FPU_OK__} will be defined, otherwise the symbol
20210 @code{__NO_FPU__} will be defined.
20212 @item -mloop
20213 @opindex mloop
20214 Enables the use of the e3v5 LOOP instruction.  The use of this
20215 instruction is not enabled by default when the e3v5 architecture is
20216 selected because its use is still experimental.
20218 @item -mrh850-abi
20219 @itemx -mghs
20220 @opindex mrh850-abi
20221 @opindex mghs
20222 Enables support for the RH850 version of the V850 ABI.  This is the
20223 default.  With this version of the ABI the following rules apply:
20225 @itemize
20226 @item
20227 Integer sized structures and unions are returned via a memory pointer
20228 rather than a register.
20230 @item
20231 Large structures and unions (more than 8 bytes in size) are passed by
20232 value.
20234 @item
20235 Functions are aligned to 16-bit boundaries.
20237 @item
20238 The @option{-m8byte-align} command line option is supported.
20240 @item
20241 The @option{-mdisable-callt} command line option is enabled by
20242 default.  The @option{-mno-disable-callt} command line option is not
20243 supported.
20244 @end itemize
20246 When this version of the ABI is enabled the C preprocessor symbol
20247 @code{__V850_RH850_ABI__} is defined.
20249 @item -mgcc-abi
20250 @opindex mgcc-abi
20251 Enables support for the old GCC version of the V850 ABI.  With this
20252 version of the ABI the following rules apply:
20254 @itemize
20255 @item
20256 Integer sized structures and unions are returned in register @code{r10}.
20258 @item
20259 Large structures and unions (more than 8 bytes in size) are passed by
20260 reference.
20262 @item
20263 Functions are aligned to 32-bit boundaries, unless optimizing for
20264 size.
20266 @item
20267 The @option{-m8byte-align} command line option is not supported.
20269 @item
20270 The @option{-mdisable-callt} command line option is supported but not
20271 enabled by default.
20272 @end itemize
20274 When this version of the ABI is enabled the C preprocessor symbol
20275 @code{__V850_GCC_ABI__} is defined.
20277 @item -m8byte-align
20278 @itemx -mno-8byte-align
20279 @opindex m8byte-align
20280 @opindex mno-8byte-align
20281 Enables support for @code{doubles} and @code{long long} types to be
20282 aligned on 8-byte boundaries.  The default is to restrict the
20283 alignment of all objects to at most 4-bytes.  When
20284 @option{-m8byte-align} is in effect the C preprocessor symbol
20285 @code{__V850_8BYTE_ALIGN__} will be defined.
20287 @item -mbig-switch
20288 @opindex mbig-switch
20289 Generate code suitable for big switch tables.  Use this option only if
20290 the assembler/linker complain about out of range branches within a switch
20291 table.
20293 @item -mapp-regs
20294 @opindex mapp-regs
20295 This option causes r2 and r5 to be used in the code generated by
20296 the compiler.  This setting is the default.
20298 @item -mno-app-regs
20299 @opindex mno-app-regs
20300 This option causes r2 and r5 to be treated as fixed registers.
20302 @end table
20304 @node VAX Options
20305 @subsection VAX Options
20306 @cindex VAX options
20308 These @samp{-m} options are defined for the VAX:
20310 @table @gcctabopt
20311 @item -munix
20312 @opindex munix
20313 Do not output certain jump instructions (@code{aobleq} and so on)
20314 that the Unix assembler for the VAX cannot handle across long
20315 ranges.
20317 @item -mgnu
20318 @opindex mgnu
20319 Do output those jump instructions, on the assumption that the
20320 GNU assembler is being used.
20322 @item -mg
20323 @opindex mg
20324 Output code for G-format floating-point numbers instead of D-format.
20325 @end table
20327 @node VMS Options
20328 @subsection VMS Options
20330 These @samp{-m} options are defined for the VMS implementations:
20332 @table @gcctabopt
20333 @item -mvms-return-codes
20334 @opindex mvms-return-codes
20335 Return VMS condition codes from @code{main}. The default is to return POSIX-style
20336 condition (e.g.@ error) codes.
20338 @item -mdebug-main=@var{prefix}
20339 @opindex mdebug-main=@var{prefix}
20340 Flag the first routine whose name starts with @var{prefix} as the main
20341 routine for the debugger.
20343 @item -mmalloc64
20344 @opindex mmalloc64
20345 Default to 64-bit memory allocation routines.
20347 @item -mpointer-size=@var{size}
20348 @opindex -mpointer-size=@var{size}
20349 Set the default size of pointers. Possible options for @var{size} are
20350 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
20351 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
20352 The later option disables @code{pragma pointer_size}.
20353 @end table
20355 @node VxWorks Options
20356 @subsection VxWorks Options
20357 @cindex VxWorks Options
20359 The options in this section are defined for all VxWorks targets.
20360 Options specific to the target hardware are listed with the other
20361 options for that target.
20363 @table @gcctabopt
20364 @item -mrtp
20365 @opindex mrtp
20366 GCC can generate code for both VxWorks kernels and real time processes
20367 (RTPs).  This option switches from the former to the latter.  It also
20368 defines the preprocessor macro @code{__RTP__}.
20370 @item -non-static
20371 @opindex non-static
20372 Link an RTP executable against shared libraries rather than static
20373 libraries.  The options @option{-static} and @option{-shared} can
20374 also be used for RTPs (@pxref{Link Options}); @option{-static}
20375 is the default.
20377 @item -Bstatic
20378 @itemx -Bdynamic
20379 @opindex Bstatic
20380 @opindex Bdynamic
20381 These options are passed down to the linker.  They are defined for
20382 compatibility with Diab.
20384 @item -Xbind-lazy
20385 @opindex Xbind-lazy
20386 Enable lazy binding of function calls.  This option is equivalent to
20387 @option{-Wl,-z,now} and is defined for compatibility with Diab.
20389 @item -Xbind-now
20390 @opindex Xbind-now
20391 Disable lazy binding of function calls.  This option is the default and
20392 is defined for compatibility with Diab.
20393 @end table
20395 @node x86-64 Options
20396 @subsection x86-64 Options
20397 @cindex x86-64 options
20399 These are listed under @xref{i386 and x86-64 Options}.
20401 @node Xstormy16 Options
20402 @subsection Xstormy16 Options
20403 @cindex Xstormy16 Options
20405 These options are defined for Xstormy16:
20407 @table @gcctabopt
20408 @item -msim
20409 @opindex msim
20410 Choose startup files and linker script suitable for the simulator.
20411 @end table
20413 @node Xtensa Options
20414 @subsection Xtensa Options
20415 @cindex Xtensa Options
20417 These options are supported for Xtensa targets:
20419 @table @gcctabopt
20420 @item -mconst16
20421 @itemx -mno-const16
20422 @opindex mconst16
20423 @opindex mno-const16
20424 Enable or disable use of @code{CONST16} instructions for loading
20425 constant values.  The @code{CONST16} instruction is currently not a
20426 standard option from Tensilica.  When enabled, @code{CONST16}
20427 instructions are always used in place of the standard @code{L32R}
20428 instructions.  The use of @code{CONST16} is enabled by default only if
20429 the @code{L32R} instruction is not available.
20431 @item -mfused-madd
20432 @itemx -mno-fused-madd
20433 @opindex mfused-madd
20434 @opindex mno-fused-madd
20435 Enable or disable use of fused multiply/add and multiply/subtract
20436 instructions in the floating-point option.  This has no effect if the
20437 floating-point option is not also enabled.  Disabling fused multiply/add
20438 and multiply/subtract instructions forces the compiler to use separate
20439 instructions for the multiply and add/subtract operations.  This may be
20440 desirable in some cases where strict IEEE 754-compliant results are
20441 required: the fused multiply add/subtract instructions do not round the
20442 intermediate result, thereby producing results with @emph{more} bits of
20443 precision than specified by the IEEE standard.  Disabling fused multiply
20444 add/subtract instructions also ensures that the program output is not
20445 sensitive to the compiler's ability to combine multiply and add/subtract
20446 operations.
20448 @item -mserialize-volatile
20449 @itemx -mno-serialize-volatile
20450 @opindex mserialize-volatile
20451 @opindex mno-serialize-volatile
20452 When this option is enabled, GCC inserts @code{MEMW} instructions before
20453 @code{volatile} memory references to guarantee sequential consistency.
20454 The default is @option{-mserialize-volatile}.  Use
20455 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
20457 @item -mforce-no-pic
20458 @opindex mforce-no-pic
20459 For targets, like GNU/Linux, where all user-mode Xtensa code must be
20460 position-independent code (PIC), this option disables PIC for compiling
20461 kernel code.
20463 @item -mtext-section-literals
20464 @itemx -mno-text-section-literals
20465 @opindex mtext-section-literals
20466 @opindex mno-text-section-literals
20467 Control the treatment of literal pools.  The default is
20468 @option{-mno-text-section-literals}, which places literals in a separate
20469 section in the output file.  This allows the literal pool to be placed
20470 in a data RAM/ROM, and it also allows the linker to combine literal
20471 pools from separate object files to remove redundant literals and
20472 improve code size.  With @option{-mtext-section-literals}, the literals
20473 are interspersed in the text section in order to keep them as close as
20474 possible to their references.  This may be necessary for large assembly
20475 files.
20477 @item -mtarget-align
20478 @itemx -mno-target-align
20479 @opindex mtarget-align
20480 @opindex mno-target-align
20481 When this option is enabled, GCC instructs the assembler to
20482 automatically align instructions to reduce branch penalties at the
20483 expense of some code density.  The assembler attempts to widen density
20484 instructions to align branch targets and the instructions following call
20485 instructions.  If there are not enough preceding safe density
20486 instructions to align a target, no widening is performed.  The
20487 default is @option{-mtarget-align}.  These options do not affect the
20488 treatment of auto-aligned instructions like @code{LOOP}, which the
20489 assembler always aligns, either by widening density instructions or
20490 by inserting NOP instructions.
20492 @item -mlongcalls
20493 @itemx -mno-longcalls
20494 @opindex mlongcalls
20495 @opindex mno-longcalls
20496 When this option is enabled, GCC instructs the assembler to translate
20497 direct calls to indirect calls unless it can determine that the target
20498 of a direct call is in the range allowed by the call instruction.  This
20499 translation typically occurs for calls to functions in other source
20500 files.  Specifically, the assembler translates a direct @code{CALL}
20501 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
20502 The default is @option{-mno-longcalls}.  This option should be used in
20503 programs where the call target can potentially be out of range.  This
20504 option is implemented in the assembler, not the compiler, so the
20505 assembly code generated by GCC still shows direct call
20506 instructions---look at the disassembled object code to see the actual
20507 instructions.  Note that the assembler uses an indirect call for
20508 every cross-file call, not just those that really are out of range.
20509 @end table
20511 @node zSeries Options
20512 @subsection zSeries Options
20513 @cindex zSeries options
20515 These are listed under @xref{S/390 and zSeries Options}.
20517 @node Code Gen Options
20518 @section Options for Code Generation Conventions
20519 @cindex code generation conventions
20520 @cindex options, code generation
20521 @cindex run-time options
20523 These machine-independent options control the interface conventions
20524 used in code generation.
20526 Most of them have both positive and negative forms; the negative form
20527 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
20528 one of the forms is listed---the one that is not the default.  You
20529 can figure out the other form by either removing @samp{no-} or adding
20532 @table @gcctabopt
20533 @item -fbounds-check
20534 @opindex fbounds-check
20535 For front ends that support it, generate additional code to check that
20536 indices used to access arrays are within the declared range.  This is
20537 currently only supported by the Java and Fortran front ends, where
20538 this option defaults to true and false respectively.
20540 @item -fstack-reuse=@var{reuse-level}
20541 @opindex fstack_reuse
20542 This option controls stack space reuse for user declared local/auto variables
20543 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
20544 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
20545 local variables and temporaries, @samp{named_vars} enables the reuse only for
20546 user defined local variables with names, and @samp{none} disables stack reuse
20547 completely. The default value is @samp{all}. The option is needed when the
20548 program extends the lifetime of a scoped local variable or a compiler generated
20549 temporary beyond the end point defined by the language.  When a lifetime of
20550 a variable ends, and if the variable lives in memory, the optimizing compiler
20551 has the freedom to reuse its stack space with other temporaries or scoped
20552 local variables whose live range does not overlap with it. Legacy code extending
20553 local lifetime will likely to break with the stack reuse optimization.
20555 For example,
20557 @smallexample
20558    int *p;
20559    @{
20560      int local1;
20562      p = &local1;
20563      local1 = 10;
20564      ....
20565    @}
20566    @{
20567       int local2;
20568       local2 = 20;
20569       ...
20570    @}
20572    if (*p == 10)  // out of scope use of local1
20573      @{
20575      @}
20576 @end smallexample
20578 Another example:
20579 @smallexample
20581    struct A
20582    @{
20583        A(int k) : i(k), j(k) @{ @}
20584        int i;
20585        int j;
20586    @};
20588    A *ap;
20590    void foo(const A& ar)
20591    @{
20592       ap = &ar;
20593    @}
20595    void bar()
20596    @{
20597       foo(A(10)); // temp object's lifetime ends when foo returns
20599       @{
20600         A a(20);
20601         ....
20602       @}
20603       ap->i+= 10;  // ap references out of scope temp whose space
20604                    // is reused with a. What is the value of ap->i?
20605    @}
20607 @end smallexample
20609 The lifetime of a compiler generated temporary is well defined by the C++
20610 standard. When a lifetime of a temporary ends, and if the temporary lives
20611 in memory, the optimizing compiler has the freedom to reuse its stack
20612 space with other temporaries or scoped local variables whose live range
20613 does not overlap with it. However some of the legacy code relies on
20614 the behavior of older compilers in which temporaries' stack space is
20615 not reused, the aggressive stack reuse can lead to runtime errors. This
20616 option is used to control the temporary stack reuse optimization.
20618 @item -ftrapv
20619 @opindex ftrapv
20620 This option generates traps for signed overflow on addition, subtraction,
20621 multiplication operations.
20623 @item -fwrapv
20624 @opindex fwrapv
20625 This option instructs the compiler to assume that signed arithmetic
20626 overflow of addition, subtraction and multiplication wraps around
20627 using twos-complement representation.  This flag enables some optimizations
20628 and disables others.  This option is enabled by default for the Java
20629 front end, as required by the Java language specification.
20631 @item -fexceptions
20632 @opindex fexceptions
20633 Enable exception handling.  Generates extra code needed to propagate
20634 exceptions.  For some targets, this implies GCC generates frame
20635 unwind information for all functions, which can produce significant data
20636 size overhead, although it does not affect execution.  If you do not
20637 specify this option, GCC enables it by default for languages like
20638 C++ that normally require exception handling, and disables it for
20639 languages like C that do not normally require it.  However, you may need
20640 to enable this option when compiling C code that needs to interoperate
20641 properly with exception handlers written in C++.  You may also wish to
20642 disable this option if you are compiling older C++ programs that don't
20643 use exception handling.
20645 @item -fnon-call-exceptions
20646 @opindex fnon-call-exceptions
20647 Generate code that allows trapping instructions to throw exceptions.
20648 Note that this requires platform-specific runtime support that does
20649 not exist everywhere.  Moreover, it only allows @emph{trapping}
20650 instructions to throw exceptions, i.e.@: memory references or floating-point
20651 instructions.  It does not allow exceptions to be thrown from
20652 arbitrary signal handlers such as @code{SIGALRM}.
20654 @item -fdelete-dead-exceptions
20655 @opindex fdelete-dead-exceptions
20656 Consider that instructions that may throw exceptions but don't otherwise
20657 contribute to the execution of the program can be optimized away.
20658 This option is enabled by default for the Ada front end, as permitted by
20659 the Ada language specification.
20660 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
20662 @item -funwind-tables
20663 @opindex funwind-tables
20664 Similar to @option{-fexceptions}, except that it just generates any needed
20665 static data, but does not affect the generated code in any other way.
20666 You normally do not need to enable this option; instead, a language processor
20667 that needs this handling enables it on your behalf.
20669 @item -fasynchronous-unwind-tables
20670 @opindex fasynchronous-unwind-tables
20671 Generate unwind table in DWARF 2 format, if supported by target machine.  The
20672 table is exact at each instruction boundary, so it can be used for stack
20673 unwinding from asynchronous events (such as debugger or garbage collector).
20675 @item -fpcc-struct-return
20676 @opindex fpcc-struct-return
20677 Return ``short'' @code{struct} and @code{union} values in memory like
20678 longer ones, rather than in registers.  This convention is less
20679 efficient, but it has the advantage of allowing intercallability between
20680 GCC-compiled files and files compiled with other compilers, particularly
20681 the Portable C Compiler (pcc).
20683 The precise convention for returning structures in memory depends
20684 on the target configuration macros.
20686 Short structures and unions are those whose size and alignment match
20687 that of some integer type.
20689 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
20690 switch is not binary compatible with code compiled with the
20691 @option{-freg-struct-return} switch.
20692 Use it to conform to a non-default application binary interface.
20694 @item -freg-struct-return
20695 @opindex freg-struct-return
20696 Return @code{struct} and @code{union} values in registers when possible.
20697 This is more efficient for small structures than
20698 @option{-fpcc-struct-return}.
20700 If you specify neither @option{-fpcc-struct-return} nor
20701 @option{-freg-struct-return}, GCC defaults to whichever convention is
20702 standard for the target.  If there is no standard convention, GCC
20703 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
20704 the principal compiler.  In those cases, we can choose the standard, and
20705 we chose the more efficient register return alternative.
20707 @strong{Warning:} code compiled with the @option{-freg-struct-return}
20708 switch is not binary compatible with code compiled with the
20709 @option{-fpcc-struct-return} switch.
20710 Use it to conform to a non-default application binary interface.
20712 @item -fshort-enums
20713 @opindex fshort-enums
20714 Allocate to an @code{enum} type only as many bytes as it needs for the
20715 declared range of possible values.  Specifically, the @code{enum} type
20716 is equivalent to the smallest integer type that has enough room.
20718 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
20719 code that is not binary compatible with code generated without that switch.
20720 Use it to conform to a non-default application binary interface.
20722 @item -fshort-double
20723 @opindex fshort-double
20724 Use the same size for @code{double} as for @code{float}.
20726 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
20727 code that is not binary compatible with code generated without that switch.
20728 Use it to conform to a non-default application binary interface.
20730 @item -fshort-wchar
20731 @opindex fshort-wchar
20732 Override the underlying type for @samp{wchar_t} to be @samp{short
20733 unsigned int} instead of the default for the target.  This option is
20734 useful for building programs to run under WINE@.
20736 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
20737 code that is not binary compatible with code generated without that switch.
20738 Use it to conform to a non-default application binary interface.
20740 @item -fno-common
20741 @opindex fno-common
20742 In C code, controls the placement of uninitialized global variables.
20743 Unix C compilers have traditionally permitted multiple definitions of
20744 such variables in different compilation units by placing the variables
20745 in a common block.
20746 This is the behavior specified by @option{-fcommon}, and is the default
20747 for GCC on most targets.
20748 On the other hand, this behavior is not required by ISO C, and on some
20749 targets may carry a speed or code size penalty on variable references.
20750 The @option{-fno-common} option specifies that the compiler should place
20751 uninitialized global variables in the data section of the object file,
20752 rather than generating them as common blocks.
20753 This has the effect that if the same variable is declared
20754 (without @code{extern}) in two different compilations,
20755 you get a multiple-definition error when you link them.
20756 In this case, you must compile with @option{-fcommon} instead.
20757 Compiling with @option{-fno-common} is useful on targets for which
20758 it provides better performance, or if you wish to verify that the
20759 program will work on other systems that always treat uninitialized
20760 variable declarations this way.
20762 @item -fno-ident
20763 @opindex fno-ident
20764 Ignore the @samp{#ident} directive.
20766 @item -finhibit-size-directive
20767 @opindex finhibit-size-directive
20768 Don't output a @code{.size} assembler directive, or anything else that
20769 would cause trouble if the function is split in the middle, and the
20770 two halves are placed at locations far apart in memory.  This option is
20771 used when compiling @file{crtstuff.c}; you should not need to use it
20772 for anything else.
20774 @item -fverbose-asm
20775 @opindex fverbose-asm
20776 Put extra commentary information in the generated assembly code to
20777 make it more readable.  This option is generally only of use to those
20778 who actually need to read the generated assembly code (perhaps while
20779 debugging the compiler itself).
20781 @option{-fno-verbose-asm}, the default, causes the
20782 extra information to be omitted and is useful when comparing two assembler
20783 files.
20785 @item -frecord-gcc-switches
20786 @opindex frecord-gcc-switches
20787 This switch causes the command line used to invoke the
20788 compiler to be recorded into the object file that is being created.
20789 This switch is only implemented on some targets and the exact format
20790 of the recording is target and binary file format dependent, but it
20791 usually takes the form of a section containing ASCII text.  This
20792 switch is related to the @option{-fverbose-asm} switch, but that
20793 switch only records information in the assembler output file as
20794 comments, so it never reaches the object file.
20795 See also @option{-grecord-gcc-switches} for another
20796 way of storing compiler options into the object file.
20798 @item -fpic
20799 @opindex fpic
20800 @cindex global offset table
20801 @cindex PIC
20802 Generate position-independent code (PIC) suitable for use in a shared
20803 library, if supported for the target machine.  Such code accesses all
20804 constant addresses through a global offset table (GOT)@.  The dynamic
20805 loader resolves the GOT entries when the program starts (the dynamic
20806 loader is not part of GCC; it is part of the operating system).  If
20807 the GOT size for the linked executable exceeds a machine-specific
20808 maximum size, you get an error message from the linker indicating that
20809 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
20810 instead.  (These maximums are 8k on the SPARC and 32k
20811 on the m68k and RS/6000.  The 386 has no such limit.)
20813 Position-independent code requires special support, and therefore works
20814 only on certain machines.  For the 386, GCC supports PIC for System V
20815 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
20816 position-independent.
20818 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20819 are defined to 1.
20821 @item -fPIC
20822 @opindex fPIC
20823 If supported for the target machine, emit position-independent code,
20824 suitable for dynamic linking and avoiding any limit on the size of the
20825 global offset table.  This option makes a difference on the m68k,
20826 PowerPC and SPARC@.
20828 Position-independent code requires special support, and therefore works
20829 only on certain machines.
20831 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20832 are defined to 2.
20834 @item -fpie
20835 @itemx -fPIE
20836 @opindex fpie
20837 @opindex fPIE
20838 These options are similar to @option{-fpic} and @option{-fPIC}, but
20839 generated position independent code can be only linked into executables.
20840 Usually these options are used when @option{-pie} GCC option is
20841 used during linking.
20843 @option{-fpie} and @option{-fPIE} both define the macros
20844 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
20845 for @option{-fpie} and 2 for @option{-fPIE}.
20847 @item -fno-jump-tables
20848 @opindex fno-jump-tables
20849 Do not use jump tables for switch statements even where it would be
20850 more efficient than other code generation strategies.  This option is
20851 of use in conjunction with @option{-fpic} or @option{-fPIC} for
20852 building code that forms part of a dynamic linker and cannot
20853 reference the address of a jump table.  On some targets, jump tables
20854 do not require a GOT and this option is not needed.
20856 @item -ffixed-@var{reg}
20857 @opindex ffixed
20858 Treat the register named @var{reg} as a fixed register; generated code
20859 should never refer to it (except perhaps as a stack pointer, frame
20860 pointer or in some other fixed role).
20862 @var{reg} must be the name of a register.  The register names accepted
20863 are machine-specific and are defined in the @code{REGISTER_NAMES}
20864 macro in the machine description macro file.
20866 This flag does not have a negative form, because it specifies a
20867 three-way choice.
20869 @item -fcall-used-@var{reg}
20870 @opindex fcall-used
20871 Treat the register named @var{reg} as an allocable register that is
20872 clobbered by function calls.  It may be allocated for temporaries or
20873 variables that do not live across a call.  Functions compiled this way
20874 do not save and restore the register @var{reg}.
20876 It is an error to use this flag with the frame pointer or stack pointer.
20877 Use of this flag for other registers that have fixed pervasive roles in
20878 the machine's execution model produces disastrous results.
20880 This flag does not have a negative form, because it specifies a
20881 three-way choice.
20883 @item -fcall-saved-@var{reg}
20884 @opindex fcall-saved
20885 Treat the register named @var{reg} as an allocable register saved by
20886 functions.  It may be allocated even for temporaries or variables that
20887 live across a call.  Functions compiled this way save and restore
20888 the register @var{reg} if they use it.
20890 It is an error to use this flag with the frame pointer or stack pointer.
20891 Use of this flag for other registers that have fixed pervasive roles in
20892 the machine's execution model produces disastrous results.
20894 A different sort of disaster results from the use of this flag for
20895 a register in which function values may be returned.
20897 This flag does not have a negative form, because it specifies a
20898 three-way choice.
20900 @item -fpack-struct[=@var{n}]
20901 @opindex fpack-struct
20902 Without a value specified, pack all structure members together without
20903 holes.  When a value is specified (which must be a small power of two), pack
20904 structure members according to this value, representing the maximum
20905 alignment (that is, objects with default alignment requirements larger than
20906 this are output potentially unaligned at the next fitting location.
20908 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
20909 code that is not binary compatible with code generated without that switch.
20910 Additionally, it makes the code suboptimal.
20911 Use it to conform to a non-default application binary interface.
20913 @item -finstrument-functions
20914 @opindex finstrument-functions
20915 Generate instrumentation calls for entry and exit to functions.  Just
20916 after function entry and just before function exit, the following
20917 profiling functions are called with the address of the current
20918 function and its call site.  (On some platforms,
20919 @code{__builtin_return_address} does not work beyond the current
20920 function, so the call site information may not be available to the
20921 profiling functions otherwise.)
20923 @smallexample
20924 void __cyg_profile_func_enter (void *this_fn,
20925                                void *call_site);
20926 void __cyg_profile_func_exit  (void *this_fn,
20927                                void *call_site);
20928 @end smallexample
20930 The first argument is the address of the start of the current function,
20931 which may be looked up exactly in the symbol table.
20933 This instrumentation is also done for functions expanded inline in other
20934 functions.  The profiling calls indicate where, conceptually, the
20935 inline function is entered and exited.  This means that addressable
20936 versions of such functions must be available.  If all your uses of a
20937 function are expanded inline, this may mean an additional expansion of
20938 code size.  If you use @samp{extern inline} in your C code, an
20939 addressable version of such functions must be provided.  (This is
20940 normally the case anyway, but if you get lucky and the optimizer always
20941 expands the functions inline, you might have gotten away without
20942 providing static copies.)
20944 A function may be given the attribute @code{no_instrument_function}, in
20945 which case this instrumentation is not done.  This can be used, for
20946 example, for the profiling functions listed above, high-priority
20947 interrupt routines, and any functions from which the profiling functions
20948 cannot safely be called (perhaps signal handlers, if the profiling
20949 routines generate output or allocate memory).
20951 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
20952 @opindex finstrument-functions-exclude-file-list
20954 Set the list of functions that are excluded from instrumentation (see
20955 the description of @code{-finstrument-functions}).  If the file that
20956 contains a function definition matches with one of @var{file}, then
20957 that function is not instrumented.  The match is done on substrings:
20958 if the @var{file} parameter is a substring of the file name, it is
20959 considered to be a match.
20961 For example:
20963 @smallexample
20964 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
20965 @end smallexample
20967 @noindent
20968 excludes any inline function defined in files whose pathnames
20969 contain @code{/bits/stl} or @code{include/sys}.
20971 If, for some reason, you want to include letter @code{','} in one of
20972 @var{sym}, write @code{'\,'}. For example,
20973 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
20974 (note the single quote surrounding the option).
20976 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
20977 @opindex finstrument-functions-exclude-function-list
20979 This is similar to @code{-finstrument-functions-exclude-file-list},
20980 but this option sets the list of function names to be excluded from
20981 instrumentation.  The function name to be matched is its user-visible
20982 name, such as @code{vector<int> blah(const vector<int> &)}, not the
20983 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
20984 match is done on substrings: if the @var{sym} parameter is a substring
20985 of the function name, it is considered to be a match.  For C99 and C++
20986 extended identifiers, the function name must be given in UTF-8, not
20987 using universal character names.
20989 @item -fstack-check
20990 @opindex fstack-check
20991 Generate code to verify that you do not go beyond the boundary of the
20992 stack.  You should specify this flag if you are running in an
20993 environment with multiple threads, but you only rarely need to specify it in
20994 a single-threaded environment since stack overflow is automatically
20995 detected on nearly all systems if there is only one stack.
20997 Note that this switch does not actually cause checking to be done; the
20998 operating system or the language runtime must do that.  The switch causes
20999 generation of code to ensure that they see the stack being extended.
21001 You can additionally specify a string parameter: @code{no} means no
21002 checking, @code{generic} means force the use of old-style checking,
21003 @code{specific} means use the best checking method and is equivalent
21004 to bare @option{-fstack-check}.
21006 Old-style checking is a generic mechanism that requires no specific
21007 target support in the compiler but comes with the following drawbacks:
21009 @enumerate
21010 @item
21011 Modified allocation strategy for large objects: they are always
21012 allocated dynamically if their size exceeds a fixed threshold.
21014 @item
21015 Fixed limit on the size of the static frame of functions: when it is
21016 topped by a particular function, stack checking is not reliable and
21017 a warning is issued by the compiler.
21019 @item
21020 Inefficiency: because of both the modified allocation strategy and the
21021 generic implementation, code performance is hampered.
21022 @end enumerate
21024 Note that old-style stack checking is also the fallback method for
21025 @code{specific} if no target support has been added in the compiler.
21027 @item -fstack-limit-register=@var{reg}
21028 @itemx -fstack-limit-symbol=@var{sym}
21029 @itemx -fno-stack-limit
21030 @opindex fstack-limit-register
21031 @opindex fstack-limit-symbol
21032 @opindex fno-stack-limit
21033 Generate code to ensure that the stack does not grow beyond a certain value,
21034 either the value of a register or the address of a symbol.  If a larger
21035 stack is required, a signal is raised at run time.  For most targets,
21036 the signal is raised before the stack overruns the boundary, so
21037 it is possible to catch the signal without taking special precautions.
21039 For instance, if the stack starts at absolute address @samp{0x80000000}
21040 and grows downwards, you can use the flags
21041 @option{-fstack-limit-symbol=__stack_limit} and
21042 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
21043 of 128KB@.  Note that this may only work with the GNU linker.
21045 @item -fsplit-stack
21046 @opindex fsplit-stack
21047 Generate code to automatically split the stack before it overflows.
21048 The resulting program has a discontiguous stack which can only
21049 overflow if the program is unable to allocate any more memory.  This
21050 is most useful when running threaded programs, as it is no longer
21051 necessary to calculate a good stack size to use for each thread.  This
21052 is currently only implemented for the i386 and x86_64 back ends running
21053 GNU/Linux.
21055 When code compiled with @option{-fsplit-stack} calls code compiled
21056 without @option{-fsplit-stack}, there may not be much stack space
21057 available for the latter code to run.  If compiling all code,
21058 including library code, with @option{-fsplit-stack} is not an option,
21059 then the linker can fix up these calls so that the code compiled
21060 without @option{-fsplit-stack} always has a large stack.  Support for
21061 this is implemented in the gold linker in GNU binutils release 2.21
21062 and later.
21064 @item -fleading-underscore
21065 @opindex fleading-underscore
21066 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
21067 change the way C symbols are represented in the object file.  One use
21068 is to help link with legacy assembly code.
21070 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
21071 generate code that is not binary compatible with code generated without that
21072 switch.  Use it to conform to a non-default application binary interface.
21073 Not all targets provide complete support for this switch.
21075 @item -ftls-model=@var{model}
21076 @opindex ftls-model
21077 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
21078 The @var{model} argument should be one of @code{global-dynamic},
21079 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
21080 Note that the choice is subject to optimization: the compiler may use
21081 a more efficient model for symbols not visible outside of the translation
21082 unit, or if @option{-fpic} is not given on the command line.
21084 The default without @option{-fpic} is @code{initial-exec}; with
21085 @option{-fpic} the default is @code{global-dynamic}.
21087 @item -fvisibility=@var{default|internal|hidden|protected}
21088 @opindex fvisibility
21089 Set the default ELF image symbol visibility to the specified option---all
21090 symbols are marked with this unless overridden within the code.
21091 Using this feature can very substantially improve linking and
21092 load times of shared object libraries, produce more optimized
21093 code, provide near-perfect API export and prevent symbol clashes.
21094 It is @strong{strongly} recommended that you use this in any shared objects
21095 you distribute.
21097 Despite the nomenclature, @code{default} always means public; i.e.,
21098 available to be linked against from outside the shared object.
21099 @code{protected} and @code{internal} are pretty useless in real-world
21100 usage so the only other commonly used option is @code{hidden}.
21101 The default if @option{-fvisibility} isn't specified is
21102 @code{default}, i.e., make every
21103 symbol public---this causes the same behavior as previous versions of
21104 GCC@.
21106 A good explanation of the benefits offered by ensuring ELF
21107 symbols have the correct visibility is given by ``How To Write
21108 Shared Libraries'' by Ulrich Drepper (which can be found at
21109 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
21110 solution made possible by this option to marking things hidden when
21111 the default is public is to make the default hidden and mark things
21112 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
21113 and @code{__attribute__ ((visibility("default")))} instead of
21114 @code{__declspec(dllexport)} you get almost identical semantics with
21115 identical syntax.  This is a great boon to those working with
21116 cross-platform projects.
21118 For those adding visibility support to existing code, you may find
21119 @samp{#pragma GCC visibility} of use.  This works by you enclosing
21120 the declarations you wish to set visibility for with (for example)
21121 @samp{#pragma GCC visibility push(hidden)} and
21122 @samp{#pragma GCC visibility pop}.
21123 Bear in mind that symbol visibility should be viewed @strong{as
21124 part of the API interface contract} and thus all new code should
21125 always specify visibility when it is not the default; i.e., declarations
21126 only for use within the local DSO should @strong{always} be marked explicitly
21127 as hidden as so to avoid PLT indirection overheads---making this
21128 abundantly clear also aids readability and self-documentation of the code.
21129 Note that due to ISO C++ specification requirements, @code{operator new} and
21130 @code{operator delete} must always be of default visibility.
21132 Be aware that headers from outside your project, in particular system
21133 headers and headers from any other library you use, may not be
21134 expecting to be compiled with visibility other than the default.  You
21135 may need to explicitly say @samp{#pragma GCC visibility push(default)}
21136 before including any such headers.
21138 @samp{extern} declarations are not affected by @option{-fvisibility}, so
21139 a lot of code can be recompiled with @option{-fvisibility=hidden} with
21140 no modifications.  However, this means that calls to @code{extern}
21141 functions with no explicit visibility use the PLT, so it is more
21142 effective to use @code{__attribute ((visibility))} and/or
21143 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
21144 declarations should be treated as hidden.
21146 Note that @option{-fvisibility} does affect C++ vague linkage
21147 entities. This means that, for instance, an exception class that is
21148 be thrown between DSOs must be explicitly marked with default
21149 visibility so that the @samp{type_info} nodes are unified between
21150 the DSOs.
21152 An overview of these techniques, their benefits and how to use them
21153 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
21155 @item -fstrict-volatile-bitfields
21156 @opindex fstrict-volatile-bitfields
21157 This option should be used if accesses to volatile bit-fields (or other
21158 structure fields, although the compiler usually honors those types
21159 anyway) should use a single access of the width of the
21160 field's type, aligned to a natural alignment if possible.  For
21161 example, targets with memory-mapped peripheral registers might require
21162 all such accesses to be 16 bits wide; with this flag you can
21163 declare all peripheral bit-fields as @code{unsigned short} (assuming short
21164 is 16 bits on these targets) to force GCC to use 16-bit accesses
21165 instead of, perhaps, a more efficient 32-bit access.
21167 If this option is disabled, the compiler uses the most efficient
21168 instruction.  In the previous example, that might be a 32-bit load
21169 instruction, even though that accesses bytes that do not contain
21170 any portion of the bit-field, or memory-mapped registers unrelated to
21171 the one being updated.
21173 If the target requires strict alignment, and honoring the field
21174 type would require violating this alignment, a warning is issued.
21175 If the field has @code{packed} attribute, the access is done without
21176 honoring the field type.  If the field doesn't have @code{packed}
21177 attribute, the access is done honoring the field type.  In both cases,
21178 GCC assumes that the user knows something about the target hardware
21179 that it is unaware of.
21181 The default value of this option is determined by the application binary
21182 interface for the target processor.
21184 @item -fsync-libcalls
21185 @opindex fsync-libcalls
21186 This option controls whether any out-of-line instance of the @code{__sync}
21187 family of functions may be used to implement the C++11 @code{__atomic}
21188 family of functions.
21190 The default value of this option is enabled, thus the only useful form
21191 of the option is @option{-fno-sync-libcalls}.  This option is used in
21192 the implementation of the @file{libatomic} runtime library.
21194 @end table
21196 @c man end
21198 @node Environment Variables
21199 @section Environment Variables Affecting GCC
21200 @cindex environment variables
21202 @c man begin ENVIRONMENT
21203 This section describes several environment variables that affect how GCC
21204 operates.  Some of them work by specifying directories or prefixes to use
21205 when searching for various kinds of files.  Some are used to specify other
21206 aspects of the compilation environment.
21208 Note that you can also specify places to search using options such as
21209 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
21210 take precedence over places specified using environment variables, which
21211 in turn take precedence over those specified by the configuration of GCC@.
21212 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
21213 GNU Compiler Collection (GCC) Internals}.
21215 @table @env
21216 @item LANG
21217 @itemx LC_CTYPE
21218 @c @itemx LC_COLLATE
21219 @itemx LC_MESSAGES
21220 @c @itemx LC_MONETARY
21221 @c @itemx LC_NUMERIC
21222 @c @itemx LC_TIME
21223 @itemx LC_ALL
21224 @findex LANG
21225 @findex LC_CTYPE
21226 @c @findex LC_COLLATE
21227 @findex LC_MESSAGES
21228 @c @findex LC_MONETARY
21229 @c @findex LC_NUMERIC
21230 @c @findex LC_TIME
21231 @findex LC_ALL
21232 @cindex locale
21233 These environment variables control the way that GCC uses
21234 localization information which allows GCC to work with different
21235 national conventions.  GCC inspects the locale categories
21236 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
21237 so.  These locale categories can be set to any value supported by your
21238 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
21239 Kingdom encoded in UTF-8.
21241 The @env{LC_CTYPE} environment variable specifies character
21242 classification.  GCC uses it to determine the character boundaries in
21243 a string; this is needed for some multibyte encodings that contain quote
21244 and escape characters that are otherwise interpreted as a string
21245 end or escape.
21247 The @env{LC_MESSAGES} environment variable specifies the language to
21248 use in diagnostic messages.
21250 If the @env{LC_ALL} environment variable is set, it overrides the value
21251 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
21252 and @env{LC_MESSAGES} default to the value of the @env{LANG}
21253 environment variable.  If none of these variables are set, GCC
21254 defaults to traditional C English behavior.
21256 @item TMPDIR
21257 @findex TMPDIR
21258 If @env{TMPDIR} is set, it specifies the directory to use for temporary
21259 files.  GCC uses temporary files to hold the output of one stage of
21260 compilation which is to be used as input to the next stage: for example,
21261 the output of the preprocessor, which is the input to the compiler
21262 proper.
21264 @item GCC_COMPARE_DEBUG
21265 @findex GCC_COMPARE_DEBUG
21266 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
21267 @option{-fcompare-debug} to the compiler driver.  See the documentation
21268 of this option for more details.
21270 @item GCC_EXEC_PREFIX
21271 @findex GCC_EXEC_PREFIX
21272 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
21273 names of the subprograms executed by the compiler.  No slash is added
21274 when this prefix is combined with the name of a subprogram, but you can
21275 specify a prefix that ends with a slash if you wish.
21277 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
21278 an appropriate prefix to use based on the pathname it is invoked with.
21280 If GCC cannot find the subprogram using the specified prefix, it
21281 tries looking in the usual places for the subprogram.
21283 The default value of @env{GCC_EXEC_PREFIX} is
21284 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
21285 the installed compiler. In many cases @var{prefix} is the value
21286 of @code{prefix} when you ran the @file{configure} script.
21288 Other prefixes specified with @option{-B} take precedence over this prefix.
21290 This prefix is also used for finding files such as @file{crt0.o} that are
21291 used for linking.
21293 In addition, the prefix is used in an unusual way in finding the
21294 directories to search for header files.  For each of the standard
21295 directories whose name normally begins with @samp{/usr/local/lib/gcc}
21296 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
21297 replacing that beginning with the specified prefix to produce an
21298 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
21299 @file{foo/bar} just before it searches the standard directory 
21300 @file{/usr/local/lib/bar}.
21301 If a standard directory begins with the configured
21302 @var{prefix} then the value of @var{prefix} is replaced by
21303 @env{GCC_EXEC_PREFIX} when looking for header files.
21305 @item COMPILER_PATH
21306 @findex COMPILER_PATH
21307 The value of @env{COMPILER_PATH} is a colon-separated list of
21308 directories, much like @env{PATH}.  GCC tries the directories thus
21309 specified when searching for subprograms, if it can't find the
21310 subprograms using @env{GCC_EXEC_PREFIX}.
21312 @item LIBRARY_PATH
21313 @findex LIBRARY_PATH
21314 The value of @env{LIBRARY_PATH} is a colon-separated list of
21315 directories, much like @env{PATH}.  When configured as a native compiler,
21316 GCC tries the directories thus specified when searching for special
21317 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
21318 using GCC also uses these directories when searching for ordinary
21319 libraries for the @option{-l} option (but directories specified with
21320 @option{-L} come first).
21322 @item LANG
21323 @findex LANG
21324 @cindex locale definition
21325 This variable is used to pass locale information to the compiler.  One way in
21326 which this information is used is to determine the character set to be used
21327 when character literals, string literals and comments are parsed in C and C++.
21328 When the compiler is configured to allow multibyte characters,
21329 the following values for @env{LANG} are recognized:
21331 @table @samp
21332 @item C-JIS
21333 Recognize JIS characters.
21334 @item C-SJIS
21335 Recognize SJIS characters.
21336 @item C-EUCJP
21337 Recognize EUCJP characters.
21338 @end table
21340 If @env{LANG} is not defined, or if it has some other value, then the
21341 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
21342 recognize and translate multibyte characters.
21343 @end table
21345 @noindent
21346 Some additional environment variables affect the behavior of the
21347 preprocessor.
21349 @include cppenv.texi
21351 @c man end
21353 @node Precompiled Headers
21354 @section Using Precompiled Headers
21355 @cindex precompiled headers
21356 @cindex speed of compilation
21358 Often large projects have many header files that are included in every
21359 source file.  The time the compiler takes to process these header files
21360 over and over again can account for nearly all of the time required to
21361 build the project.  To make builds faster, GCC allows you to
21362 @dfn{precompile} a header file.
21364 To create a precompiled header file, simply compile it as you would any
21365 other file, if necessary using the @option{-x} option to make the driver
21366 treat it as a C or C++ header file.  You may want to use a
21367 tool like @command{make} to keep the precompiled header up-to-date when
21368 the headers it contains change.
21370 A precompiled header file is searched for when @code{#include} is
21371 seen in the compilation.  As it searches for the included file
21372 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
21373 compiler looks for a precompiled header in each directory just before it
21374 looks for the include file in that directory.  The name searched for is
21375 the name specified in the @code{#include} with @samp{.gch} appended.  If
21376 the precompiled header file can't be used, it is ignored.
21378 For instance, if you have @code{#include "all.h"}, and you have
21379 @file{all.h.gch} in the same directory as @file{all.h}, then the
21380 precompiled header file is used if possible, and the original
21381 header is used otherwise.
21383 Alternatively, you might decide to put the precompiled header file in a
21384 directory and use @option{-I} to ensure that directory is searched
21385 before (or instead of) the directory containing the original header.
21386 Then, if you want to check that the precompiled header file is always
21387 used, you can put a file of the same name as the original header in this
21388 directory containing an @code{#error} command.
21390 This also works with @option{-include}.  So yet another way to use
21391 precompiled headers, good for projects not designed with precompiled
21392 header files in mind, is to simply take most of the header files used by
21393 a project, include them from another header file, precompile that header
21394 file, and @option{-include} the precompiled header.  If the header files
21395 have guards against multiple inclusion, they are skipped because
21396 they've already been included (in the precompiled header).
21398 If you need to precompile the same header file for different
21399 languages, targets, or compiler options, you can instead make a
21400 @emph{directory} named like @file{all.h.gch}, and put each precompiled
21401 header in the directory, perhaps using @option{-o}.  It doesn't matter
21402 what you call the files in the directory; every precompiled header in
21403 the directory is considered.  The first precompiled header
21404 encountered in the directory that is valid for this compilation is
21405 used; they're searched in no particular order.
21407 There are many other possibilities, limited only by your imagination,
21408 good sense, and the constraints of your build system.
21410 A precompiled header file can be used only when these conditions apply:
21412 @itemize
21413 @item
21414 Only one precompiled header can be used in a particular compilation.
21416 @item
21417 A precompiled header can't be used once the first C token is seen.  You
21418 can have preprocessor directives before a precompiled header; you cannot
21419 include a precompiled header from inside another header.
21421 @item
21422 The precompiled header file must be produced for the same language as
21423 the current compilation.  You can't use a C precompiled header for a C++
21424 compilation.
21426 @item
21427 The precompiled header file must have been produced by the same compiler
21428 binary as the current compilation is using.
21430 @item
21431 Any macros defined before the precompiled header is included must
21432 either be defined in the same way as when the precompiled header was
21433 generated, or must not affect the precompiled header, which usually
21434 means that they don't appear in the precompiled header at all.
21436 The @option{-D} option is one way to define a macro before a
21437 precompiled header is included; using a @code{#define} can also do it.
21438 There are also some options that define macros implicitly, like
21439 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
21440 defined this way.
21442 @item If debugging information is output when using the precompiled
21443 header, using @option{-g} or similar, the same kind of debugging information
21444 must have been output when building the precompiled header.  However,
21445 a precompiled header built using @option{-g} can be used in a compilation
21446 when no debugging information is being output.
21448 @item The same @option{-m} options must generally be used when building
21449 and using the precompiled header.  @xref{Submodel Options},
21450 for any cases where this rule is relaxed.
21452 @item Each of the following options must be the same when building and using
21453 the precompiled header:
21455 @gccoptlist{-fexceptions}
21457 @item
21458 Some other command-line options starting with @option{-f},
21459 @option{-p}, or @option{-O} must be defined in the same way as when
21460 the precompiled header was generated.  At present, it's not clear
21461 which options are safe to change and which are not; the safest choice
21462 is to use exactly the same options when generating and using the
21463 precompiled header.  The following are known to be safe:
21465 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
21466 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
21467 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
21468 -pedantic-errors}
21470 @end itemize
21472 For all of these except the last, the compiler automatically
21473 ignores the precompiled header if the conditions aren't met.  If you
21474 find an option combination that doesn't work and doesn't cause the
21475 precompiled header to be ignored, please consider filing a bug report,
21476 see @ref{Bugs}.
21478 If you do use differing options when generating and using the
21479 precompiled header, the actual behavior is a mixture of the
21480 behavior for the options.  For instance, if you use @option{-g} to
21481 generate the precompiled header but not when using it, you may or may
21482 not get debugging information for routines in the precompiled header.