2013-05-30 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / doc / invoke.texi
blob06c55fe4808650455bc1c60a5796bd34cadb36b8
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 -fvisibility-ms-compat @gol
195 -fext-numeric-literals @gol
196 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
197 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
198 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
199 -Weffc++  -Wstrict-null-sentinel @gol
200 -Wno-non-template-friend  -Wold-style-cast @gol
201 -Woverloaded-virtual  -Wno-pmf-conversions @gol
202 -Wsign-promo}
204 @item Objective-C and Objective-C++ Language Options
205 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
206 Objective-C and Objective-C++ Dialects}.
207 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
208 -fgnu-runtime  -fnext-runtime @gol
209 -fno-nil-receivers @gol
210 -fobjc-abi-version=@var{n} @gol
211 -fobjc-call-cxx-cdtors @gol
212 -fobjc-direct-dispatch @gol
213 -fobjc-exceptions @gol
214 -fobjc-gc @gol
215 -fobjc-nilcheck @gol
216 -fobjc-std=objc1 @gol
217 -freplace-objc-classes @gol
218 -fzero-link @gol
219 -gen-decls @gol
220 -Wassign-intercept @gol
221 -Wno-protocol  -Wselector @gol
222 -Wstrict-selector-match @gol
223 -Wundeclared-selector}
225 @item Language Independent Options
226 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
227 @gccoptlist{-fmessage-length=@var{n}  @gol
228 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
229 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
230 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
232 @item Warning Options
233 @xref{Warning Options,,Options to Request or Suppress Warnings}.
234 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
235 -pedantic-errors @gol
236 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
237 -Waggressive-loop-optimizations -Warray-bounds @gol
238 -Wno-attributes -Wno-builtin-macro-redefined @gol
239 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
240 -Wchar-subscripts -Wclobbered  -Wcomment @gol
241 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
242 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
243 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
244 -Wno-endif-labels -Werror  -Werror=* @gol
245 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
246 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
247 -Wformat-security  -Wformat-y2k @gol
248 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
249 -Wignored-qualifiers @gol
250 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
251 -Winit-self  -Winline -Wmaybe-uninitialized @gol
252 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
253 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
254 -Wlogical-op -Wlong-long @gol
255 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
256 -Wmissing-include-dirs @gol
257 -Wno-mudflap @gol
258 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
259 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
260 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
261 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
262 -Wredundant-decls  -Wno-return-local-addr @gol
263 -Wreturn-type  -Wsequence-point  -Wshadow @gol
264 -Wsign-compare  -Wsign-conversion  -Wsizeof-pointer-memaccess @gol
265 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
266 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
267 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
268 -Wmissing-format-attribute @gol
269 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
270 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
271 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
272 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
273 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
274 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
275 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
276 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
277 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
279 @item C and Objective-C-only Warning Options
280 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
281 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
282 -Wold-style-declaration  -Wold-style-definition @gol
283 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
284 -Wdeclaration-after-statement -Wpointer-sign}
286 @item Debugging Options
287 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
288 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
289 -fsanitize=@var{style} @gol
290 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
291 -fdisable-ipa-@var{pass_name} @gol
292 -fdisable-rtl-@var{pass_name} @gol
293 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
294 -fdisable-tree-@var{pass_name} @gol
295 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
296 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
297 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
298 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
299 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
300 -fdump-passes @gol
301 -fdump-statistics @gol
302 -fdump-tree-all @gol
303 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
304 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-cfg -fdump-tree-alias @gol
306 -fdump-tree-ch @gol
307 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-nrv -fdump-tree-vect @gol
317 -fdump-tree-sink @gol
318 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
322 -ftree-vectorizer-verbose=@var{n} @gol
323 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
324 -fdump-final-insns=@var{file} @gol
325 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
326 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
327 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
328 -fenable-@var{kind}-@var{pass} @gol
329 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
330 -fdebug-types-section -fmem-report-wpa @gol
331 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
332 -fopt-info @gol
333 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
334 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
335 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
336 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
337 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
338 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
339 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
340 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
341 -gvms  -gxcoff  -gxcoff+ @gol
342 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
343 -fdebug-prefix-map=@var{old}=@var{new} @gol
344 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
345 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
346 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
347 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
348 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
349 -print-sysroot -print-sysroot-headers-suffix @gol
350 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
352 @item Optimization Options
353 @xref{Optimize Options,,Options that Control Optimization}.
354 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
355 -falign-jumps[=@var{n}] @gol
356 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
357 -fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
358 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
359 -fbtr-bb-exclusive -fcaller-saves @gol
360 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
361 -fcompare-elim -fcprop-registers -fcrossjumping @gol
362 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
363 -fcx-limited-range @gol
364 -fdata-sections -fdce -fdelayed-branch @gol
365 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
366 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
367 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
368 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
369 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
370 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
371 -fif-conversion2 -findirect-inlining @gol
372 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
373 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
374 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
375 -fira-algorithm=@var{algorithm} @gol
376 -fira-region=@var{region} -fira-hoist-pressure @gol
377 -fira-loop-pressure -fno-ira-share-save-slots @gol
378 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
379 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
380 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
381 -floop-parallelize-all -flto -flto-compression-level @gol
382 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
383 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
384 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
385 -fno-default-inline @gol
386 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
387 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
388 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
389 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
390 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
391 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
392 -fprefetch-loop-arrays -fprofile-report @gol
393 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
394 -fprofile-generate=@var{path} @gol
395 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
396 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
397 -freorder-blocks-and-partition -freorder-functions @gol
398 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
399 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
400 -fsched-spec-load -fsched-spec-load-dangerous @gol
401 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
402 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
403 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
404 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
405 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
406 -fselective-scheduling -fselective-scheduling2 @gol
407 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
408 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
409 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
410 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
411 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
412 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
413 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
414 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
415 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
416 -ftree-loop-if-convert-stores -ftree-loop-im @gol
417 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
418 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
419 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
420 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
421 -ftree-switch-conversion -ftree-tail-merge @gol
422 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
423 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
424 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
425 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
426 -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
427 --param @var{name}=@var{value}
428 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
430 @item Preprocessor Options
431 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
432 @gccoptlist{-A@var{question}=@var{answer} @gol
433 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
434 -C  -dD  -dI  -dM  -dN @gol
435 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
436 -idirafter @var{dir} @gol
437 -include @var{file}  -imacros @var{file} @gol
438 -iprefix @var{file}  -iwithprefix @var{dir} @gol
439 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
440 -imultilib @var{dir} -isysroot @var{dir} @gol
441 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
442 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
443 -remap -trigraphs  -undef  -U@var{macro}  @gol
444 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
446 @item Assembler Option
447 @xref{Assembler Options,,Passing Options to the Assembler}.
448 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
450 @item Linker Options
451 @xref{Link Options,,Options for Linking}.
452 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
453 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
454 -s  -static -static-libgcc -static-libstdc++ @gol
455 -static-libasan -static-libtsan @gol
456 -shared -shared-libgcc  -symbolic @gol
457 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
458 -u @var{symbol}}
460 @item Directory Options
461 @xref{Directory Options,,Options for Directory Search}.
462 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
463 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
464 --sysroot=@var{dir} --no-sysroot-suffix}
466 @item Machine Dependent Options
467 @xref{Submodel Options,,Hardware Models and Configurations}.
468 @c This list is ordered alphanumerically by subsection name.
469 @c Try and put the significant identifier (CPU or system) first,
470 @c so users have a clue at guessing where the ones they want will be.
472 @emph{AArch64 Options}
473 @gccoptlist{-mbig-endian  -mlittle-endian @gol
474 -mgeneral-regs-only @gol
475 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
476 -mstrict-align @gol
477 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
478 -mtls-dialect=desc  -mtls-dialect=traditional @gol
479 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
481 @emph{Adapteva Epiphany Options}
482 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
483 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
484 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
485 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
486 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
487 -msplit-vecmove-early -m1reg-@var{reg}}
489 @emph{ARM Options}
490 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
491 -mabi=@var{name} @gol
492 -mapcs-stack-check  -mno-apcs-stack-check @gol
493 -mapcs-float  -mno-apcs-float @gol
494 -mapcs-reentrant  -mno-apcs-reentrant @gol
495 -msched-prolog  -mno-sched-prolog @gol
496 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
497 -mfloat-abi=@var{name} @gol
498 -mfp16-format=@var{name}
499 -mthumb-interwork  -mno-thumb-interwork @gol
500 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
501 -mstructure-size-boundary=@var{n} @gol
502 -mabort-on-noreturn @gol
503 -mlong-calls  -mno-long-calls @gol
504 -msingle-pic-base  -mno-single-pic-base @gol
505 -mpic-register=@var{reg} @gol
506 -mnop-fun-dllimport @gol
507 -mpoke-function-name @gol
508 -mthumb  -marm @gol
509 -mtpcs-frame  -mtpcs-leaf-frame @gol
510 -mcaller-super-interworking  -mcallee-super-interworking @gol
511 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
512 -mword-relocations @gol
513 -mfix-cortex-m3-ldrd @gol
514 -munaligned-access @gol
515 -mneon-for-64bits}
517 @emph{AVR Options}
518 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
519 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
520 -mstrict-X -mtiny-stack -Waddr-space-convert}
522 @emph{Blackfin Options}
523 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
524 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
525 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
526 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
527 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
528 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
529 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
530 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
531 -micplb}
533 @emph{C6X Options}
534 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
535 -msim -msdata=@var{sdata-type}}
537 @emph{CRIS Options}
538 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
539 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
540 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
541 -mstack-align  -mdata-align  -mconst-align @gol
542 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
543 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
544 -mmul-bug-workaround  -mno-mul-bug-workaround}
546 @emph{CR16 Options}
547 @gccoptlist{-mmac @gol
548 -mcr16cplus -mcr16c @gol
549 -msim -mint32 -mbit-ops
550 -mdata-model=@var{model}}
552 @emph{Darwin Options}
553 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
554 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
555 -client_name  -compatibility_version  -current_version @gol
556 -dead_strip @gol
557 -dependency-file  -dylib_file  -dylinker_install_name @gol
558 -dynamic  -dynamiclib  -exported_symbols_list @gol
559 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
560 -force_flat_namespace  -headerpad_max_install_names @gol
561 -iframework @gol
562 -image_base  -init  -install_name  -keep_private_externs @gol
563 -multi_module  -multiply_defined  -multiply_defined_unused @gol
564 -noall_load   -no_dead_strip_inits_and_terms @gol
565 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
566 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
567 -private_bundle  -read_only_relocs  -sectalign @gol
568 -sectobjectsymbols  -whyload  -seg1addr @gol
569 -sectcreate  -sectobjectsymbols  -sectorder @gol
570 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
571 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
572 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
573 -single_module  -static  -sub_library  -sub_umbrella @gol
574 -twolevel_namespace  -umbrella  -undefined @gol
575 -unexported_symbols_list  -weak_reference_mismatches @gol
576 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
577 -mkernel -mone-byte-bool}
579 @emph{DEC Alpha Options}
580 @gccoptlist{-mno-fp-regs  -msoft-float @gol
581 -mieee  -mieee-with-inexact  -mieee-conformant @gol
582 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
583 -mtrap-precision=@var{mode}  -mbuild-constants @gol
584 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
585 -mbwx  -mmax  -mfix  -mcix @gol
586 -mfloat-vax  -mfloat-ieee @gol
587 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
588 -msmall-text  -mlarge-text @gol
589 -mmemory-latency=@var{time}}
591 @emph{FR30 Options}
592 @gccoptlist{-msmall-model -mno-lsim}
594 @emph{FRV Options}
595 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
596 -mhard-float  -msoft-float @gol
597 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
598 -mdouble  -mno-double @gol
599 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
600 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
601 -mlinked-fp  -mlong-calls  -malign-labels @gol
602 -mlibrary-pic  -macc-4  -macc-8 @gol
603 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
604 -moptimize-membar -mno-optimize-membar @gol
605 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
606 -mvliw-branch  -mno-vliw-branch @gol
607 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
608 -mno-nested-cond-exec  -mtomcat-stats @gol
609 -mTLS -mtls @gol
610 -mcpu=@var{cpu}}
612 @emph{GNU/Linux Options}
613 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
614 -tno-android-cc -tno-android-ld}
616 @emph{H8/300 Options}
617 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
619 @emph{HPPA Options}
620 @gccoptlist{-march=@var{architecture-type} @gol
621 -mdisable-fpregs  -mdisable-indexing @gol
622 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
623 -mfixed-range=@var{register-range} @gol
624 -mjump-in-delay -mlinker-opt -mlong-calls @gol
625 -mlong-load-store  -mno-disable-fpregs @gol
626 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
627 -mno-jump-in-delay  -mno-long-load-store @gol
628 -mno-portable-runtime  -mno-soft-float @gol
629 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
630 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
631 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
632 -munix=@var{unix-std}  -nolibdld  -static  -threads}
634 @emph{i386 and x86-64 Options}
635 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
636 -mfpmath=@var{unit} @gol
637 -masm=@var{dialect}  -mno-fancy-math-387 @gol
638 -mno-fp-ret-in-387  -msoft-float @gol
639 -mno-wide-multiply  -mrtd  -malign-double @gol
640 -mpreferred-stack-boundary=@var{num} @gol
641 -mincoming-stack-boundary=@var{num} @gol
642 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
643 -mrecip -mrecip=@var{opt} @gol
644 -mvzeroupper -mprefer-avx128 @gol
645 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
646 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
647 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
648 -mbmi2 -mrtm -mlwp -mthreads @gol
649 -mno-align-stringops  -minline-all-stringops @gol
650 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
651 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
652 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
653 -mregparm=@var{num}  -msseregparm @gol
654 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
655 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
656 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
657 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
658 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
659 -msse2avx -mfentry -m8bit-idiv @gol
660 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
661 -mstack-protector-guard=@var{guard}}
663 @emph{i386 and x86-64 Windows Options}
664 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
665 -mnop-fun-dllimport -mthread @gol
666 -municode -mwin32 -mwindows -fno-set-stack-executable}
668 @emph{IA-64 Options}
669 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
670 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
671 -mconstant-gp  -mauto-pic  -mfused-madd @gol
672 -minline-float-divide-min-latency @gol
673 -minline-float-divide-max-throughput @gol
674 -mno-inline-float-divide @gol
675 -minline-int-divide-min-latency @gol
676 -minline-int-divide-max-throughput  @gol
677 -mno-inline-int-divide @gol
678 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
679 -mno-inline-sqrt @gol
680 -mdwarf2-asm -mearly-stop-bits @gol
681 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
682 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
683 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
684 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
685 -msched-spec-ldc -msched-spec-control-ldc @gol
686 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
687 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
688 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
689 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
691 @emph{LM32 Options}
692 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
693 -msign-extend-enabled -muser-enabled}
695 @emph{M32R/D Options}
696 @gccoptlist{-m32r2 -m32rx -m32r @gol
697 -mdebug @gol
698 -malign-loops -mno-align-loops @gol
699 -missue-rate=@var{number} @gol
700 -mbranch-cost=@var{number} @gol
701 -mmodel=@var{code-size-model-type} @gol
702 -msdata=@var{sdata-type} @gol
703 -mno-flush-func -mflush-func=@var{name} @gol
704 -mno-flush-trap -mflush-trap=@var{number} @gol
705 -G @var{num}}
707 @emph{M32C Options}
708 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
710 @emph{M680x0 Options}
711 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
712 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
713 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
714 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
715 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
716 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
717 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
718 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
719 -mxgot -mno-xgot}
721 @emph{MCore Options}
722 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
723 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
724 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
725 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
726 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
728 @emph{MeP Options}
729 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
730 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
731 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
732 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
733 -mtiny=@var{n}}
735 @emph{MicroBlaze Options}
736 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
737 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
738 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
739 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
740 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
742 @emph{MIPS Options}
743 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
744 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
745 -mips64  -mips64r2 @gol
746 -mips16  -mno-mips16  -mflip-mips16 @gol
747 -minterlink-compressed -mno-interlink-compressed @gol
748 -minterlink-mips16  -mno-interlink-mips16 @gol
749 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
750 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
751 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
752 -mno-float -msingle-float  -mdouble-float  @gol
753 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
754 -mmcu -mmno-mcu @gol
755 -mmicromips -mno-micromips @gol
756 -mfpu=@var{fpu-type} @gol
757 -msmartmips  -mno-smartmips @gol
758 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
759 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
760 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
761 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
762 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
763 -membedded-data  -mno-embedded-data @gol
764 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
765 -mcode-readable=@var{setting} @gol
766 -msplit-addresses  -mno-split-addresses @gol
767 -mexplicit-relocs  -mno-explicit-relocs @gol
768 -mcheck-zero-division  -mno-check-zero-division @gol
769 -mdivide-traps  -mdivide-breaks @gol
770 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
771 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
772 -mfix-24k -mno-fix-24k @gol
773 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
774 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
775 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
776 -mflush-func=@var{func}  -mno-flush-func @gol
777 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
778 -mfp-exceptions -mno-fp-exceptions @gol
779 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
780 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
782 @emph{MMIX Options}
783 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
784 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
785 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
786 -mno-base-addresses  -msingle-exit  -mno-single-exit}
788 @emph{MN10300 Options}
789 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
790 -mno-am33 -mam33 -mam33-2 -mam34 @gol
791 -mtune=@var{cpu-type} @gol
792 -mreturn-pointer-on-d0 @gol
793 -mno-crt0  -mrelax -mliw -msetlb}
795 @emph{Moxie Options}
796 @gccoptlist{-meb -mel -mno-crt0}
798 @emph{PDP-11 Options}
799 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
800 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
801 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
802 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
803 -mbranch-expensive  -mbranch-cheap @gol
804 -munix-asm  -mdec-asm}
806 @emph{picoChip Options}
807 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
808 -msymbol-as-address -mno-inefficient-warnings}
810 @emph{PowerPC Options}
811 See RS/6000 and PowerPC Options.
813 @emph{RL78 Options}
814 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
816 @emph{RS/6000 and PowerPC Options}
817 @gccoptlist{-mcpu=@var{cpu-type} @gol
818 -mtune=@var{cpu-type} @gol
819 -mcmodel=@var{code-model} @gol
820 -mpowerpc64 @gol
821 -maltivec  -mno-altivec @gol
822 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
823 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
824 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
825 -mfprnd  -mno-fprnd @gol
826 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
827 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
828 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
829 -malign-power  -malign-natural @gol
830 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
831 -msingle-float -mdouble-float -msimple-fpu @gol
832 -mstring  -mno-string  -mupdate  -mno-update @gol
833 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
834 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
835 -mstrict-align  -mno-strict-align  -mrelocatable @gol
836 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
837 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
838 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
839 -mprioritize-restricted-insns=@var{priority} @gol
840 -msched-costly-dep=@var{dependence_type} @gol
841 -minsert-sched-nops=@var{scheme} @gol
842 -mcall-sysv  -mcall-netbsd @gol
843 -maix-struct-return  -msvr4-struct-return @gol
844 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
845 -mblock-move-inline-limit=@var{num} @gol
846 -misel -mno-isel @gol
847 -misel=yes  -misel=no @gol
848 -mspe -mno-spe @gol
849 -mspe=yes  -mspe=no @gol
850 -mpaired @gol
851 -mgen-cell-microcode -mwarn-cell-microcode @gol
852 -mvrsave -mno-vrsave @gol
853 -mmulhw -mno-mulhw @gol
854 -mdlmzb -mno-dlmzb @gol
855 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
856 -mprototype  -mno-prototype @gol
857 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
858 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
859 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
860 -mno-recip-precision @gol
861 -mveclibabi=@var{type} -mfriz -mno-friz @gol
862 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
863 -msave-toc-indirect -mno-save-toc-indirect @gol
864 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
865 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
866 -mquad-memory -mno-quad-memory}
868 @emph{RX Options}
869 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
870 -mcpu=@gol
871 -mbig-endian-data -mlittle-endian-data @gol
872 -msmall-data @gol
873 -msim  -mno-sim@gol
874 -mas100-syntax -mno-as100-syntax@gol
875 -mrelax@gol
876 -mmax-constant-size=@gol
877 -mint-register=@gol
878 -mpid@gol
879 -mno-warn-multiple-fast-interrupts@gol
880 -msave-acc-in-interrupts}
882 @emph{S/390 and zSeries Options}
883 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
884 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
885 -mlong-double-64 -mlong-double-128 @gol
886 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
887 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
888 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
889 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
890 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
892 @emph{Score Options}
893 @gccoptlist{-meb -mel @gol
894 -mnhwloop @gol
895 -muls @gol
896 -mmac @gol
897 -mscore5 -mscore5u -mscore7 -mscore7d}
899 @emph{SH Options}
900 @gccoptlist{-m1  -m2  -m2e @gol
901 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
902 -m3  -m3e @gol
903 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
904 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
905 -m5-64media  -m5-64media-nofpu @gol
906 -m5-32media  -m5-32media-nofpu @gol
907 -m5-compact  -m5-compact-nofpu @gol
908 -mb  -ml  -mdalign  -mrelax @gol
909 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
910 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
911 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
912 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
913 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
914 -maccumulate-outgoing-args -minvalid-symbols @gol
915 -matomic-model=@var{atomic-model} @gol
916 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
917 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
918 -mpretend-cmove -mtas}
920 @emph{Solaris 2 Options}
921 @gccoptlist{-mimpure-text  -mno-impure-text @gol
922 -pthreads -pthread}
924 @emph{SPARC Options}
925 @gccoptlist{-mcpu=@var{cpu-type} @gol
926 -mtune=@var{cpu-type} @gol
927 -mcmodel=@var{code-model} @gol
928 -mmemory-model=@var{mem-model} @gol
929 -m32  -m64  -mapp-regs  -mno-app-regs @gol
930 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
931 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
932 -mhard-quad-float  -msoft-quad-float @gol
933 -mstack-bias  -mno-stack-bias @gol
934 -munaligned-doubles  -mno-unaligned-doubles @gol
935 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
936 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
937 -mcbcond -mno-cbcond @gol
938 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
939 -mfix-at697f -mfix-ut699}
941 @emph{SPU Options}
942 @gccoptlist{-mwarn-reloc -merror-reloc @gol
943 -msafe-dma -munsafe-dma @gol
944 -mbranch-hints @gol
945 -msmall-mem -mlarge-mem -mstdmain @gol
946 -mfixed-range=@var{register-range} @gol
947 -mea32 -mea64 @gol
948 -maddress-space-conversion -mno-address-space-conversion @gol
949 -mcache-size=@var{cache-size} @gol
950 -matomic-updates -mno-atomic-updates}
952 @emph{System V Options}
953 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
955 @emph{TILE-Gx Options}
956 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
958 @emph{TILEPro Options}
959 @gccoptlist{-mcpu=@var{cpu} -m32}
961 @emph{V850 Options}
962 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
963 -mprolog-function  -mno-prolog-function  -mspace @gol
964 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
965 -mapp-regs  -mno-app-regs @gol
966 -mdisable-callt  -mno-disable-callt @gol
967 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
968 -mv850e -mv850 -mv850e3v5 @gol
969 -mloop @gol
970 -mrelax @gol
971 -mlong-jumps @gol
972 -msoft-float @gol
973 -mhard-float @gol
974 -mgcc-abi @gol
975 -mrh850-abi @gol
976 -mbig-switch}
978 @emph{VAX Options}
979 @gccoptlist{-mg  -mgnu  -munix}
981 @emph{VMS Options}
982 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
983 -mpointer-size=@var{size}}
985 @emph{VxWorks Options}
986 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
987 -Xbind-lazy  -Xbind-now}
989 @emph{x86-64 Options}
990 See i386 and x86-64 Options.
992 @emph{Xstormy16 Options}
993 @gccoptlist{-msim}
995 @emph{Xtensa Options}
996 @gccoptlist{-mconst16 -mno-const16 @gol
997 -mfused-madd  -mno-fused-madd @gol
998 -mforce-no-pic @gol
999 -mserialize-volatile  -mno-serialize-volatile @gol
1000 -mtext-section-literals  -mno-text-section-literals @gol
1001 -mtarget-align  -mno-target-align @gol
1002 -mlongcalls  -mno-longcalls}
1004 @emph{zSeries Options}
1005 See S/390 and zSeries Options.
1007 @item Code Generation Options
1008 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1009 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1010 -ffixed-@var{reg}  -fexceptions @gol
1011 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1012 -fasynchronous-unwind-tables @gol
1013 -finhibit-size-directive  -finstrument-functions @gol
1014 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1015 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1016 -fno-common  -fno-ident @gol
1017 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1018 -fno-jump-tables @gol
1019 -frecord-gcc-switches @gol
1020 -freg-struct-return  -fshort-enums @gol
1021 -fshort-double  -fshort-wchar @gol
1022 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1023 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1024 -fno-stack-limit -fsplit-stack @gol
1025 -fleading-underscore  -ftls-model=@var{model} @gol
1026 -fstack-reuse=@var{reuse_level} @gol
1027 -ftrapv  -fwrapv  -fbounds-check @gol
1028 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1029 @end table
1031 @menu
1032 * Overall Options::     Controlling the kind of output:
1033                         an executable, object files, assembler files,
1034                         or preprocessed source.
1035 * C Dialect Options::   Controlling the variant of C language compiled.
1036 * C++ Dialect Options:: Variations on C++.
1037 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1038                         and Objective-C++.
1039 * Language Independent Options:: Controlling how diagnostics should be
1040                         formatted.
1041 * Warning Options::     How picky should the compiler be?
1042 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1043 * Optimize Options::    How much optimization?
1044 * Preprocessor Options:: Controlling header files and macro definitions.
1045                          Also, getting dependency information for Make.
1046 * Assembler Options::   Passing options to the assembler.
1047 * Link Options::        Specifying libraries and so on.
1048 * Directory Options::   Where to find header files and libraries.
1049                         Where to find the compiler executable files.
1050 * Spec Files::          How to pass switches to sub-processes.
1051 * Target Options::      Running a cross-compiler, or an old version of GCC.
1052 @end menu
1054 @node Overall Options
1055 @section Options Controlling the Kind of Output
1057 Compilation can involve up to four stages: preprocessing, compilation
1058 proper, assembly and linking, always in that order.  GCC is capable of
1059 preprocessing and compiling several files either into several
1060 assembler input files, or into one assembler input file; then each
1061 assembler input file produces an object file, and linking combines all
1062 the object files (those newly compiled, and those specified as input)
1063 into an executable file.
1065 @cindex file name suffix
1066 For any given input file, the file name suffix determines what kind of
1067 compilation is done:
1069 @table @gcctabopt
1070 @item @var{file}.c
1071 C source code that must be preprocessed.
1073 @item @var{file}.i
1074 C source code that should not be preprocessed.
1076 @item @var{file}.ii
1077 C++ source code that should not be preprocessed.
1079 @item @var{file}.m
1080 Objective-C source code.  Note that you must link with the @file{libobjc}
1081 library to make an Objective-C program work.
1083 @item @var{file}.mi
1084 Objective-C source code that should not be preprocessed.
1086 @item @var{file}.mm
1087 @itemx @var{file}.M
1088 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1089 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1090 to a literal capital M@.
1092 @item @var{file}.mii
1093 Objective-C++ source code that should not be preprocessed.
1095 @item @var{file}.h
1096 C, C++, Objective-C or Objective-C++ header file to be turned into a
1097 precompiled header (default), or C, C++ header file to be turned into an
1098 Ada spec (via the @option{-fdump-ada-spec} switch).
1100 @item @var{file}.cc
1101 @itemx @var{file}.cp
1102 @itemx @var{file}.cxx
1103 @itemx @var{file}.cpp
1104 @itemx @var{file}.CPP
1105 @itemx @var{file}.c++
1106 @itemx @var{file}.C
1107 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1108 the last two letters must both be literally @samp{x}.  Likewise,
1109 @samp{.C} refers to a literal capital C@.
1111 @item @var{file}.mm
1112 @itemx @var{file}.M
1113 Objective-C++ source code that must be preprocessed.
1115 @item @var{file}.mii
1116 Objective-C++ source code that should not be preprocessed.
1118 @item @var{file}.hh
1119 @itemx @var{file}.H
1120 @itemx @var{file}.hp
1121 @itemx @var{file}.hxx
1122 @itemx @var{file}.hpp
1123 @itemx @var{file}.HPP
1124 @itemx @var{file}.h++
1125 @itemx @var{file}.tcc
1126 C++ header file to be turned into a precompiled header or Ada spec.
1128 @item @var{file}.f
1129 @itemx @var{file}.for
1130 @itemx @var{file}.ftn
1131 Fixed form Fortran source code that should not be preprocessed.
1133 @item @var{file}.F
1134 @itemx @var{file}.FOR
1135 @itemx @var{file}.fpp
1136 @itemx @var{file}.FPP
1137 @itemx @var{file}.FTN
1138 Fixed form Fortran source code that must be preprocessed (with the traditional
1139 preprocessor).
1141 @item @var{file}.f90
1142 @itemx @var{file}.f95
1143 @itemx @var{file}.f03
1144 @itemx @var{file}.f08
1145 Free form Fortran source code that should not be preprocessed.
1147 @item @var{file}.F90
1148 @itemx @var{file}.F95
1149 @itemx @var{file}.F03
1150 @itemx @var{file}.F08
1151 Free form Fortran source code that must be preprocessed (with the
1152 traditional preprocessor).
1154 @item @var{file}.go
1155 Go source code.
1157 @c FIXME: Descriptions of Java file types.
1158 @c @var{file}.java
1159 @c @var{file}.class
1160 @c @var{file}.zip
1161 @c @var{file}.jar
1163 @item @var{file}.ads
1164 Ada source code file that contains a library unit declaration (a
1165 declaration of a package, subprogram, or generic, or a generic
1166 instantiation), or a library unit renaming declaration (a package,
1167 generic, or subprogram renaming declaration).  Such files are also
1168 called @dfn{specs}.
1170 @item @var{file}.adb
1171 Ada source code file containing a library unit body (a subprogram or
1172 package body).  Such files are also called @dfn{bodies}.
1174 @c GCC also knows about some suffixes for languages not yet included:
1175 @c Pascal:
1176 @c @var{file}.p
1177 @c @var{file}.pas
1178 @c Ratfor:
1179 @c @var{file}.r
1181 @item @var{file}.s
1182 Assembler code.
1184 @item @var{file}.S
1185 @itemx @var{file}.sx
1186 Assembler code that must be preprocessed.
1188 @item @var{other}
1189 An object file to be fed straight into linking.
1190 Any file name with no recognized suffix is treated this way.
1191 @end table
1193 @opindex x
1194 You can specify the input language explicitly with the @option{-x} option:
1196 @table @gcctabopt
1197 @item -x @var{language}
1198 Specify explicitly the @var{language} for the following input files
1199 (rather than letting the compiler choose a default based on the file
1200 name suffix).  This option applies to all following input files until
1201 the next @option{-x} option.  Possible values for @var{language} are:
1202 @smallexample
1203 c  c-header  cpp-output
1204 c++  c++-header  c++-cpp-output
1205 objective-c  objective-c-header  objective-c-cpp-output
1206 objective-c++ objective-c++-header objective-c++-cpp-output
1207 assembler  assembler-with-cpp
1209 f77  f77-cpp-input f95  f95-cpp-input
1211 java
1212 @end smallexample
1214 @item -x none
1215 Turn off any specification of a language, so that subsequent files are
1216 handled according to their file name suffixes (as they are if @option{-x}
1217 has not been used at all).
1219 @item -pass-exit-codes
1220 @opindex pass-exit-codes
1221 Normally the @command{gcc} program exits with the code of 1 if any
1222 phase of the compiler returns a non-success return code.  If you specify
1223 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1224 the numerically highest error produced by any phase returning an error
1225 indication.  The C, C++, and Fortran front ends return 4 if an internal
1226 compiler error is encountered.
1227 @end table
1229 If you only want some of the stages of compilation, you can use
1230 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1231 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1232 @command{gcc} is to stop.  Note that some combinations (for example,
1233 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1235 @table @gcctabopt
1236 @item -c
1237 @opindex c
1238 Compile or assemble the source files, but do not link.  The linking
1239 stage simply is not done.  The ultimate output is in the form of an
1240 object file for each source file.
1242 By default, the object file name for a source file is made by replacing
1243 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1245 Unrecognized input files, not requiring compilation or assembly, are
1246 ignored.
1248 @item -S
1249 @opindex S
1250 Stop after the stage of compilation proper; do not assemble.  The output
1251 is in the form of an assembler code file for each non-assembler input
1252 file specified.
1254 By default, the assembler file name for a source file is made by
1255 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1257 Input files that don't require compilation are ignored.
1259 @item -E
1260 @opindex E
1261 Stop after the preprocessing stage; do not run the compiler proper.  The
1262 output is in the form of preprocessed source code, which is sent to the
1263 standard output.
1265 Input files that don't require preprocessing are ignored.
1267 @cindex output file option
1268 @item -o @var{file}
1269 @opindex o
1270 Place output in file @var{file}.  This applies to whatever
1271 sort of output is being produced, whether it be an executable file,
1272 an object file, an assembler file or preprocessed C code.
1274 If @option{-o} is not specified, the default is to put an executable
1275 file in @file{a.out}, the object file for
1276 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1277 assembler file in @file{@var{source}.s}, a precompiled header file in
1278 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1279 standard output.
1281 @item -v
1282 @opindex v
1283 Print (on standard error output) the commands executed to run the stages
1284 of compilation.  Also print the version number of the compiler driver
1285 program and of the preprocessor and the compiler proper.
1287 @item -###
1288 @opindex ###
1289 Like @option{-v} except the commands are not executed and arguments
1290 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1291 This is useful for shell scripts to capture the driver-generated command lines.
1293 @item -pipe
1294 @opindex pipe
1295 Use pipes rather than temporary files for communication between the
1296 various stages of compilation.  This fails to work on some systems where
1297 the assembler is unable to read from a pipe; but the GNU assembler has
1298 no trouble.
1300 @item --help
1301 @opindex help
1302 Print (on the standard output) a description of the command-line options
1303 understood by @command{gcc}.  If the @option{-v} option is also specified
1304 then @option{--help} is also passed on to the various processes
1305 invoked by @command{gcc}, so that they can display the command-line options
1306 they accept.  If the @option{-Wextra} option has also been specified
1307 (prior to the @option{--help} option), then command-line options that
1308 have no documentation associated with them are also displayed.
1310 @item --target-help
1311 @opindex target-help
1312 Print (on the standard output) a description of target-specific command-line
1313 options for each tool.  For some targets extra target-specific
1314 information may also be printed.
1316 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1317 Print (on the standard output) a description of the command-line
1318 options understood by the compiler that fit into all specified classes
1319 and qualifiers.  These are the supported classes:
1321 @table @asis
1322 @item @samp{optimizers}
1323 Display all of the optimization options supported by the
1324 compiler.
1326 @item @samp{warnings}
1327 Display all of the options controlling warning messages
1328 produced by the compiler.
1330 @item @samp{target}
1331 Display target-specific options.  Unlike the
1332 @option{--target-help} option however, target-specific options of the
1333 linker and assembler are not displayed.  This is because those
1334 tools do not currently support the extended @option{--help=} syntax.
1336 @item @samp{params}
1337 Display the values recognized by the @option{--param}
1338 option.
1340 @item @var{language}
1341 Display the options supported for @var{language}, where
1342 @var{language} is the name of one of the languages supported in this
1343 version of GCC@.
1345 @item @samp{common}
1346 Display the options that are common to all languages.
1347 @end table
1349 These are the supported qualifiers:
1351 @table @asis
1352 @item @samp{undocumented}
1353 Display only those options that are undocumented.
1355 @item @samp{joined}
1356 Display options taking an argument that appears after an equal
1357 sign in the same continuous piece of text, such as:
1358 @samp{--help=target}.
1360 @item @samp{separate}
1361 Display options taking an argument that appears as a separate word
1362 following the original option, such as: @samp{-o output-file}.
1363 @end table
1365 Thus for example to display all the undocumented target-specific
1366 switches supported by the compiler, use:
1368 @smallexample
1369 --help=target,undocumented
1370 @end smallexample
1372 The sense of a qualifier can be inverted by prefixing it with the
1373 @samp{^} character, so for example to display all binary warning
1374 options (i.e., ones that are either on or off and that do not take an
1375 argument) that have a description, use:
1377 @smallexample
1378 --help=warnings,^joined,^undocumented
1379 @end smallexample
1381 The argument to @option{--help=} should not consist solely of inverted
1382 qualifiers.
1384 Combining several classes is possible, although this usually
1385 restricts the output so much that there is nothing to display.  One
1386 case where it does work, however, is when one of the classes is
1387 @var{target}.  For example, to display all the target-specific
1388 optimization options, use:
1390 @smallexample
1391 --help=target,optimizers
1392 @end smallexample
1394 The @option{--help=} option can be repeated on the command line.  Each
1395 successive use displays its requested class of options, skipping
1396 those that have already been displayed.
1398 If the @option{-Q} option appears on the command line before the
1399 @option{--help=} option, then the descriptive text displayed by
1400 @option{--help=} is changed.  Instead of describing the displayed
1401 options, an indication is given as to whether the option is enabled,
1402 disabled or set to a specific value (assuming that the compiler
1403 knows this at the point where the @option{--help=} option is used).
1405 Here is a truncated example from the ARM port of @command{gcc}:
1407 @smallexample
1408   % gcc -Q -mabi=2 --help=target -c
1409   The following options are target specific:
1410   -mabi=                                2
1411   -mabort-on-noreturn                   [disabled]
1412   -mapcs                                [disabled]
1413 @end smallexample
1415 The output is sensitive to the effects of previous command-line
1416 options, so for example it is possible to find out which optimizations
1417 are enabled at @option{-O2} by using:
1419 @smallexample
1420 -Q -O2 --help=optimizers
1421 @end smallexample
1423 Alternatively you can discover which binary optimizations are enabled
1424 by @option{-O3} by using:
1426 @smallexample
1427 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1428 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1429 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1430 @end smallexample
1432 @item -no-canonical-prefixes
1433 @opindex no-canonical-prefixes
1434 Do not expand any symbolic links, resolve references to @samp{/../}
1435 or @samp{/./}, or make the path absolute when generating a relative
1436 prefix.
1438 @item --version
1439 @opindex version
1440 Display the version number and copyrights of the invoked GCC@.
1442 @item -wrapper
1443 @opindex wrapper
1444 Invoke all subcommands under a wrapper program.  The name of the
1445 wrapper program and its parameters are passed as a comma separated
1446 list.
1448 @smallexample
1449 gcc -c t.c -wrapper gdb,--args
1450 @end smallexample
1452 @noindent
1453 This invokes all subprograms of @command{gcc} under
1454 @samp{gdb --args}, thus the invocation of @command{cc1} is
1455 @samp{gdb --args cc1 @dots{}}.
1457 @item -fplugin=@var{name}.so
1458 Load the plugin code in file @var{name}.so, assumed to be a
1459 shared object to be dlopen'd by the compiler.  The base name of
1460 the shared object file is used to identify the plugin for the
1461 purposes of argument parsing (See
1462 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1463 Each plugin should define the callback functions specified in the
1464 Plugins API.
1466 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1467 Define an argument called @var{key} with a value of @var{value}
1468 for the plugin called @var{name}.
1470 @item -fdump-ada-spec@r{[}-slim@r{]}
1471 For C and C++ source and include files, generate corresponding Ada
1472 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1473 GNAT User's Guide}, which provides detailed documentation on this feature.
1475 @item -fdump-go-spec=@var{file}
1476 For input files in any language, generate corresponding Go
1477 declarations in @var{file}.  This generates Go @code{const},
1478 @code{type}, @code{var}, and @code{func} declarations which may be a
1479 useful way to start writing a Go interface to code written in some
1480 other language.
1482 @include @value{srcdir}/../libiberty/at-file.texi
1483 @end table
1485 @node Invoking G++
1486 @section Compiling C++ Programs
1488 @cindex suffixes for C++ source
1489 @cindex C++ source file suffixes
1490 C++ source files conventionally use one of the suffixes @samp{.C},
1491 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1492 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1493 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1494 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1495 files with these names and compiles them as C++ programs even if you
1496 call the compiler the same way as for compiling C programs (usually
1497 with the name @command{gcc}).
1499 @findex g++
1500 @findex c++
1501 However, the use of @command{gcc} does not add the C++ library.
1502 @command{g++} is a program that calls GCC and automatically specifies linking
1503 against the C++ library.  It treats @samp{.c},
1504 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1505 files unless @option{-x} is used.  This program is also useful when
1506 precompiling a C header file with a @samp{.h} extension for use in C++
1507 compilations.  On many systems, @command{g++} is also installed with
1508 the name @command{c++}.
1510 @cindex invoking @command{g++}
1511 When you compile C++ programs, you may specify many of the same
1512 command-line options that you use for compiling programs in any
1513 language; or command-line options meaningful for C and related
1514 languages; or options that are meaningful only for C++ programs.
1515 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1516 explanations of options for languages related to C@.
1517 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1518 explanations of options that are meaningful only for C++ programs.
1520 @node C Dialect Options
1521 @section Options Controlling C Dialect
1522 @cindex dialect options
1523 @cindex language dialect options
1524 @cindex options, dialect
1526 The following options control the dialect of C (or languages derived
1527 from C, such as C++, Objective-C and Objective-C++) that the compiler
1528 accepts:
1530 @table @gcctabopt
1531 @cindex ANSI support
1532 @cindex ISO support
1533 @item -ansi
1534 @opindex ansi
1535 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1536 equivalent to @option{-std=c++98}.
1538 This turns off certain features of GCC that are incompatible with ISO
1539 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1540 such as the @code{asm} and @code{typeof} keywords, and
1541 predefined macros such as @code{unix} and @code{vax} that identify the
1542 type of system you are using.  It also enables the undesirable and
1543 rarely used ISO trigraph feature.  For the C compiler,
1544 it disables recognition of C++ style @samp{//} comments as well as
1545 the @code{inline} keyword.
1547 The alternate keywords @code{__asm__}, @code{__extension__},
1548 @code{__inline__} and @code{__typeof__} continue to work despite
1549 @option{-ansi}.  You would not want to use them in an ISO C program, of
1550 course, but it is useful to put them in header files that might be included
1551 in compilations done with @option{-ansi}.  Alternate predefined macros
1552 such as @code{__unix__} and @code{__vax__} are also available, with or
1553 without @option{-ansi}.
1555 The @option{-ansi} option does not cause non-ISO programs to be
1556 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1557 addition to @option{-ansi}.  @xref{Warning Options}.
1559 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1560 option is used.  Some header files may notice this macro and refrain
1561 from declaring certain functions or defining certain macros that the
1562 ISO standard doesn't call for; this is to avoid interfering with any
1563 programs that might use these names for other things.
1565 Functions that are normally built in but do not have semantics
1566 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1567 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1568 built-in functions provided by GCC}, for details of the functions
1569 affected.
1571 @item -std=
1572 @opindex std
1573 Determine the language standard. @xref{Standards,,Language Standards
1574 Supported by GCC}, for details of these standard versions.  This option
1575 is currently only supported when compiling C or C++.
1577 The compiler can accept several base standards, such as @samp{c90} or
1578 @samp{c++98}, and GNU dialects of those standards, such as
1579 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1580 compiler accepts all programs following that standard plus those
1581 using GNU extensions that do not contradict it.  For example,
1582 @option{-std=c90} turns off certain features of GCC that are
1583 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1584 keywords, but not other GNU extensions that do not have a meaning in
1585 ISO C90, such as omitting the middle term of a @code{?:}
1586 expression. On the other hand, when a GNU dialect of a standard is
1587 specified, all features supported by the compiler are enabled, even when
1588 those features change the meaning of the base standard.  As a result, some
1589 strict-conforming programs may be rejected.  The particular standard
1590 is used by @option{-Wpedantic} to identify which features are GNU
1591 extensions given that version of the standard. For example
1592 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1593 comments, while @option{-std=gnu99 -Wpedantic} does not.
1595 A value for this option must be provided; possible values are
1597 @table @samp
1598 @item c90
1599 @itemx c89
1600 @itemx iso9899:1990
1601 Support all ISO C90 programs (certain GNU extensions that conflict
1602 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1604 @item iso9899:199409
1605 ISO C90 as modified in amendment 1.
1607 @item c99
1608 @itemx c9x
1609 @itemx iso9899:1999
1610 @itemx iso9899:199x
1611 ISO C99.  Note that this standard is not yet fully supported; see
1612 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1613 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1615 @item c11
1616 @itemx c1x
1617 @itemx iso9899:2011
1618 ISO C11, the 2011 revision of the ISO C standard.
1619 Support is incomplete and experimental.  The name @samp{c1x} is
1620 deprecated.
1622 @item gnu90
1623 @itemx gnu89
1624 GNU dialect of ISO C90 (including some C99 features). This
1625 is the default for C code.
1627 @item gnu99
1628 @itemx gnu9x
1629 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1630 this will become the default.  The name @samp{gnu9x} is deprecated.
1632 @item gnu11
1633 @itemx gnu1x
1634 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1635 name @samp{gnu1x} is deprecated.
1637 @item c++98
1638 @itemx c++03
1639 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1640 additional defect reports. Same as @option{-ansi} for C++ code.
1642 @item gnu++98
1643 @itemx gnu++03
1644 GNU dialect of @option{-std=c++98}.  This is the default for
1645 C++ code.
1647 @item c++11
1648 @itemx c++0x
1649 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1650 experimental, and may change in incompatible ways in future releases.
1651 The name @samp{c++0x} is deprecated.
1653 @item gnu++11
1654 @itemx gnu++0x
1655 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1656 experimental, and may change in incompatible ways in future releases.
1657 The name @samp{gnu++0x} is deprecated.
1659 @item c++1y
1660 The next revision of the ISO C++ standard, tentatively planned for
1661 2014.  Support is highly experimental, and will almost certainly
1662 change in incompatible ways in future releases.
1664 @item gnu++1y
1665 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1666 and will almost certainly change in incompatible ways in future
1667 releases.
1668 @end table
1670 @item -fgnu89-inline
1671 @opindex fgnu89-inline
1672 The option @option{-fgnu89-inline} tells GCC to use the traditional
1673 GNU semantics for @code{inline} functions when in C99 mode.
1674 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1675 is accepted and ignored by GCC versions 4.1.3 up to but not including
1676 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1677 C99 mode.  Using this option is roughly equivalent to adding the
1678 @code{gnu_inline} function attribute to all inline functions
1679 (@pxref{Function Attributes}).
1681 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1682 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1683 specifies the default behavior).  This option was first supported in
1684 GCC 4.3.  This option is not supported in @option{-std=c90} or
1685 @option{-std=gnu90} mode.
1687 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1688 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1689 in effect for @code{inline} functions.  @xref{Common Predefined
1690 Macros,,,cpp,The C Preprocessor}.
1692 @item -aux-info @var{filename}
1693 @opindex aux-info
1694 Output to the given filename prototyped declarations for all functions
1695 declared and/or defined in a translation unit, including those in header
1696 files.  This option is silently ignored in any language other than C@.
1698 Besides declarations, the file indicates, in comments, the origin of
1699 each declaration (source file and line), whether the declaration was
1700 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1701 @samp{O} for old, respectively, in the first character after the line
1702 number and the colon), and whether it came from a declaration or a
1703 definition (@samp{C} or @samp{F}, respectively, in the following
1704 character).  In the case of function definitions, a K&R-style list of
1705 arguments followed by their declarations is also provided, inside
1706 comments, after the declaration.
1708 @item -fallow-parameterless-variadic-functions
1709 Accept variadic functions without named parameters.
1711 Although it is possible to define such a function, this is not very
1712 useful as it is not possible to read the arguments.  This is only
1713 supported for C as this construct is allowed by C++.
1715 @item -fno-asm
1716 @opindex fno-asm
1717 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1718 keyword, so that code can use these words as identifiers.  You can use
1719 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1720 instead.  @option{-ansi} implies @option{-fno-asm}.
1722 In C++, this switch only affects the @code{typeof} keyword, since
1723 @code{asm} and @code{inline} are standard keywords.  You may want to
1724 use the @option{-fno-gnu-keywords} flag instead, which has the same
1725 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1726 switch only affects the @code{asm} and @code{typeof} keywords, since
1727 @code{inline} is a standard keyword in ISO C99.
1729 @item -fno-builtin
1730 @itemx -fno-builtin-@var{function}
1731 @opindex fno-builtin
1732 @cindex built-in functions
1733 Don't recognize built-in functions that do not begin with
1734 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1735 functions provided by GCC}, for details of the functions affected,
1736 including those which are not built-in functions when @option{-ansi} or
1737 @option{-std} options for strict ISO C conformance are used because they
1738 do not have an ISO standard meaning.
1740 GCC normally generates special code to handle certain built-in functions
1741 more efficiently; for instance, calls to @code{alloca} may become single
1742 instructions which adjust the stack directly, and calls to @code{memcpy}
1743 may become inline copy loops.  The resulting code is often both smaller
1744 and faster, but since the function calls no longer appear as such, you
1745 cannot set a breakpoint on those calls, nor can you change the behavior
1746 of the functions by linking with a different library.  In addition,
1747 when a function is recognized as a built-in function, GCC may use
1748 information about that function to warn about problems with calls to
1749 that function, or to generate more efficient code, even if the
1750 resulting code still contains calls to that function.  For example,
1751 warnings are given with @option{-Wformat} for bad calls to
1752 @code{printf} when @code{printf} is built in and @code{strlen} is
1753 known not to modify global memory.
1755 With the @option{-fno-builtin-@var{function}} option
1756 only the built-in function @var{function} is
1757 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1758 function is named that is not built-in in this version of GCC, this
1759 option is ignored.  There is no corresponding
1760 @option{-fbuiltin-@var{function}} option; if you wish to enable
1761 built-in functions selectively when using @option{-fno-builtin} or
1762 @option{-ffreestanding}, you may define macros such as:
1764 @smallexample
1765 #define abs(n)          __builtin_abs ((n))
1766 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1767 @end smallexample
1769 @item -fhosted
1770 @opindex fhosted
1771 @cindex hosted environment
1773 Assert that compilation targets a hosted environment.  This implies
1774 @option{-fbuiltin}.  A hosted environment is one in which the
1775 entire standard library is available, and in which @code{main} has a return
1776 type of @code{int}.  Examples are nearly everything except a kernel.
1777 This is equivalent to @option{-fno-freestanding}.
1779 @item -ffreestanding
1780 @opindex ffreestanding
1781 @cindex hosted environment
1783 Assert that compilation targets a freestanding environment.  This
1784 implies @option{-fno-builtin}.  A freestanding environment
1785 is one in which the standard library may not exist, and program startup may
1786 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1787 This is equivalent to @option{-fno-hosted}.
1789 @xref{Standards,,Language Standards Supported by GCC}, for details of
1790 freestanding and hosted environments.
1792 @item -fopenmp
1793 @opindex fopenmp
1794 @cindex OpenMP parallel
1795 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1796 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1797 compiler generates parallel code according to the OpenMP Application
1798 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1799 implies @option{-pthread}, and thus is only supported on targets that
1800 have support for @option{-pthread}.
1802 @item -fcilkplus
1803 @opindex fcilkplus
1804 @cindex Enable Cilk Plus
1805 Enable the usage of Cilk Language extension features for C/C++.  When the flag
1806 @option{-fcilkplus} is specified, all the Cilk Plus components are converted 
1807 to the appropriate C/C++ code.  The present implementation follows ABI version 
1808 0.9.  There are four major parts to Cilk Plus language 
1809 extension: Array Notations, Cilk Keywords, SIMD annotations and elemental 
1810 functions.  Detailed information about Cilk Plus can be found at 
1811 @w{@uref{http://www.cilkplus.org}}. 
1813 @item -fgnu-tm
1814 @opindex fgnu-tm
1815 When the option @option{-fgnu-tm} is specified, the compiler
1816 generates code for the Linux variant of Intel's current Transactional
1817 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1818 an experimental feature whose interface may change in future versions
1819 of GCC, as the official specification changes.  Please note that not
1820 all architectures are supported for this feature.
1822 For more information on GCC's support for transactional memory,
1823 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1824 Transactional Memory Library}.
1826 Note that the transactional memory feature is not supported with
1827 non-call exceptions (@option{-fnon-call-exceptions}).
1829 @item -fms-extensions
1830 @opindex fms-extensions
1831 Accept some non-standard constructs used in Microsoft header files.
1833 In C++ code, this allows member names in structures to be similar
1834 to previous types declarations.
1836 @smallexample
1837 typedef int UOW;
1838 struct ABC @{
1839   UOW UOW;
1841 @end smallexample
1843 Some cases of unnamed fields in structures and unions are only
1844 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1845 fields within structs/unions}, for details.
1847 @item -fplan9-extensions
1848 Accept some non-standard constructs used in Plan 9 code.
1850 This enables @option{-fms-extensions}, permits passing pointers to
1851 structures with anonymous fields to functions that expect pointers to
1852 elements of the type of the field, and permits referring to anonymous
1853 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1854 struct/union fields within structs/unions}, for details.  This is only
1855 supported for C, not C++.
1857 @item -trigraphs
1858 @opindex trigraphs
1859 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1860 options for strict ISO C conformance) implies @option{-trigraphs}.
1862 @cindex traditional C language
1863 @cindex C language, traditional
1864 @item -traditional
1865 @itemx -traditional-cpp
1866 @opindex traditional-cpp
1867 @opindex traditional
1868 Formerly, these options caused GCC to attempt to emulate a pre-standard
1869 C compiler.  They are now only supported with the @option{-E} switch.
1870 The preprocessor continues to support a pre-standard mode.  See the GNU
1871 CPP manual for details.
1873 @item -fcond-mismatch
1874 @opindex fcond-mismatch
1875 Allow conditional expressions with mismatched types in the second and
1876 third arguments.  The value of such an expression is void.  This option
1877 is not supported for C++.
1879 @item -flax-vector-conversions
1880 @opindex flax-vector-conversions
1881 Allow implicit conversions between vectors with differing numbers of
1882 elements and/or incompatible element types.  This option should not be
1883 used for new code.
1885 @item -funsigned-char
1886 @opindex funsigned-char
1887 Let the type @code{char} be unsigned, like @code{unsigned char}.
1889 Each kind of machine has a default for what @code{char} should
1890 be.  It is either like @code{unsigned char} by default or like
1891 @code{signed char} by default.
1893 Ideally, a portable program should always use @code{signed char} or
1894 @code{unsigned char} when it depends on the signedness of an object.
1895 But many programs have been written to use plain @code{char} and
1896 expect it to be signed, or expect it to be unsigned, depending on the
1897 machines they were written for.  This option, and its inverse, let you
1898 make such a program work with the opposite default.
1900 The type @code{char} is always a distinct type from each of
1901 @code{signed char} or @code{unsigned char}, even though its behavior
1902 is always just like one of those two.
1904 @item -fsigned-char
1905 @opindex fsigned-char
1906 Let the type @code{char} be signed, like @code{signed char}.
1908 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1909 the negative form of @option{-funsigned-char}.  Likewise, the option
1910 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1912 @item -fsigned-bitfields
1913 @itemx -funsigned-bitfields
1914 @itemx -fno-signed-bitfields
1915 @itemx -fno-unsigned-bitfields
1916 @opindex fsigned-bitfields
1917 @opindex funsigned-bitfields
1918 @opindex fno-signed-bitfields
1919 @opindex fno-unsigned-bitfields
1920 These options control whether a bit-field is signed or unsigned, when the
1921 declaration does not use either @code{signed} or @code{unsigned}.  By
1922 default, such a bit-field is signed, because this is consistent: the
1923 basic integer types such as @code{int} are signed types.
1924 @end table
1926 @node C++ Dialect Options
1927 @section Options Controlling C++ Dialect
1929 @cindex compiler options, C++
1930 @cindex C++ options, command-line
1931 @cindex options, C++
1932 This section describes the command-line options that are only meaningful
1933 for C++ programs.  You can also use most of the GNU compiler options
1934 regardless of what language your program is in.  For example, you
1935 might compile a file @code{firstClass.C} like this:
1937 @smallexample
1938 g++ -g -frepo -O -c firstClass.C
1939 @end smallexample
1941 @noindent
1942 In this example, only @option{-frepo} is an option meant
1943 only for C++ programs; you can use the other options with any
1944 language supported by GCC@.
1946 Here is a list of options that are @emph{only} for compiling C++ programs:
1948 @table @gcctabopt
1950 @item -fabi-version=@var{n}
1951 @opindex fabi-version
1952 Use version @var{n} of the C++ ABI@.  The default is version 2.
1954 Version 0 refers to the version conforming most closely to
1955 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1956 will change in different versions of G++ as ABI bugs are fixed.
1958 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1960 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1962 Version 3 corrects an error in mangling a constant address as a
1963 template argument.
1965 Version 4, which first appeared in G++ 4.5, implements a standard
1966 mangling for vector types.
1968 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1969 attribute const/volatile on function pointer types, decltype of a
1970 plain decl, and use of a function parameter in the declaration of
1971 another parameter.
1973 Version 6, which first appeared in G++ 4.7, corrects the promotion
1974 behavior of C++11 scoped enums and the mangling of template argument
1975 packs, const/static_cast, prefix ++ and --, and a class scope function
1976 used as a template argument.
1978 See also @option{-Wabi}.
1980 @item -fno-access-control
1981 @opindex fno-access-control
1982 Turn off all access checking.  This switch is mainly useful for working
1983 around bugs in the access control code.
1985 @item -fcheck-new
1986 @opindex fcheck-new
1987 Check that the pointer returned by @code{operator new} is non-null
1988 before attempting to modify the storage allocated.  This check is
1989 normally unnecessary because the C++ standard specifies that
1990 @code{operator new} only returns @code{0} if it is declared
1991 @samp{throw()}, in which case the compiler always checks the
1992 return value even without this option.  In all other cases, when
1993 @code{operator new} has a non-empty exception specification, memory
1994 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1995 @samp{new (nothrow)}.
1997 @item -fconstexpr-depth=@var{n}
1998 @opindex fconstexpr-depth
1999 Set the maximum nested evaluation depth for C++11 constexpr functions
2000 to @var{n}.  A limit is needed to detect endless recursion during
2001 constant expression evaluation.  The minimum specified by the standard
2002 is 512.
2004 @item -fdeduce-init-list
2005 @opindex fdeduce-init-list
2006 Enable deduction of a template type parameter as
2007 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2009 @smallexample
2010 template <class T> auto forward(T t) -> decltype (realfn (t))
2012   return realfn (t);
2015 void f()
2017   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2019 @end smallexample
2021 This deduction was implemented as a possible extension to the
2022 originally proposed semantics for the C++11 standard, but was not part
2023 of the final standard, so it is disabled by default.  This option is
2024 deprecated, and may be removed in a future version of G++.
2026 @item -ffriend-injection
2027 @opindex ffriend-injection
2028 Inject friend functions into the enclosing namespace, so that they are
2029 visible outside the scope of the class in which they are declared.
2030 Friend functions were documented to work this way in the old Annotated
2031 C++ Reference Manual, and versions of G++ before 4.1 always worked
2032 that way.  However, in ISO C++ a friend function that is not declared
2033 in an enclosing scope can only be found using argument dependent
2034 lookup.  This option causes friends to be injected as they were in
2035 earlier releases.
2037 This option is for compatibility, and may be removed in a future
2038 release of G++.
2040 @item -fno-elide-constructors
2041 @opindex fno-elide-constructors
2042 The C++ standard allows an implementation to omit creating a temporary
2043 that is only used to initialize another object of the same type.
2044 Specifying this option disables that optimization, and forces G++ to
2045 call the copy constructor in all cases.
2047 @item -fno-enforce-eh-specs
2048 @opindex fno-enforce-eh-specs
2049 Don't generate code to check for violation of exception specifications
2050 at run time.  This option violates the C++ standard, but may be useful
2051 for reducing code size in production builds, much like defining
2052 @samp{NDEBUG}.  This does not give user code permission to throw
2053 exceptions in violation of the exception specifications; the compiler
2054 still optimizes based on the specifications, so throwing an
2055 unexpected exception results in undefined behavior at run time.
2057 @item -fextern-tls-init
2058 @itemx -fno-extern-tls-init
2059 @opindex fextern-tls-init
2060 @opindex fno-extern-tls-init
2061 The C++11 and OpenMP standards allow @samp{thread_local} and
2062 @samp{threadprivate} variables to have dynamic (runtime)
2063 initialization.  To support this, any use of such a variable goes
2064 through a wrapper function that performs any necessary initialization.
2065 When the use and definition of the variable are in the same
2066 translation unit, this overhead can be optimized away, but when the
2067 use is in a different translation unit there is significant overhead
2068 even if the variable doesn't actually need dynamic initialization.  If
2069 the programmer can be sure that no use of the variable in a
2070 non-defining TU needs to trigger dynamic initialization (either
2071 because the variable is statically initialized, or a use of the
2072 variable in the defining TU will be executed before any uses in
2073 another TU), they can avoid this overhead with the
2074 @option{-fno-extern-tls-init} option.
2076 On targets that support symbol aliases, the default is
2077 @option{-fextern-tls-init}.  On targets that do not support symbol
2078 aliases, the default is @option{-fno-extern-tls-init}.
2080 @item -ffor-scope
2081 @itemx -fno-for-scope
2082 @opindex ffor-scope
2083 @opindex fno-for-scope
2084 If @option{-ffor-scope} is specified, the scope of variables declared in
2085 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2086 as specified by the C++ standard.
2087 If @option{-fno-for-scope} is specified, the scope of variables declared in
2088 a @i{for-init-statement} extends to the end of the enclosing scope,
2089 as was the case in old versions of G++, and other (traditional)
2090 implementations of C++.
2092 If neither flag is given, the default is to follow the standard,
2093 but to allow and give a warning for old-style code that would
2094 otherwise be invalid, or have different behavior.
2096 @item -fno-gnu-keywords
2097 @opindex fno-gnu-keywords
2098 Do not recognize @code{typeof} as a keyword, so that code can use this
2099 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2100 @option{-ansi} implies @option{-fno-gnu-keywords}.
2102 @item -fno-implicit-templates
2103 @opindex fno-implicit-templates
2104 Never emit code for non-inline templates that are instantiated
2105 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2106 @xref{Template Instantiation}, for more information.
2108 @item -fno-implicit-inline-templates
2109 @opindex fno-implicit-inline-templates
2110 Don't emit code for implicit instantiations of inline templates, either.
2111 The default is to handle inlines differently so that compiles with and
2112 without optimization need the same set of explicit instantiations.
2114 @item -fno-implement-inlines
2115 @opindex fno-implement-inlines
2116 To save space, do not emit out-of-line copies of inline functions
2117 controlled by @samp{#pragma implementation}.  This causes linker
2118 errors if these functions are not inlined everywhere they are called.
2120 @item -fms-extensions
2121 @opindex fms-extensions
2122 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2123 int and getting a pointer to member function via non-standard syntax.
2125 @item -fno-nonansi-builtins
2126 @opindex fno-nonansi-builtins
2127 Disable built-in declarations of functions that are not mandated by
2128 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2129 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2131 @item -fnothrow-opt
2132 @opindex fnothrow-opt
2133 Treat a @code{throw()} exception specification as if it were a
2134 @code{noexcept} specification to reduce or eliminate the text size
2135 overhead relative to a function with no exception specification.  If
2136 the function has local variables of types with non-trivial
2137 destructors, the exception specification actually makes the
2138 function smaller because the EH cleanups for those variables can be
2139 optimized away.  The semantic effect is that an exception thrown out of
2140 a function with such an exception specification results in a call
2141 to @code{terminate} rather than @code{unexpected}.
2143 @item -fno-operator-names
2144 @opindex fno-operator-names
2145 Do not treat the operator name keywords @code{and}, @code{bitand},
2146 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2147 synonyms as keywords.
2149 @item -fno-optional-diags
2150 @opindex fno-optional-diags
2151 Disable diagnostics that the standard says a compiler does not need to
2152 issue.  Currently, the only such diagnostic issued by G++ is the one for
2153 a name having multiple meanings within a class.
2155 @item -fpermissive
2156 @opindex fpermissive
2157 Downgrade some diagnostics about nonconformant code from errors to
2158 warnings.  Thus, using @option{-fpermissive} allows some
2159 nonconforming code to compile.
2161 @item -fno-pretty-templates
2162 @opindex fno-pretty-templates
2163 When an error message refers to a specialization of a function
2164 template, the compiler normally prints the signature of the
2165 template followed by the template arguments and any typedefs or
2166 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2167 rather than @code{void f(int)}) so that it's clear which template is
2168 involved.  When an error message refers to a specialization of a class
2169 template, the compiler omits any template arguments that match
2170 the default template arguments for that template.  If either of these
2171 behaviors make it harder to understand the error message rather than
2172 easier, you can use @option{-fno-pretty-templates} to disable them.
2174 @item -frepo
2175 @opindex frepo
2176 Enable automatic template instantiation at link time.  This option also
2177 implies @option{-fno-implicit-templates}.  @xref{Template
2178 Instantiation}, for more information.
2180 @item -fno-rtti
2181 @opindex fno-rtti
2182 Disable generation of information about every class with virtual
2183 functions for use by the C++ run-time type identification features
2184 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2185 of the language, you can save some space by using this flag.  Note that
2186 exception handling uses the same information, but G++ generates it as
2187 needed. The @samp{dynamic_cast} operator can still be used for casts that
2188 do not require run-time type information, i.e.@: casts to @code{void *} or to
2189 unambiguous base classes.
2191 @item -fstats
2192 @opindex fstats
2193 Emit statistics about front-end processing at the end of the compilation.
2194 This information is generally only useful to the G++ development team.
2196 @item -fstrict-enums
2197 @opindex fstrict-enums
2198 Allow the compiler to optimize using the assumption that a value of
2199 enumerated type can only be one of the values of the enumeration (as
2200 defined in the C++ standard; basically, a value that can be
2201 represented in the minimum number of bits needed to represent all the
2202 enumerators).  This assumption may not be valid if the program uses a
2203 cast to convert an arbitrary integer value to the enumerated type.
2205 @item -ftemplate-backtrace-limit=@var{n}
2206 @opindex ftemplate-backtrace-limit
2207 Set the maximum number of template instantiation notes for a single
2208 warning or error to @var{n}.  The default value is 10.
2210 @item -ftemplate-depth=@var{n}
2211 @opindex ftemplate-depth
2212 Set the maximum instantiation depth for template classes to @var{n}.
2213 A limit on the template instantiation depth is needed to detect
2214 endless recursions during template class instantiation.  ANSI/ISO C++
2215 conforming programs must not rely on a maximum depth greater than 17
2216 (changed to 1024 in C++11).  The default value is 900, as the compiler
2217 can run out of stack space before hitting 1024 in some situations.
2219 @item -fno-threadsafe-statics
2220 @opindex fno-threadsafe-statics
2221 Do not emit the extra code to use the routines specified in the C++
2222 ABI for thread-safe initialization of local statics.  You can use this
2223 option to reduce code size slightly in code that doesn't need to be
2224 thread-safe.
2226 @item -fuse-cxa-atexit
2227 @opindex fuse-cxa-atexit
2228 Register destructors for objects with static storage duration with the
2229 @code{__cxa_atexit} function rather than the @code{atexit} function.
2230 This option is required for fully standards-compliant handling of static
2231 destructors, but only works if your C library supports
2232 @code{__cxa_atexit}.
2234 @item -fno-use-cxa-get-exception-ptr
2235 @opindex fno-use-cxa-get-exception-ptr
2236 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2237 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2238 if the runtime routine is not available.
2240 @item -fvisibility-inlines-hidden
2241 @opindex fvisibility-inlines-hidden
2242 This switch declares that the user does not attempt to compare
2243 pointers to inline functions or methods where the addresses of the two functions
2244 are taken in different shared objects.
2246 The effect of this is that GCC may, effectively, mark inline methods with
2247 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2248 appear in the export table of a DSO and do not require a PLT indirection
2249 when used within the DSO@.  Enabling this option can have a dramatic effect
2250 on load and link times of a DSO as it massively reduces the size of the
2251 dynamic export table when the library makes heavy use of templates.
2253 The behavior of this switch is not quite the same as marking the
2254 methods as hidden directly, because it does not affect static variables
2255 local to the function or cause the compiler to deduce that
2256 the function is defined in only one shared object.
2258 You may mark a method as having a visibility explicitly to negate the
2259 effect of the switch for that method.  For example, if you do want to
2260 compare pointers to a particular inline method, you might mark it as
2261 having default visibility.  Marking the enclosing class with explicit
2262 visibility has no effect.
2264 Explicitly instantiated inline methods are unaffected by this option
2265 as their linkage might otherwise cross a shared library boundary.
2266 @xref{Template Instantiation}.
2268 @item -fvisibility-ms-compat
2269 @opindex fvisibility-ms-compat
2270 This flag attempts to use visibility settings to make GCC's C++
2271 linkage model compatible with that of Microsoft Visual Studio.
2273 The flag makes these changes to GCC's linkage model:
2275 @enumerate
2276 @item
2277 It sets the default visibility to @code{hidden}, like
2278 @option{-fvisibility=hidden}.
2280 @item
2281 Types, but not their members, are not hidden by default.
2283 @item
2284 The One Definition Rule is relaxed for types without explicit
2285 visibility specifications that are defined in more than one
2286 shared object: those declarations are permitted if they are
2287 permitted when this option is not used.
2288 @end enumerate
2290 In new code it is better to use @option{-fvisibility=hidden} and
2291 export those classes that are intended to be externally visible.
2292 Unfortunately it is possible for code to rely, perhaps accidentally,
2293 on the Visual Studio behavior.
2295 Among the consequences of these changes are that static data members
2296 of the same type with the same name but defined in different shared
2297 objects are different, so changing one does not change the other;
2298 and that pointers to function members defined in different shared
2299 objects may not compare equal.  When this flag is given, it is a
2300 violation of the ODR to define types with the same name differently.
2302 @item -fno-weak
2303 @opindex fno-weak
2304 Do not use weak symbol support, even if it is provided by the linker.
2305 By default, G++ uses weak symbols if they are available.  This
2306 option exists only for testing, and should not be used by end-users;
2307 it results in inferior code and has no benefits.  This option may
2308 be removed in a future release of G++.
2310 @item -nostdinc++
2311 @opindex nostdinc++
2312 Do not search for header files in the standard directories specific to
2313 C++, but do still search the other standard directories.  (This option
2314 is used when building the C++ library.)
2315 @end table
2317 In addition, these optimization, warning, and code generation options
2318 have meanings only for C++ programs:
2320 @table @gcctabopt
2321 @item -fno-default-inline
2322 @opindex fno-default-inline
2323 Do not assume @samp{inline} for functions defined inside a class scope.
2324 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2325 functions have linkage like inline functions; they just aren't
2326 inlined by default.
2328 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2329 @opindex Wabi
2330 @opindex Wno-abi
2331 Warn when G++ generates code that is probably not compatible with the
2332 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2333 all such cases, there are probably some cases that are not warned about,
2334 even though G++ is generating incompatible code.  There may also be
2335 cases where warnings are emitted even though the code that is generated
2336 is compatible.
2338 You should rewrite your code to avoid these warnings if you are
2339 concerned about the fact that code generated by G++ may not be binary
2340 compatible with code generated by other compilers.
2342 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2344 @itemize @bullet
2346 @item
2347 A template with a non-type template parameter of reference type is
2348 mangled incorrectly:
2349 @smallexample
2350 extern int N;
2351 template <int &> struct S @{@};
2352 void n (S<N>) @{2@}
2353 @end smallexample
2355 This is fixed in @option{-fabi-version=3}.
2357 @item
2358 SIMD vector types declared using @code{__attribute ((vector_size))} are
2359 mangled in a non-standard way that does not allow for overloading of
2360 functions taking vectors of different sizes.
2362 The mangling is changed in @option{-fabi-version=4}.
2363 @end itemize
2365 The known incompatibilities in @option{-fabi-version=1} include:
2367 @itemize @bullet
2369 @item
2370 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2371 pack data into the same byte as a base class.  For example:
2373 @smallexample
2374 struct A @{ virtual void f(); int f1 : 1; @};
2375 struct B : public A @{ int f2 : 1; @};
2376 @end smallexample
2378 @noindent
2379 In this case, G++ places @code{B::f2} into the same byte
2380 as @code{A::f1}; other compilers do not.  You can avoid this problem
2381 by explicitly padding @code{A} so that its size is a multiple of the
2382 byte size on your platform; that causes G++ and other compilers to
2383 lay out @code{B} identically.
2385 @item
2386 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2387 tail padding when laying out virtual bases.  For example:
2389 @smallexample
2390 struct A @{ virtual void f(); char c1; @};
2391 struct B @{ B(); char c2; @};
2392 struct C : public A, public virtual B @{@};
2393 @end smallexample
2395 @noindent
2396 In this case, G++ does not place @code{B} into the tail-padding for
2397 @code{A}; other compilers do.  You can avoid this problem by
2398 explicitly padding @code{A} so that its size is a multiple of its
2399 alignment (ignoring virtual base classes); that causes G++ and other
2400 compilers to lay out @code{C} identically.
2402 @item
2403 Incorrect handling of bit-fields with declared widths greater than that
2404 of their underlying types, when the bit-fields appear in a union.  For
2405 example:
2407 @smallexample
2408 union U @{ int i : 4096; @};
2409 @end smallexample
2411 @noindent
2412 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2413 union too small by the number of bits in an @code{int}.
2415 @item
2416 Empty classes can be placed at incorrect offsets.  For example:
2418 @smallexample
2419 struct A @{@};
2421 struct B @{
2422   A a;
2423   virtual void f ();
2426 struct C : public B, public A @{@};
2427 @end smallexample
2429 @noindent
2430 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2431 it should be placed at offset zero.  G++ mistakenly believes that the
2432 @code{A} data member of @code{B} is already at offset zero.
2434 @item
2435 Names of template functions whose types involve @code{typename} or
2436 template template parameters can be mangled incorrectly.
2438 @smallexample
2439 template <typename Q>
2440 void f(typename Q::X) @{@}
2442 template <template <typename> class Q>
2443 void f(typename Q<int>::X) @{@}
2444 @end smallexample
2446 @noindent
2447 Instantiations of these templates may be mangled incorrectly.
2449 @end itemize
2451 It also warns about psABI-related changes.  The known psABI changes at this
2452 point include:
2454 @itemize @bullet
2456 @item
2457 For SysV/x86-64, unions with @code{long double} members are 
2458 passed in memory as specified in psABI.  For example:
2460 @smallexample
2461 union U @{
2462   long double ld;
2463   int i;
2465 @end smallexample
2467 @noindent
2468 @code{union U} is always passed in memory.
2470 @end itemize
2472 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2473 @opindex Wctor-dtor-privacy
2474 @opindex Wno-ctor-dtor-privacy
2475 Warn when a class seems unusable because all the constructors or
2476 destructors in that class are private, and it has neither friends nor
2477 public static member functions.  Also warn if there are no non-private
2478 methods, and there's at least one private member function that isn't
2479 a constructor or destructor.
2481 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2482 @opindex Wdelete-non-virtual-dtor
2483 @opindex Wno-delete-non-virtual-dtor
2484 Warn when @samp{delete} is used to destroy an instance of a class that
2485 has virtual functions and non-virtual destructor. It is unsafe to delete
2486 an instance of a derived class through a pointer to a base class if the
2487 base class does not have a virtual destructor.  This warning is enabled
2488 by @option{-Wall}.
2490 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2491 @opindex Wliteral-suffix
2492 @opindex Wno-literal-suffix
2493 Warn when a string or character literal is followed by a ud-suffix which does
2494 not begin with an underscore.  As a conforming extension, GCC treats such
2495 suffixes as separate preprocessing tokens in order to maintain backwards
2496 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2497 For example:
2499 @smallexample
2500 #define __STDC_FORMAT_MACROS
2501 #include <inttypes.h>
2502 #include <stdio.h>
2504 int main() @{
2505   int64_t i64 = 123;
2506   printf("My int64: %"PRId64"\n", i64);
2508 @end smallexample
2510 In this case, @code{PRId64} is treated as a separate preprocessing token.
2512 This warning is enabled by default.
2514 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2515 @opindex Wnarrowing
2516 @opindex Wno-narrowing
2517 Warn when a narrowing conversion prohibited by C++11 occurs within
2518 @samp{@{ @}}, e.g.
2520 @smallexample
2521 int i = @{ 2.2 @}; // error: narrowing from double to int
2522 @end smallexample
2524 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2526 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2527 required by the standard.  Note that this does not affect the meaning
2528 of well-formed code; narrowing conversions are still considered
2529 ill-formed in SFINAE context.
2531 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2532 @opindex Wnoexcept
2533 @opindex Wno-noexcept
2534 Warn when a noexcept-expression evaluates to false because of a call
2535 to a function that does not have a non-throwing exception
2536 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2537 the compiler to never throw an exception.
2539 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2540 @opindex Wnon-virtual-dtor
2541 @opindex Wno-non-virtual-dtor
2542 Warn when a class has virtual functions and an accessible non-virtual
2543 destructor, in which case it is possible but unsafe to delete
2544 an instance of a derived class through a pointer to the base class.
2545 This warning is also enabled if @option{-Weffc++} is specified.
2547 @item -Wreorder @r{(C++ and Objective-C++ only)}
2548 @opindex Wreorder
2549 @opindex Wno-reorder
2550 @cindex reordering, warning
2551 @cindex warning for reordering of member initializers
2552 Warn when the order of member initializers given in the code does not
2553 match the order in which they must be executed.  For instance:
2555 @smallexample
2556 struct A @{
2557   int i;
2558   int j;
2559   A(): j (0), i (1) @{ @}
2561 @end smallexample
2563 @noindent
2564 The compiler rearranges the member initializers for @samp{i}
2565 and @samp{j} to match the declaration order of the members, emitting
2566 a warning to that effect.  This warning is enabled by @option{-Wall}.
2568 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2569 @opindex fext-numeric-literals
2570 @opindex fno-ext-numeric-literals
2571 Accept imaginary, fixed-point, or machine-defined
2572 literal number suffixes as GNU extensions.
2573 When this option is turned off these suffixes are treated
2574 as C++11 user-defined literal numeric suffixes.
2575 This is on by default for all pre-C++11 dialects and all GNU dialects:
2576 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2577 @option{-std=gnu++1y}.
2578 This option is off by default
2579 for ISO C++11 onwards (@option{-std=c++11}, ...).
2580 @end table
2582 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2584 @table @gcctabopt
2585 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2586 @opindex Weffc++
2587 @opindex Wno-effc++
2588 Warn about violations of the following style guidelines from Scott Meyers'
2589 @cite{Effective C++, Second Edition} book:
2591 @itemize @bullet
2592 @item
2593 Item 11:  Define a copy constructor and an assignment operator for classes
2594 with dynamically-allocated memory.
2596 @item
2597 Item 12:  Prefer initialization to assignment in constructors.
2599 @item
2600 Item 14:  Make destructors virtual in base classes.
2602 @item
2603 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2605 @item
2606 Item 23:  Don't try to return a reference when you must return an object.
2608 @end itemize
2610 Also warn about violations of the following style guidelines from
2611 Scott Meyers' @cite{More Effective C++} book:
2613 @itemize @bullet
2614 @item
2615 Item 6:  Distinguish between prefix and postfix forms of increment and
2616 decrement operators.
2618 @item
2619 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2621 @end itemize
2623 When selecting this option, be aware that the standard library
2624 headers do not obey all of these guidelines; use @samp{grep -v}
2625 to filter out those warnings.
2627 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2628 @opindex Wstrict-null-sentinel
2629 @opindex Wno-strict-null-sentinel
2630 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2631 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2632 to @code{__null}.  Although it is a null pointer constant rather than a
2633 null pointer, it is guaranteed to be of the same size as a pointer.
2634 But this use is not portable across different compilers.
2636 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2637 @opindex Wno-non-template-friend
2638 @opindex Wnon-template-friend
2639 Disable warnings when non-templatized friend functions are declared
2640 within a template.  Since the advent of explicit template specification
2641 support in G++, if the name of the friend is an unqualified-id (i.e.,
2642 @samp{friend foo(int)}), the C++ language specification demands that the
2643 friend declare or define an ordinary, nontemplate function.  (Section
2644 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2645 could be interpreted as a particular specialization of a templatized
2646 function.  Because this non-conforming behavior is no longer the default
2647 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2648 check existing code for potential trouble spots and is on by default.
2649 This new compiler behavior can be turned off with
2650 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2651 but disables the helpful warning.
2653 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2654 @opindex Wold-style-cast
2655 @opindex Wno-old-style-cast
2656 Warn if an old-style (C-style) cast to a non-void type is used within
2657 a C++ program.  The new-style casts (@samp{dynamic_cast},
2658 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2659 less vulnerable to unintended effects and much easier to search for.
2661 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2662 @opindex Woverloaded-virtual
2663 @opindex Wno-overloaded-virtual
2664 @cindex overloaded virtual function, warning
2665 @cindex warning for overloaded virtual function
2666 Warn when a function declaration hides virtual functions from a
2667 base class.  For example, in:
2669 @smallexample
2670 struct A @{
2671   virtual void f();
2674 struct B: public A @{
2675   void f(int);
2677 @end smallexample
2679 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2680 like:
2682 @smallexample
2683 B* b;
2684 b->f();
2685 @end smallexample
2687 @noindent
2688 fails to compile.
2690 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2691 @opindex Wno-pmf-conversions
2692 @opindex Wpmf-conversions
2693 Disable the diagnostic for converting a bound pointer to member function
2694 to a plain pointer.
2696 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2697 @opindex Wsign-promo
2698 @opindex Wno-sign-promo
2699 Warn when overload resolution chooses a promotion from unsigned or
2700 enumerated type to a signed type, over a conversion to an unsigned type of
2701 the same size.  Previous versions of G++ tried to preserve
2702 unsignedness, but the standard mandates the current behavior.
2703 @end table
2705 @node Objective-C and Objective-C++ Dialect Options
2706 @section Options Controlling Objective-C and Objective-C++ Dialects
2708 @cindex compiler options, Objective-C and Objective-C++
2709 @cindex Objective-C and Objective-C++ options, command-line
2710 @cindex options, Objective-C and Objective-C++
2711 (NOTE: This manual does not describe the Objective-C and Objective-C++
2712 languages themselves.  @xref{Standards,,Language Standards
2713 Supported by GCC}, for references.)
2715 This section describes the command-line options that are only meaningful
2716 for Objective-C and Objective-C++ programs.  You can also use most of
2717 the language-independent GNU compiler options.
2718 For example, you might compile a file @code{some_class.m} like this:
2720 @smallexample
2721 gcc -g -fgnu-runtime -O -c some_class.m
2722 @end smallexample
2724 @noindent
2725 In this example, @option{-fgnu-runtime} is an option meant only for
2726 Objective-C and Objective-C++ programs; you can use the other options with
2727 any language supported by GCC@.
2729 Note that since Objective-C is an extension of the C language, Objective-C
2730 compilations may also use options specific to the C front-end (e.g.,
2731 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2732 C++-specific options (e.g., @option{-Wabi}).
2734 Here is a list of options that are @emph{only} for compiling Objective-C
2735 and Objective-C++ programs:
2737 @table @gcctabopt
2738 @item -fconstant-string-class=@var{class-name}
2739 @opindex fconstant-string-class
2740 Use @var{class-name} as the name of the class to instantiate for each
2741 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2742 class name is @code{NXConstantString} if the GNU runtime is being used, and
2743 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2744 @option{-fconstant-cfstrings} option, if also present, overrides the
2745 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2746 to be laid out as constant CoreFoundation strings.
2748 @item -fgnu-runtime
2749 @opindex fgnu-runtime
2750 Generate object code compatible with the standard GNU Objective-C
2751 runtime.  This is the default for most types of systems.
2753 @item -fnext-runtime
2754 @opindex fnext-runtime
2755 Generate output compatible with the NeXT runtime.  This is the default
2756 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2757 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2758 used.
2760 @item -fno-nil-receivers
2761 @opindex fno-nil-receivers
2762 Assume that all Objective-C message dispatches (@code{[receiver
2763 message:arg]}) in this translation unit ensure that the receiver is
2764 not @code{nil}.  This allows for more efficient entry points in the
2765 runtime to be used.  This option is only available in conjunction with
2766 the NeXT runtime and ABI version 0 or 1.
2768 @item -fobjc-abi-version=@var{n}
2769 @opindex fobjc-abi-version
2770 Use version @var{n} of the Objective-C ABI for the selected runtime.
2771 This option is currently supported only for the NeXT runtime.  In that
2772 case, Version 0 is the traditional (32-bit) ABI without support for
2773 properties and other Objective-C 2.0 additions.  Version 1 is the
2774 traditional (32-bit) ABI with support for properties and other
2775 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2776 nothing is specified, the default is Version 0 on 32-bit target
2777 machines, and Version 2 on 64-bit target machines.
2779 @item -fobjc-call-cxx-cdtors
2780 @opindex fobjc-call-cxx-cdtors
2781 For each Objective-C class, check if any of its instance variables is a
2782 C++ object with a non-trivial default constructor.  If so, synthesize a
2783 special @code{- (id) .cxx_construct} instance method which runs
2784 non-trivial default constructors on any such instance variables, in order,
2785 and then return @code{self}.  Similarly, check if any instance variable
2786 is a C++ object with a non-trivial destructor, and if so, synthesize a
2787 special @code{- (void) .cxx_destruct} method which runs
2788 all such default destructors, in reverse order.
2790 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2791 methods thusly generated only operate on instance variables
2792 declared in the current Objective-C class, and not those inherited
2793 from superclasses.  It is the responsibility of the Objective-C
2794 runtime to invoke all such methods in an object's inheritance
2795 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2796 by the runtime immediately after a new object instance is allocated;
2797 the @code{- (void) .cxx_destruct} methods are invoked immediately
2798 before the runtime deallocates an object instance.
2800 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2801 support for invoking the @code{- (id) .cxx_construct} and
2802 @code{- (void) .cxx_destruct} methods.
2804 @item -fobjc-direct-dispatch
2805 @opindex fobjc-direct-dispatch
2806 Allow fast jumps to the message dispatcher.  On Darwin this is
2807 accomplished via the comm page.
2809 @item -fobjc-exceptions
2810 @opindex fobjc-exceptions
2811 Enable syntactic support for structured exception handling in
2812 Objective-C, similar to what is offered by C++ and Java.  This option
2813 is required to use the Objective-C keywords @code{@@try},
2814 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2815 @code{@@synchronized}.  This option is available with both the GNU
2816 runtime and the NeXT runtime (but not available in conjunction with
2817 the NeXT runtime on Mac OS X 10.2 and earlier).
2819 @item -fobjc-gc
2820 @opindex fobjc-gc
2821 Enable garbage collection (GC) in Objective-C and Objective-C++
2822 programs.  This option is only available with the NeXT runtime; the
2823 GNU runtime has a different garbage collection implementation that
2824 does not require special compiler flags.
2826 @item -fobjc-nilcheck
2827 @opindex fobjc-nilcheck
2828 For the NeXT runtime with version 2 of the ABI, check for a nil
2829 receiver in method invocations before doing the actual method call.
2830 This is the default and can be disabled using
2831 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2832 checked for nil in this way no matter what this flag is set to.
2833 Currently this flag does nothing when the GNU runtime, or an older
2834 version of the NeXT runtime ABI, is used.
2836 @item -fobjc-std=objc1
2837 @opindex fobjc-std
2838 Conform to the language syntax of Objective-C 1.0, the language
2839 recognized by GCC 4.0.  This only affects the Objective-C additions to
2840 the C/C++ language; it does not affect conformance to C/C++ standards,
2841 which is controlled by the separate C/C++ dialect option flags.  When
2842 this option is used with the Objective-C or Objective-C++ compiler,
2843 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2844 This is useful if you need to make sure that your Objective-C code can
2845 be compiled with older versions of GCC@.
2847 @item -freplace-objc-classes
2848 @opindex freplace-objc-classes
2849 Emit a special marker instructing @command{ld(1)} not to statically link in
2850 the resulting object file, and allow @command{dyld(1)} to load it in at
2851 run time instead.  This is used in conjunction with the Fix-and-Continue
2852 debugging mode, where the object file in question may be recompiled and
2853 dynamically reloaded in the course of program execution, without the need
2854 to restart the program itself.  Currently, Fix-and-Continue functionality
2855 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2856 and later.
2858 @item -fzero-link
2859 @opindex fzero-link
2860 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2861 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2862 compile time) with static class references that get initialized at load time,
2863 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2864 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2865 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2866 for individual class implementations to be modified during program execution.
2867 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2868 regardless of command-line options.
2870 @item -gen-decls
2871 @opindex gen-decls
2872 Dump interface declarations for all classes seen in the source file to a
2873 file named @file{@var{sourcename}.decl}.
2875 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2876 @opindex Wassign-intercept
2877 @opindex Wno-assign-intercept
2878 Warn whenever an Objective-C assignment is being intercepted by the
2879 garbage collector.
2881 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2882 @opindex Wno-protocol
2883 @opindex Wprotocol
2884 If a class is declared to implement a protocol, a warning is issued for
2885 every method in the protocol that is not implemented by the class.  The
2886 default behavior is to issue a warning for every method not explicitly
2887 implemented in the class, even if a method implementation is inherited
2888 from the superclass.  If you use the @option{-Wno-protocol} option, then
2889 methods inherited from the superclass are considered to be implemented,
2890 and no warning is issued for them.
2892 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2893 @opindex Wselector
2894 @opindex Wno-selector
2895 Warn if multiple methods of different types for the same selector are
2896 found during compilation.  The check is performed on the list of methods
2897 in the final stage of compilation.  Additionally, a check is performed
2898 for each selector appearing in a @code{@@selector(@dots{})}
2899 expression, and a corresponding method for that selector has been found
2900 during compilation.  Because these checks scan the method table only at
2901 the end of compilation, these warnings are not produced if the final
2902 stage of compilation is not reached, for example because an error is
2903 found during compilation, or because the @option{-fsyntax-only} option is
2904 being used.
2906 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2907 @opindex Wstrict-selector-match
2908 @opindex Wno-strict-selector-match
2909 Warn if multiple methods with differing argument and/or return types are
2910 found for a given selector when attempting to send a message using this
2911 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2912 is off (which is the default behavior), the compiler omits such warnings
2913 if any differences found are confined to types that share the same size
2914 and alignment.
2916 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2917 @opindex Wundeclared-selector
2918 @opindex Wno-undeclared-selector
2919 Warn if a @code{@@selector(@dots{})} expression referring to an
2920 undeclared selector is found.  A selector is considered undeclared if no
2921 method with that name has been declared before the
2922 @code{@@selector(@dots{})} expression, either explicitly in an
2923 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2924 an @code{@@implementation} section.  This option always performs its
2925 checks as soon as a @code{@@selector(@dots{})} expression is found,
2926 while @option{-Wselector} only performs its checks in the final stage of
2927 compilation.  This also enforces the coding style convention
2928 that methods and selectors must be declared before being used.
2930 @item -print-objc-runtime-info
2931 @opindex print-objc-runtime-info
2932 Generate C header describing the largest structure that is passed by
2933 value, if any.
2935 @end table
2937 @node Language Independent Options
2938 @section Options to Control Diagnostic Messages Formatting
2939 @cindex options to control diagnostics formatting
2940 @cindex diagnostic messages
2941 @cindex message formatting
2943 Traditionally, diagnostic messages have been formatted irrespective of
2944 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
2945 options described below
2946 to control the formatting algorithm for diagnostic messages, 
2947 e.g.@: how many characters per line, how often source location
2948 information should be reported.  Note that some language front ends may not
2949 honor these options.
2951 @table @gcctabopt
2952 @item -fmessage-length=@var{n}
2953 @opindex fmessage-length
2954 Try to format error messages so that they fit on lines of about @var{n}
2955 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2956 the front ends supported by GCC@.  If @var{n} is zero, then no
2957 line-wrapping is done; each error message appears on a single
2958 line.
2960 @item -fdiagnostics-show-location=once
2961 @opindex fdiagnostics-show-location
2962 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2963 reporter to emit source location information @emph{once}; that is, in
2964 case the message is too long to fit on a single physical line and has to
2965 be wrapped, the source location won't be emitted (as prefix) again,
2966 over and over, in subsequent continuation lines.  This is the default
2967 behavior.
2969 @item -fdiagnostics-show-location=every-line
2970 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2971 messages reporter to emit the same source location information (as
2972 prefix) for physical lines that result from the process of breaking
2973 a message which is too long to fit on a single line.
2975 @item -fdiagnostics-color[=@var{WHEN}]
2976 @itemx -fno-diagnostics-color
2977 @opindex fdiagnostics-color
2978 @cindex highlight, color, colour
2979 @vindex GCC_COLORS @r{environment variable}
2980 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
2981 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
2982 variable isn't present in the environment, and @samp{auto} otherwise.
2983 @samp{auto} means to use color only when the standard error is a terminal.
2984 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
2985 aliases for @option{-fdiagnostics-color=always} and
2986 @option{-fdiagnostics-color=never}, respectively.
2988 The colors are defined by the environment variable @env{GCC_COLORS}.
2989 Its value is a colon-separated list of capabilities and Select Graphic
2990 Rendition (SGR) substrings. SGR commands are interpreted by the
2991 terminal or terminal emulator.  (See the section in the documentation
2992 of your text terminal for permitted values and their meanings as
2993 character attributes.)  These substring values are integers in decimal
2994 representation and can be concatenated with semicolons.
2995 Common values to concatenate include
2996 @samp{1} for bold,
2997 @samp{4} for underline,
2998 @samp{5} for blink,
2999 @samp{7} for inverse,
3000 @samp{39} for default foreground color,
3001 @samp{30} to @samp{37} for foreground colors,
3002 @samp{90} to @samp{97} for 16-color mode foreground colors,
3003 @samp{38;5;0} to @samp{38;5;255}
3004 for 88-color and 256-color modes foreground colors,
3005 @samp{49} for default background color,
3006 @samp{40} to @samp{47} for background colors,
3007 @samp{100} to @samp{107} for 16-color mode background colors,
3008 and @samp{48;5;0} to @samp{48;5;255}
3009 for 88-color and 256-color modes background colors.
3011 The default @env{GCC_COLORS} is
3012 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3013 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3014 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3015 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3016 string disables colors.
3017 Supported capabilities are as follows.
3019 @table @code
3020 @item error=
3021 @vindex error GCC_COLORS @r{capability}
3022 SGR substring for error: markers.
3024 @item warning=
3025 @vindex warning GCC_COLORS @r{capability}
3026 SGR substring for warning: markers.
3028 @item note=
3029 @vindex note GCC_COLORS @r{capability}
3030 SGR substring for note: markers.
3032 @item caret=
3033 @vindex caret GCC_COLORS @r{capability}
3034 SGR substring for caret line.
3036 @item locus=
3037 @vindex locus GCC_COLORS @r{capability}
3038 SGR substring for location information, @samp{file:line} or
3039 @samp{file:line:column} etc.
3041 @item quote=
3042 @vindex quote GCC_COLORS @r{capability}
3043 SGR substring for information printed within quotes.
3044 @end table
3046 @item -fno-diagnostics-show-option
3047 @opindex fno-diagnostics-show-option
3048 @opindex fdiagnostics-show-option
3049 By default, each diagnostic emitted includes text indicating the
3050 command-line option that directly controls the diagnostic (if such an
3051 option is known to the diagnostic machinery).  Specifying the
3052 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3054 @item -fno-diagnostics-show-caret
3055 @opindex fno-diagnostics-show-caret
3056 @opindex fdiagnostics-show-caret
3057 By default, each diagnostic emitted includes the original source line
3058 and a caret '^' indicating the column.  This option suppresses this
3059 information.
3061 @end table
3063 @node Warning Options
3064 @section Options to Request or Suppress Warnings
3065 @cindex options to control warnings
3066 @cindex warning messages
3067 @cindex messages, warning
3068 @cindex suppressing warnings
3070 Warnings are diagnostic messages that report constructions that
3071 are not inherently erroneous but that are risky or suggest there
3072 may have been an error.
3074 The following language-independent options do not enable specific
3075 warnings but control the kinds of diagnostics produced by GCC@.
3077 @table @gcctabopt
3078 @cindex syntax checking
3079 @item -fsyntax-only
3080 @opindex fsyntax-only
3081 Check the code for syntax errors, but don't do anything beyond that.
3083 @item -fmax-errors=@var{n}
3084 @opindex fmax-errors
3085 Limits the maximum number of error messages to @var{n}, at which point
3086 GCC bails out rather than attempting to continue processing the source
3087 code.  If @var{n} is 0 (the default), there is no limit on the number
3088 of error messages produced.  If @option{-Wfatal-errors} is also
3089 specified, then @option{-Wfatal-errors} takes precedence over this
3090 option.
3092 @item -w
3093 @opindex w
3094 Inhibit all warning messages.
3096 @item -Werror
3097 @opindex Werror
3098 @opindex Wno-error
3099 Make all warnings into errors.
3101 @item -Werror=
3102 @opindex Werror=
3103 @opindex Wno-error=
3104 Make the specified warning into an error.  The specifier for a warning
3105 is appended; for example @option{-Werror=switch} turns the warnings
3106 controlled by @option{-Wswitch} into errors.  This switch takes a
3107 negative form, to be used to negate @option{-Werror} for specific
3108 warnings; for example @option{-Wno-error=switch} makes
3109 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3110 is in effect.
3112 The warning message for each controllable warning includes the
3113 option that controls the warning.  That option can then be used with
3114 @option{-Werror=} and @option{-Wno-error=} as described above.
3115 (Printing of the option in the warning message can be disabled using the
3116 @option{-fno-diagnostics-show-option} flag.)
3118 Note that specifying @option{-Werror=}@var{foo} automatically implies
3119 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3120 imply anything.
3122 @item -Wfatal-errors
3123 @opindex Wfatal-errors
3124 @opindex Wno-fatal-errors
3125 This option causes the compiler to abort compilation on the first error
3126 occurred rather than trying to keep going and printing further error
3127 messages.
3129 @end table
3131 You can request many specific warnings with options beginning with
3132 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3133 implicit declarations.  Each of these specific warning options also
3134 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3135 example, @option{-Wno-implicit}.  This manual lists only one of the
3136 two forms, whichever is not the default.  For further
3137 language-specific options also refer to @ref{C++ Dialect Options} and
3138 @ref{Objective-C and Objective-C++ Dialect Options}.
3140 When an unrecognized warning option is requested (e.g.,
3141 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3142 that the option is not recognized.  However, if the @option{-Wno-} form
3143 is used, the behavior is slightly different: no diagnostic is
3144 produced for @option{-Wno-unknown-warning} unless other diagnostics
3145 are being produced.  This allows the use of new @option{-Wno-} options
3146 with old compilers, but if something goes wrong, the compiler
3147 warns that an unrecognized option is present.
3149 @table @gcctabopt
3150 @item -Wpedantic
3151 @itemx -pedantic
3152 @opindex pedantic
3153 @opindex Wpedantic
3154 Issue all the warnings demanded by strict ISO C and ISO C++;
3155 reject all programs that use forbidden extensions, and some other
3156 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3157 version of the ISO C standard specified by any @option{-std} option used.
3159 Valid ISO C and ISO C++ programs should compile properly with or without
3160 this option (though a rare few require @option{-ansi} or a
3161 @option{-std} option specifying the required version of ISO C)@.  However,
3162 without this option, certain GNU extensions and traditional C and C++
3163 features are supported as well.  With this option, they are rejected.
3165 @option{-Wpedantic} does not cause warning messages for use of the
3166 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3167 warnings are also disabled in the expression that follows
3168 @code{__extension__}.  However, only system header files should use
3169 these escape routes; application programs should avoid them.
3170 @xref{Alternate Keywords}.
3172 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3173 C conformance.  They soon find that it does not do quite what they want:
3174 it finds some non-ISO practices, but not all---only those for which
3175 ISO C @emph{requires} a diagnostic, and some others for which
3176 diagnostics have been added.
3178 A feature to report any failure to conform to ISO C might be useful in
3179 some instances, but would require considerable additional work and would
3180 be quite different from @option{-Wpedantic}.  We don't have plans to
3181 support such a feature in the near future.
3183 Where the standard specified with @option{-std} represents a GNU
3184 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3185 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3186 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3187 where they are required by the base standard.  (It does not make sense
3188 for such warnings to be given only for features not in the specified GNU
3189 C dialect, since by definition the GNU dialects of C include all
3190 features the compiler supports with the given option, and there would be
3191 nothing to warn about.)
3193 @item -pedantic-errors
3194 @opindex pedantic-errors
3195 Like @option{-Wpedantic}, except that errors are produced rather than
3196 warnings.
3198 @item -Wall
3199 @opindex Wall
3200 @opindex Wno-all
3201 This enables all the warnings about constructions that some users
3202 consider questionable, and that are easy to avoid (or modify to
3203 prevent the warning), even in conjunction with macros.  This also
3204 enables some language-specific warnings described in @ref{C++ Dialect
3205 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3207 @option{-Wall} turns on the following warning flags:
3209 @gccoptlist{-Waddress   @gol
3210 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3211 -Wc++11-compat  @gol
3212 -Wchar-subscripts  @gol
3213 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3214 -Wimplicit-int @r{(C and Objective-C only)} @gol
3215 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3216 -Wcomment  @gol
3217 -Wformat   @gol
3218 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3219 -Wmaybe-uninitialized @gol
3220 -Wmissing-braces @r{(only for C/ObjC)} @gol
3221 -Wnonnull  @gol
3222 -Wparentheses  @gol
3223 -Wpointer-sign  @gol
3224 -Wreorder   @gol
3225 -Wreturn-type  @gol
3226 -Wsequence-point  @gol
3227 -Wsign-compare @r{(only in C++)}  @gol
3228 -Wstrict-aliasing  @gol
3229 -Wstrict-overflow=1  @gol
3230 -Wswitch  @gol
3231 -Wtrigraphs  @gol
3232 -Wuninitialized  @gol
3233 -Wunknown-pragmas  @gol
3234 -Wunused-function  @gol
3235 -Wunused-label     @gol
3236 -Wunused-value     @gol
3237 -Wunused-variable  @gol
3238 -Wvolatile-register-var @gol
3241 Note that some warning flags are not implied by @option{-Wall}.  Some of
3242 them warn about constructions that users generally do not consider
3243 questionable, but which occasionally you might wish to check for;
3244 others warn about constructions that are necessary or hard to avoid in
3245 some cases, and there is no simple way to modify the code to suppress
3246 the warning. Some of them are enabled by @option{-Wextra} but many of
3247 them must be enabled individually.
3249 @item -Wextra
3250 @opindex W
3251 @opindex Wextra
3252 @opindex Wno-extra
3253 This enables some extra warning flags that are not enabled by
3254 @option{-Wall}. (This option used to be called @option{-W}.  The older
3255 name is still supported, but the newer name is more descriptive.)
3257 @gccoptlist{-Wclobbered  @gol
3258 -Wempty-body  @gol
3259 -Wignored-qualifiers @gol
3260 -Wmissing-field-initializers  @gol
3261 -Wmissing-parameter-type @r{(C only)}  @gol
3262 -Wold-style-declaration @r{(C only)}  @gol
3263 -Woverride-init  @gol
3264 -Wsign-compare  @gol
3265 -Wtype-limits  @gol
3266 -Wuninitialized  @gol
3267 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3268 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3271 The option @option{-Wextra} also prints warning messages for the
3272 following cases:
3274 @itemize @bullet
3276 @item
3277 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3278 @samp{>}, or @samp{>=}.
3280 @item
3281 (C++ only) An enumerator and a non-enumerator both appear in a
3282 conditional expression.
3284 @item
3285 (C++ only) Ambiguous virtual bases.
3287 @item
3288 (C++ only) Subscripting an array that has been declared @samp{register}.
3290 @item
3291 (C++ only) Taking the address of a variable that has been declared
3292 @samp{register}.
3294 @item
3295 (C++ only) A base class is not initialized in a derived class's copy
3296 constructor.
3298 @end itemize
3300 @item -Wchar-subscripts
3301 @opindex Wchar-subscripts
3302 @opindex Wno-char-subscripts
3303 Warn if an array subscript has type @code{char}.  This is a common cause
3304 of error, as programmers often forget that this type is signed on some
3305 machines.
3306 This warning is enabled by @option{-Wall}.
3308 @item -Wcomment
3309 @opindex Wcomment
3310 @opindex Wno-comment
3311 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3312 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3313 This warning is enabled by @option{-Wall}.
3315 @item -Wno-coverage-mismatch
3316 @opindex Wno-coverage-mismatch
3317 Warn if feedback profiles do not match when using the
3318 @option{-fprofile-use} option.
3319 If a source file is changed between compiling with @option{-fprofile-gen} and
3320 with @option{-fprofile-use}, the files with the profile feedback can fail
3321 to match the source file and GCC cannot use the profile feedback
3322 information.  By default, this warning is enabled and is treated as an
3323 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3324 warning or @option{-Wno-error=coverage-mismatch} can be used to
3325 disable the error.  Disabling the error for this warning can result in
3326 poorly optimized code and is useful only in the
3327 case of very minor changes such as bug fixes to an existing code-base.
3328 Completely disabling the warning is not recommended.
3330 @item -Wno-cpp
3331 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3333 Suppress warning messages emitted by @code{#warning} directives.
3335 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3336 @opindex Wdouble-promotion
3337 @opindex Wno-double-promotion
3338 Give a warning when a value of type @code{float} is implicitly
3339 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3340 floating-point unit implement @code{float} in hardware, but emulate
3341 @code{double} in software.  On such a machine, doing computations
3342 using @code{double} values is much more expensive because of the
3343 overhead required for software emulation.
3345 It is easy to accidentally do computations with @code{double} because
3346 floating-point literals are implicitly of type @code{double}.  For
3347 example, in:
3348 @smallexample
3349 @group
3350 float area(float radius)
3352    return 3.14159 * radius * radius;
3354 @end group
3355 @end smallexample
3356 the compiler performs the entire computation with @code{double}
3357 because the floating-point literal is a @code{double}.
3359 @item -Wformat
3360 @itemx -Wformat=@var{n}
3361 @opindex Wformat
3362 @opindex Wno-format
3363 @opindex ffreestanding
3364 @opindex fno-builtin
3365 @opindex Wformat=
3366 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3367 the arguments supplied have types appropriate to the format string
3368 specified, and that the conversions specified in the format string make
3369 sense.  This includes standard functions, and others specified by format
3370 attributes (@pxref{Function Attributes}), in the @code{printf},
3371 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3372 not in the C standard) families (or other target-specific families).
3373 Which functions are checked without format attributes having been
3374 specified depends on the standard version selected, and such checks of
3375 functions without the attribute specified are disabled by
3376 @option{-ffreestanding} or @option{-fno-builtin}.
3378 The formats are checked against the format features supported by GNU
3379 libc version 2.2.  These include all ISO C90 and C99 features, as well
3380 as features from the Single Unix Specification and some BSD and GNU
3381 extensions.  Other library implementations may not support all these
3382 features; GCC does not support warning about features that go beyond a
3383 particular library's limitations.  However, if @option{-Wpedantic} is used
3384 with @option{-Wformat}, warnings are given about format features not
3385 in the selected standard version (but not for @code{strfmon} formats,
3386 since those are not in any version of the C standard).  @xref{C Dialect
3387 Options,,Options Controlling C Dialect}.
3389 @table @gcctabopt
3390 @item -Wformat=1
3391 @itemx -Wformat
3392 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3393 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3394 @option{-Wformat} also checks for null format arguments for several
3395 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3396 aspects of this level of format checking can be disabled by the
3397 options: @option{-Wno-format-contains-nul},
3398 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3399 @option{-Wformat} is enabled by @option{-Wall}.
3401 @item -Wno-format-contains-nul
3402 @opindex Wno-format-contains-nul
3403 @opindex Wformat-contains-nul
3404 If @option{-Wformat} is specified, do not warn about format strings that
3405 contain NUL bytes.
3407 @item -Wno-format-extra-args
3408 @opindex Wno-format-extra-args
3409 @opindex Wformat-extra-args
3410 If @option{-Wformat} is specified, do not warn about excess arguments to a
3411 @code{printf} or @code{scanf} format function.  The C standard specifies
3412 that such arguments are ignored.
3414 Where the unused arguments lie between used arguments that are
3415 specified with @samp{$} operand number specifications, normally
3416 warnings are still given, since the implementation could not know what
3417 type to pass to @code{va_arg} to skip the unused arguments.  However,
3418 in the case of @code{scanf} formats, this option suppresses the
3419 warning if the unused arguments are all pointers, since the Single
3420 Unix Specification says that such unused arguments are allowed.
3422 @item -Wno-format-zero-length
3423 @opindex Wno-format-zero-length
3424 @opindex Wformat-zero-length
3425 If @option{-Wformat} is specified, do not warn about zero-length formats.
3426 The C standard specifies that zero-length formats are allowed.
3429 @item -Wformat=2
3430 Enable @option{-Wformat} plus additional format checks.  Currently
3431 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3432 -Wformat-y2k}.
3434 @item -Wformat-nonliteral
3435 @opindex Wformat-nonliteral
3436 @opindex Wno-format-nonliteral
3437 If @option{-Wformat} is specified, also warn if the format string is not a
3438 string literal and so cannot be checked, unless the format function
3439 takes its format arguments as a @code{va_list}.
3441 @item -Wformat-security
3442 @opindex Wformat-security
3443 @opindex Wno-format-security
3444 If @option{-Wformat} is specified, also warn about uses of format
3445 functions that represent possible security problems.  At present, this
3446 warns about calls to @code{printf} and @code{scanf} functions where the
3447 format string is not a string literal and there are no format arguments,
3448 as in @code{printf (foo);}.  This may be a security hole if the format
3449 string came from untrusted input and contains @samp{%n}.  (This is
3450 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3451 in future warnings may be added to @option{-Wformat-security} that are not
3452 included in @option{-Wformat-nonliteral}.)
3454 @item -Wformat-y2k
3455 @opindex Wformat-y2k
3456 @opindex Wno-format-y2k
3457 If @option{-Wformat} is specified, also warn about @code{strftime}
3458 formats that may yield only a two-digit year.
3459 @end table
3461 @item -Wnonnull
3462 @opindex Wnonnull
3463 @opindex Wno-nonnull
3464 Warn about passing a null pointer for arguments marked as
3465 requiring a non-null value by the @code{nonnull} function attribute.
3467 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3468 can be disabled with the @option{-Wno-nonnull} option.
3470 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3471 @opindex Winit-self
3472 @opindex Wno-init-self
3473 Warn about uninitialized variables that are initialized with themselves.
3474 Note this option can only be used with the @option{-Wuninitialized} option.
3476 For example, GCC warns about @code{i} being uninitialized in the
3477 following snippet only when @option{-Winit-self} has been specified:
3478 @smallexample
3479 @group
3480 int f()
3482   int i = i;
3483   return i;
3485 @end group
3486 @end smallexample
3488 This warning is enabled by @option{-Wall} in C++.
3490 @item -Wimplicit-int @r{(C and Objective-C only)}
3491 @opindex Wimplicit-int
3492 @opindex Wno-implicit-int
3493 Warn when a declaration does not specify a type.
3494 This warning is enabled by @option{-Wall}.
3496 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3497 @opindex Wimplicit-function-declaration
3498 @opindex Wno-implicit-function-declaration
3499 Give a warning whenever a function is used before being declared. In
3500 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3501 enabled by default and it is made into an error by
3502 @option{-pedantic-errors}. This warning is also enabled by
3503 @option{-Wall}.
3505 @item -Wimplicit @r{(C and Objective-C only)}
3506 @opindex Wimplicit
3507 @opindex Wno-implicit
3508 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3509 This warning is enabled by @option{-Wall}.
3511 @item -Wignored-qualifiers @r{(C and C++ only)}
3512 @opindex Wignored-qualifiers
3513 @opindex Wno-ignored-qualifiers
3514 Warn if the return type of a function has a type qualifier
3515 such as @code{const}.  For ISO C such a type qualifier has no effect,
3516 since the value returned by a function is not an lvalue.
3517 For C++, the warning is only emitted for scalar types or @code{void}.
3518 ISO C prohibits qualified @code{void} return types on function
3519 definitions, so such return types always receive a warning
3520 even without this option.
3522 This warning is also enabled by @option{-Wextra}.
3524 @item -Wmain
3525 @opindex Wmain
3526 @opindex Wno-main
3527 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3528 a function with external linkage, returning int, taking either zero
3529 arguments, two, or three arguments of appropriate types.  This warning
3530 is enabled by default in C++ and is enabled by either @option{-Wall}
3531 or @option{-Wpedantic}.
3533 @item -Wmissing-braces
3534 @opindex Wmissing-braces
3535 @opindex Wno-missing-braces
3536 Warn if an aggregate or union initializer is not fully bracketed.  In
3537 the following example, the initializer for @samp{a} is not fully
3538 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3539 enabled by @option{-Wall} in C.
3541 @smallexample
3542 int a[2][2] = @{ 0, 1, 2, 3 @};
3543 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3544 @end smallexample
3546 This warning is enabled by @option{-Wall}.
3548 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3549 @opindex Wmissing-include-dirs
3550 @opindex Wno-missing-include-dirs
3551 Warn if a user-supplied include directory does not exist.
3553 @item -Wparentheses
3554 @opindex Wparentheses
3555 @opindex Wno-parentheses
3556 Warn if parentheses are omitted in certain contexts, such
3557 as when there is an assignment in a context where a truth value
3558 is expected, or when operators are nested whose precedence people
3559 often get confused about.
3561 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3562 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3563 interpretation from that of ordinary mathematical notation.
3565 Also warn about constructions where there may be confusion to which
3566 @code{if} statement an @code{else} branch belongs.  Here is an example of
3567 such a case:
3569 @smallexample
3570 @group
3572   if (a)
3573     if (b)
3574       foo ();
3575   else
3576     bar ();
3578 @end group
3579 @end smallexample
3581 In C/C++, every @code{else} branch belongs to the innermost possible
3582 @code{if} statement, which in this example is @code{if (b)}.  This is
3583 often not what the programmer expected, as illustrated in the above
3584 example by indentation the programmer chose.  When there is the
3585 potential for this confusion, GCC issues a warning when this flag
3586 is specified.  To eliminate the warning, add explicit braces around
3587 the innermost @code{if} statement so there is no way the @code{else}
3588 can belong to the enclosing @code{if}.  The resulting code
3589 looks like this:
3591 @smallexample
3592 @group
3594   if (a)
3595     @{
3596       if (b)
3597         foo ();
3598       else
3599         bar ();
3600     @}
3602 @end group
3603 @end smallexample
3605 Also warn for dangerous uses of the GNU extension to
3606 @code{?:} with omitted middle operand. When the condition
3607 in the @code{?}: operator is a boolean expression, the omitted value is
3608 always 1.  Often programmers expect it to be a value computed
3609 inside the conditional expression instead.
3611 This warning is enabled by @option{-Wall}.
3613 @item -Wsequence-point
3614 @opindex Wsequence-point
3615 @opindex Wno-sequence-point
3616 Warn about code that may have undefined semantics because of violations
3617 of sequence point rules in the C and C++ standards.
3619 The C and C++ standards define the order in which expressions in a C/C++
3620 program are evaluated in terms of @dfn{sequence points}, which represent
3621 a partial ordering between the execution of parts of the program: those
3622 executed before the sequence point, and those executed after it.  These
3623 occur after the evaluation of a full expression (one which is not part
3624 of a larger expression), after the evaluation of the first operand of a
3625 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3626 function is called (but after the evaluation of its arguments and the
3627 expression denoting the called function), and in certain other places.
3628 Other than as expressed by the sequence point rules, the order of
3629 evaluation of subexpressions of an expression is not specified.  All
3630 these rules describe only a partial order rather than a total order,
3631 since, for example, if two functions are called within one expression
3632 with no sequence point between them, the order in which the functions
3633 are called is not specified.  However, the standards committee have
3634 ruled that function calls do not overlap.
3636 It is not specified when between sequence points modifications to the
3637 values of objects take effect.  Programs whose behavior depends on this
3638 have undefined behavior; the C and C++ standards specify that ``Between
3639 the previous and next sequence point an object shall have its stored
3640 value modified at most once by the evaluation of an expression.
3641 Furthermore, the prior value shall be read only to determine the value
3642 to be stored.''.  If a program breaks these rules, the results on any
3643 particular implementation are entirely unpredictable.
3645 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3646 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3647 diagnosed by this option, and it may give an occasional false positive
3648 result, but in general it has been found fairly effective at detecting
3649 this sort of problem in programs.
3651 The standard is worded confusingly, therefore there is some debate
3652 over the precise meaning of the sequence point rules in subtle cases.
3653 Links to discussions of the problem, including proposed formal
3654 definitions, may be found on the GCC readings page, at
3655 @uref{http://gcc.gnu.org/@/readings.html}.
3657 This warning is enabled by @option{-Wall} for C and C++.
3659 @item -Wno-return-local-addr
3660 @opindex Wno-return-local-addr
3661 @opindex Wreturn-local-addr
3662 Do not warn about returning a pointer (or in C++, a reference) to a
3663 variable that goes out of scope after the function returns.
3665 @item -Wreturn-type
3666 @opindex Wreturn-type
3667 @opindex Wno-return-type
3668 Warn whenever a function is defined with a return type that defaults
3669 to @code{int}.  Also warn about any @code{return} statement with no
3670 return value in a function whose return type is not @code{void}
3671 (falling off the end of the function body is considered returning
3672 without a value), and about a @code{return} statement with an
3673 expression in a function whose return type is @code{void}.
3675 For C++, a function without return type always produces a diagnostic
3676 message, even when @option{-Wno-return-type} is specified.  The only
3677 exceptions are @samp{main} and functions defined in system headers.
3679 This warning is enabled by @option{-Wall}.
3681 @item -Wswitch
3682 @opindex Wswitch
3683 @opindex Wno-switch
3684 Warn whenever a @code{switch} statement has an index of enumerated type
3685 and lacks a @code{case} for one or more of the named codes of that
3686 enumeration.  (The presence of a @code{default} label prevents this
3687 warning.)  @code{case} labels outside the enumeration range also
3688 provoke warnings when this option is used (even if there is a
3689 @code{default} label).
3690 This warning is enabled by @option{-Wall}.
3692 @item -Wswitch-default
3693 @opindex Wswitch-default
3694 @opindex Wno-switch-default
3695 Warn whenever a @code{switch} statement does not have a @code{default}
3696 case.
3698 @item -Wswitch-enum
3699 @opindex Wswitch-enum
3700 @opindex Wno-switch-enum
3701 Warn whenever a @code{switch} statement has an index of enumerated type
3702 and lacks a @code{case} for one or more of the named codes of that
3703 enumeration.  @code{case} labels outside the enumeration range also
3704 provoke warnings when this option is used.  The only difference
3705 between @option{-Wswitch} and this option is that this option gives a
3706 warning about an omitted enumeration code even if there is a
3707 @code{default} label.
3709 @item -Wsync-nand @r{(C and C++ only)}
3710 @opindex Wsync-nand
3711 @opindex Wno-sync-nand
3712 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3713 built-in functions are used.  These functions changed semantics in GCC 4.4.
3715 @item -Wtrigraphs
3716 @opindex Wtrigraphs
3717 @opindex Wno-trigraphs
3718 Warn if any trigraphs are encountered that might change the meaning of
3719 the program (trigraphs within comments are not warned about).
3720 This warning is enabled by @option{-Wall}.
3722 @item -Wunused-but-set-parameter
3723 @opindex Wunused-but-set-parameter
3724 @opindex Wno-unused-but-set-parameter
3725 Warn whenever a function parameter is assigned to, but otherwise unused
3726 (aside from its declaration).
3728 To suppress this warning use the @samp{unused} attribute
3729 (@pxref{Variable Attributes}).
3731 This warning is also enabled by @option{-Wunused} together with
3732 @option{-Wextra}.
3734 @item -Wunused-but-set-variable
3735 @opindex Wunused-but-set-variable
3736 @opindex Wno-unused-but-set-variable
3737 Warn whenever a local variable is assigned to, but otherwise unused
3738 (aside from its declaration).
3739 This warning is enabled by @option{-Wall}.
3741 To suppress this warning use the @samp{unused} attribute
3742 (@pxref{Variable Attributes}).
3744 This warning is also enabled by @option{-Wunused}, which is enabled
3745 by @option{-Wall}.
3747 @item -Wunused-function
3748 @opindex Wunused-function
3749 @opindex Wno-unused-function
3750 Warn whenever a static function is declared but not defined or a
3751 non-inline static function is unused.
3752 This warning is enabled by @option{-Wall}.
3754 @item -Wunused-label
3755 @opindex Wunused-label
3756 @opindex Wno-unused-label
3757 Warn whenever a label is declared but not used.
3758 This warning is enabled by @option{-Wall}.
3760 To suppress this warning use the @samp{unused} attribute
3761 (@pxref{Variable Attributes}).
3763 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3764 @opindex Wunused-local-typedefs
3765 Warn when a typedef locally defined in a function is not used.
3766 This warning is enabled by @option{-Wall}.
3768 @item -Wunused-parameter
3769 @opindex Wunused-parameter
3770 @opindex Wno-unused-parameter
3771 Warn whenever a function parameter is unused aside from its declaration.
3773 To suppress this warning use the @samp{unused} attribute
3774 (@pxref{Variable Attributes}).
3776 @item -Wno-unused-result
3777 @opindex Wunused-result
3778 @opindex Wno-unused-result
3779 Do not warn if a caller of a function marked with attribute
3780 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3781 its return value. The default is @option{-Wunused-result}.
3783 @item -Wunused-variable
3784 @opindex Wunused-variable
3785 @opindex Wno-unused-variable
3786 Warn whenever a local variable or non-constant static variable is unused
3787 aside from its declaration.
3788 This warning is enabled by @option{-Wall}.
3790 To suppress this warning use the @samp{unused} attribute
3791 (@pxref{Variable Attributes}).
3793 @item -Wunused-value
3794 @opindex Wunused-value
3795 @opindex Wno-unused-value
3796 Warn whenever a statement computes a result that is explicitly not
3797 used. To suppress this warning cast the unused expression to
3798 @samp{void}. This includes an expression-statement or the left-hand
3799 side of a comma expression that contains no side effects. For example,
3800 an expression such as @samp{x[i,j]} causes a warning, while
3801 @samp{x[(void)i,j]} does not.
3803 This warning is enabled by @option{-Wall}.
3805 @item -Wunused
3806 @opindex Wunused
3807 @opindex Wno-unused
3808 All the above @option{-Wunused} options combined.
3810 In order to get a warning about an unused function parameter, you must
3811 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3812 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3814 @item -Wuninitialized
3815 @opindex Wuninitialized
3816 @opindex Wno-uninitialized
3817 Warn if an automatic variable is used without first being initialized
3818 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3819 warn if a non-static reference or non-static @samp{const} member
3820 appears in a class without constructors.
3822 If you want to warn about code that uses the uninitialized value of the
3823 variable in its own initializer, use the @option{-Winit-self} option.
3825 These warnings occur for individual uninitialized or clobbered
3826 elements of structure, union or array variables as well as for
3827 variables that are uninitialized or clobbered as a whole.  They do
3828 not occur for variables or elements declared @code{volatile}.  Because
3829 these warnings depend on optimization, the exact variables or elements
3830 for which there are warnings depends on the precise optimization
3831 options and version of GCC used.
3833 Note that there may be no warning about a variable that is used only
3834 to compute a value that itself is never used, because such
3835 computations may be deleted by data flow analysis before the warnings
3836 are printed.
3838 @item -Wmaybe-uninitialized
3839 @opindex Wmaybe-uninitialized
3840 @opindex Wno-maybe-uninitialized
3841 For an automatic variable, if there exists a path from the function
3842 entry to a use of the variable that is initialized, but there exist
3843 some other paths for which the variable is not initialized, the compiler
3844 emits a warning if it cannot prove the uninitialized paths are not
3845 executed at run time. These warnings are made optional because GCC is
3846 not smart enough to see all the reasons why the code might be correct
3847 in spite of appearing to have an error.  Here is one example of how
3848 this can happen:
3850 @smallexample
3851 @group
3853   int x;
3854   switch (y)
3855     @{
3856     case 1: x = 1;
3857       break;
3858     case 2: x = 4;
3859       break;
3860     case 3: x = 5;
3861     @}
3862   foo (x);
3864 @end group
3865 @end smallexample
3867 @noindent
3868 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3869 always initialized, but GCC doesn't know this. To suppress the
3870 warning, you need to provide a default case with assert(0) or
3871 similar code.
3873 @cindex @code{longjmp} warnings
3874 This option also warns when a non-volatile automatic variable might be
3875 changed by a call to @code{longjmp}.  These warnings as well are possible
3876 only in optimizing compilation.
3878 The compiler sees only the calls to @code{setjmp}.  It cannot know
3879 where @code{longjmp} will be called; in fact, a signal handler could
3880 call it at any point in the code.  As a result, you may get a warning
3881 even when there is in fact no problem because @code{longjmp} cannot
3882 in fact be called at the place that would cause a problem.
3884 Some spurious warnings can be avoided if you declare all the functions
3885 you use that never return as @code{noreturn}.  @xref{Function
3886 Attributes}.
3888 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3890 @item -Wunknown-pragmas
3891 @opindex Wunknown-pragmas
3892 @opindex Wno-unknown-pragmas
3893 @cindex warning for unknown pragmas
3894 @cindex unknown pragmas, warning
3895 @cindex pragmas, warning of unknown
3896 Warn when a @code{#pragma} directive is encountered that is not understood by 
3897 GCC@.  If this command-line option is used, warnings are even issued
3898 for unknown pragmas in system header files.  This is not the case if
3899 the warnings are only enabled by the @option{-Wall} command-line option.
3901 @item -Wno-pragmas
3902 @opindex Wno-pragmas
3903 @opindex Wpragmas
3904 Do not warn about misuses of pragmas, such as incorrect parameters,
3905 invalid syntax, or conflicts between pragmas.  See also
3906 @option{-Wunknown-pragmas}.
3908 @item -Wstrict-aliasing
3909 @opindex Wstrict-aliasing
3910 @opindex Wno-strict-aliasing
3911 This option is only active when @option{-fstrict-aliasing} is active.
3912 It warns about code that might break the strict aliasing rules that the
3913 compiler is using for optimization.  The warning does not catch all
3914 cases, but does attempt to catch the more common pitfalls.  It is
3915 included in @option{-Wall}.
3916 It is equivalent to @option{-Wstrict-aliasing=3}
3918 @item -Wstrict-aliasing=n
3919 @opindex Wstrict-aliasing=n
3920 This option is only active when @option{-fstrict-aliasing} is active.
3921 It warns about code that might break the strict aliasing rules that the
3922 compiler is using for optimization.
3923 Higher levels correspond to higher accuracy (fewer false positives).
3924 Higher levels also correspond to more effort, similar to the way @option{-O} 
3925 works.
3926 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3928 Level 1: Most aggressive, quick, least accurate.
3929 Possibly useful when higher levels
3930 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3931 false negatives.  However, it has many false positives.
3932 Warns for all pointer conversions between possibly incompatible types,
3933 even if never dereferenced.  Runs in the front end only.
3935 Level 2: Aggressive, quick, not too precise.
3936 May still have many false positives (not as many as level 1 though),
3937 and few false negatives (but possibly more than level 1).
3938 Unlike level 1, it only warns when an address is taken.  Warns about
3939 incomplete types.  Runs in the front end only.
3941 Level 3 (default for @option{-Wstrict-aliasing}):
3942 Should have very few false positives and few false
3943 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3944 Takes care of the common pun+dereference pattern in the front end:
3945 @code{*(int*)&some_float}.
3946 If optimization is enabled, it also runs in the back end, where it deals
3947 with multiple statement cases using flow-sensitive points-to information.
3948 Only warns when the converted pointer is dereferenced.
3949 Does not warn about incomplete types.
3951 @item -Wstrict-overflow
3952 @itemx -Wstrict-overflow=@var{n}
3953 @opindex Wstrict-overflow
3954 @opindex Wno-strict-overflow
3955 This option is only active when @option{-fstrict-overflow} is active.
3956 It warns about cases where the compiler optimizes based on the
3957 assumption that signed overflow does not occur.  Note that it does not
3958 warn about all cases where the code might overflow: it only warns
3959 about cases where the compiler implements some optimization.  Thus
3960 this warning depends on the optimization level.
3962 An optimization that assumes that signed overflow does not occur is
3963 perfectly safe if the values of the variables involved are such that
3964 overflow never does, in fact, occur.  Therefore this warning can
3965 easily give a false positive: a warning about code that is not
3966 actually a problem.  To help focus on important issues, several
3967 warning levels are defined.  No warnings are issued for the use of
3968 undefined signed overflow when estimating how many iterations a loop
3969 requires, in particular when determining whether a loop will be
3970 executed at all.
3972 @table @gcctabopt
3973 @item -Wstrict-overflow=1
3974 Warn about cases that are both questionable and easy to avoid.  For
3975 example,  with @option{-fstrict-overflow}, the compiler simplifies
3976 @code{x + 1 > x} to @code{1}.  This level of
3977 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3978 are not, and must be explicitly requested.
3980 @item -Wstrict-overflow=2
3981 Also warn about other cases where a comparison is simplified to a
3982 constant.  For example: @code{abs (x) >= 0}.  This can only be
3983 simplified when @option{-fstrict-overflow} is in effect, because
3984 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3985 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3986 @option{-Wstrict-overflow=2}.
3988 @item -Wstrict-overflow=3
3989 Also warn about other cases where a comparison is simplified.  For
3990 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
3992 @item -Wstrict-overflow=4
3993 Also warn about other simplifications not covered by the above cases.
3994 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
3996 @item -Wstrict-overflow=5
3997 Also warn about cases where the compiler reduces the magnitude of a
3998 constant involved in a comparison.  For example: @code{x + 2 > y} is
3999 simplified to @code{x + 1 >= y}.  This is reported only at the
4000 highest warning level because this simplification applies to many
4001 comparisons, so this warning level gives a very large number of
4002 false positives.
4003 @end table
4005 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4006 @opindex Wsuggest-attribute=
4007 @opindex Wno-suggest-attribute=
4008 Warn for cases where adding an attribute may be beneficial. The
4009 attributes currently supported are listed below.
4011 @table @gcctabopt
4012 @item -Wsuggest-attribute=pure
4013 @itemx -Wsuggest-attribute=const
4014 @itemx -Wsuggest-attribute=noreturn
4015 @opindex Wsuggest-attribute=pure
4016 @opindex Wno-suggest-attribute=pure
4017 @opindex Wsuggest-attribute=const
4018 @opindex Wno-suggest-attribute=const
4019 @opindex Wsuggest-attribute=noreturn
4020 @opindex Wno-suggest-attribute=noreturn
4022 Warn about functions that might be candidates for attributes
4023 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4024 functions visible in other compilation units or (in the case of @code{pure} and
4025 @code{const}) if it cannot prove that the function returns normally. A function
4026 returns normally if it doesn't contain an infinite loop or return abnormally
4027 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4028 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4029 higher.  Higher optimization levels improve the accuracy of the analysis.
4031 @item -Wsuggest-attribute=format
4032 @itemx -Wmissing-format-attribute
4033 @opindex Wsuggest-attribute=format
4034 @opindex Wmissing-format-attribute
4035 @opindex Wno-suggest-attribute=format
4036 @opindex Wno-missing-format-attribute
4037 @opindex Wformat
4038 @opindex Wno-format
4040 Warn about function pointers that might be candidates for @code{format}
4041 attributes.  Note these are only possible candidates, not absolute ones.
4042 GCC guesses that function pointers with @code{format} attributes that
4043 are used in assignment, initialization, parameter passing or return
4044 statements should have a corresponding @code{format} attribute in the
4045 resulting type.  I.e.@: the left-hand side of the assignment or
4046 initialization, the type of the parameter variable, or the return type
4047 of the containing function respectively should also have a @code{format}
4048 attribute to avoid the warning.
4050 GCC also warns about function definitions that might be
4051 candidates for @code{format} attributes.  Again, these are only
4052 possible candidates.  GCC guesses that @code{format} attributes
4053 might be appropriate for any function that calls a function like
4054 @code{vprintf} or @code{vscanf}, but this might not always be the
4055 case, and some functions for which @code{format} attributes are
4056 appropriate may not be detected.
4057 @end table
4059 @item -Warray-bounds
4060 @opindex Wno-array-bounds
4061 @opindex Warray-bounds
4062 This option is only active when @option{-ftree-vrp} is active
4063 (default for @option{-O2} and above). It warns about subscripts to arrays
4064 that are always out of bounds. This warning is enabled by @option{-Wall}.
4066 @item -Wno-div-by-zero
4067 @opindex Wno-div-by-zero
4068 @opindex Wdiv-by-zero
4069 Do not warn about compile-time integer division by zero.  Floating-point
4070 division by zero is not warned about, as it can be a legitimate way of
4071 obtaining infinities and NaNs.
4073 @item -Wsystem-headers
4074 @opindex Wsystem-headers
4075 @opindex Wno-system-headers
4076 @cindex warnings from system headers
4077 @cindex system headers, warnings from
4078 Print warning messages for constructs found in system header files.
4079 Warnings from system headers are normally suppressed, on the assumption
4080 that they usually do not indicate real problems and would only make the
4081 compiler output harder to read.  Using this command-line option tells
4082 GCC to emit warnings from system headers as if they occurred in user
4083 code.  However, note that using @option{-Wall} in conjunction with this
4084 option does @emph{not} warn about unknown pragmas in system
4085 headers---for that, @option{-Wunknown-pragmas} must also be used.
4087 @item -Wtrampolines
4088 @opindex Wtrampolines
4089 @opindex Wno-trampolines
4090  Warn about trampolines generated for pointers to nested functions.
4092  A trampoline is a small piece of data or code that is created at run
4093  time on the stack when the address of a nested function is taken, and
4094  is used to call the nested function indirectly.  For some targets, it
4095  is made up of data only and thus requires no special treatment.  But,
4096  for most targets, it is made up of code and thus requires the stack
4097  to be made executable in order for the program to work properly.
4099 @item -Wfloat-equal
4100 @opindex Wfloat-equal
4101 @opindex Wno-float-equal
4102 Warn if floating-point values are used in equality comparisons.
4104 The idea behind this is that sometimes it is convenient (for the
4105 programmer) to consider floating-point values as approximations to
4106 infinitely precise real numbers.  If you are doing this, then you need
4107 to compute (by analyzing the code, or in some other way) the maximum or
4108 likely maximum error that the computation introduces, and allow for it
4109 when performing comparisons (and when producing output, but that's a
4110 different problem).  In particular, instead of testing for equality, you
4111 should check to see whether the two values have ranges that overlap; and
4112 this is done with the relational operators, so equality comparisons are
4113 probably mistaken.
4115 @item -Wtraditional @r{(C and Objective-C only)}
4116 @opindex Wtraditional
4117 @opindex Wno-traditional
4118 Warn about certain constructs that behave differently in traditional and
4119 ISO C@.  Also warn about ISO C constructs that have no traditional C
4120 equivalent, and/or problematic constructs that should be avoided.
4122 @itemize @bullet
4123 @item
4124 Macro parameters that appear within string literals in the macro body.
4125 In traditional C macro replacement takes place within string literals,
4126 but in ISO C it does not.
4128 @item
4129 In traditional C, some preprocessor directives did not exist.
4130 Traditional preprocessors only considered a line to be a directive
4131 if the @samp{#} appeared in column 1 on the line.  Therefore
4132 @option{-Wtraditional} warns about directives that traditional C
4133 understands but ignores because the @samp{#} does not appear as the
4134 first character on the line.  It also suggests you hide directives like
4135 @samp{#pragma} not understood by traditional C by indenting them.  Some
4136 traditional implementations do not recognize @samp{#elif}, so this option
4137 suggests avoiding it altogether.
4139 @item
4140 A function-like macro that appears without arguments.
4142 @item
4143 The unary plus operator.
4145 @item
4146 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4147 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4148 constants.)  Note, these suffixes appear in macros defined in the system
4149 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4150 Use of these macros in user code might normally lead to spurious
4151 warnings, however GCC's integrated preprocessor has enough context to
4152 avoid warning in these cases.
4154 @item
4155 A function declared external in one block and then used after the end of
4156 the block.
4158 @item
4159 A @code{switch} statement has an operand of type @code{long}.
4161 @item
4162 A non-@code{static} function declaration follows a @code{static} one.
4163 This construct is not accepted by some traditional C compilers.
4165 @item
4166 The ISO type of an integer constant has a different width or
4167 signedness from its traditional type.  This warning is only issued if
4168 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4169 typically represent bit patterns, are not warned about.
4171 @item
4172 Usage of ISO string concatenation is detected.
4174 @item
4175 Initialization of automatic aggregates.
4177 @item
4178 Identifier conflicts with labels.  Traditional C lacks a separate
4179 namespace for labels.
4181 @item
4182 Initialization of unions.  If the initializer is zero, the warning is
4183 omitted.  This is done under the assumption that the zero initializer in
4184 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4185 initializer warnings and relies on default initialization to zero in the
4186 traditional C case.
4188 @item
4189 Conversions by prototypes between fixed/floating-point values and vice
4190 versa.  The absence of these prototypes when compiling with traditional
4191 C causes serious problems.  This is a subset of the possible
4192 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4194 @item
4195 Use of ISO C style function definitions.  This warning intentionally is
4196 @emph{not} issued for prototype declarations or variadic functions
4197 because these ISO C features appear in your code when using
4198 libiberty's traditional C compatibility macros, @code{PARAMS} and
4199 @code{VPARAMS}.  This warning is also bypassed for nested functions
4200 because that feature is already a GCC extension and thus not relevant to
4201 traditional C compatibility.
4202 @end itemize
4204 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4205 @opindex Wtraditional-conversion
4206 @opindex Wno-traditional-conversion
4207 Warn if a prototype causes a type conversion that is different from what
4208 would happen to the same argument in the absence of a prototype.  This
4209 includes conversions of fixed point to floating and vice versa, and
4210 conversions changing the width or signedness of a fixed-point argument
4211 except when the same as the default promotion.
4213 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4214 @opindex Wdeclaration-after-statement
4215 @opindex Wno-declaration-after-statement
4216 Warn when a declaration is found after a statement in a block.  This
4217 construct, known from C++, was introduced with ISO C99 and is by default
4218 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4219 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4221 @item -Wundef
4222 @opindex Wundef
4223 @opindex Wno-undef
4224 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4226 @item -Wno-endif-labels
4227 @opindex Wno-endif-labels
4228 @opindex Wendif-labels
4229 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4231 @item -Wshadow
4232 @opindex Wshadow
4233 @opindex Wno-shadow
4234 Warn whenever a local variable or type declaration shadows another variable,
4235 parameter, type, or class member (in C++), or whenever a built-in function
4236 is shadowed. Note that in C++, the compiler warns if a local variable
4237 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4239 @item -Wlarger-than=@var{len}
4240 @opindex Wlarger-than=@var{len}
4241 @opindex Wlarger-than-@var{len}
4242 Warn whenever an object of larger than @var{len} bytes is defined.
4244 @item -Wframe-larger-than=@var{len}
4245 @opindex Wframe-larger-than
4246 Warn if the size of a function frame is larger than @var{len} bytes.
4247 The computation done to determine the stack frame size is approximate
4248 and not conservative.
4249 The actual requirements may be somewhat greater than @var{len}
4250 even if you do not get a warning.  In addition, any space allocated
4251 via @code{alloca}, variable-length arrays, or related constructs
4252 is not included by the compiler when determining
4253 whether or not to issue a warning.
4255 @item -Wno-free-nonheap-object
4256 @opindex Wno-free-nonheap-object
4257 @opindex Wfree-nonheap-object
4258 Do not warn when attempting to free an object that was not allocated
4259 on the heap.
4261 @item -Wstack-usage=@var{len}
4262 @opindex Wstack-usage
4263 Warn if the stack usage of a function might be larger than @var{len} bytes.
4264 The computation done to determine the stack usage is conservative.
4265 Any space allocated via @code{alloca}, variable-length arrays, or related
4266 constructs is included by the compiler when determining whether or not to
4267 issue a warning.
4269 The message is in keeping with the output of @option{-fstack-usage}.
4271 @itemize
4272 @item
4273 If the stack usage is fully static but exceeds the specified amount, it's:
4275 @smallexample
4276   warning: stack usage is 1120 bytes
4277 @end smallexample
4278 @item
4279 If the stack usage is (partly) dynamic but bounded, it's:
4281 @smallexample
4282   warning: stack usage might be 1648 bytes
4283 @end smallexample
4284 @item
4285 If the stack usage is (partly) dynamic and not bounded, it's:
4287 @smallexample
4288   warning: stack usage might be unbounded
4289 @end smallexample
4290 @end itemize
4292 @item -Wunsafe-loop-optimizations
4293 @opindex Wunsafe-loop-optimizations
4294 @opindex Wno-unsafe-loop-optimizations
4295 Warn if the loop cannot be optimized because the compiler cannot
4296 assume anything on the bounds of the loop indices.  With
4297 @option{-funsafe-loop-optimizations} warn if the compiler makes
4298 such assumptions.
4300 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4301 @opindex Wno-pedantic-ms-format
4302 @opindex Wpedantic-ms-format
4303 When used in combination with @option{-Wformat}
4304 and @option{-pedantic} without GNU extensions, this option
4305 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4306 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4307 which depend on the MS runtime.
4309 @item -Wpointer-arith
4310 @opindex Wpointer-arith
4311 @opindex Wno-pointer-arith
4312 Warn about anything that depends on the ``size of'' a function type or
4313 of @code{void}.  GNU C assigns these types a size of 1, for
4314 convenience in calculations with @code{void *} pointers and pointers
4315 to functions.  In C++, warn also when an arithmetic operation involves
4316 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4318 @item -Wtype-limits
4319 @opindex Wtype-limits
4320 @opindex Wno-type-limits
4321 Warn if a comparison is always true or always false due to the limited
4322 range of the data type, but do not warn for constant expressions.  For
4323 example, warn if an unsigned variable is compared against zero with
4324 @samp{<} or @samp{>=}.  This warning is also enabled by
4325 @option{-Wextra}.
4327 @item -Wbad-function-cast @r{(C and Objective-C only)}
4328 @opindex Wbad-function-cast
4329 @opindex Wno-bad-function-cast
4330 Warn whenever a function call is cast to a non-matching type.
4331 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4333 @item -Wc++-compat @r{(C and Objective-C only)}
4334 Warn about ISO C constructs that are outside of the common subset of
4335 ISO C and ISO C++, e.g.@: request for implicit conversion from
4336 @code{void *} to a pointer to non-@code{void} type.
4338 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4339 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4340 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4341 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4342 enabled by @option{-Wall}.
4344 @item -Wcast-qual
4345 @opindex Wcast-qual
4346 @opindex Wno-cast-qual
4347 Warn whenever a pointer is cast so as to remove a type qualifier from
4348 the target type.  For example, warn if a @code{const char *} is cast
4349 to an ordinary @code{char *}.
4351 Also warn when making a cast that introduces a type qualifier in an
4352 unsafe way.  For example, casting @code{char **} to @code{const char **}
4353 is unsafe, as in this example:
4355 @smallexample
4356   /* p is char ** value.  */
4357   const char **q = (const char **) p;
4358   /* Assignment of readonly string to const char * is OK.  */
4359   *q = "string";
4360   /* Now char** pointer points to read-only memory.  */
4361   **p = 'b';
4362 @end smallexample
4364 @item -Wcast-align
4365 @opindex Wcast-align
4366 @opindex Wno-cast-align
4367 Warn whenever a pointer is cast such that the required alignment of the
4368 target is increased.  For example, warn if a @code{char *} is cast to
4369 an @code{int *} on machines where integers can only be accessed at
4370 two- or four-byte boundaries.
4372 @item -Wwrite-strings
4373 @opindex Wwrite-strings
4374 @opindex Wno-write-strings
4375 When compiling C, give string constants the type @code{const
4376 char[@var{length}]} so that copying the address of one into a
4377 non-@code{const} @code{char *} pointer produces a warning.  These
4378 warnings help you find at compile time code that can try to write
4379 into a string constant, but only if you have been very careful about
4380 using @code{const} in declarations and prototypes.  Otherwise, it is
4381 just a nuisance. This is why we did not make @option{-Wall} request
4382 these warnings.
4384 When compiling C++, warn about the deprecated conversion from string
4385 literals to @code{char *}.  This warning is enabled by default for C++
4386 programs.
4388 @item -Wclobbered
4389 @opindex Wclobbered
4390 @opindex Wno-clobbered
4391 Warn for variables that might be changed by @samp{longjmp} or
4392 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4394 @item -Wconversion
4395 @opindex Wconversion
4396 @opindex Wno-conversion
4397 Warn for implicit conversions that may alter a value. This includes
4398 conversions between real and integer, like @code{abs (x)} when
4399 @code{x} is @code{double}; conversions between signed and unsigned,
4400 like @code{unsigned ui = -1}; and conversions to smaller types, like
4401 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4402 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4403 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4404 conversions between signed and unsigned integers can be disabled by
4405 using @option{-Wno-sign-conversion}.
4407 For C++, also warn for confusing overload resolution for user-defined
4408 conversions; and conversions that never use a type conversion
4409 operator: conversions to @code{void}, the same type, a base class or a
4410 reference to them. Warnings about conversions between signed and
4411 unsigned integers are disabled by default in C++ unless
4412 @option{-Wsign-conversion} is explicitly enabled.
4414 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4415 @opindex Wconversion-null
4416 @opindex Wno-conversion-null
4417 Do not warn for conversions between @code{NULL} and non-pointer
4418 types. @option{-Wconversion-null} is enabled by default.
4420 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4421 @opindex Wzero-as-null-pointer-constant
4422 @opindex Wno-zero-as-null-pointer-constant
4423 Warn when a literal '0' is used as null pointer constant.  This can
4424 be useful to facilitate the conversion to @code{nullptr} in C++11.
4426 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4427 @opindex Wuseless-cast
4428 @opindex Wno-useless-cast
4429 Warn when an expression is casted to its own type.
4431 @item -Wempty-body
4432 @opindex Wempty-body
4433 @opindex Wno-empty-body
4434 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4435 while} statement.  This warning is also enabled by @option{-Wextra}.
4437 @item -Wenum-compare
4438 @opindex Wenum-compare
4439 @opindex Wno-enum-compare
4440 Warn about a comparison between values of different enumerated types.
4441 In C++ enumeral mismatches in conditional expressions are also
4442 diagnosed and the warning is enabled by default.  In C this warning is 
4443 enabled by @option{-Wall}.
4445 @item -Wjump-misses-init @r{(C, Objective-C only)}
4446 @opindex Wjump-misses-init
4447 @opindex Wno-jump-misses-init
4448 Warn if a @code{goto} statement or a @code{switch} statement jumps
4449 forward across the initialization of a variable, or jumps backward to a
4450 label after the variable has been initialized.  This only warns about
4451 variables that are initialized when they are declared.  This warning is
4452 only supported for C and Objective-C; in C++ this sort of branch is an
4453 error in any case.
4455 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4456 can be disabled with the @option{-Wno-jump-misses-init} option.
4458 @item -Wsign-compare
4459 @opindex Wsign-compare
4460 @opindex Wno-sign-compare
4461 @cindex warning for comparison of signed and unsigned values
4462 @cindex comparison of signed and unsigned values, warning
4463 @cindex signed and unsigned values, comparison warning
4464 Warn when a comparison between signed and unsigned values could produce
4465 an incorrect result when the signed value is converted to unsigned.
4466 This warning is also enabled by @option{-Wextra}; to get the other warnings
4467 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4469 @item -Wsign-conversion
4470 @opindex Wsign-conversion
4471 @opindex Wno-sign-conversion
4472 Warn for implicit conversions that may change the sign of an integer
4473 value, like assigning a signed integer expression to an unsigned
4474 integer variable. An explicit cast silences the warning. In C, this
4475 option is enabled also by @option{-Wconversion}.
4477 @item -Wsizeof-pointer-memaccess
4478 @opindex Wsizeof-pointer-memaccess
4479 @opindex Wno-sizeof-pointer-memaccess
4480 Warn for suspicious length parameters to certain string and memory built-in
4481 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4482 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4483 but a pointer, and suggests a possible fix, or about
4484 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4485 @option{-Wall}.
4487 @item -Waddress
4488 @opindex Waddress
4489 @opindex Wno-address
4490 Warn about suspicious uses of memory addresses. These include using
4491 the address of a function in a conditional expression, such as
4492 @code{void func(void); if (func)}, and comparisons against the memory
4493 address of a string literal, such as @code{if (x == "abc")}.  Such
4494 uses typically indicate a programmer error: the address of a function
4495 always evaluates to true, so their use in a conditional usually
4496 indicate that the programmer forgot the parentheses in a function
4497 call; and comparisons against string literals result in unspecified
4498 behavior and are not portable in C, so they usually indicate that the
4499 programmer intended to use @code{strcmp}.  This warning is enabled by
4500 @option{-Wall}.
4502 @item -Wlogical-op
4503 @opindex Wlogical-op
4504 @opindex Wno-logical-op
4505 Warn about suspicious uses of logical operators in expressions.
4506 This includes using logical operators in contexts where a
4507 bit-wise operator is likely to be expected.
4509 @item -Waggregate-return
4510 @opindex Waggregate-return
4511 @opindex Wno-aggregate-return
4512 Warn if any functions that return structures or unions are defined or
4513 called.  (In languages where you can return an array, this also elicits
4514 a warning.)
4516 @item -Wno-aggressive-loop-optimizations
4517 @opindex Wno-aggressive-loop-optimizations
4518 @opindex Waggressive-loop-optimizations
4519 Warn if in a loop with constant number of iterations the compiler detects
4520 undefined behavior in some statement during one or more of the iterations.
4522 @item -Wno-attributes
4523 @opindex Wno-attributes
4524 @opindex Wattributes
4525 Do not warn if an unexpected @code{__attribute__} is used, such as
4526 unrecognized attributes, function attributes applied to variables,
4527 etc.  This does not stop errors for incorrect use of supported
4528 attributes.
4530 @item -Wno-builtin-macro-redefined
4531 @opindex Wno-builtin-macro-redefined
4532 @opindex Wbuiltin-macro-redefined
4533 Do not warn if certain built-in macros are redefined.  This suppresses
4534 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4535 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4537 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4538 @opindex Wstrict-prototypes
4539 @opindex Wno-strict-prototypes
4540 Warn if a function is declared or defined without specifying the
4541 argument types.  (An old-style function definition is permitted without
4542 a warning if preceded by a declaration that specifies the argument
4543 types.)
4545 @item -Wold-style-declaration @r{(C and Objective-C only)}
4546 @opindex Wold-style-declaration
4547 @opindex Wno-old-style-declaration
4548 Warn for obsolescent usages, according to the C Standard, in a
4549 declaration. For example, warn if storage-class specifiers like
4550 @code{static} are not the first things in a declaration.  This warning
4551 is also enabled by @option{-Wextra}.
4553 @item -Wold-style-definition @r{(C and Objective-C only)}
4554 @opindex Wold-style-definition
4555 @opindex Wno-old-style-definition
4556 Warn if an old-style function definition is used.  A warning is given
4557 even if there is a previous prototype.
4559 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4560 @opindex Wmissing-parameter-type
4561 @opindex Wno-missing-parameter-type
4562 A function parameter is declared without a type specifier in K&R-style
4563 functions:
4565 @smallexample
4566 void foo(bar) @{ @}
4567 @end smallexample
4569 This warning is also enabled by @option{-Wextra}.
4571 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4572 @opindex Wmissing-prototypes
4573 @opindex Wno-missing-prototypes
4574 Warn if a global function is defined without a previous prototype
4575 declaration.  This warning is issued even if the definition itself
4576 provides a prototype.  Use this option to detect global functions
4577 that do not have a matching prototype declaration in a header file.
4578 This option is not valid for C++ because all function declarations
4579 provide prototypes and a non-matching declaration will declare an
4580 overload rather than conflict with an earlier declaration.
4581 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4583 @item -Wmissing-declarations
4584 @opindex Wmissing-declarations
4585 @opindex Wno-missing-declarations
4586 Warn if a global function is defined without a previous declaration.
4587 Do so even if the definition itself provides a prototype.
4588 Use this option to detect global functions that are not declared in
4589 header files.  In C, no warnings are issued for functions with previous
4590 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4591 missing prototypes.  In C++, no warnings are issued for function templates,
4592 or for inline functions, or for functions in anonymous namespaces.
4594 @item -Wmissing-field-initializers
4595 @opindex Wmissing-field-initializers
4596 @opindex Wno-missing-field-initializers
4597 @opindex W
4598 @opindex Wextra
4599 @opindex Wno-extra
4600 Warn if a structure's initializer has some fields missing.  For
4601 example, the following code causes such a warning, because
4602 @code{x.h} is implicitly zero:
4604 @smallexample
4605 struct s @{ int f, g, h; @};
4606 struct s x = @{ 3, 4 @};
4607 @end smallexample
4609 This option does not warn about designated initializers, so the following
4610 modification does not trigger a warning:
4612 @smallexample
4613 struct s @{ int f, g, h; @};
4614 struct s x = @{ .f = 3, .g = 4 @};
4615 @end smallexample
4617 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4618 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4620 @item -Wno-multichar
4621 @opindex Wno-multichar
4622 @opindex Wmultichar
4623 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4624 Usually they indicate a typo in the user's code, as they have
4625 implementation-defined values, and should not be used in portable code.
4627 @item -Wnormalized=<none|id|nfc|nfkc>
4628 @opindex Wnormalized=
4629 @cindex NFC
4630 @cindex NFKC
4631 @cindex character set, input normalization
4632 In ISO C and ISO C++, two identifiers are different if they are
4633 different sequences of characters.  However, sometimes when characters
4634 outside the basic ASCII character set are used, you can have two
4635 different character sequences that look the same.  To avoid confusion,
4636 the ISO 10646 standard sets out some @dfn{normalization rules} which
4637 when applied ensure that two sequences that look the same are turned into
4638 the same sequence.  GCC can warn you if you are using identifiers that
4639 have not been normalized; this option controls that warning.
4641 There are four levels of warning supported by GCC@.  The default is
4642 @option{-Wnormalized=nfc}, which warns about any identifier that is
4643 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4644 recommended form for most uses.
4646 Unfortunately, there are some characters allowed in identifiers by
4647 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4648 identifiers.  That is, there's no way to use these symbols in portable
4649 ISO C or C++ and have all your identifiers in NFC@.
4650 @option{-Wnormalized=id} suppresses the warning for these characters.
4651 It is hoped that future versions of the standards involved will correct
4652 this, which is why this option is not the default.
4654 You can switch the warning off for all characters by writing
4655 @option{-Wnormalized=none}.  You should only do this if you
4656 are using some other normalization scheme (like ``D''), because
4657 otherwise you can easily create bugs that are literally impossible to see.
4659 Some characters in ISO 10646 have distinct meanings but look identical
4660 in some fonts or display methodologies, especially once formatting has
4661 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4662 LETTER N'', displays just like a regular @code{n} that has been
4663 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4664 normalization scheme to convert all these into a standard form as
4665 well, and GCC warns if your code is not in NFKC if you use
4666 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4667 about every identifier that contains the letter O because it might be
4668 confused with the digit 0, and so is not the default, but may be
4669 useful as a local coding convention if the programming environment 
4670 cannot be fixed to display these characters distinctly.
4672 @item -Wno-deprecated
4673 @opindex Wno-deprecated
4674 @opindex Wdeprecated
4675 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4677 @item -Wno-deprecated-declarations
4678 @opindex Wno-deprecated-declarations
4679 @opindex Wdeprecated-declarations
4680 Do not warn about uses of functions (@pxref{Function Attributes}),
4681 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4682 Attributes}) marked as deprecated by using the @code{deprecated}
4683 attribute.
4685 @item -Wno-overflow
4686 @opindex Wno-overflow
4687 @opindex Woverflow
4688 Do not warn about compile-time overflow in constant expressions.
4690 @item -Woverride-init @r{(C and Objective-C only)}
4691 @opindex Woverride-init
4692 @opindex Wno-override-init
4693 @opindex W
4694 @opindex Wextra
4695 @opindex Wno-extra
4696 Warn if an initialized field without side effects is overridden when
4697 using designated initializers (@pxref{Designated Inits, , Designated
4698 Initializers}).
4700 This warning is included in @option{-Wextra}.  To get other
4701 @option{-Wextra} warnings without this one, use @option{-Wextra
4702 -Wno-override-init}.
4704 @item -Wpacked
4705 @opindex Wpacked
4706 @opindex Wno-packed
4707 Warn if a structure is given the packed attribute, but the packed
4708 attribute has no effect on the layout or size of the structure.
4709 Such structures may be mis-aligned for little benefit.  For
4710 instance, in this code, the variable @code{f.x} in @code{struct bar}
4711 is misaligned even though @code{struct bar} does not itself
4712 have the packed attribute:
4714 @smallexample
4715 @group
4716 struct foo @{
4717   int x;
4718   char a, b, c, d;
4719 @} __attribute__((packed));
4720 struct bar @{
4721   char z;
4722   struct foo f;
4724 @end group
4725 @end smallexample
4727 @item -Wpacked-bitfield-compat
4728 @opindex Wpacked-bitfield-compat
4729 @opindex Wno-packed-bitfield-compat
4730 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4731 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4732 the change can lead to differences in the structure layout.  GCC
4733 informs you when the offset of such a field has changed in GCC 4.4.
4734 For example there is no longer a 4-bit padding between field @code{a}
4735 and @code{b} in this structure:
4737 @smallexample
4738 struct foo
4740   char a:4;
4741   char b:8;
4742 @} __attribute__ ((packed));
4743 @end smallexample
4745 This warning is enabled by default.  Use
4746 @option{-Wno-packed-bitfield-compat} to disable this warning.
4748 @item -Wpadded
4749 @opindex Wpadded
4750 @opindex Wno-padded
4751 Warn if padding is included in a structure, either to align an element
4752 of the structure or to align the whole structure.  Sometimes when this
4753 happens it is possible to rearrange the fields of the structure to
4754 reduce the padding and so make the structure smaller.
4756 @item -Wredundant-decls
4757 @opindex Wredundant-decls
4758 @opindex Wno-redundant-decls
4759 Warn if anything is declared more than once in the same scope, even in
4760 cases where multiple declaration is valid and changes nothing.
4762 @item -Wnested-externs @r{(C and Objective-C only)}
4763 @opindex Wnested-externs
4764 @opindex Wno-nested-externs
4765 Warn if an @code{extern} declaration is encountered within a function.
4767 @item -Wno-inherited-variadic-ctor
4768 @opindex Winherited-variadic-ctor
4769 @opindex Wno-inherited-variadic-ctor
4770 Suppress warnings about use of C++11 inheriting constructors when the
4771 base class inherited from has a C variadic constructor; the warning is
4772 on by default because the ellipsis is not inherited.
4774 @item -Winline
4775 @opindex Winline
4776 @opindex Wno-inline
4777 Warn if a function that is declared as inline cannot be inlined.
4778 Even with this option, the compiler does not warn about failures to
4779 inline functions declared in system headers.
4781 The compiler uses a variety of heuristics to determine whether or not
4782 to inline a function.  For example, the compiler takes into account
4783 the size of the function being inlined and the amount of inlining
4784 that has already been done in the current function.  Therefore,
4785 seemingly insignificant changes in the source program can cause the
4786 warnings produced by @option{-Winline} to appear or disappear.
4788 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4789 @opindex Wno-invalid-offsetof
4790 @opindex Winvalid-offsetof
4791 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4792 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4793 to a non-POD type is undefined.  In existing C++ implementations,
4794 however, @samp{offsetof} typically gives meaningful results even when
4795 applied to certain kinds of non-POD types (such as a simple
4796 @samp{struct} that fails to be a POD type only by virtue of having a
4797 constructor).  This flag is for users who are aware that they are
4798 writing nonportable code and who have deliberately chosen to ignore the
4799 warning about it.
4801 The restrictions on @samp{offsetof} may be relaxed in a future version
4802 of the C++ standard.
4804 @item -Wno-int-to-pointer-cast
4805 @opindex Wno-int-to-pointer-cast
4806 @opindex Wint-to-pointer-cast
4807 Suppress warnings from casts to pointer type of an integer of a
4808 different size. In C++, casting to a pointer type of smaller size is
4809 an error. @option{Wint-to-pointer-cast} is enabled by default.
4812 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4813 @opindex Wno-pointer-to-int-cast
4814 @opindex Wpointer-to-int-cast
4815 Suppress warnings from casts from a pointer to an integer type of a
4816 different size.
4818 @item -Winvalid-pch
4819 @opindex Winvalid-pch
4820 @opindex Wno-invalid-pch
4821 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4822 the search path but can't be used.
4824 @item -Wlong-long
4825 @opindex Wlong-long
4826 @opindex Wno-long-long
4827 Warn if @samp{long long} type is used.  This is enabled by either
4828 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4829 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4831 @item -Wvariadic-macros
4832 @opindex Wvariadic-macros
4833 @opindex Wno-variadic-macros
4834 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4835 alternate syntax when in pedantic ISO C99 mode.  This is default.
4836 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4838 @item -Wvarargs
4839 @opindex Wvarargs
4840 @opindex Wno-varargs
4841 Warn upon questionable usage of the macros used to handle variable
4842 arguments like @samp{va_start}.  This is default.  To inhibit the
4843 warning messages, use @option{-Wno-varargs}.
4845 @item -Wvector-operation-performance
4846 @opindex Wvector-operation-performance
4847 @opindex Wno-vector-operation-performance
4848 Warn if vector operation is not implemented via SIMD capabilities of the
4849 architecture.  Mainly useful for the performance tuning.
4850 Vector operation can be implemented @code{piecewise}, which means that the
4851 scalar operation is performed on every vector element; 
4852 @code{in parallel}, which means that the vector operation is implemented
4853 using scalars of wider type, which normally is more performance efficient;
4854 and @code{as a single scalar}, which means that vector fits into a
4855 scalar type.
4857 @item -Wno-virtual-move-assign
4858 @opindex Wvirtual-move-assign
4859 @opindex Wno-virtual-move-assign
4860 Suppress warnings about inheriting from a virtual base with a
4861 non-trivial C++11 move assignment operator.  This is dangerous because
4862 if the virtual base is reachable along more than one path, it will be
4863 moved multiple times, which can mean both objects end up in the
4864 moved-from state.  If the move assignment operator is written to avoid
4865 moving from a moved-from object, this warning can be disabled.
4867 @item -Wvla
4868 @opindex Wvla
4869 @opindex Wno-vla
4870 Warn if variable length array is used in the code.
4871 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4872 the variable length array.
4874 @item -Wvolatile-register-var
4875 @opindex Wvolatile-register-var
4876 @opindex Wno-volatile-register-var
4877 Warn if a register variable is declared volatile.  The volatile
4878 modifier does not inhibit all optimizations that may eliminate reads
4879 and/or writes to register variables.  This warning is enabled by
4880 @option{-Wall}.
4882 @item -Wdisabled-optimization
4883 @opindex Wdisabled-optimization
4884 @opindex Wno-disabled-optimization
4885 Warn if a requested optimization pass is disabled.  This warning does
4886 not generally indicate that there is anything wrong with your code; it
4887 merely indicates that GCC's optimizers are unable to handle the code
4888 effectively.  Often, the problem is that your code is too big or too
4889 complex; GCC refuses to optimize programs when the optimization
4890 itself is likely to take inordinate amounts of time.
4892 @item -Wpointer-sign @r{(C and Objective-C only)}
4893 @opindex Wpointer-sign
4894 @opindex Wno-pointer-sign
4895 Warn for pointer argument passing or assignment with different signedness.
4896 This option is only supported for C and Objective-C@.  It is implied by
4897 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4898 @option{-Wno-pointer-sign}.
4900 @item -Wstack-protector
4901 @opindex Wstack-protector
4902 @opindex Wno-stack-protector
4903 This option is only active when @option{-fstack-protector} is active.  It
4904 warns about functions that are not protected against stack smashing.
4906 @item -Wno-mudflap
4907 @opindex Wno-mudflap
4908 Suppress warnings about constructs that cannot be instrumented by
4909 @option{-fmudflap}.
4911 @item -Woverlength-strings
4912 @opindex Woverlength-strings
4913 @opindex Wno-overlength-strings
4914 Warn about string constants that are longer than the ``minimum
4915 maximum'' length specified in the C standard.  Modern compilers
4916 generally allow string constants that are much longer than the
4917 standard's minimum limit, but very portable programs should avoid
4918 using longer strings.
4920 The limit applies @emph{after} string constant concatenation, and does
4921 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4922 C99, it was raised to 4095.  C++98 does not specify a normative
4923 minimum maximum, so we do not diagnose overlength strings in C++@.
4925 This option is implied by @option{-Wpedantic}, and can be disabled with
4926 @option{-Wno-overlength-strings}.
4928 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4929 @opindex Wunsuffixed-float-constants
4931 Issue a warning for any floating constant that does not have
4932 a suffix.  When used together with @option{-Wsystem-headers} it
4933 warns about such constants in system header files.  This can be useful
4934 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4935 from the decimal floating-point extension to C99.
4936 @end table
4938 @node Debugging Options
4939 @section Options for Debugging Your Program or GCC
4940 @cindex options, debugging
4941 @cindex debugging information options
4943 GCC has various special options that are used for debugging
4944 either your program or GCC:
4946 @table @gcctabopt
4947 @item -g
4948 @opindex g
4949 Produce debugging information in the operating system's native format
4950 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4951 information.
4953 On most systems that use stabs format, @option{-g} enables use of extra
4954 debugging information that only GDB can use; this extra information
4955 makes debugging work better in GDB but probably makes other debuggers
4956 crash or
4957 refuse to read the program.  If you want to control for certain whether
4958 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4959 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4961 GCC allows you to use @option{-g} with
4962 @option{-O}.  The shortcuts taken by optimized code may occasionally
4963 produce surprising results: some variables you declared may not exist
4964 at all; flow of control may briefly move where you did not expect it;
4965 some statements may not be executed because they compute constant
4966 results or their values are already at hand; some statements may
4967 execute in different places because they have been moved out of loops.
4969 Nevertheless it proves possible to debug optimized output.  This makes
4970 it reasonable to use the optimizer for programs that might have bugs.
4972 The following options are useful when GCC is generated with the
4973 capability for more than one debugging format.
4975 @item -gsplit-dwarf
4976 @opindex gsplit-dwarf
4977 Separate as much dwarf debugging information as possible into a
4978 separate output file with the extension .dwo.  This option allows
4979 the build system to avoid linking files with debug information.  To
4980 be useful, this option requires a debugger capable of reading .dwo
4981 files.
4983 @item -ggdb
4984 @opindex ggdb
4985 Produce debugging information for use by GDB@.  This means to use the
4986 most expressive format available (DWARF 2, stabs, or the native format
4987 if neither of those are supported), including GDB extensions if at all
4988 possible.
4990 @item -gpubnames
4991 @opindex gpubnames
4992 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
4994 @item -gstabs
4995 @opindex gstabs
4996 Produce debugging information in stabs format (if that is supported),
4997 without GDB extensions.  This is the format used by DBX on most BSD
4998 systems.  On MIPS, Alpha and System V Release 4 systems this option
4999 produces stabs debugging output that is not understood by DBX or SDB@.
5000 On System V Release 4 systems this option requires the GNU assembler.
5002 @item -feliminate-unused-debug-symbols
5003 @opindex feliminate-unused-debug-symbols
5004 Produce debugging information in stabs format (if that is supported),
5005 for only symbols that are actually used.
5007 @item -femit-class-debug-always
5008 Instead of emitting debugging information for a C++ class in only one
5009 object file, emit it in all object files using the class.  This option
5010 should be used only with debuggers that are unable to handle the way GCC
5011 normally emits debugging information for classes because using this
5012 option increases the size of debugging information by as much as a
5013 factor of two.
5015 @item -fdebug-types-section
5016 @opindex fdebug-types-section
5017 @opindex fno-debug-types-section
5018 When using DWARF Version 4 or higher, type DIEs can be put into
5019 their own @code{.debug_types} section instead of making them part of the
5020 @code{.debug_info} section.  It is more efficient to put them in a separate
5021 comdat sections since the linker can then remove duplicates.
5022 But not all DWARF consumers support @code{.debug_types} sections yet
5023 and on some objects @code{.debug_types} produces larger instead of smaller
5024 debugging information.
5026 @item -gstabs+
5027 @opindex gstabs+
5028 Produce debugging information in stabs format (if that is supported),
5029 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5030 use of these extensions is likely to make other debuggers crash or
5031 refuse to read the program.
5033 @item -gcoff
5034 @opindex gcoff
5035 Produce debugging information in COFF format (if that is supported).
5036 This is the format used by SDB on most System V systems prior to
5037 System V Release 4.
5039 @item -gxcoff
5040 @opindex gxcoff
5041 Produce debugging information in XCOFF format (if that is supported).
5042 This is the format used by the DBX debugger on IBM RS/6000 systems.
5044 @item -gxcoff+
5045 @opindex gxcoff+
5046 Produce debugging information in XCOFF format (if that is supported),
5047 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5048 use of these extensions is likely to make other debuggers crash or
5049 refuse to read the program, and may cause assemblers other than the GNU
5050 assembler (GAS) to fail with an error.
5052 @item -gdwarf-@var{version}
5053 @opindex gdwarf-@var{version}
5054 Produce debugging information in DWARF format (if that is supported).
5055 The value of @var{version} may be either 2, 3 or 4; the default version
5056 for most targets is 4.
5058 Note that with DWARF Version 2, some ports require and always
5059 use some non-conflicting DWARF 3 extensions in the unwind tables.
5061 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5062 for maximum benefit.
5064 @item -grecord-gcc-switches
5065 @opindex grecord-gcc-switches
5066 This switch causes the command-line options used to invoke the
5067 compiler that may affect code generation to be appended to the
5068 DW_AT_producer attribute in DWARF debugging information.  The options
5069 are concatenated with spaces separating them from each other and from
5070 the compiler version.  See also @option{-frecord-gcc-switches} for another
5071 way of storing compiler options into the object file.  This is the default.
5073 @item -gno-record-gcc-switches
5074 @opindex gno-record-gcc-switches
5075 Disallow appending command-line options to the DW_AT_producer attribute
5076 in DWARF debugging information.
5078 @item -gstrict-dwarf
5079 @opindex gstrict-dwarf
5080 Disallow using extensions of later DWARF standard version than selected
5081 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5082 DWARF extensions from later standard versions is allowed.
5084 @item -gno-strict-dwarf
5085 @opindex gno-strict-dwarf
5086 Allow using extensions of later DWARF standard version than selected with
5087 @option{-gdwarf-@var{version}}.
5089 @item -gvms
5090 @opindex gvms
5091 Produce debugging information in Alpha/VMS debug format (if that is
5092 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5094 @item -g@var{level}
5095 @itemx -ggdb@var{level}
5096 @itemx -gstabs@var{level}
5097 @itemx -gcoff@var{level}
5098 @itemx -gxcoff@var{level}
5099 @itemx -gvms@var{level}
5100 Request debugging information and also use @var{level} to specify how
5101 much information.  The default level is 2.
5103 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5104 @option{-g}.
5106 Level 1 produces minimal information, enough for making backtraces in
5107 parts of the program that you don't plan to debug.  This includes
5108 descriptions of functions and external variables, but no information
5109 about local variables and no line numbers.
5111 Level 3 includes extra information, such as all the macro definitions
5112 present in the program.  Some debuggers support macro expansion when
5113 you use @option{-g3}.
5115 @option{-gdwarf-2} does not accept a concatenated debug level, because
5116 GCC used to support an option @option{-gdwarf} that meant to generate
5117 debug information in version 1 of the DWARF format (which is very
5118 different from version 2), and it would have been too confusing.  That
5119 debug format is long obsolete, but the option cannot be changed now.
5120 Instead use an additional @option{-g@var{level}} option to change the
5121 debug level for DWARF.
5123 @item -gtoggle
5124 @opindex gtoggle
5125 Turn off generation of debug info, if leaving out this option
5126 generates it, or turn it on at level 2 otherwise.  The position of this
5127 argument in the command line does not matter; it takes effect after all
5128 other options are processed, and it does so only once, no matter how
5129 many times it is given.  This is mainly intended to be used with
5130 @option{-fcompare-debug}.
5132 @item -fsanitize=address
5133 Enable AddressSanitizer, a fast memory error detector.
5134 Memory access instructions will be instrumented to detect
5135 out-of-bounds and use-after-free bugs.
5136 See @uref{http://code.google.com/p/address-sanitizer/} for more details.
5138 @item -fsanitize=thread
5139 Enable ThreadSanitizer, a fast data race detector.
5140 Memory access instructions will be instrumented to detect
5141 data race bugs.
5142 See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for more details.
5144 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5145 @opindex fdump-final-insns
5146 Dump the final internal representation (RTL) to @var{file}.  If the
5147 optional argument is omitted (or if @var{file} is @code{.}), the name
5148 of the dump file is determined by appending @code{.gkd} to the
5149 compilation output file name.
5151 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5152 @opindex fcompare-debug
5153 @opindex fno-compare-debug
5154 If no error occurs during compilation, run the compiler a second time,
5155 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5156 passed to the second compilation.  Dump the final internal
5157 representation in both compilations, and print an error if they differ.
5159 If the equal sign is omitted, the default @option{-gtoggle} is used.
5161 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5162 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5163 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5164 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5165 is used.
5167 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5168 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5169 of the final representation and the second compilation, preventing even
5170 @env{GCC_COMPARE_DEBUG} from taking effect.
5172 To verify full coverage during @option{-fcompare-debug} testing, set
5173 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5174 which GCC rejects as an invalid option in any actual compilation
5175 (rather than preprocessing, assembly or linking).  To get just a
5176 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5177 not overridden} will do.
5179 @item -fcompare-debug-second
5180 @opindex fcompare-debug-second
5181 This option is implicitly passed to the compiler for the second
5182 compilation requested by @option{-fcompare-debug}, along with options to
5183 silence warnings, and omitting other options that would cause
5184 side-effect compiler outputs to files or to the standard output.  Dump
5185 files and preserved temporary files are renamed so as to contain the
5186 @code{.gk} additional extension during the second compilation, to avoid
5187 overwriting those generated by the first.
5189 When this option is passed to the compiler driver, it causes the
5190 @emph{first} compilation to be skipped, which makes it useful for little
5191 other than debugging the compiler proper.
5193 @item -feliminate-dwarf2-dups
5194 @opindex feliminate-dwarf2-dups
5195 Compress DWARF 2 debugging information by eliminating duplicated
5196 information about each symbol.  This option only makes sense when
5197 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5199 @item -femit-struct-debug-baseonly
5200 Emit debug information for struct-like types
5201 only when the base name of the compilation source file
5202 matches the base name of file in which the struct is defined.
5204 This option substantially reduces the size of debugging information,
5205 but at significant potential loss in type information to the debugger.
5206 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5207 See @option{-femit-struct-debug-detailed} for more detailed control.
5209 This option works only with DWARF 2.
5211 @item -femit-struct-debug-reduced
5212 Emit debug information for struct-like types
5213 only when the base name of the compilation source file
5214 matches the base name of file in which the type is defined,
5215 unless the struct is a template or defined in a system header.
5217 This option significantly reduces the size of debugging information,
5218 with some potential loss in type information to the debugger.
5219 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5220 See @option{-femit-struct-debug-detailed} for more detailed control.
5222 This option works only with DWARF 2.
5224 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5225 Specify the struct-like types
5226 for which the compiler generates debug information.
5227 The intent is to reduce duplicate struct debug information
5228 between different object files within the same program.
5230 This option is a detailed version of
5231 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5232 which serves for most needs.
5234 A specification has the syntax@*
5235 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5237 The optional first word limits the specification to
5238 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5239 A struct type is used directly when it is the type of a variable, member.
5240 Indirect uses arise through pointers to structs.
5241 That is, when use of an incomplete struct is valid, the use is indirect.
5242 An example is
5243 @samp{struct one direct; struct two * indirect;}.
5245 The optional second word limits the specification to
5246 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5247 Generic structs are a bit complicated to explain.
5248 For C++, these are non-explicit specializations of template classes,
5249 or non-template classes within the above.
5250 Other programming languages have generics,
5251 but @option{-femit-struct-debug-detailed} does not yet implement them.
5253 The third word specifies the source files for those
5254 structs for which the compiler should emit debug information.
5255 The values @samp{none} and @samp{any} have the normal meaning.
5256 The value @samp{base} means that
5257 the base of name of the file in which the type declaration appears
5258 must match the base of the name of the main compilation file.
5259 In practice, this means that when compiling @file{foo.c}, debug information
5260 is generated for types declared in that file and @file{foo.h},
5261 but not other header files.
5262 The value @samp{sys} means those types satisfying @samp{base}
5263 or declared in system or compiler headers.
5265 You may need to experiment to determine the best settings for your application.
5267 The default is @option{-femit-struct-debug-detailed=all}.
5269 This option works only with DWARF 2.
5271 @item -fno-merge-debug-strings
5272 @opindex fmerge-debug-strings
5273 @opindex fno-merge-debug-strings
5274 Direct the linker to not merge together strings in the debugging
5275 information that are identical in different object files.  Merging is
5276 not supported by all assemblers or linkers.  Merging decreases the size
5277 of the debug information in the output file at the cost of increasing
5278 link processing time.  Merging is enabled by default.
5280 @item -fdebug-prefix-map=@var{old}=@var{new}
5281 @opindex fdebug-prefix-map
5282 When compiling files in directory @file{@var{old}}, record debugging
5283 information describing them as in @file{@var{new}} instead.
5285 @item -fno-dwarf2-cfi-asm
5286 @opindex fdwarf2-cfi-asm
5287 @opindex fno-dwarf2-cfi-asm
5288 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5289 instead of using GAS @code{.cfi_*} directives.
5291 @cindex @command{prof}
5292 @item -p
5293 @opindex p
5294 Generate extra code to write profile information suitable for the
5295 analysis program @command{prof}.  You must use this option when compiling
5296 the source files you want data about, and you must also use it when
5297 linking.
5299 @cindex @command{gprof}
5300 @item -pg
5301 @opindex pg
5302 Generate extra code to write profile information suitable for the
5303 analysis program @command{gprof}.  You must use this option when compiling
5304 the source files you want data about, and you must also use it when
5305 linking.
5307 @item -Q
5308 @opindex Q
5309 Makes the compiler print out each function name as it is compiled, and
5310 print some statistics about each pass when it finishes.
5312 @item -ftime-report
5313 @opindex ftime-report
5314 Makes the compiler print some statistics about the time consumed by each
5315 pass when it finishes.
5317 @item -fmem-report
5318 @opindex fmem-report
5319 Makes the compiler print some statistics about permanent memory
5320 allocation when it finishes.
5322 @item -fmem-report-wpa
5323 @opindex fmem-report-wpa
5324 Makes the compiler print some statistics about permanent memory
5325 allocation for the WPA phase only.
5327 @item -fpre-ipa-mem-report
5328 @opindex fpre-ipa-mem-report
5329 @item -fpost-ipa-mem-report
5330 @opindex fpost-ipa-mem-report
5331 Makes the compiler print some statistics about permanent memory
5332 allocation before or after interprocedural optimization.
5334 @item -fprofile-report
5335 @opindex fprofile-report
5336 Makes the compiler print some statistics about consistency of the
5337 (estimated) profile and effect of individual passes.
5339 @item -fstack-usage
5340 @opindex fstack-usage
5341 Makes the compiler output stack usage information for the program, on a
5342 per-function basis.  The filename for the dump is made by appending
5343 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5344 the output file, if explicitly specified and it is not an executable,
5345 otherwise it is the basename of the source file.  An entry is made up
5346 of three fields:
5348 @itemize
5349 @item
5350 The name of the function.
5351 @item
5352 A number of bytes.
5353 @item
5354 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5355 @end itemize
5357 The qualifier @code{static} means that the function manipulates the stack
5358 statically: a fixed number of bytes are allocated for the frame on function
5359 entry and released on function exit; no stack adjustments are otherwise made
5360 in the function.  The second field is this fixed number of bytes.
5362 The qualifier @code{dynamic} means that the function manipulates the stack
5363 dynamically: in addition to the static allocation described above, stack
5364 adjustments are made in the body of the function, for example to push/pop
5365 arguments around function calls.  If the qualifier @code{bounded} is also
5366 present, the amount of these adjustments is bounded at compile time and
5367 the second field is an upper bound of the total amount of stack used by
5368 the function.  If it is not present, the amount of these adjustments is
5369 not bounded at compile time and the second field only represents the
5370 bounded part.
5372 @item -fprofile-arcs
5373 @opindex fprofile-arcs
5374 Add code so that program flow @dfn{arcs} are instrumented.  During
5375 execution the program records how many times each branch and call is
5376 executed and how many times it is taken or returns.  When the compiled
5377 program exits it saves this data to a file called
5378 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5379 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5380 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5381 @var{auxname} is generated from the name of the output file, if
5382 explicitly specified and it is not the final executable, otherwise it is
5383 the basename of the source file.  In both cases any suffix is removed
5384 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5385 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5386 @xref{Cross-profiling}.
5388 @cindex @command{gcov}
5389 @item --coverage
5390 @opindex coverage
5392 This option is used to compile and link code instrumented for coverage
5393 analysis.  The option is a synonym for @option{-fprofile-arcs}
5394 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5395 linking).  See the documentation for those options for more details.
5397 @itemize
5399 @item
5400 Compile the source files with @option{-fprofile-arcs} plus optimization
5401 and code generation options.  For test coverage analysis, use the
5402 additional @option{-ftest-coverage} option.  You do not need to profile
5403 every source file in a program.
5405 @item
5406 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5407 (the latter implies the former).
5409 @item
5410 Run the program on a representative workload to generate the arc profile
5411 information.  This may be repeated any number of times.  You can run
5412 concurrent instances of your program, and provided that the file system
5413 supports locking, the data files will be correctly updated.  Also
5414 @code{fork} calls are detected and correctly handled (double counting
5415 will not happen).
5417 @item
5418 For profile-directed optimizations, compile the source files again with
5419 the same optimization and code generation options plus
5420 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5421 Control Optimization}).
5423 @item
5424 For test coverage analysis, use @command{gcov} to produce human readable
5425 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5426 @command{gcov} documentation for further information.
5428 @end itemize
5430 With @option{-fprofile-arcs}, for each function of your program GCC
5431 creates a program flow graph, then finds a spanning tree for the graph.
5432 Only arcs that are not on the spanning tree have to be instrumented: the
5433 compiler adds code to count the number of times that these arcs are
5434 executed.  When an arc is the only exit or only entrance to a block, the
5435 instrumentation code can be added to the block; otherwise, a new basic
5436 block must be created to hold the instrumentation code.
5438 @need 2000
5439 @item -ftest-coverage
5440 @opindex ftest-coverage
5441 Produce a notes file that the @command{gcov} code-coverage utility
5442 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5443 show program coverage.  Each source file's note file is called
5444 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5445 above for a description of @var{auxname} and instructions on how to
5446 generate test coverage data.  Coverage data matches the source files
5447 more closely if you do not optimize.
5449 @item -fdbg-cnt-list
5450 @opindex fdbg-cnt-list
5451 Print the name and the counter upper bound for all debug counters.
5454 @item -fdbg-cnt=@var{counter-value-list}
5455 @opindex fdbg-cnt
5456 Set the internal debug counter upper bound.  @var{counter-value-list}
5457 is a comma-separated list of @var{name}:@var{value} pairs
5458 which sets the upper bound of each debug counter @var{name} to @var{value}.
5459 All debug counters have the initial upper bound of @code{UINT_MAX};
5460 thus @code{dbg_cnt()} returns true always unless the upper bound
5461 is set by this option.
5462 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5463 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5465 @item -fenable-@var{kind}-@var{pass}
5466 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5467 @opindex fdisable-
5468 @opindex fenable-
5470 This is a set of options that are used to explicitly disable/enable
5471 optimization passes.  These options are intended for use for debugging GCC.
5472 Compiler users should use regular options for enabling/disabling
5473 passes instead.
5475 @table @gcctabopt
5477 @item -fdisable-ipa-@var{pass}
5478 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5479 statically invoked in the compiler multiple times, the pass name should be
5480 appended with a sequential number starting from 1.
5482 @item -fdisable-rtl-@var{pass}
5483 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5484 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5485 statically invoked in the compiler multiple times, the pass name should be
5486 appended with a sequential number starting from 1.  @var{range-list} is a 
5487 comma-separated list of function ranges or assembler names.  Each range is a number
5488 pair separated by a colon.  The range is inclusive in both ends.  If the range
5489 is trivial, the number pair can be simplified as a single number.  If the
5490 function's call graph node's @var{uid} falls within one of the specified ranges,
5491 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5492 function header of a dump file, and the pass names can be dumped by using
5493 option @option{-fdump-passes}.
5495 @item -fdisable-tree-@var{pass}
5496 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5497 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5498 option arguments.
5500 @item -fenable-ipa-@var{pass}
5501 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5502 statically invoked in the compiler multiple times, the pass name should be
5503 appended with a sequential number starting from 1.
5505 @item -fenable-rtl-@var{pass}
5506 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5507 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5508 description and examples.
5510 @item -fenable-tree-@var{pass}
5511 @itemx -fenable-tree-@var{pass}=@var{range-list}
5512 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5513 of option arguments.
5515 @end table
5517 Here are some examples showing uses of these options.
5519 @smallexample
5521 # disable ccp1 for all functions
5522    -fdisable-tree-ccp1
5523 # disable complete unroll for function whose cgraph node uid is 1
5524    -fenable-tree-cunroll=1
5525 # disable gcse2 for functions at the following ranges [1,1],
5526 # [300,400], and [400,1000]
5527 # disable gcse2 for functions foo and foo2
5528    -fdisable-rtl-gcse2=foo,foo2
5529 # disable early inlining
5530    -fdisable-tree-einline
5531 # disable ipa inlining
5532    -fdisable-ipa-inline
5533 # enable tree full unroll
5534    -fenable-tree-unroll
5536 @end smallexample
5538 @item -d@var{letters}
5539 @itemx -fdump-rtl-@var{pass}
5540 @itemx -fdump-rtl-@var{pass}=@var{filename}
5541 @opindex d
5542 Says to make debugging dumps during compilation at times specified by
5543 @var{letters}.  This is used for debugging the RTL-based passes of the
5544 compiler.  The file names for most of the dumps are made by appending
5545 a pass number and a word to the @var{dumpname}, and the files are
5546 created in the directory of the output file. In case of
5547 @option{=@var{filename}} option, the dump is output on the given file
5548 instead of the pass numbered dump files. Note that the pass number is
5549 computed statically as passes get registered into the pass manager.
5550 Thus the numbering is not related to the dynamic order of execution of
5551 passes.  In particular, a pass installed by a plugin could have a
5552 number over 200 even if it executed quite early.  @var{dumpname} is
5553 generated from the name of the output file, if explicitly specified
5554 and it is not an executable, otherwise it is the basename of the
5555 source file. These switches may have different effects when
5556 @option{-E} is used for preprocessing.
5558 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5559 @option{-d} option @var{letters}.  Here are the possible
5560 letters for use in @var{pass} and @var{letters}, and their meanings:
5562 @table @gcctabopt
5564 @item -fdump-rtl-alignments
5565 @opindex fdump-rtl-alignments
5566 Dump after branch alignments have been computed.
5568 @item -fdump-rtl-asmcons
5569 @opindex fdump-rtl-asmcons
5570 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5572 @item -fdump-rtl-auto_inc_dec
5573 @opindex fdump-rtl-auto_inc_dec
5574 Dump after auto-inc-dec discovery.  This pass is only run on
5575 architectures that have auto inc or auto dec instructions.
5577 @item -fdump-rtl-barriers
5578 @opindex fdump-rtl-barriers
5579 Dump after cleaning up the barrier instructions.
5581 @item -fdump-rtl-bbpart
5582 @opindex fdump-rtl-bbpart
5583 Dump after partitioning hot and cold basic blocks.
5585 @item -fdump-rtl-bbro
5586 @opindex fdump-rtl-bbro
5587 Dump after block reordering.
5589 @item -fdump-rtl-btl1
5590 @itemx -fdump-rtl-btl2
5591 @opindex fdump-rtl-btl2
5592 @opindex fdump-rtl-btl2
5593 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5594 after the two branch
5595 target load optimization passes.
5597 @item -fdump-rtl-bypass
5598 @opindex fdump-rtl-bypass
5599 Dump after jump bypassing and control flow optimizations.
5601 @item -fdump-rtl-combine
5602 @opindex fdump-rtl-combine
5603 Dump after the RTL instruction combination pass.
5605 @item -fdump-rtl-compgotos
5606 @opindex fdump-rtl-compgotos
5607 Dump after duplicating the computed gotos.
5609 @item -fdump-rtl-ce1
5610 @itemx -fdump-rtl-ce2
5611 @itemx -fdump-rtl-ce3
5612 @opindex fdump-rtl-ce1
5613 @opindex fdump-rtl-ce2
5614 @opindex fdump-rtl-ce3
5615 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5616 @option{-fdump-rtl-ce3} enable dumping after the three
5617 if conversion passes.
5619 @item -fdump-rtl-cprop_hardreg
5620 @opindex fdump-rtl-cprop_hardreg
5621 Dump after hard register copy propagation.
5623 @item -fdump-rtl-csa
5624 @opindex fdump-rtl-csa
5625 Dump after combining stack adjustments.
5627 @item -fdump-rtl-cse1
5628 @itemx -fdump-rtl-cse2
5629 @opindex fdump-rtl-cse1
5630 @opindex fdump-rtl-cse2
5631 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5632 the two common subexpression elimination passes.
5634 @item -fdump-rtl-dce
5635 @opindex fdump-rtl-dce
5636 Dump after the standalone dead code elimination passes.
5638 @item -fdump-rtl-dbr
5639 @opindex fdump-rtl-dbr
5640 Dump after delayed branch scheduling.
5642 @item -fdump-rtl-dce1
5643 @itemx -fdump-rtl-dce2
5644 @opindex fdump-rtl-dce1
5645 @opindex fdump-rtl-dce2
5646 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5647 the two dead store elimination passes.
5649 @item -fdump-rtl-eh
5650 @opindex fdump-rtl-eh
5651 Dump after finalization of EH handling code.
5653 @item -fdump-rtl-eh_ranges
5654 @opindex fdump-rtl-eh_ranges
5655 Dump after conversion of EH handling range regions.
5657 @item -fdump-rtl-expand
5658 @opindex fdump-rtl-expand
5659 Dump after RTL generation.
5661 @item -fdump-rtl-fwprop1
5662 @itemx -fdump-rtl-fwprop2
5663 @opindex fdump-rtl-fwprop1
5664 @opindex fdump-rtl-fwprop2
5665 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5666 dumping after the two forward propagation passes.
5668 @item -fdump-rtl-gcse1
5669 @itemx -fdump-rtl-gcse2
5670 @opindex fdump-rtl-gcse1
5671 @opindex fdump-rtl-gcse2
5672 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5673 after global common subexpression elimination.
5675 @item -fdump-rtl-init-regs
5676 @opindex fdump-rtl-init-regs
5677 Dump after the initialization of the registers.
5679 @item -fdump-rtl-initvals
5680 @opindex fdump-rtl-initvals
5681 Dump after the computation of the initial value sets.
5683 @item -fdump-rtl-into_cfglayout
5684 @opindex fdump-rtl-into_cfglayout
5685 Dump after converting to cfglayout mode.
5687 @item -fdump-rtl-ira
5688 @opindex fdump-rtl-ira
5689 Dump after iterated register allocation.
5691 @item -fdump-rtl-jump
5692 @opindex fdump-rtl-jump
5693 Dump after the second jump optimization.
5695 @item -fdump-rtl-loop2
5696 @opindex fdump-rtl-loop2
5697 @option{-fdump-rtl-loop2} enables dumping after the rtl
5698 loop optimization passes.
5700 @item -fdump-rtl-mach
5701 @opindex fdump-rtl-mach
5702 Dump after performing the machine dependent reorganization pass, if that
5703 pass exists.
5705 @item -fdump-rtl-mode_sw
5706 @opindex fdump-rtl-mode_sw
5707 Dump after removing redundant mode switches.
5709 @item -fdump-rtl-rnreg
5710 @opindex fdump-rtl-rnreg
5711 Dump after register renumbering.
5713 @item -fdump-rtl-outof_cfglayout
5714 @opindex fdump-rtl-outof_cfglayout
5715 Dump after converting from cfglayout mode.
5717 @item -fdump-rtl-peephole2
5718 @opindex fdump-rtl-peephole2
5719 Dump after the peephole pass.
5721 @item -fdump-rtl-postreload
5722 @opindex fdump-rtl-postreload
5723 Dump after post-reload optimizations.
5725 @item -fdump-rtl-pro_and_epilogue
5726 @opindex fdump-rtl-pro_and_epilogue
5727 Dump after generating the function prologues and epilogues.
5729 @item -fdump-rtl-regmove
5730 @opindex fdump-rtl-regmove
5731 Dump after the register move pass.
5733 @item -fdump-rtl-sched1
5734 @itemx -fdump-rtl-sched2
5735 @opindex fdump-rtl-sched1
5736 @opindex fdump-rtl-sched2
5737 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5738 after the basic block scheduling passes.
5740 @item -fdump-rtl-see
5741 @opindex fdump-rtl-see
5742 Dump after sign extension elimination.
5744 @item -fdump-rtl-seqabstr
5745 @opindex fdump-rtl-seqabstr
5746 Dump after common sequence discovery.
5748 @item -fdump-rtl-shorten
5749 @opindex fdump-rtl-shorten
5750 Dump after shortening branches.
5752 @item -fdump-rtl-sibling
5753 @opindex fdump-rtl-sibling
5754 Dump after sibling call optimizations.
5756 @item -fdump-rtl-split1
5757 @itemx -fdump-rtl-split2
5758 @itemx -fdump-rtl-split3
5759 @itemx -fdump-rtl-split4
5760 @itemx -fdump-rtl-split5
5761 @opindex fdump-rtl-split1
5762 @opindex fdump-rtl-split2
5763 @opindex fdump-rtl-split3
5764 @opindex fdump-rtl-split4
5765 @opindex fdump-rtl-split5
5766 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5767 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5768 @option{-fdump-rtl-split5} enable dumping after five rounds of
5769 instruction splitting.
5771 @item -fdump-rtl-sms
5772 @opindex fdump-rtl-sms
5773 Dump after modulo scheduling.  This pass is only run on some
5774 architectures.
5776 @item -fdump-rtl-stack
5777 @opindex fdump-rtl-stack
5778 Dump after conversion from GCC's ``flat register file'' registers to the
5779 x87's stack-like registers.  This pass is only run on x86 variants.
5781 @item -fdump-rtl-subreg1
5782 @itemx -fdump-rtl-subreg2
5783 @opindex fdump-rtl-subreg1
5784 @opindex fdump-rtl-subreg2
5785 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5786 the two subreg expansion passes.
5788 @item -fdump-rtl-unshare
5789 @opindex fdump-rtl-unshare
5790 Dump after all rtl has been unshared.
5792 @item -fdump-rtl-vartrack
5793 @opindex fdump-rtl-vartrack
5794 Dump after variable tracking.
5796 @item -fdump-rtl-vregs
5797 @opindex fdump-rtl-vregs
5798 Dump after converting virtual registers to hard registers.
5800 @item -fdump-rtl-web
5801 @opindex fdump-rtl-web
5802 Dump after live range splitting.
5804 @item -fdump-rtl-regclass
5805 @itemx -fdump-rtl-subregs_of_mode_init
5806 @itemx -fdump-rtl-subregs_of_mode_finish
5807 @itemx -fdump-rtl-dfinit
5808 @itemx -fdump-rtl-dfinish
5809 @opindex fdump-rtl-regclass
5810 @opindex fdump-rtl-subregs_of_mode_init
5811 @opindex fdump-rtl-subregs_of_mode_finish
5812 @opindex fdump-rtl-dfinit
5813 @opindex fdump-rtl-dfinish
5814 These dumps are defined but always produce empty files.
5816 @item -da
5817 @itemx -fdump-rtl-all
5818 @opindex da
5819 @opindex fdump-rtl-all
5820 Produce all the dumps listed above.
5822 @item -dA
5823 @opindex dA
5824 Annotate the assembler output with miscellaneous debugging information.
5826 @item -dD
5827 @opindex dD
5828 Dump all macro definitions, at the end of preprocessing, in addition to
5829 normal output.
5831 @item -dH
5832 @opindex dH
5833 Produce a core dump whenever an error occurs.
5835 @item -dp
5836 @opindex dp
5837 Annotate the assembler output with a comment indicating which
5838 pattern and alternative is used.  The length of each instruction is
5839 also printed.
5841 @item -dP
5842 @opindex dP
5843 Dump the RTL in the assembler output as a comment before each instruction.
5844 Also turns on @option{-dp} annotation.
5846 @item -dx
5847 @opindex dx
5848 Just generate RTL for a function instead of compiling it.  Usually used
5849 with @option{-fdump-rtl-expand}.
5850 @end table
5852 @item -fdump-noaddr
5853 @opindex fdump-noaddr
5854 When doing debugging dumps, suppress address output.  This makes it more
5855 feasible to use diff on debugging dumps for compiler invocations with
5856 different compiler binaries and/or different
5857 text / bss / data / heap / stack / dso start locations.
5859 @item -fdump-unnumbered
5860 @opindex fdump-unnumbered
5861 When doing debugging dumps, suppress instruction numbers and address output.
5862 This makes it more feasible to use diff on debugging dumps for compiler
5863 invocations with different options, in particular with and without
5864 @option{-g}.
5866 @item -fdump-unnumbered-links
5867 @opindex fdump-unnumbered-links
5868 When doing debugging dumps (see @option{-d} option above), suppress
5869 instruction numbers for the links to the previous and next instructions
5870 in a sequence.
5872 @item -fdump-translation-unit @r{(C++ only)}
5873 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5874 @opindex fdump-translation-unit
5875 Dump a representation of the tree structure for the entire translation
5876 unit to a file.  The file name is made by appending @file{.tu} to the
5877 source file name, and the file is created in the same directory as the
5878 output file.  If the @samp{-@var{options}} form is used, @var{options}
5879 controls the details of the dump as described for the
5880 @option{-fdump-tree} options.
5882 @item -fdump-class-hierarchy @r{(C++ only)}
5883 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5884 @opindex fdump-class-hierarchy
5885 Dump a representation of each class's hierarchy and virtual function
5886 table layout to a file.  The file name is made by appending
5887 @file{.class} to the source file name, and the file is created in the
5888 same directory as the output file.  If the @samp{-@var{options}} form
5889 is used, @var{options} controls the details of the dump as described
5890 for the @option{-fdump-tree} options.
5892 @item -fdump-ipa-@var{switch}
5893 @opindex fdump-ipa
5894 Control the dumping at various stages of inter-procedural analysis
5895 language tree to a file.  The file name is generated by appending a
5896 switch specific suffix to the source file name, and the file is created
5897 in the same directory as the output file.  The following dumps are
5898 possible:
5900 @table @samp
5901 @item all
5902 Enables all inter-procedural analysis dumps.
5904 @item cgraph
5905 Dumps information about call-graph optimization, unused function removal,
5906 and inlining decisions.
5908 @item inline
5909 Dump after function inlining.
5911 @end table
5913 @item -fdump-passes
5914 @opindex fdump-passes
5915 Dump the list of optimization passes that are turned on and off by
5916 the current command-line options.
5918 @item -fdump-statistics-@var{option}
5919 @opindex fdump-statistics
5920 Enable and control dumping of pass statistics in a separate file.  The
5921 file name is generated by appending a suffix ending in
5922 @samp{.statistics} to the source file name, and the file is created in
5923 the same directory as the output file.  If the @samp{-@var{option}}
5924 form is used, @samp{-stats} causes counters to be summed over the
5925 whole compilation unit while @samp{-details} dumps every event as
5926 the passes generate them.  The default with no option is to sum
5927 counters for each function compiled.
5929 @item -fdump-tree-@var{switch}
5930 @itemx -fdump-tree-@var{switch}-@var{options}
5931 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
5932 @opindex fdump-tree
5933 Control the dumping at various stages of processing the intermediate
5934 language tree to a file.  The file name is generated by appending a
5935 switch-specific suffix to the source file name, and the file is
5936 created in the same directory as the output file. In case of
5937 @option{=@var{filename}} option, the dump is output on the given file
5938 instead of the auto named dump files.  If the @samp{-@var{options}}
5939 form is used, @var{options} is a list of @samp{-} separated options
5940 which control the details of the dump.  Not all options are applicable
5941 to all dumps; those that are not meaningful are ignored.  The
5942 following options are available
5944 @table @samp
5945 @item address
5946 Print the address of each node.  Usually this is not meaningful as it
5947 changes according to the environment and source file.  Its primary use
5948 is for tying up a dump file with a debug environment.
5949 @item asmname
5950 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5951 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5952 use working backward from mangled names in the assembly file.
5953 @item slim
5954 When dumping front-end intermediate representations, inhibit dumping
5955 of members of a scope or body of a function merely because that scope
5956 has been reached.  Only dump such items when they are directly reachable
5957 by some other path.
5959 When dumping pretty-printed trees, this option inhibits dumping the
5960 bodies of control structures.
5962 When dumping RTL, print the RTL in slim (condensed) form instead of
5963 the default LISP-like representation.
5964 @item raw
5965 Print a raw representation of the tree.  By default, trees are
5966 pretty-printed into a C-like representation.
5967 @item details
5968 Enable more detailed dumps (not honored by every dump option). Also
5969 include information from the optimization passes.
5970 @item stats
5971 Enable dumping various statistics about the pass (not honored by every dump
5972 option).
5973 @item blocks
5974 Enable showing basic block boundaries (disabled in raw dumps).
5975 @item graph
5976 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5977 dump a representation of the control flow graph suitable for viewing with
5978 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
5979 the file is pretty-printed as a subgraph, so that GraphViz can render them
5980 all in a single plot.
5982 This option currently only works for RTL dumps, and the RTL is always
5983 dumped in slim form.
5984 @item vops
5985 Enable showing virtual operands for every statement.
5986 @item lineno
5987 Enable showing line numbers for statements.
5988 @item uid
5989 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5990 @item verbose
5991 Enable showing the tree dump for each statement.
5992 @item eh
5993 Enable showing the EH region number holding each statement.
5994 @item scev
5995 Enable showing scalar evolution analysis details.
5996 @item optimized
5997 Enable showing optimization information (only available in certain
5998 passes).
5999 @item missed
6000 Enable showing missed optimization information (only available in certain
6001 passes).
6002 @item notes
6003 Enable other detailed optimization information (only available in
6004 certain passes).
6005 @item =@var{filename}
6006 Instead of an auto named dump file, output into the given file
6007 name. The file names @file{stdout} and @file{stderr} are treated
6008 specially and are considered already open standard streams. For
6009 example,
6011 @smallexample
6012 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6013      -fdump-tree-pre=stderr file.c
6014 @end smallexample
6016 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6017 output on to @file{stderr}. If two conflicting dump filenames are
6018 given for the same pass, then the latter option overrides the earlier
6019 one.
6021 @item all
6022 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6023 and @option{lineno}.
6025 @item optall
6026 Turn on all optimization options, i.e., @option{optimized},
6027 @option{missed}, and @option{note}.
6028 @end table
6030 The following tree dumps are possible:
6031 @table @samp
6033 @item original
6034 @opindex fdump-tree-original
6035 Dump before any tree based optimization, to @file{@var{file}.original}.
6037 @item optimized
6038 @opindex fdump-tree-optimized
6039 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6041 @item gimple
6042 @opindex fdump-tree-gimple
6043 Dump each function before and after the gimplification pass to a file.  The
6044 file name is made by appending @file{.gimple} to the source file name.
6046 @item cfg
6047 @opindex fdump-tree-cfg
6048 Dump the control flow graph of each function to a file.  The file name is
6049 made by appending @file{.cfg} to the source file name.
6051 @item ch
6052 @opindex fdump-tree-ch
6053 Dump each function after copying loop headers.  The file name is made by
6054 appending @file{.ch} to the source file name.
6056 @item ssa
6057 @opindex fdump-tree-ssa
6058 Dump SSA related information to a file.  The file name is made by appending
6059 @file{.ssa} to the source file name.
6061 @item alias
6062 @opindex fdump-tree-alias
6063 Dump aliasing information for each function.  The file name is made by
6064 appending @file{.alias} to the source file name.
6066 @item ccp
6067 @opindex fdump-tree-ccp
6068 Dump each function after CCP@.  The file name is made by appending
6069 @file{.ccp} to the source file name.
6071 @item storeccp
6072 @opindex fdump-tree-storeccp
6073 Dump each function after STORE-CCP@.  The file name is made by appending
6074 @file{.storeccp} to the source file name.
6076 @item pre
6077 @opindex fdump-tree-pre
6078 Dump trees after partial redundancy elimination.  The file name is made
6079 by appending @file{.pre} to the source file name.
6081 @item fre
6082 @opindex fdump-tree-fre
6083 Dump trees after full redundancy elimination.  The file name is made
6084 by appending @file{.fre} to the source file name.
6086 @item copyprop
6087 @opindex fdump-tree-copyprop
6088 Dump trees after copy propagation.  The file name is made
6089 by appending @file{.copyprop} to the source file name.
6091 @item store_copyprop
6092 @opindex fdump-tree-store_copyprop
6093 Dump trees after store copy-propagation.  The file name is made
6094 by appending @file{.store_copyprop} to the source file name.
6096 @item dce
6097 @opindex fdump-tree-dce
6098 Dump each function after dead code elimination.  The file name is made by
6099 appending @file{.dce} to the source file name.
6101 @item mudflap
6102 @opindex fdump-tree-mudflap
6103 Dump each function after adding mudflap instrumentation.  The file name is
6104 made by appending @file{.mudflap} to the source file name.
6106 @item sra
6107 @opindex fdump-tree-sra
6108 Dump each function after performing scalar replacement of aggregates.  The
6109 file name is made by appending @file{.sra} to the source file name.
6111 @item sink
6112 @opindex fdump-tree-sink
6113 Dump each function after performing code sinking.  The file name is made
6114 by appending @file{.sink} to the source file name.
6116 @item dom
6117 @opindex fdump-tree-dom
6118 Dump each function after applying dominator tree optimizations.  The file
6119 name is made by appending @file{.dom} to the source file name.
6121 @item dse
6122 @opindex fdump-tree-dse
6123 Dump each function after applying dead store elimination.  The file
6124 name is made by appending @file{.dse} to the source file name.
6126 @item phiopt
6127 @opindex fdump-tree-phiopt
6128 Dump each function after optimizing PHI nodes into straightline code.  The file
6129 name is made by appending @file{.phiopt} to the source file name.
6131 @item forwprop
6132 @opindex fdump-tree-forwprop
6133 Dump each function after forward propagating single use variables.  The file
6134 name is made by appending @file{.forwprop} to the source file name.
6136 @item copyrename
6137 @opindex fdump-tree-copyrename
6138 Dump each function after applying the copy rename optimization.  The file
6139 name is made by appending @file{.copyrename} to the source file name.
6141 @item nrv
6142 @opindex fdump-tree-nrv
6143 Dump each function after applying the named return value optimization on
6144 generic trees.  The file name is made by appending @file{.nrv} to the source
6145 file name.
6147 @item vect
6148 @opindex fdump-tree-vect
6149 Dump each function after applying vectorization of loops.  The file name is
6150 made by appending @file{.vect} to the source file name.
6152 @item slp
6153 @opindex fdump-tree-slp
6154 Dump each function after applying vectorization of basic blocks.  The file name
6155 is made by appending @file{.slp} to the source file name.
6157 @item vrp
6158 @opindex fdump-tree-vrp
6159 Dump each function after Value Range Propagation (VRP).  The file name
6160 is made by appending @file{.vrp} to the source file name.
6162 @item all
6163 @opindex fdump-tree-all
6164 Enable all the available tree dumps with the flags provided in this option.
6165 @end table
6167 @item -fopt-info
6168 @itemx -fopt-info-@var{options}
6169 @itemx -fopt-info-@var{options}=@var{filename}
6170 @opindex fopt-info
6171 Controls optimization dumps from various optimization passes. If the
6172 @samp{-@var{options}} form is used, @var{options} is a list of
6173 @samp{-} separated options to select the dump details and
6174 optimizations.  If @var{options} is not specified, it defaults to
6175 @option{all} for details and @option{optall} for optimization
6176 groups. If the @var{filename} is not specified, it defaults to
6177 @file{stderr}. Note that the output @var{filename} will be overwritten
6178 in case of multiple translation units. If a combined output from
6179 multiple translation units is desired, @file{stderr} should be used
6180 instead.
6182 The options can be divided into two groups, 1) options describing the
6183 verbosity of the dump, and 2) options describing which optimizations
6184 should be included. The options from both the groups can be freely
6185 mixed as they are non-overlapping. However, in case of any conflicts,
6186 the latter options override the earlier options on the command
6187 line. Though multiple -fopt-info options are accepted, only one of
6188 them can have @option{=filename}. If other filenames are provided then
6189 all but the first one are ignored.
6191 The dump verbosity has the following options
6193 @table @samp
6194 @item optimized
6195 Print information when an optimization is successfully applied. It is
6196 up to a pass to decide which information is relevant. For example, the
6197 vectorizer passes print the source location of loops which got
6198 successfully vectorized.
6199 @item missed
6200 Print information about missed optimizations. Individual passes
6201 control which information to include in the output. For example,
6203 @smallexample
6204 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6205 @end smallexample
6207 will print information about missed optimization opportunities from
6208 vectorization passes on stderr.
6209 @item note
6210 Print verbose information about optimizations, such as certain
6211 transformations, more detailed messages about decisions etc.
6212 @item all
6213 Print detailed optimization information. This includes
6214 @var{optimized}, @var{missed}, and @var{note}.
6215 @end table
6217 The second set of options describes a group of optimizations and may
6218 include one or more of the following.
6220 @table @samp
6221 @item ipa
6222 Enable dumps from all interprocedural optimizations.
6223 @item loop
6224 Enable dumps from all loop optimizations.
6225 @item inline
6226 Enable dumps from all inlining optimizations.
6227 @item vec
6228 Enable dumps from all vectorization optimizations.
6229 @end table
6231 For example,
6232 @smallexample
6233 gcc -O3 -fopt-info-missed=missed.all
6234 @end smallexample
6236 outputs missed optimization report from all the passes into
6237 @file{missed.all}.
6239 As another example,
6240 @smallexample
6241 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6242 @end smallexample
6244 will output information about missed optimizations as well as
6245 optimized locations from all the inlining passes into
6246 @file{inline.txt}.
6248 If the @var{filename} is provided, then the dumps from all the
6249 applicable optimizations are concatenated into the @file{filename}.
6250 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6251 omitted, it defaults to @option{all-optall}, which means dump all
6252 available optimization info from all the passes. In the following
6253 example, all optimization info is output on to @file{stderr}.
6255 @smallexample
6256 gcc -O3 -fopt-info
6257 @end smallexample
6259 Note that @option{-fopt-info-vec-missed} behaves the same as
6260 @option{-fopt-info-missed-vec}.
6262 As another example, consider
6264 @smallexample
6265 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6266 @end smallexample
6268 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6269 in conflict since only one output file is allowed. In this case, only
6270 the first option takes effect and the subsequent options are
6271 ignored. Thus only the @file{vec.miss} is produced which cotaints
6272 dumps from the vectorizer about missed opportunities.
6274 @item -ftree-vectorizer-verbose=@var{n}
6275 @opindex ftree-vectorizer-verbose
6276 This option is deprecated and is implemented in terms of
6277 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6278 instead, where @var{kind} is one of the valid opt-info options. It
6279 prints additional optimization information.  For @var{n}=0 no
6280 diagnostic information is reported.  If @var{n}=1 the vectorizer
6281 reports each loop that got vectorized, and the total number of loops
6282 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6283 which could not be vectorized and the reasons for those. For any
6284 higher verbosity levels all the analysis and transformation
6285 information from the vectorizer is reported.
6287 Note that the information output by @option{-ftree-vectorizer-verbose}
6288 option is sent to @file{stderr}. If the equivalent form
6289 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6290 output is sent into @var{filename} instead.
6292 @item -frandom-seed=@var{string}
6293 @opindex frandom-seed
6294 This option provides a seed that GCC uses in place of
6295 random numbers in generating certain symbol names
6296 that have to be different in every compiled file.  It is also used to
6297 place unique stamps in coverage data files and the object files that
6298 produce them.  You can use the @option{-frandom-seed} option to produce
6299 reproducibly identical object files.
6301 The @var{string} should be different for every file you compile.
6303 @item -fsched-verbose=@var{n}
6304 @opindex fsched-verbose
6305 On targets that use instruction scheduling, this option controls the
6306 amount of debugging output the scheduler prints.  This information is
6307 written to standard error, unless @option{-fdump-rtl-sched1} or
6308 @option{-fdump-rtl-sched2} is specified, in which case it is output
6309 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6310 respectively.  However for @var{n} greater than nine, the output is
6311 always printed to standard error.
6313 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6314 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6315 For @var{n} greater than one, it also output basic block probabilities,
6316 detailed ready list information and unit/insn info.  For @var{n} greater
6317 than two, it includes RTL at abort point, control-flow and regions info.
6318 And for @var{n} over four, @option{-fsched-verbose} also includes
6319 dependence info.
6321 @item -save-temps
6322 @itemx -save-temps=cwd
6323 @opindex save-temps
6324 Store the usual ``temporary'' intermediate files permanently; place them
6325 in the current directory and name them based on the source file.  Thus,
6326 compiling @file{foo.c} with @option{-c -save-temps} produces files
6327 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6328 preprocessed @file{foo.i} output file even though the compiler now
6329 normally uses an integrated preprocessor.
6331 When used in combination with the @option{-x} command-line option,
6332 @option{-save-temps} is sensible enough to avoid over writing an
6333 input source file with the same extension as an intermediate file.
6334 The corresponding intermediate file may be obtained by renaming the
6335 source file before using @option{-save-temps}.
6337 If you invoke GCC in parallel, compiling several different source
6338 files that share a common base name in different subdirectories or the
6339 same source file compiled for multiple output destinations, it is
6340 likely that the different parallel compilers will interfere with each
6341 other, and overwrite the temporary files.  For instance:
6343 @smallexample
6344 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6345 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6346 @end smallexample
6348 may result in @file{foo.i} and @file{foo.o} being written to
6349 simultaneously by both compilers.
6351 @item -save-temps=obj
6352 @opindex save-temps=obj
6353 Store the usual ``temporary'' intermediate files permanently.  If the
6354 @option{-o} option is used, the temporary files are based on the
6355 object file.  If the @option{-o} option is not used, the
6356 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6358 For example:
6360 @smallexample
6361 gcc -save-temps=obj -c foo.c
6362 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6363 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6364 @end smallexample
6366 @noindent
6367 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6368 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6369 @file{dir2/yfoobar.o}.
6371 @item -time@r{[}=@var{file}@r{]}
6372 @opindex time
6373 Report the CPU time taken by each subprocess in the compilation
6374 sequence.  For C source files, this is the compiler proper and assembler
6375 (plus the linker if linking is done).
6377 Without the specification of an output file, the output looks like this:
6379 @smallexample
6380 # cc1 0.12 0.01
6381 # as 0.00 0.01
6382 @end smallexample
6384 The first number on each line is the ``user time'', that is time spent
6385 executing the program itself.  The second number is ``system time'',
6386 time spent executing operating system routines on behalf of the program.
6387 Both numbers are in seconds.
6389 With the specification of an output file, the output is appended to the
6390 named file, and it looks like this:
6392 @smallexample
6393 0.12 0.01 cc1 @var{options}
6394 0.00 0.01 as @var{options}
6395 @end smallexample
6397 The ``user time'' and the ``system time'' are moved before the program
6398 name, and the options passed to the program are displayed, so that one
6399 can later tell what file was being compiled, and with which options.
6401 @item -fvar-tracking
6402 @opindex fvar-tracking
6403 Run variable tracking pass.  It computes where variables are stored at each
6404 position in code.  Better debugging information is then generated
6405 (if the debugging information format supports this information).
6407 It is enabled by default when compiling with optimization (@option{-Os},
6408 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6409 the debug info format supports it.
6411 @item -fvar-tracking-assignments
6412 @opindex fvar-tracking-assignments
6413 @opindex fno-var-tracking-assignments
6414 Annotate assignments to user variables early in the compilation and
6415 attempt to carry the annotations over throughout the compilation all the
6416 way to the end, in an attempt to improve debug information while
6417 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6419 It can be enabled even if var-tracking is disabled, in which case
6420 annotations are created and maintained, but discarded at the end.
6422 @item -fvar-tracking-assignments-toggle
6423 @opindex fvar-tracking-assignments-toggle
6424 @opindex fno-var-tracking-assignments-toggle
6425 Toggle @option{-fvar-tracking-assignments}, in the same way that
6426 @option{-gtoggle} toggles @option{-g}.
6428 @item -print-file-name=@var{library}
6429 @opindex print-file-name
6430 Print the full absolute name of the library file @var{library} that
6431 would be used when linking---and don't do anything else.  With this
6432 option, GCC does not compile or link anything; it just prints the
6433 file name.
6435 @item -print-multi-directory
6436 @opindex print-multi-directory
6437 Print the directory name corresponding to the multilib selected by any
6438 other switches present in the command line.  This directory is supposed
6439 to exist in @env{GCC_EXEC_PREFIX}.
6441 @item -print-multi-lib
6442 @opindex print-multi-lib
6443 Print the mapping from multilib directory names to compiler switches
6444 that enable them.  The directory name is separated from the switches by
6445 @samp{;}, and each switch starts with an @samp{@@} instead of the
6446 @samp{-}, without spaces between multiple switches.  This is supposed to
6447 ease shell processing.
6449 @item -print-multi-os-directory
6450 @opindex print-multi-os-directory
6451 Print the path to OS libraries for the selected
6452 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6453 present in the @file{lib} subdirectory and no multilibs are used, this is
6454 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6455 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6456 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6457 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6459 @item -print-multiarch
6460 @opindex print-multiarch
6461 Print the path to OS libraries for the selected multiarch,
6462 relative to some @file{lib} subdirectory.
6464 @item -print-prog-name=@var{program}
6465 @opindex print-prog-name
6466 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6468 @item -print-libgcc-file-name
6469 @opindex print-libgcc-file-name
6470 Same as @option{-print-file-name=libgcc.a}.
6472 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6473 but you do want to link with @file{libgcc.a}.  You can do:
6475 @smallexample
6476 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6477 @end smallexample
6479 @item -print-search-dirs
6480 @opindex print-search-dirs
6481 Print the name of the configured installation directory and a list of
6482 program and library directories @command{gcc} searches---and don't do anything else.
6484 This is useful when @command{gcc} prints the error message
6485 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6486 To resolve this you either need to put @file{cpp0} and the other compiler
6487 components where @command{gcc} expects to find them, or you can set the environment
6488 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6489 Don't forget the trailing @samp{/}.
6490 @xref{Environment Variables}.
6492 @item -print-sysroot
6493 @opindex print-sysroot
6494 Print the target sysroot directory that is used during
6495 compilation.  This is the target sysroot specified either at configure
6496 time or using the @option{--sysroot} option, possibly with an extra
6497 suffix that depends on compilation options.  If no target sysroot is
6498 specified, the option prints nothing.
6500 @item -print-sysroot-headers-suffix
6501 @opindex print-sysroot-headers-suffix
6502 Print the suffix added to the target sysroot when searching for
6503 headers, or give an error if the compiler is not configured with such
6504 a suffix---and don't do anything else.
6506 @item -dumpmachine
6507 @opindex dumpmachine
6508 Print the compiler's target machine (for example,
6509 @samp{i686-pc-linux-gnu})---and don't do anything else.
6511 @item -dumpversion
6512 @opindex dumpversion
6513 Print the compiler version (for example, @samp{3.0})---and don't do
6514 anything else.
6516 @item -dumpspecs
6517 @opindex dumpspecs
6518 Print the compiler's built-in specs---and don't do anything else.  (This
6519 is used when GCC itself is being built.)  @xref{Spec Files}.
6521 @item -fno-eliminate-unused-debug-types
6522 @opindex feliminate-unused-debug-types
6523 @opindex fno-eliminate-unused-debug-types
6524 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6525 output for types that are nowhere used in the source file being compiled.
6526 Sometimes it is useful to have GCC emit debugging
6527 information for all types declared in a compilation
6528 unit, regardless of whether or not they are actually used
6529 in that compilation unit, for example 
6530 if, in the debugger, you want to cast a value to a type that is
6531 not actually used in your program (but is declared).  More often,
6532 however, this results in a significant amount of wasted space.
6533 @end table
6535 @node Optimize Options
6536 @section Options That Control Optimization
6537 @cindex optimize options
6538 @cindex options, optimization
6540 These options control various sorts of optimizations.
6542 Without any optimization option, the compiler's goal is to reduce the
6543 cost of compilation and to make debugging produce the expected
6544 results.  Statements are independent: if you stop the program with a
6545 breakpoint between statements, you can then assign a new value to any
6546 variable or change the program counter to any other statement in the
6547 function and get exactly the results you expect from the source
6548 code.
6550 Turning on optimization flags makes the compiler attempt to improve
6551 the performance and/or code size at the expense of compilation time
6552 and possibly the ability to debug the program.
6554 The compiler performs optimization based on the knowledge it has of the
6555 program.  Compiling multiple files at once to a single output file mode allows
6556 the compiler to use information gained from all of the files when compiling
6557 each of them.
6559 Not all optimizations are controlled directly by a flag.  Only
6560 optimizations that have a flag are listed in this section.
6562 Most optimizations are only enabled if an @option{-O} level is set on
6563 the command line.  Otherwise they are disabled, even if individual
6564 optimization flags are specified.
6566 Depending on the target and how GCC was configured, a slightly different
6567 set of optimizations may be enabled at each @option{-O} level than
6568 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6569 to find out the exact set of optimizations that are enabled at each level.
6570 @xref{Overall Options}, for examples.
6572 @table @gcctabopt
6573 @item -O
6574 @itemx -O1
6575 @opindex O
6576 @opindex O1
6577 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6578 more memory for a large function.
6580 With @option{-O}, the compiler tries to reduce code size and execution
6581 time, without performing any optimizations that take a great deal of
6582 compilation time.
6584 @option{-O} turns on the following optimization flags:
6585 @gccoptlist{
6586 -fauto-inc-dec @gol
6587 -fcompare-elim @gol
6588 -fcprop-registers @gol
6589 -fdce @gol
6590 -fdefer-pop @gol
6591 -fdelayed-branch @gol
6592 -fdse @gol
6593 -fguess-branch-probability @gol
6594 -fif-conversion2 @gol
6595 -fif-conversion @gol
6596 -fipa-pure-const @gol
6597 -fipa-profile @gol
6598 -fipa-reference @gol
6599 -fmerge-constants
6600 -fsplit-wide-types @gol
6601 -ftree-bit-ccp @gol
6602 -ftree-builtin-call-dce @gol
6603 -ftree-ccp @gol
6604 -ftree-ch @gol
6605 -ftree-copyrename @gol
6606 -ftree-dce @gol
6607 -ftree-dominator-opts @gol
6608 -ftree-dse @gol
6609 -ftree-forwprop @gol
6610 -ftree-fre @gol
6611 -ftree-phiprop @gol
6612 -ftree-slsr @gol
6613 -ftree-sra @gol
6614 -ftree-pta @gol
6615 -ftree-ter @gol
6616 -funit-at-a-time}
6618 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6619 where doing so does not interfere with debugging.
6621 @item -O2
6622 @opindex O2
6623 Optimize even more.  GCC performs nearly all supported optimizations
6624 that do not involve a space-speed tradeoff.
6625 As compared to @option{-O}, this option increases both compilation time
6626 and the performance of the generated code.
6628 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6629 also turns on the following optimization flags:
6630 @gccoptlist{-fthread-jumps @gol
6631 -falign-functions  -falign-jumps @gol
6632 -falign-loops  -falign-labels @gol
6633 -fcaller-saves @gol
6634 -fcrossjumping @gol
6635 -fcse-follow-jumps  -fcse-skip-blocks @gol
6636 -fdelete-null-pointer-checks @gol
6637 -fdevirtualize @gol
6638 -fexpensive-optimizations @gol
6639 -fgcse  -fgcse-lm  @gol
6640 -fhoist-adjacent-loads @gol
6641 -finline-small-functions @gol
6642 -findirect-inlining @gol
6643 -fipa-sra @gol
6644 -foptimize-sibling-calls @gol
6645 -fpartial-inlining @gol
6646 -fpeephole2 @gol
6647 -fregmove @gol
6648 -freorder-blocks  -freorder-functions @gol
6649 -frerun-cse-after-loop  @gol
6650 -fsched-interblock  -fsched-spec @gol
6651 -fschedule-insns  -fschedule-insns2 @gol
6652 -fstrict-aliasing -fstrict-overflow @gol
6653 -ftree-switch-conversion -ftree-tail-merge @gol
6654 -ftree-pre @gol
6655 -ftree-vrp}
6657 Please note the warning under @option{-fgcse} about
6658 invoking @option{-O2} on programs that use computed gotos.
6660 @item -O3
6661 @opindex O3
6662 Optimize yet more.  @option{-O3} turns on all optimizations specified
6663 by @option{-O2} and also turns on the @option{-finline-functions},
6664 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6665 @option{-fgcse-after-reload}, @option{-ftree-vectorize},
6666 @option{-fvect-cost-model},
6667 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6669 @item -O0
6670 @opindex O0
6671 Reduce compilation time and make debugging produce the expected
6672 results.  This is the default.
6674 @item -Os
6675 @opindex Os
6676 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6677 do not typically increase code size.  It also performs further
6678 optimizations designed to reduce code size.
6680 @option{-Os} disables the following optimization flags:
6681 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6682 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6683 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6685 @item -Ofast
6686 @opindex Ofast
6687 Disregard strict standards compliance.  @option{-Ofast} enables all
6688 @option{-O3} optimizations.  It also enables optimizations that are not
6689 valid for all standard-compliant programs.
6690 It turns on @option{-ffast-math} and the Fortran-specific
6691 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6693 @item -Og
6694 @opindex Og
6695 Optimize debugging experience.  @option{-Og} enables optimizations
6696 that do not interfere with debugging. It should be the optimization
6697 level of choice for the standard edit-compile-debug cycle, offering
6698 a reasonable level of optimization while maintaining fast compilation
6699 and a good debugging experience.
6701 If you use multiple @option{-O} options, with or without level numbers,
6702 the last such option is the one that is effective.
6703 @end table
6705 Options of the form @option{-f@var{flag}} specify machine-independent
6706 flags.  Most flags have both positive and negative forms; the negative
6707 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6708 below, only one of the forms is listed---the one you typically 
6709 use.  You can figure out the other form by either removing @samp{no-}
6710 or adding it.
6712 The following options control specific optimizations.  They are either
6713 activated by @option{-O} options or are related to ones that are.  You
6714 can use the following flags in the rare cases when ``fine-tuning'' of
6715 optimizations to be performed is desired.
6717 @table @gcctabopt
6718 @item -fno-default-inline
6719 @opindex fno-default-inline
6720 Do not make member functions inline by default merely because they are
6721 defined inside the class scope (C++ only).  Otherwise, when you specify
6722 @w{@option{-O}}, member functions defined inside class scope are compiled
6723 inline by default; i.e., you don't need to add @samp{inline} in front of
6724 the member function name.
6726 @item -fno-defer-pop
6727 @opindex fno-defer-pop
6728 Always pop the arguments to each function call as soon as that function
6729 returns.  For machines that must pop arguments after a function call,
6730 the compiler normally lets arguments accumulate on the stack for several
6731 function calls and pops them all at once.
6733 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6735 @item -fforward-propagate
6736 @opindex fforward-propagate
6737 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6738 instructions and checks if the result can be simplified.  If loop unrolling
6739 is active, two passes are performed and the second is scheduled after
6740 loop unrolling.
6742 This option is enabled by default at optimization levels @option{-O},
6743 @option{-O2}, @option{-O3}, @option{-Os}.
6745 @item -ffp-contract=@var{style}
6746 @opindex ffp-contract
6747 @option{-ffp-contract=off} disables floating-point expression contraction.
6748 @option{-ffp-contract=fast} enables floating-point expression contraction
6749 such as forming of fused multiply-add operations if the target has
6750 native support for them.
6751 @option{-ffp-contract=on} enables floating-point expression contraction
6752 if allowed by the language standard.  This is currently not implemented
6753 and treated equal to @option{-ffp-contract=off}.
6755 The default is @option{-ffp-contract=fast}.
6757 @item -fomit-frame-pointer
6758 @opindex fomit-frame-pointer
6759 Don't keep the frame pointer in a register for functions that
6760 don't need one.  This avoids the instructions to save, set up and
6761 restore frame pointers; it also makes an extra register available
6762 in many functions.  @strong{It also makes debugging impossible on
6763 some machines.}
6765 On some machines, such as the VAX, this flag has no effect, because
6766 the standard calling sequence automatically handles the frame pointer
6767 and nothing is saved by pretending it doesn't exist.  The
6768 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6769 whether a target machine supports this flag.  @xref{Registers,,Register
6770 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6772 Starting with GCC version 4.6, the default setting (when not optimizing for
6773 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6774 @option{-fomit-frame-pointer}.  The default can be reverted to
6775 @option{-fno-omit-frame-pointer} by configuring GCC with the
6776 @option{--enable-frame-pointer} configure option.
6778 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6780 @item -foptimize-sibling-calls
6781 @opindex foptimize-sibling-calls
6782 Optimize sibling and tail recursive calls.
6784 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6786 @item -fno-inline
6787 @opindex fno-inline
6788 Do not expand any functions inline apart from those marked with
6789 the @code{always_inline} attribute.  This is the default when not
6790 optimizing.
6792 Single functions can be exempted from inlining by marking them
6793 with the @code{noinline} attribute.
6795 @item -finline-small-functions
6796 @opindex finline-small-functions
6797 Integrate functions into their callers when their body is smaller than expected
6798 function call code (so overall size of program gets smaller).  The compiler
6799 heuristically decides which functions are simple enough to be worth integrating
6800 in this way.  This inlining applies to all functions, even those not declared
6801 inline.
6803 Enabled at level @option{-O2}.
6805 @item -findirect-inlining
6806 @opindex findirect-inlining
6807 Inline also indirect calls that are discovered to be known at compile
6808 time thanks to previous inlining.  This option has any effect only
6809 when inlining itself is turned on by the @option{-finline-functions}
6810 or @option{-finline-small-functions} options.
6812 Enabled at level @option{-O2}.
6814 @item -finline-functions
6815 @opindex finline-functions
6816 Consider all functions for inlining, even if they are not declared inline.
6817 The compiler heuristically decides which functions are worth integrating
6818 in this way.
6820 If all calls to a given function are integrated, and the function is
6821 declared @code{static}, then the function is normally not output as
6822 assembler code in its own right.
6824 Enabled at level @option{-O3}.
6826 @item -finline-functions-called-once
6827 @opindex finline-functions-called-once
6828 Consider all @code{static} functions called once for inlining into their
6829 caller even if they are not marked @code{inline}.  If a call to a given
6830 function is integrated, then the function is not output as assembler code
6831 in its own right.
6833 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6835 @item -fearly-inlining
6836 @opindex fearly-inlining
6837 Inline functions marked by @code{always_inline} and functions whose body seems
6838 smaller than the function call overhead early before doing
6839 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6840 makes profiling significantly cheaper and usually inlining faster on programs
6841 having large chains of nested wrapper functions.
6843 Enabled by default.
6845 @item -fipa-sra
6846 @opindex fipa-sra
6847 Perform interprocedural scalar replacement of aggregates, removal of
6848 unused parameters and replacement of parameters passed by reference
6849 by parameters passed by value.
6851 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6853 @item -finline-limit=@var{n}
6854 @opindex finline-limit
6855 By default, GCC limits the size of functions that can be inlined.  This flag
6856 allows coarse control of this limit.  @var{n} is the size of functions that
6857 can be inlined in number of pseudo instructions.
6859 Inlining is actually controlled by a number of parameters, which may be
6860 specified individually by using @option{--param @var{name}=@var{value}}.
6861 The @option{-finline-limit=@var{n}} option sets some of these parameters
6862 as follows:
6864 @table @gcctabopt
6865 @item max-inline-insns-single
6866 is set to @var{n}/2.
6867 @item max-inline-insns-auto
6868 is set to @var{n}/2.
6869 @end table
6871 See below for a documentation of the individual
6872 parameters controlling inlining and for the defaults of these parameters.
6874 @emph{Note:} there may be no value to @option{-finline-limit} that results
6875 in default behavior.
6877 @emph{Note:} pseudo instruction represents, in this particular context, an
6878 abstract measurement of function's size.  In no way does it represent a count
6879 of assembly instructions and as such its exact meaning might change from one
6880 release to an another.
6882 @item -fno-keep-inline-dllexport
6883 @opindex -fno-keep-inline-dllexport
6884 This is a more fine-grained version of @option{-fkeep-inline-functions},
6885 which applies only to functions that are declared using the @code{dllexport}
6886 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6887 Functions}.)
6889 @item -fkeep-inline-functions
6890 @opindex fkeep-inline-functions
6891 In C, emit @code{static} functions that are declared @code{inline}
6892 into the object file, even if the function has been inlined into all
6893 of its callers.  This switch does not affect functions using the
6894 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6895 inline functions into the object file.
6897 @item -fkeep-static-consts
6898 @opindex fkeep-static-consts
6899 Emit variables declared @code{static const} when optimization isn't turned
6900 on, even if the variables aren't referenced.
6902 GCC enables this option by default.  If you want to force the compiler to
6903 check if a variable is referenced, regardless of whether or not
6904 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6906 @item -fmerge-constants
6907 @opindex fmerge-constants
6908 Attempt to merge identical constants (string constants and floating-point
6909 constants) across compilation units.
6911 This option is the default for optimized compilation if the assembler and
6912 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6913 behavior.
6915 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6917 @item -fmerge-all-constants
6918 @opindex fmerge-all-constants
6919 Attempt to merge identical constants and identical variables.
6921 This option implies @option{-fmerge-constants}.  In addition to
6922 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6923 arrays or initialized constant variables with integral or floating-point
6924 types.  Languages like C or C++ require each variable, including multiple
6925 instances of the same variable in recursive calls, to have distinct locations,
6926 so using this option results in non-conforming
6927 behavior.
6929 @item -fmodulo-sched
6930 @opindex fmodulo-sched
6931 Perform swing modulo scheduling immediately before the first scheduling
6932 pass.  This pass looks at innermost loops and reorders their
6933 instructions by overlapping different iterations.
6935 @item -fmodulo-sched-allow-regmoves
6936 @opindex fmodulo-sched-allow-regmoves
6937 Perform more aggressive SMS-based modulo scheduling with register moves
6938 allowed.  By setting this flag certain anti-dependences edges are
6939 deleted, which triggers the generation of reg-moves based on the
6940 life-range analysis.  This option is effective only with
6941 @option{-fmodulo-sched} enabled.
6943 @item -fno-branch-count-reg
6944 @opindex fno-branch-count-reg
6945 Do not use ``decrement and branch'' instructions on a count register,
6946 but instead generate a sequence of instructions that decrement a
6947 register, compare it against zero, then branch based upon the result.
6948 This option is only meaningful on architectures that support such
6949 instructions, which include x86, PowerPC, IA-64 and S/390.
6951 The default is @option{-fbranch-count-reg}.
6953 @item -fno-function-cse
6954 @opindex fno-function-cse
6955 Do not put function addresses in registers; make each instruction that
6956 calls a constant function contain the function's address explicitly.
6958 This option results in less efficient code, but some strange hacks
6959 that alter the assembler output may be confused by the optimizations
6960 performed when this option is not used.
6962 The default is @option{-ffunction-cse}
6964 @item -fno-zero-initialized-in-bss
6965 @opindex fno-zero-initialized-in-bss
6966 If the target supports a BSS section, GCC by default puts variables that
6967 are initialized to zero into BSS@.  This can save space in the resulting
6968 code.
6970 This option turns off this behavior because some programs explicitly
6971 rely on variables going to the data section---e.g., so that the
6972 resulting executable can find the beginning of that section and/or make
6973 assumptions based on that.
6975 The default is @option{-fzero-initialized-in-bss}.
6977 @item -fmudflap -fmudflapth -fmudflapir
6978 @opindex fmudflap
6979 @opindex fmudflapth
6980 @opindex fmudflapir
6981 @cindex bounds checking
6982 @cindex mudflap
6983 For front-ends that support it (C and C++), instrument all risky
6984 pointer/array dereferencing operations, some standard library
6985 string/heap functions, and some other associated constructs with
6986 range/validity tests.  Modules so instrumented should be immune to
6987 buffer overflows, invalid heap use, and some other classes of C/C++
6988 programming errors.  The instrumentation relies on a separate runtime
6989 library (@file{libmudflap}), which is linked into a program if
6990 @option{-fmudflap} is given at link time.  Run-time behavior of the
6991 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6992 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6993 for its options.
6995 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6996 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6997 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6998 instrumentation should ignore pointer reads.  This produces less
6999 instrumentation (and therefore faster execution) and still provides
7000 some protection against outright memory corrupting writes, but allows
7001 erroneously read data to propagate within a program.
7003 @item -fthread-jumps
7004 @opindex fthread-jumps
7005 Perform optimizations that check to see if a jump branches to a
7006 location where another comparison subsumed by the first is found.  If
7007 so, the first branch is redirected to either the destination of the
7008 second branch or a point immediately following it, depending on whether
7009 the condition is known to be true or false.
7011 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7013 @item -fsplit-wide-types
7014 @opindex fsplit-wide-types
7015 When using a type that occupies multiple registers, such as @code{long
7016 long} on a 32-bit system, split the registers apart and allocate them
7017 independently.  This normally generates better code for those types,
7018 but may make debugging more difficult.
7020 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7021 @option{-Os}.
7023 @item -fcse-follow-jumps
7024 @opindex fcse-follow-jumps
7025 In common subexpression elimination (CSE), scan through jump instructions
7026 when the target of the jump is not reached by any other path.  For
7027 example, when CSE encounters an @code{if} statement with an
7028 @code{else} clause, CSE follows the jump when the condition
7029 tested is false.
7031 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7033 @item -fcse-skip-blocks
7034 @opindex fcse-skip-blocks
7035 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7036 follow jumps that conditionally skip over blocks.  When CSE
7037 encounters a simple @code{if} statement with no else clause,
7038 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7039 body of the @code{if}.
7041 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7043 @item -frerun-cse-after-loop
7044 @opindex frerun-cse-after-loop
7045 Re-run common subexpression elimination after loop optimizations are
7046 performed.
7048 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7050 @item -fgcse
7051 @opindex fgcse
7052 Perform a global common subexpression elimination pass.
7053 This pass also performs global constant and copy propagation.
7055 @emph{Note:} When compiling a program using computed gotos, a GCC
7056 extension, you may get better run-time performance if you disable
7057 the global common subexpression elimination pass by adding
7058 @option{-fno-gcse} to the command line.
7060 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7062 @item -fgcse-lm
7063 @opindex fgcse-lm
7064 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7065 attempts to move loads that are only killed by stores into themselves.  This
7066 allows a loop containing a load/store sequence to be changed to a load outside
7067 the loop, and a copy/store within the loop.
7069 Enabled by default when @option{-fgcse} is enabled.
7071 @item -fgcse-sm
7072 @opindex fgcse-sm
7073 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7074 global common subexpression elimination.  This pass attempts to move
7075 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7076 loops containing a load/store sequence can be changed to a load before
7077 the loop and a store after the loop.
7079 Not enabled at any optimization level.
7081 @item -fgcse-las
7082 @opindex fgcse-las
7083 When @option{-fgcse-las} is enabled, the global common subexpression
7084 elimination pass eliminates redundant loads that come after stores to the
7085 same memory location (both partial and full redundancies).
7087 Not enabled at any optimization level.
7089 @item -fgcse-after-reload
7090 @opindex fgcse-after-reload
7091 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7092 pass is performed after reload.  The purpose of this pass is to clean up
7093 redundant spilling.
7095 @item -faggressive-loop-optimizations
7096 @opindex faggressive-loop-optimizations
7097 This option tells the loop optimizer to use language constraints to
7098 derive bounds for the number of iterations of a loop.  This assumes that
7099 loop code does not invoke undefined behavior by for example causing signed
7100 integer overflows or out-of-bound array accesses.  The bounds for the
7101 number of iterations of a loop are used to guide loop unrolling and peeling
7102 and loop exit test optimizations.
7103 This option is enabled by default.
7105 @item -funsafe-loop-optimizations
7106 @opindex funsafe-loop-optimizations
7107 This option tells the loop optimizer to assume that loop indices do not
7108 overflow, and that loops with nontrivial exit condition are not
7109 infinite.  This enables a wider range of loop optimizations even if
7110 the loop optimizer itself cannot prove that these assumptions are valid.
7111 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7112 if it finds this kind of loop.
7114 @item -fcrossjumping
7115 @opindex fcrossjumping
7116 Perform cross-jumping transformation.
7117 This transformation unifies equivalent code and saves code size.  The
7118 resulting code may or may not perform better than without cross-jumping.
7120 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7122 @item -fauto-inc-dec
7123 @opindex fauto-inc-dec
7124 Combine increments or decrements of addresses with memory accesses.
7125 This pass is always skipped on architectures that do not have
7126 instructions to support this.  Enabled by default at @option{-O} and
7127 higher on architectures that support this.
7129 @item -fdce
7130 @opindex fdce
7131 Perform dead code elimination (DCE) on RTL@.
7132 Enabled by default at @option{-O} and higher.
7134 @item -fdse
7135 @opindex fdse
7136 Perform dead store elimination (DSE) on RTL@.
7137 Enabled by default at @option{-O} and higher.
7139 @item -fif-conversion
7140 @opindex fif-conversion
7141 Attempt to transform conditional jumps into branch-less equivalents.  This
7142 includes use of conditional moves, min, max, set flags and abs instructions, and
7143 some tricks doable by standard arithmetics.  The use of conditional execution
7144 on chips where it is available is controlled by @code{if-conversion2}.
7146 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7148 @item -fif-conversion2
7149 @opindex fif-conversion2
7150 Use conditional execution (where available) to transform conditional jumps into
7151 branch-less equivalents.
7153 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7155 @item -fdelete-null-pointer-checks
7156 @opindex fdelete-null-pointer-checks
7157 Assume that programs cannot safely dereference null pointers, and that
7158 no code or data element resides there.  This enables simple constant
7159 folding optimizations at all optimization levels.  In addition, other
7160 optimization passes in GCC use this flag to control global dataflow
7161 analyses that eliminate useless checks for null pointers; these assume
7162 that if a pointer is checked after it has already been dereferenced,
7163 it cannot be null.
7165 Note however that in some environments this assumption is not true.
7166 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7167 for programs that depend on that behavior.
7169 Some targets, especially embedded ones, disable this option at all levels.
7170 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7171 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7172 are enabled independently at different optimization levels.
7174 @item -fdevirtualize
7175 @opindex fdevirtualize
7176 Attempt to convert calls to virtual functions to direct calls.  This
7177 is done both within a procedure and interprocedurally as part of
7178 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7179 propagation (@option{-fipa-cp}).
7180 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7182 @item -fexpensive-optimizations
7183 @opindex fexpensive-optimizations
7184 Perform a number of minor optimizations that are relatively expensive.
7186 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7188 @item -free
7189 @opindex free
7190 Attempt to remove redundant extension instructions.  This is especially
7191 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7192 registers after writing to their lower 32-bit half.
7194 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7196 @item -foptimize-register-move
7197 @itemx -fregmove
7198 @opindex foptimize-register-move
7199 @opindex fregmove
7200 Attempt to reassign register numbers in move instructions and as
7201 operands of other simple instructions in order to maximize the amount of
7202 register tying.  This is especially helpful on machines with two-operand
7203 instructions.
7205 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7206 optimization.
7208 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7210 @item -fira-algorithm=@var{algorithm}
7211 Use the specified coloring algorithm for the integrated register
7212 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7213 specifies Chow's priority coloring, or @samp{CB}, which specifies
7214 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7215 for all architectures, but for those targets that do support it, it is
7216 the default because it generates better code.
7218 @item -fira-region=@var{region}
7219 Use specified regions for the integrated register allocator.  The
7220 @var{region} argument should be one of the following:
7222 @table @samp
7224 @item all
7225 Use all loops as register allocation regions.
7226 This can give the best results for machines with a small and/or
7227 irregular register set.
7229 @item mixed
7230 Use all loops except for loops with small register pressure 
7231 as the regions.  This value usually gives
7232 the best results in most cases and for most architectures,
7233 and is enabled by default when compiling with optimization for speed
7234 (@option{-O}, @option{-O2}, @dots{}).
7236 @item one
7237 Use all functions as a single region.  
7238 This typically results in the smallest code size, and is enabled by default for
7239 @option{-Os} or @option{-O0}.
7241 @end table
7243 @item -fira-hoist-pressure
7244 @opindex fira-hoist-pressure
7245 Use IRA to evaluate register pressure in the code hoisting pass for
7246 decisions to hoist expressions.  This option usually results in smaller
7247 code, but it can slow the compiler down.
7249 This option is enabled at level @option{-Os} for all targets.
7251 @item -fira-loop-pressure
7252 @opindex fira-loop-pressure
7253 Use IRA to evaluate register pressure in loops for decisions to move
7254 loop invariants.  This option usually results in generation
7255 of faster and smaller code on machines with large register files (>= 32
7256 registers), but it can slow the compiler down.
7258 This option is enabled at level @option{-O3} for some targets.
7260 @item -fno-ira-share-save-slots
7261 @opindex fno-ira-share-save-slots
7262 Disable sharing of stack slots used for saving call-used hard
7263 registers living through a call.  Each hard register gets a
7264 separate stack slot, and as a result function stack frames are
7265 larger.
7267 @item -fno-ira-share-spill-slots
7268 @opindex fno-ira-share-spill-slots
7269 Disable sharing of stack slots allocated for pseudo-registers.  Each
7270 pseudo-register that does not get a hard register gets a separate
7271 stack slot, and as a result function stack frames are larger.
7273 @item -fira-verbose=@var{n}
7274 @opindex fira-verbose
7275 Control the verbosity of the dump file for the integrated register allocator.
7276 The default value is 5.  If the value @var{n} is greater or equal to 10,
7277 the dump output is sent to stderr using the same format as @var{n} minus 10.
7279 @item -fdelayed-branch
7280 @opindex fdelayed-branch
7281 If supported for the target machine, attempt to reorder instructions
7282 to exploit instruction slots available after delayed branch
7283 instructions.
7285 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7287 @item -fschedule-insns
7288 @opindex fschedule-insns
7289 If supported for the target machine, attempt to reorder instructions to
7290 eliminate execution stalls due to required data being unavailable.  This
7291 helps machines that have slow floating point or memory load instructions
7292 by allowing other instructions to be issued until the result of the load
7293 or floating-point instruction is required.
7295 Enabled at levels @option{-O2}, @option{-O3}.
7297 @item -fschedule-insns2
7298 @opindex fschedule-insns2
7299 Similar to @option{-fschedule-insns}, but requests an additional pass of
7300 instruction scheduling after register allocation has been done.  This is
7301 especially useful on machines with a relatively small number of
7302 registers and where memory load instructions take more than one cycle.
7304 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7306 @item -fno-sched-interblock
7307 @opindex fno-sched-interblock
7308 Don't schedule instructions across basic blocks.  This is normally
7309 enabled by default when scheduling before register allocation, i.e.@:
7310 with @option{-fschedule-insns} or at @option{-O2} or higher.
7312 @item -fno-sched-spec
7313 @opindex fno-sched-spec
7314 Don't allow speculative motion of non-load instructions.  This is normally
7315 enabled by default when scheduling before register allocation, i.e.@:
7316 with @option{-fschedule-insns} or at @option{-O2} or higher.
7318 @item -fsched-pressure
7319 @opindex fsched-pressure
7320 Enable register pressure sensitive insn scheduling before register
7321 allocation.  This only makes sense when scheduling before register
7322 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7323 @option{-O2} or higher.  Usage of this option can improve the
7324 generated code and decrease its size by preventing register pressure
7325 increase above the number of available hard registers and subsequent
7326 spills in register allocation.
7328 @item -fsched-spec-load
7329 @opindex fsched-spec-load
7330 Allow speculative motion of some load instructions.  This only makes
7331 sense when scheduling before register allocation, i.e.@: with
7332 @option{-fschedule-insns} or at @option{-O2} or higher.
7334 @item -fsched-spec-load-dangerous
7335 @opindex fsched-spec-load-dangerous
7336 Allow speculative motion of more load instructions.  This only makes
7337 sense when scheduling before register allocation, i.e.@: with
7338 @option{-fschedule-insns} or at @option{-O2} or higher.
7340 @item -fsched-stalled-insns
7341 @itemx -fsched-stalled-insns=@var{n}
7342 @opindex fsched-stalled-insns
7343 Define how many insns (if any) can be moved prematurely from the queue
7344 of stalled insns into the ready list during the second scheduling pass.
7345 @option{-fno-sched-stalled-insns} means that no insns are moved
7346 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7347 on how many queued insns can be moved prematurely.
7348 @option{-fsched-stalled-insns} without a value is equivalent to
7349 @option{-fsched-stalled-insns=1}.
7351 @item -fsched-stalled-insns-dep
7352 @itemx -fsched-stalled-insns-dep=@var{n}
7353 @opindex fsched-stalled-insns-dep
7354 Define how many insn groups (cycles) are examined for a dependency
7355 on a stalled insn that is a candidate for premature removal from the queue
7356 of stalled insns.  This has an effect only during the second scheduling pass,
7357 and only if @option{-fsched-stalled-insns} is used.
7358 @option{-fno-sched-stalled-insns-dep} is equivalent to
7359 @option{-fsched-stalled-insns-dep=0}.
7360 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7361 @option{-fsched-stalled-insns-dep=1}.
7363 @item -fsched2-use-superblocks
7364 @opindex fsched2-use-superblocks
7365 When scheduling after register allocation, use superblock scheduling.
7366 This allows motion across basic block boundaries,
7367 resulting in faster schedules.  This option is experimental, as not all machine
7368 descriptions used by GCC model the CPU closely enough to avoid unreliable
7369 results from the algorithm.
7371 This only makes sense when scheduling after register allocation, i.e.@: with
7372 @option{-fschedule-insns2} or at @option{-O2} or higher.
7374 @item -fsched-group-heuristic
7375 @opindex fsched-group-heuristic
7376 Enable the group heuristic in the scheduler.  This heuristic favors
7377 the instruction that belongs to a schedule group.  This is enabled
7378 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7379 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7381 @item -fsched-critical-path-heuristic
7382 @opindex fsched-critical-path-heuristic
7383 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7384 instructions on the critical path.  This is enabled by default when
7385 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7386 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7388 @item -fsched-spec-insn-heuristic
7389 @opindex fsched-spec-insn-heuristic
7390 Enable the speculative instruction heuristic in the scheduler.  This
7391 heuristic favors speculative instructions with greater dependency weakness.
7392 This is enabled by default when scheduling is enabled, i.e.@:
7393 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7394 or at @option{-O2} or higher.
7396 @item -fsched-rank-heuristic
7397 @opindex fsched-rank-heuristic
7398 Enable the rank heuristic in the scheduler.  This heuristic favors
7399 the instruction belonging to a basic block with greater size or frequency.
7400 This is enabled by default when scheduling is enabled, i.e.@:
7401 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7402 at @option{-O2} or higher.
7404 @item -fsched-last-insn-heuristic
7405 @opindex fsched-last-insn-heuristic
7406 Enable the last-instruction heuristic in the scheduler.  This heuristic
7407 favors the instruction that is less dependent on the last instruction
7408 scheduled.  This is enabled by default when scheduling is enabled,
7409 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7410 at @option{-O2} or higher.
7412 @item -fsched-dep-count-heuristic
7413 @opindex fsched-dep-count-heuristic
7414 Enable the dependent-count heuristic in the scheduler.  This heuristic
7415 favors the instruction that has more instructions depending on it.
7416 This is enabled by default when scheduling is enabled, i.e.@:
7417 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7418 at @option{-O2} or higher.
7420 @item -freschedule-modulo-scheduled-loops
7421 @opindex freschedule-modulo-scheduled-loops
7422 Modulo scheduling is performed before traditional scheduling.  If a loop
7423 is modulo scheduled, later scheduling passes may change its schedule.  
7424 Use this option to control that behavior.
7426 @item -fselective-scheduling
7427 @opindex fselective-scheduling
7428 Schedule instructions using selective scheduling algorithm.  Selective
7429 scheduling runs instead of the first scheduler pass.
7431 @item -fselective-scheduling2
7432 @opindex fselective-scheduling2
7433 Schedule instructions using selective scheduling algorithm.  Selective
7434 scheduling runs instead of the second scheduler pass.
7436 @item -fsel-sched-pipelining
7437 @opindex fsel-sched-pipelining
7438 Enable software pipelining of innermost loops during selective scheduling.
7439 This option has no effect unless one of @option{-fselective-scheduling} or
7440 @option{-fselective-scheduling2} is turned on.
7442 @item -fsel-sched-pipelining-outer-loops
7443 @opindex fsel-sched-pipelining-outer-loops
7444 When pipelining loops during selective scheduling, also pipeline outer loops.
7445 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7447 @item -fshrink-wrap
7448 @opindex fshrink-wrap
7449 Emit function prologues only before parts of the function that need it,
7450 rather than at the top of the function.  This flag is enabled by default at
7451 @option{-O} and higher.
7453 @item -fcaller-saves
7454 @opindex fcaller-saves
7455 Enable allocation of values to registers that are clobbered by
7456 function calls, by emitting extra instructions to save and restore the
7457 registers around such calls.  Such allocation is done only when it
7458 seems to result in better code.
7460 This option is always enabled by default on certain machines, usually
7461 those which have no call-preserved registers to use instead.
7463 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7465 @item -fcombine-stack-adjustments
7466 @opindex fcombine-stack-adjustments
7467 Tracks stack adjustments (pushes and pops) and stack memory references
7468 and then tries to find ways to combine them.
7470 Enabled by default at @option{-O1} and higher.
7472 @item -fconserve-stack
7473 @opindex fconserve-stack
7474 Attempt to minimize stack usage.  The compiler attempts to use less
7475 stack space, even if that makes the program slower.  This option
7476 implies setting the @option{large-stack-frame} parameter to 100
7477 and the @option{large-stack-frame-growth} parameter to 400.
7479 @item -ftree-reassoc
7480 @opindex ftree-reassoc
7481 Perform reassociation on trees.  This flag is enabled by default
7482 at @option{-O} and higher.
7484 @item -ftree-pre
7485 @opindex ftree-pre
7486 Perform partial redundancy elimination (PRE) on trees.  This flag is
7487 enabled by default at @option{-O2} and @option{-O3}.
7489 @item -ftree-partial-pre
7490 @opindex ftree-partial-pre
7491 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7492 enabled by default at @option{-O3}.
7494 @item -ftree-forwprop
7495 @opindex ftree-forwprop
7496 Perform forward propagation on trees.  This flag is enabled by default
7497 at @option{-O} and higher.
7499 @item -ftree-fre
7500 @opindex ftree-fre
7501 Perform full redundancy elimination (FRE) on trees.  The difference
7502 between FRE and PRE is that FRE only considers expressions
7503 that are computed on all paths leading to the redundant computation.
7504 This analysis is faster than PRE, though it exposes fewer redundancies.
7505 This flag is enabled by default at @option{-O} and higher.
7507 @item -ftree-phiprop
7508 @opindex ftree-phiprop
7509 Perform hoisting of loads from conditional pointers on trees.  This
7510 pass is enabled by default at @option{-O} and higher.
7512 @item -fhoist-adjacent-loads
7513 @opindex hoist-adjacent-loads
7514 Speculatively hoist loads from both branches of an if-then-else if the
7515 loads are from adjacent locations in the same structure and the target
7516 architecture has a conditional move instruction.  This flag is enabled
7517 by default at @option{-O2} and higher.
7519 @item -ftree-copy-prop
7520 @opindex ftree-copy-prop
7521 Perform copy propagation on trees.  This pass eliminates unnecessary
7522 copy operations.  This flag is enabled by default at @option{-O} and
7523 higher.
7525 @item -fipa-pure-const
7526 @opindex fipa-pure-const
7527 Discover which functions are pure or constant.
7528 Enabled by default at @option{-O} and higher.
7530 @item -fipa-reference
7531 @opindex fipa-reference
7532 Discover which static variables do not escape the
7533 compilation unit.
7534 Enabled by default at @option{-O} and higher.
7536 @item -fipa-pta
7537 @opindex fipa-pta
7538 Perform interprocedural pointer analysis and interprocedural modification
7539 and reference analysis.  This option can cause excessive memory and
7540 compile-time usage on large compilation units.  It is not enabled by
7541 default at any optimization level.
7543 @item -fipa-profile
7544 @opindex fipa-profile
7545 Perform interprocedural profile propagation.  The functions called only from
7546 cold functions are marked as cold. Also functions executed once (such as
7547 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7548 functions and loop less parts of functions executed once are then optimized for
7549 size.
7550 Enabled by default at @option{-O} and higher.
7552 @item -fipa-cp
7553 @opindex fipa-cp
7554 Perform interprocedural constant propagation.
7555 This optimization analyzes the program to determine when values passed
7556 to functions are constants and then optimizes accordingly.
7557 This optimization can substantially increase performance
7558 if the application has constants passed to functions.
7559 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7561 @item -fipa-cp-clone
7562 @opindex fipa-cp-clone
7563 Perform function cloning to make interprocedural constant propagation stronger.
7564 When enabled, interprocedural constant propagation performs function cloning
7565 when externally visible function can be called with constant arguments.
7566 Because this optimization can create multiple copies of functions,
7567 it may significantly increase code size
7568 (see @option{--param ipcp-unit-growth=@var{value}}).
7569 This flag is enabled by default at @option{-O3}.
7571 @item -ftree-sink
7572 @opindex ftree-sink
7573 Perform forward store motion  on trees.  This flag is
7574 enabled by default at @option{-O} and higher.
7576 @item -ftree-bit-ccp
7577 @opindex ftree-bit-ccp
7578 Perform sparse conditional bit constant propagation on trees and propagate
7579 pointer alignment information.
7580 This pass only operates on local scalar variables and is enabled by default
7581 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7583 @item -ftree-ccp
7584 @opindex ftree-ccp
7585 Perform sparse conditional constant propagation (CCP) on trees.  This
7586 pass only operates on local scalar variables and is enabled by default
7587 at @option{-O} and higher.
7589 @item -ftree-switch-conversion
7590 Perform conversion of simple initializations in a switch to
7591 initializations from a scalar array.  This flag is enabled by default
7592 at @option{-O2} and higher.
7594 @item -ftree-tail-merge
7595 Look for identical code sequences.  When found, replace one with a jump to the
7596 other.  This optimization is known as tail merging or cross jumping.  This flag
7597 is enabled by default at @option{-O2} and higher.  The compilation time
7598 in this pass can
7599 be limited using @option{max-tail-merge-comparisons} parameter and
7600 @option{max-tail-merge-iterations} parameter.
7602 @item -ftree-dce
7603 @opindex ftree-dce
7604 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7605 default at @option{-O} and higher.
7607 @item -ftree-builtin-call-dce
7608 @opindex ftree-builtin-call-dce
7609 Perform conditional dead code elimination (DCE) for calls to built-in functions
7610 that may set @code{errno} but are otherwise side-effect free.  This flag is
7611 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7612 specified.
7614 @item -ftree-dominator-opts
7615 @opindex ftree-dominator-opts
7616 Perform a variety of simple scalar cleanups (constant/copy
7617 propagation, redundancy elimination, range propagation and expression
7618 simplification) based on a dominator tree traversal.  This also
7619 performs jump threading (to reduce jumps to jumps). This flag is
7620 enabled by default at @option{-O} and higher.
7622 @item -ftree-dse
7623 @opindex ftree-dse
7624 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7625 a memory location that is later overwritten by another store without
7626 any intervening loads.  In this case the earlier store can be deleted.  This
7627 flag is enabled by default at @option{-O} and higher.
7629 @item -ftree-ch
7630 @opindex ftree-ch
7631 Perform loop header copying on trees.  This is beneficial since it increases
7632 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7633 is enabled by default at @option{-O} and higher.  It is not enabled
7634 for @option{-Os}, since it usually increases code size.
7636 @item -ftree-loop-optimize
7637 @opindex ftree-loop-optimize
7638 Perform loop optimizations on trees.  This flag is enabled by default
7639 at @option{-O} and higher.
7641 @item -ftree-loop-linear
7642 @opindex ftree-loop-linear
7643 Perform loop interchange transformations on tree.  Same as
7644 @option{-floop-interchange}.  To use this code transformation, GCC has
7645 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7646 enable the Graphite loop transformation infrastructure.
7648 @item -floop-interchange
7649 @opindex floop-interchange
7650 Perform loop interchange transformations on loops.  Interchanging two
7651 nested loops switches the inner and outer loops.  For example, given a
7652 loop like:
7653 @smallexample
7654 DO J = 1, M
7655   DO I = 1, N
7656     A(J, I) = A(J, I) * C
7657   ENDDO
7658 ENDDO
7659 @end smallexample
7660 loop interchange transforms the loop as if it were written:
7661 @smallexample
7662 DO I = 1, N
7663   DO J = 1, M
7664     A(J, I) = A(J, I) * C
7665   ENDDO
7666 ENDDO
7667 @end smallexample
7668 which can be beneficial when @code{N} is larger than the caches,
7669 because in Fortran, the elements of an array are stored in memory
7670 contiguously by column, and the original loop iterates over rows,
7671 potentially creating at each access a cache miss.  This optimization
7672 applies to all the languages supported by GCC and is not limited to
7673 Fortran.  To use this code transformation, GCC has to be configured
7674 with @option{--with-ppl} and @option{--with-cloog} to enable the
7675 Graphite loop transformation infrastructure.
7677 @item -floop-strip-mine
7678 @opindex floop-strip-mine
7679 Perform loop strip mining transformations on loops.  Strip mining
7680 splits a loop into two nested loops.  The outer loop has strides
7681 equal to the strip size and the inner loop has strides of the
7682 original loop within a strip.  The strip length can be changed
7683 using the @option{loop-block-tile-size} parameter.  For example,
7684 given a loop like:
7685 @smallexample
7686 DO I = 1, N
7687   A(I) = A(I) + C
7688 ENDDO
7689 @end smallexample
7690 loop strip mining transforms the loop as if it were written:
7691 @smallexample
7692 DO II = 1, N, 51
7693   DO I = II, min (II + 50, N)
7694     A(I) = A(I) + C
7695   ENDDO
7696 ENDDO
7697 @end smallexample
7698 This optimization applies to all the languages supported by GCC and is
7699 not limited to Fortran.  To use this code transformation, GCC has to
7700 be configured with @option{--with-ppl} and @option{--with-cloog} to
7701 enable the Graphite loop transformation infrastructure.
7703 @item -floop-block
7704 @opindex floop-block
7705 Perform loop blocking transformations on loops.  Blocking strip mines
7706 each loop in the loop nest such that the memory accesses of the
7707 element loops fit inside caches.  The strip length can be changed
7708 using the @option{loop-block-tile-size} parameter.  For example, given
7709 a loop like:
7710 @smallexample
7711 DO I = 1, N
7712   DO J = 1, M
7713     A(J, I) = B(I) + C(J)
7714   ENDDO
7715 ENDDO
7716 @end smallexample
7717 loop blocking transforms the loop as if it were written:
7718 @smallexample
7719 DO II = 1, N, 51
7720   DO JJ = 1, M, 51
7721     DO I = II, min (II + 50, N)
7722       DO J = JJ, min (JJ + 50, M)
7723         A(J, I) = B(I) + C(J)
7724       ENDDO
7725     ENDDO
7726   ENDDO
7727 ENDDO
7728 @end smallexample
7729 which can be beneficial when @code{M} is larger than the caches,
7730 because the innermost loop iterates over a smaller amount of data
7731 which can be kept in the caches.  This optimization applies to all the
7732 languages supported by GCC and is not limited to Fortran.  To use this
7733 code transformation, GCC has to be configured with @option{--with-ppl}
7734 and @option{--with-cloog} to enable the Graphite loop transformation
7735 infrastructure.
7737 @item -fgraphite-identity
7738 @opindex fgraphite-identity
7739 Enable the identity transformation for graphite.  For every SCoP we generate
7740 the polyhedral representation and transform it back to gimple.  Using
7741 @option{-fgraphite-identity} we can check the costs or benefits of the
7742 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7743 are also performed by the code generator CLooG, like index splitting and
7744 dead code elimination in loops.
7746 @item -floop-nest-optimize
7747 @opindex floop-nest-optimize
7748 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7749 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7750 structure optimized for data-locality and parallelism.  This option
7751 is experimental.
7753 @item -floop-parallelize-all
7754 @opindex floop-parallelize-all
7755 Use the Graphite data dependence analysis to identify loops that can
7756 be parallelized.  Parallelize all the loops that can be analyzed to
7757 not contain loop carried dependences without checking that it is
7758 profitable to parallelize the loops.
7760 @item -fcheck-data-deps
7761 @opindex fcheck-data-deps
7762 Compare the results of several data dependence analyzers.  This option
7763 is used for debugging the data dependence analyzers.
7765 @item -ftree-loop-if-convert
7766 Attempt to transform conditional jumps in the innermost loops to
7767 branch-less equivalents.  The intent is to remove control-flow from
7768 the innermost loops in order to improve the ability of the
7769 vectorization pass to handle these loops.  This is enabled by default
7770 if vectorization is enabled.
7772 @item -ftree-loop-if-convert-stores
7773 Attempt to also if-convert conditional jumps containing memory writes.
7774 This transformation can be unsafe for multi-threaded programs as it
7775 transforms conditional memory writes into unconditional memory writes.
7776 For example,
7777 @smallexample
7778 for (i = 0; i < N; i++)
7779   if (cond)
7780     A[i] = expr;
7781 @end smallexample
7782 is transformed to
7783 @smallexample
7784 for (i = 0; i < N; i++)
7785   A[i] = cond ? expr : A[i];
7786 @end smallexample
7787 potentially producing data races.
7789 @item -ftree-loop-distribution
7790 Perform loop distribution.  This flag can improve cache performance on
7791 big loop bodies and allow further loop optimizations, like
7792 parallelization or vectorization, to take place.  For example, the loop
7793 @smallexample
7794 DO I = 1, N
7795   A(I) = B(I) + C
7796   D(I) = E(I) * F
7797 ENDDO
7798 @end smallexample
7799 is transformed to
7800 @smallexample
7801 DO I = 1, N
7802    A(I) = B(I) + C
7803 ENDDO
7804 DO I = 1, N
7805    D(I) = E(I) * F
7806 ENDDO
7807 @end smallexample
7809 @item -ftree-loop-distribute-patterns
7810 Perform loop distribution of patterns that can be code generated with
7811 calls to a library.  This flag is enabled by default at @option{-O3}.
7813 This pass distributes the initialization loops and generates a call to
7814 memset zero.  For example, the loop
7815 @smallexample
7816 DO I = 1, N
7817   A(I) = 0
7818   B(I) = A(I) + I
7819 ENDDO
7820 @end smallexample
7821 is transformed to
7822 @smallexample
7823 DO I = 1, N
7824    A(I) = 0
7825 ENDDO
7826 DO I = 1, N
7827    B(I) = A(I) + I
7828 ENDDO
7829 @end smallexample
7830 and the initialization loop is transformed into a call to memset zero.
7832 @item -ftree-loop-im
7833 @opindex ftree-loop-im
7834 Perform loop invariant motion on trees.  This pass moves only invariants that
7835 are hard to handle at RTL level (function calls, operations that expand to
7836 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7837 operands of conditions that are invariant out of the loop, so that we can use
7838 just trivial invariantness analysis in loop unswitching.  The pass also includes
7839 store motion.
7841 @item -ftree-loop-ivcanon
7842 @opindex ftree-loop-ivcanon
7843 Create a canonical counter for number of iterations in loops for which
7844 determining number of iterations requires complicated analysis.  Later
7845 optimizations then may determine the number easily.  Useful especially
7846 in connection with unrolling.
7848 @item -fivopts
7849 @opindex fivopts
7850 Perform induction variable optimizations (strength reduction, induction
7851 variable merging and induction variable elimination) on trees.
7853 @item -ftree-parallelize-loops=n
7854 @opindex ftree-parallelize-loops
7855 Parallelize loops, i.e., split their iteration space to run in n threads.
7856 This is only possible for loops whose iterations are independent
7857 and can be arbitrarily reordered.  The optimization is only
7858 profitable on multiprocessor machines, for loops that are CPU-intensive,
7859 rather than constrained e.g.@: by memory bandwidth.  This option
7860 implies @option{-pthread}, and thus is only supported on targets
7861 that have support for @option{-pthread}.
7863 @item -ftree-pta
7864 @opindex ftree-pta
7865 Perform function-local points-to analysis on trees.  This flag is
7866 enabled by default at @option{-O} and higher.
7868 @item -ftree-sra
7869 @opindex ftree-sra
7870 Perform scalar replacement of aggregates.  This pass replaces structure
7871 references with scalars to prevent committing structures to memory too
7872 early.  This flag is enabled by default at @option{-O} and higher.
7874 @item -ftree-copyrename
7875 @opindex ftree-copyrename
7876 Perform copy renaming on trees.  This pass attempts to rename compiler
7877 temporaries to other variables at copy locations, usually resulting in
7878 variable names which more closely resemble the original variables.  This flag
7879 is enabled by default at @option{-O} and higher.
7881 @item -ftree-coalesce-inlined-vars
7882 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7883 combine small user-defined variables too, but only if they were inlined
7884 from other functions.  It is a more limited form of
7885 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7886 inlined variables, but it will keep variables of the inlined-into
7887 function apart from each other, such that they are more likely to
7888 contain the expected values in a debugging session.  This was the
7889 default in GCC versions older than 4.7.
7891 @item -ftree-coalesce-vars
7892 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7893 combine small user-defined variables too, instead of just compiler
7894 temporaries.  This may severely limit the ability to debug an optimized
7895 program compiled with @option{-fno-var-tracking-assignments}.  In the
7896 negated form, this flag prevents SSA coalescing of user variables,
7897 including inlined ones.  This option is enabled by default.
7899 @item -ftree-ter
7900 @opindex ftree-ter
7901 Perform temporary expression replacement during the SSA->normal phase.  Single
7902 use/single def temporaries are replaced at their use location with their
7903 defining expression.  This results in non-GIMPLE code, but gives the expanders
7904 much more complex trees to work on resulting in better RTL generation.  This is
7905 enabled by default at @option{-O} and higher.
7907 @item -ftree-slsr
7908 @opindex ftree-slsr
7909 Perform straight-line strength reduction on trees.  This recognizes related
7910 expressions involving multiplications and replaces them by less expensive
7911 calculations when possible.  This is enabled by default at @option{-O} and
7912 higher.
7914 @item -ftree-vectorize
7915 @opindex ftree-vectorize
7916 Perform loop vectorization on trees. This flag is enabled by default at
7917 @option{-O3}.
7919 @item -ftree-slp-vectorize
7920 @opindex ftree-slp-vectorize
7921 Perform basic block vectorization on trees. This flag is enabled by default at
7922 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7924 @item -ftree-vect-loop-version
7925 @opindex ftree-vect-loop-version
7926 Perform loop versioning when doing loop vectorization on trees.  When a loop
7927 appears to be vectorizable except that data alignment or data dependence cannot
7928 be determined at compile time, then vectorized and non-vectorized versions of
7929 the loop are generated along with run-time checks for alignment or dependence
7930 to control which version is executed.  This option is enabled by default
7931 except at level @option{-Os} where it is disabled.
7933 @item -fvect-cost-model
7934 @opindex fvect-cost-model
7935 Enable cost model for vectorization.  This option is enabled by default at
7936 @option{-O3}.
7938 @item -ftree-vrp
7939 @opindex ftree-vrp
7940 Perform Value Range Propagation on trees.  This is similar to the
7941 constant propagation pass, but instead of values, ranges of values are
7942 propagated.  This allows the optimizers to remove unnecessary range
7943 checks like array bound checks and null pointer checks.  This is
7944 enabled by default at @option{-O2} and higher.  Null pointer check
7945 elimination is only done if @option{-fdelete-null-pointer-checks} is
7946 enabled.
7948 @item -ftracer
7949 @opindex ftracer
7950 Perform tail duplication to enlarge superblock size.  This transformation
7951 simplifies the control flow of the function allowing other optimizations to do
7952 a better job.
7954 @item -funroll-loops
7955 @opindex funroll-loops
7956 Unroll loops whose number of iterations can be determined at compile
7957 time or upon entry to the loop.  @option{-funroll-loops} implies
7958 @option{-frerun-cse-after-loop}.  This option makes code larger,
7959 and may or may not make it run faster.
7961 @item -funroll-all-loops
7962 @opindex funroll-all-loops
7963 Unroll all loops, even if their number of iterations is uncertain when
7964 the loop is entered.  This usually makes programs run more slowly.
7965 @option{-funroll-all-loops} implies the same options as
7966 @option{-funroll-loops},
7968 @item -fsplit-ivs-in-unroller
7969 @opindex fsplit-ivs-in-unroller
7970 Enables expression of values of induction variables in later iterations
7971 of the unrolled loop using the value in the first iteration.  This breaks
7972 long dependency chains, thus improving efficiency of the scheduling passes.
7974 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7975 same effect.  However, that is not reliable in cases where the loop body
7976 is more complicated than a single basic block.  It also does not work at all
7977 on some architectures due to restrictions in the CSE pass.
7979 This optimization is enabled by default.
7981 @item -fvariable-expansion-in-unroller
7982 @opindex fvariable-expansion-in-unroller
7983 With this option, the compiler creates multiple copies of some
7984 local variables when unrolling a loop, which can result in superior code.
7986 @item -fpartial-inlining
7987 @opindex fpartial-inlining
7988 Inline parts of functions.  This option has any effect only
7989 when inlining itself is turned on by the @option{-finline-functions}
7990 or @option{-finline-small-functions} options.
7992 Enabled at level @option{-O2}.
7994 @item -fpredictive-commoning
7995 @opindex fpredictive-commoning
7996 Perform predictive commoning optimization, i.e., reusing computations
7997 (especially memory loads and stores) performed in previous
7998 iterations of loops.
8000 This option is enabled at level @option{-O3}.
8002 @item -fprefetch-loop-arrays
8003 @opindex fprefetch-loop-arrays
8004 If supported by the target machine, generate instructions to prefetch
8005 memory to improve the performance of loops that access large arrays.
8007 This option may generate better or worse code; results are highly
8008 dependent on the structure of loops within the source code.
8010 Disabled at level @option{-Os}.
8012 @item -fno-peephole
8013 @itemx -fno-peephole2
8014 @opindex fno-peephole
8015 @opindex fno-peephole2
8016 Disable any machine-specific peephole optimizations.  The difference
8017 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8018 are implemented in the compiler; some targets use one, some use the
8019 other, a few use both.
8021 @option{-fpeephole} is enabled by default.
8022 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8024 @item -fno-guess-branch-probability
8025 @opindex fno-guess-branch-probability
8026 Do not guess branch probabilities using heuristics.
8028 GCC uses heuristics to guess branch probabilities if they are
8029 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8030 heuristics are based on the control flow graph.  If some branch probabilities
8031 are specified by @samp{__builtin_expect}, then the heuristics are
8032 used to guess branch probabilities for the rest of the control flow graph,
8033 taking the @samp{__builtin_expect} info into account.  The interactions
8034 between the heuristics and @samp{__builtin_expect} can be complex, and in
8035 some cases, it may be useful to disable the heuristics so that the effects
8036 of @samp{__builtin_expect} are easier to understand.
8038 The default is @option{-fguess-branch-probability} at levels
8039 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8041 @item -freorder-blocks
8042 @opindex freorder-blocks
8043 Reorder basic blocks in the compiled function in order to reduce number of
8044 taken branches and improve code locality.
8046 Enabled at levels @option{-O2}, @option{-O3}.
8048 @item -freorder-blocks-and-partition
8049 @opindex freorder-blocks-and-partition
8050 In addition to reordering basic blocks in the compiled function, in order
8051 to reduce number of taken branches, partitions hot and cold basic blocks
8052 into separate sections of the assembly and .o files, to improve
8053 paging and cache locality performance.
8055 This optimization is automatically turned off in the presence of
8056 exception handling, for linkonce sections, for functions with a user-defined
8057 section attribute and on any architecture that does not support named
8058 sections.
8060 @item -freorder-functions
8061 @opindex freorder-functions
8062 Reorder functions in the object file in order to
8063 improve code locality.  This is implemented by using special
8064 subsections @code{.text.hot} for most frequently executed functions and
8065 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8066 the linker so object file format must support named sections and linker must
8067 place them in a reasonable way.
8069 Also profile feedback must be available to make this option effective.  See
8070 @option{-fprofile-arcs} for details.
8072 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8074 @item -fstrict-aliasing
8075 @opindex fstrict-aliasing
8076 Allow the compiler to assume the strictest aliasing rules applicable to
8077 the language being compiled.  For C (and C++), this activates
8078 optimizations based on the type of expressions.  In particular, an
8079 object of one type is assumed never to reside at the same address as an
8080 object of a different type, unless the types are almost the same.  For
8081 example, an @code{unsigned int} can alias an @code{int}, but not a
8082 @code{void*} or a @code{double}.  A character type may alias any other
8083 type.
8085 @anchor{Type-punning}Pay special attention to code like this:
8086 @smallexample
8087 union a_union @{
8088   int i;
8089   double d;
8092 int f() @{
8093   union a_union t;
8094   t.d = 3.0;
8095   return t.i;
8097 @end smallexample
8098 The practice of reading from a different union member than the one most
8099 recently written to (called ``type-punning'') is common.  Even with
8100 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8101 is accessed through the union type.  So, the code above works as
8102 expected.  @xref{Structures unions enumerations and bit-fields
8103 implementation}.  However, this code might not:
8104 @smallexample
8105 int f() @{
8106   union a_union t;
8107   int* ip;
8108   t.d = 3.0;
8109   ip = &t.i;
8110   return *ip;
8112 @end smallexample
8114 Similarly, access by taking the address, casting the resulting pointer
8115 and dereferencing the result has undefined behavior, even if the cast
8116 uses a union type, e.g.:
8117 @smallexample
8118 int f() @{
8119   double d = 3.0;
8120   return ((union a_union *) &d)->i;
8122 @end smallexample
8124 The @option{-fstrict-aliasing} option is enabled at levels
8125 @option{-O2}, @option{-O3}, @option{-Os}.
8127 @item -fstrict-overflow
8128 @opindex fstrict-overflow
8129 Allow the compiler to assume strict signed overflow rules, depending
8130 on the language being compiled.  For C (and C++) this means that
8131 overflow when doing arithmetic with signed numbers is undefined, which
8132 means that the compiler may assume that it does not happen.  This
8133 permits various optimizations.  For example, the compiler assumes
8134 that an expression like @code{i + 10 > i} is always true for
8135 signed @code{i}.  This assumption is only valid if signed overflow is
8136 undefined, as the expression is false if @code{i + 10} overflows when
8137 using twos complement arithmetic.  When this option is in effect any
8138 attempt to determine whether an operation on signed numbers 
8139 overflows must be written carefully to not actually involve overflow.
8141 This option also allows the compiler to assume strict pointer
8142 semantics: given a pointer to an object, if adding an offset to that
8143 pointer does not produce a pointer to the same object, the addition is
8144 undefined.  This permits the compiler to conclude that @code{p + u >
8145 p} is always true for a pointer @code{p} and unsigned integer
8146 @code{u}.  This assumption is only valid because pointer wraparound is
8147 undefined, as the expression is false if @code{p + u} overflows using
8148 twos complement arithmetic.
8150 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8151 that integer signed overflow is fully defined: it wraps.  When
8152 @option{-fwrapv} is used, there is no difference between
8153 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8154 integers.  With @option{-fwrapv} certain types of overflow are
8155 permitted.  For example, if the compiler gets an overflow when doing
8156 arithmetic on constants, the overflowed value can still be used with
8157 @option{-fwrapv}, but not otherwise.
8159 The @option{-fstrict-overflow} option is enabled at levels
8160 @option{-O2}, @option{-O3}, @option{-Os}.
8162 @item -falign-functions
8163 @itemx -falign-functions=@var{n}
8164 @opindex falign-functions
8165 Align the start of functions to the next power-of-two greater than
8166 @var{n}, skipping up to @var{n} bytes.  For instance,
8167 @option{-falign-functions=32} aligns functions to the next 32-byte
8168 boundary, but @option{-falign-functions=24} aligns to the next
8169 32-byte boundary only if this can be done by skipping 23 bytes or less.
8171 @option{-fno-align-functions} and @option{-falign-functions=1} are
8172 equivalent and mean that functions are not aligned.
8174 Some assemblers only support this flag when @var{n} is a power of two;
8175 in that case, it is rounded up.
8177 If @var{n} is not specified or is zero, use a machine-dependent default.
8179 Enabled at levels @option{-O2}, @option{-O3}.
8181 @item -falign-labels
8182 @itemx -falign-labels=@var{n}
8183 @opindex falign-labels
8184 Align all branch targets to a power-of-two boundary, skipping up to
8185 @var{n} bytes like @option{-falign-functions}.  This option can easily
8186 make code slower, because it must insert dummy operations for when the
8187 branch target is reached in the usual flow of the code.
8189 @option{-fno-align-labels} and @option{-falign-labels=1} are
8190 equivalent and mean that labels are not aligned.
8192 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8193 are greater than this value, then their values are used instead.
8195 If @var{n} is not specified or is zero, use a machine-dependent default
8196 which is very likely to be @samp{1}, meaning no alignment.
8198 Enabled at levels @option{-O2}, @option{-O3}.
8200 @item -falign-loops
8201 @itemx -falign-loops=@var{n}
8202 @opindex falign-loops
8203 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8204 like @option{-falign-functions}.  If the loops are
8205 executed many times, this makes up for any execution of the dummy
8206 operations.
8208 @option{-fno-align-loops} and @option{-falign-loops=1} are
8209 equivalent and mean that loops are not aligned.
8211 If @var{n} is not specified or is zero, use a machine-dependent default.
8213 Enabled at levels @option{-O2}, @option{-O3}.
8215 @item -falign-jumps
8216 @itemx -falign-jumps=@var{n}
8217 @opindex falign-jumps
8218 Align branch targets to a power-of-two boundary, for branch targets
8219 where the targets can only be reached by jumping, skipping up to @var{n}
8220 bytes like @option{-falign-functions}.  In this case, no dummy operations
8221 need be executed.
8223 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8224 equivalent and mean that loops are not aligned.
8226 If @var{n} is not specified or is zero, use a machine-dependent default.
8228 Enabled at levels @option{-O2}, @option{-O3}.
8230 @item -funit-at-a-time
8231 @opindex funit-at-a-time
8232 This option is left for compatibility reasons. @option{-funit-at-a-time}
8233 has no effect, while @option{-fno-unit-at-a-time} implies
8234 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8236 Enabled by default.
8238 @item -fno-toplevel-reorder
8239 @opindex fno-toplevel-reorder
8240 Do not reorder top-level functions, variables, and @code{asm}
8241 statements.  Output them in the same order that they appear in the
8242 input file.  When this option is used, unreferenced static variables
8243 are not removed.  This option is intended to support existing code
8244 that relies on a particular ordering.  For new code, it is better to
8245 use attributes.
8247 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8248 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8249 targets.
8251 @item -fweb
8252 @opindex fweb
8253 Constructs webs as commonly used for register allocation purposes and assign
8254 each web individual pseudo register.  This allows the register allocation pass
8255 to operate on pseudos directly, but also strengthens several other optimization
8256 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8257 however, make debugging impossible, since variables no longer stay in a
8258 ``home register''.
8260 Enabled by default with @option{-funroll-loops}.
8262 @item -fwhole-program
8263 @opindex fwhole-program
8264 Assume that the current compilation unit represents the whole program being
8265 compiled.  All public functions and variables with the exception of @code{main}
8266 and those merged by attribute @code{externally_visible} become static functions
8267 and in effect are optimized more aggressively by interprocedural optimizers.
8269 This option should not be used in combination with @code{-flto}.
8270 Instead relying on a linker plugin should provide safer and more precise
8271 information.
8273 @item -flto[=@var{n}]
8274 @opindex flto
8275 This option runs the standard link-time optimizer.  When invoked
8276 with source code, it generates GIMPLE (one of GCC's internal
8277 representations) and writes it to special ELF sections in the object
8278 file.  When the object files are linked together, all the function
8279 bodies are read from these ELF sections and instantiated as if they
8280 had been part of the same translation unit.
8282 To use the link-time optimizer, @option{-flto} needs to be specified at
8283 compile time and during the final link.  For example:
8285 @smallexample
8286 gcc -c -O2 -flto foo.c
8287 gcc -c -O2 -flto bar.c
8288 gcc -o myprog -flto -O2 foo.o bar.o
8289 @end smallexample
8291 The first two invocations to GCC save a bytecode representation
8292 of GIMPLE into special ELF sections inside @file{foo.o} and
8293 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8294 @file{foo.o} and @file{bar.o}, merges the two files into a single
8295 internal image, and compiles the result as usual.  Since both
8296 @file{foo.o} and @file{bar.o} are merged into a single image, this
8297 causes all the interprocedural analyses and optimizations in GCC to
8298 work across the two files as if they were a single one.  This means,
8299 for example, that the inliner is able to inline functions in
8300 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8302 Another (simpler) way to enable link-time optimization is:
8304 @smallexample
8305 gcc -o myprog -flto -O2 foo.c bar.c
8306 @end smallexample
8308 The above generates bytecode for @file{foo.c} and @file{bar.c},
8309 merges them together into a single GIMPLE representation and optimizes
8310 them as usual to produce @file{myprog}.
8312 The only important thing to keep in mind is that to enable link-time
8313 optimizations the @option{-flto} flag needs to be passed to both the
8314 compile and the link commands.
8316 To make whole program optimization effective, it is necessary to make
8317 certain whole program assumptions.  The compiler needs to know
8318 what functions and variables can be accessed by libraries and runtime
8319 outside of the link-time optimized unit.  When supported by the linker,
8320 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8321 to the compiler about used and externally visible symbols.  When
8322 the linker plugin is not available, @option{-fwhole-program} should be
8323 used to allow the compiler to make these assumptions, which leads
8324 to more aggressive optimization decisions.
8326 Note that when a file is compiled with @option{-flto}, the generated
8327 object file is larger than a regular object file because it 
8328 contains GIMPLE bytecodes and the usual final code.  This means that
8329 object files with LTO information can be linked as normal object
8330 files; if @option{-flto} is not passed to the linker, no
8331 interprocedural optimizations are applied.
8333 Additionally, the optimization flags used to compile individual files
8334 are not necessarily related to those used at link time.  For instance,
8336 @smallexample
8337 gcc -c -O0 -flto foo.c
8338 gcc -c -O0 -flto bar.c
8339 gcc -o myprog -flto -O3 foo.o bar.o
8340 @end smallexample
8342 This produces individual object files with unoptimized assembler
8343 code, but the resulting binary @file{myprog} is optimized at
8344 @option{-O3}.  If, instead, the final binary is generated without
8345 @option{-flto}, then @file{myprog} is not optimized.
8347 When producing the final binary with @option{-flto}, GCC only
8348 applies link-time optimizations to those files that contain bytecode.
8349 Therefore, you can mix and match object files and libraries with
8350 GIMPLE bytecodes and final object code.  GCC automatically selects
8351 which files to optimize in LTO mode and which files to link without
8352 further processing.
8354 There are some code generation flags preserved by GCC when
8355 generating bytecodes, as they need to be used during the final link
8356 stage.  Currently, the following options are saved into the GIMPLE
8357 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8358 @option{-m} target flags.
8360 At link time, these options are read in and reapplied.  Note that the
8361 current implementation makes no attempt to recognize conflicting
8362 values for these options.  If different files have conflicting option
8363 values (e.g., one file is compiled with @option{-fPIC} and another
8364 isn't), the compiler simply uses the last value read from the
8365 bytecode files.  It is recommended, then, that you compile all the files
8366 participating in the same link with the same options.
8368 If LTO encounters objects with C linkage declared with incompatible
8369 types in separate translation units to be linked together (undefined
8370 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8371 issued.  The behavior is still undefined at run time.
8373 Another feature of LTO is that it is possible to apply interprocedural
8374 optimizations on files written in different languages.  This requires
8375 support in the language front end.  Currently, the C, C++ and
8376 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8377 something like this should work:
8379 @smallexample
8380 gcc -c -flto foo.c
8381 g++ -c -flto bar.cc
8382 gfortran -c -flto baz.f90
8383 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8384 @end smallexample
8386 Notice that the final link is done with @command{g++} to get the C++
8387 runtime libraries and @option{-lgfortran} is added to get the Fortran
8388 runtime libraries.  In general, when mixing languages in LTO mode, you
8389 should use the same link command options as when mixing languages in a
8390 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8391 all the compile and link commands.
8393 If object files containing GIMPLE bytecode are stored in a library archive, say
8394 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8395 are using a linker with plugin support.  To enable this feature, use
8396 the flag @option{-fuse-linker-plugin} at link time:
8398 @smallexample
8399 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8400 @end smallexample
8402 With the linker plugin enabled, the linker extracts the needed
8403 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8404 to make them part of the aggregated GIMPLE image to be optimized.
8406 If you are not using a linker with plugin support and/or do not
8407 enable the linker plugin, then the objects inside @file{libfoo.a}
8408 are extracted and linked as usual, but they do not participate
8409 in the LTO optimization process.
8411 Link-time optimizations do not require the presence of the whole program to
8412 operate.  If the program does not require any symbols to be exported, it is
8413 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8414 the interprocedural optimizers to use more aggressive assumptions which may
8415 lead to improved optimization opportunities.
8416 Use of @option{-fwhole-program} is not needed when linker plugin is
8417 active (see @option{-fuse-linker-plugin}).
8419 The current implementation of LTO makes no
8420 attempt to generate bytecode that is portable between different
8421 types of hosts.  The bytecode files are versioned and there is a
8422 strict version check, so bytecode files generated in one version of
8423 GCC will not work with an older/newer version of GCC@.
8425 Link-time optimization does not work well with generation of debugging
8426 information.  Combining @option{-flto} with
8427 @option{-g} is currently experimental and expected to produce wrong
8428 results.
8430 If you specify the optional @var{n}, the optimization and code
8431 generation done at link time is executed in parallel using @var{n}
8432 parallel jobs by utilizing an installed @command{make} program.  The
8433 environment variable @env{MAKE} may be used to override the program
8434 used.  The default value for @var{n} is 1.
8436 You can also specify @option{-flto=jobserver} to use GNU make's
8437 job server mode to determine the number of parallel jobs. This
8438 is useful when the Makefile calling GCC is already executing in parallel.
8439 You must prepend a @samp{+} to the command recipe in the parent Makefile
8440 for this to work.  This option likely only works if @env{MAKE} is
8441 GNU make.
8443 This option is disabled by default.
8445 @item -flto-partition=@var{alg}
8446 @opindex flto-partition
8447 Specify the partitioning algorithm used by the link-time optimizer.
8448 The value is either @code{1to1} to specify a partitioning mirroring
8449 the original source files or @code{balanced} to specify partitioning
8450 into equally sized chunks (whenever possible) or @code{max} to create
8451 new partition for every symbol where possible.  Specifying @code{none}
8452 as an algorithm disables partitioning and streaming completely. 
8453 The default value is @code{balanced}. While @code{1to1} can be used
8454 as an workaround for various code ordering issues, the @code{max}
8455 partitioning is intended for internal testing only.
8457 @item -flto-compression-level=@var{n}
8458 This option specifies the level of compression used for intermediate
8459 language written to LTO object files, and is only meaningful in
8460 conjunction with LTO mode (@option{-flto}).  Valid
8461 values are 0 (no compression) to 9 (maximum compression).  Values
8462 outside this range are clamped to either 0 or 9.  If the option is not
8463 given, a default balanced compression setting is used.
8465 @item -flto-report
8466 Prints a report with internal details on the workings of the link-time
8467 optimizer.  The contents of this report vary from version to version.
8468 It is meant to be useful to GCC developers when processing object
8469 files in LTO mode (via @option{-flto}).
8471 Disabled by default.
8473 @item -flto-report-wpa
8474 Like @option{-flto-report}, but only print for the WPA phase of Link
8475 Time Optimization.
8477 @item -fuse-linker-plugin
8478 Enables the use of a linker plugin during link-time optimization.  This
8479 option relies on plugin support in the linker, which is available in gold
8480 or in GNU ld 2.21 or newer.
8482 This option enables the extraction of object files with GIMPLE bytecode out
8483 of library archives. This improves the quality of optimization by exposing
8484 more code to the link-time optimizer.  This information specifies what
8485 symbols can be accessed externally (by non-LTO object or during dynamic
8486 linking).  Resulting code quality improvements on binaries (and shared
8487 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8488 See @option{-flto} for a description of the effect of this flag and how to
8489 use it.
8491 This option is enabled by default when LTO support in GCC is enabled
8492 and GCC was configured for use with
8493 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8495 @item -ffat-lto-objects
8496 @opindex ffat-lto-objects
8497 Fat LTO objects are object files that contain both the intermediate language
8498 and the object code. This makes them usable for both LTO linking and normal
8499 linking. This option is effective only when compiling with @option{-flto}
8500 and is ignored at link time.
8502 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8503 requires the complete toolchain to be aware of LTO. It requires a linker with
8504 linker plugin support for basic functionality.  Additionally,
8505 @command{nm}, @command{ar} and @command{ranlib}
8506 need to support linker plugins to allow a full-featured build environment
8507 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8508 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8509 to these tools. With non fat LTO makefiles need to be modified to use them.
8511 The default is @option{-ffat-lto-objects} but this default is intended to
8512 change in future releases when linker plugin enabled environments become more
8513 common.
8515 @item -fcompare-elim
8516 @opindex fcompare-elim
8517 After register allocation and post-register allocation instruction splitting,
8518 identify arithmetic instructions that compute processor flags similar to a
8519 comparison operation based on that arithmetic.  If possible, eliminate the
8520 explicit comparison operation.
8522 This pass only applies to certain targets that cannot explicitly represent
8523 the comparison operation before register allocation is complete.
8525 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8527 @item -fuse-ld=bfd
8528 Use the @command{bfd} linker instead of the default linker.
8530 @item -fuse-ld=gold
8531 Use the @command{gold} linker instead of the default linker.
8533 @item -fcprop-registers
8534 @opindex fcprop-registers
8535 After register allocation and post-register allocation instruction splitting,
8536 perform a copy-propagation pass to try to reduce scheduling dependencies
8537 and occasionally eliminate the copy.
8539 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8541 @item -fprofile-correction
8542 @opindex fprofile-correction
8543 Profiles collected using an instrumented binary for multi-threaded programs may
8544 be inconsistent due to missed counter updates. When this option is specified,
8545 GCC uses heuristics to correct or smooth out such inconsistencies. By
8546 default, GCC emits an error message when an inconsistent profile is detected.
8548 @item -fprofile-dir=@var{path}
8549 @opindex fprofile-dir
8551 Set the directory to search for the profile data files in to @var{path}.
8552 This option affects only the profile data generated by
8553 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8554 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8555 and its related options.  Both absolute and relative paths can be used.
8556 By default, GCC uses the current directory as @var{path}, thus the
8557 profile data file appears in the same directory as the object file.
8559 @item -fprofile-generate
8560 @itemx -fprofile-generate=@var{path}
8561 @opindex fprofile-generate
8563 Enable options usually used for instrumenting application to produce
8564 profile useful for later recompilation with profile feedback based
8565 optimization.  You must use @option{-fprofile-generate} both when
8566 compiling and when linking your program.
8568 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8570 If @var{path} is specified, GCC looks at the @var{path} to find
8571 the profile feedback data files. See @option{-fprofile-dir}.
8573 @item -fprofile-use
8574 @itemx -fprofile-use=@var{path}
8575 @opindex fprofile-use
8576 Enable profile feedback directed optimizations, and optimizations
8577 generally profitable only with profile feedback available.
8579 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8580 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8581 @code{ftree-loop-distribute-patterns}
8583 By default, GCC emits an error message if the feedback profiles do not
8584 match the source code.  This error can be turned into a warning by using
8585 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8586 code.
8588 If @var{path} is specified, GCC looks at the @var{path} to find
8589 the profile feedback data files. See @option{-fprofile-dir}.
8590 @end table
8592 The following options control compiler behavior regarding floating-point 
8593 arithmetic.  These options trade off between speed and
8594 correctness.  All must be specifically enabled.
8596 @table @gcctabopt
8597 @item -ffloat-store
8598 @opindex ffloat-store
8599 Do not store floating-point variables in registers, and inhibit other
8600 options that might change whether a floating-point value is taken from a
8601 register or memory.
8603 @cindex floating-point precision
8604 This option prevents undesirable excess precision on machines such as
8605 the 68000 where the floating registers (of the 68881) keep more
8606 precision than a @code{double} is supposed to have.  Similarly for the
8607 x86 architecture.  For most programs, the excess precision does only
8608 good, but a few programs rely on the precise definition of IEEE floating
8609 point.  Use @option{-ffloat-store} for such programs, after modifying
8610 them to store all pertinent intermediate computations into variables.
8612 @item -fexcess-precision=@var{style}
8613 @opindex fexcess-precision
8614 This option allows further control over excess precision on machines
8615 where floating-point registers have more precision than the IEEE
8616 @code{float} and @code{double} types and the processor does not
8617 support operations rounding to those types.  By default,
8618 @option{-fexcess-precision=fast} is in effect; this means that
8619 operations are carried out in the precision of the registers and that
8620 it is unpredictable when rounding to the types specified in the source
8621 code takes place.  When compiling C, if
8622 @option{-fexcess-precision=standard} is specified then excess
8623 precision follows the rules specified in ISO C99; in particular,
8624 both casts and assignments cause values to be rounded to their
8625 semantic types (whereas @option{-ffloat-store} only affects
8626 assignments).  This option is enabled by default for C if a strict
8627 conformance option such as @option{-std=c99} is used.
8629 @opindex mfpmath
8630 @option{-fexcess-precision=standard} is not implemented for languages
8631 other than C, and has no effect if
8632 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8633 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8634 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8635 semantics apply without excess precision, and in the latter, rounding
8636 is unpredictable.
8638 @item -ffast-math
8639 @opindex ffast-math
8640 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8641 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8642 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8644 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8646 This option is not turned on by any @option{-O} option besides
8647 @option{-Ofast} since it can result in incorrect output for programs
8648 that depend on an exact implementation of IEEE or ISO rules/specifications
8649 for math functions. It may, however, yield faster code for programs
8650 that do not require the guarantees of these specifications.
8652 @item -fno-math-errno
8653 @opindex fno-math-errno
8654 Do not set @code{errno} after calling math functions that are executed
8655 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8656 IEEE exceptions for math error handling may want to use this flag
8657 for speed while maintaining IEEE arithmetic compatibility.
8659 This option is not turned on by any @option{-O} option since
8660 it can result in incorrect output for programs that depend on
8661 an exact implementation of IEEE or ISO rules/specifications for
8662 math functions. It may, however, yield faster code for programs
8663 that do not require the guarantees of these specifications.
8665 The default is @option{-fmath-errno}.
8667 On Darwin systems, the math library never sets @code{errno}.  There is
8668 therefore no reason for the compiler to consider the possibility that
8669 it might, and @option{-fno-math-errno} is the default.
8671 @item -funsafe-math-optimizations
8672 @opindex funsafe-math-optimizations
8674 Allow optimizations for floating-point arithmetic that (a) assume
8675 that arguments and results are valid and (b) may violate IEEE or
8676 ANSI standards.  When used at link-time, it may include libraries
8677 or startup files that change the default FPU control word or other
8678 similar optimizations.
8680 This option is not turned on by any @option{-O} option since
8681 it can result in incorrect output for programs that depend on
8682 an exact implementation of IEEE or ISO rules/specifications for
8683 math functions. It may, however, yield faster code for programs
8684 that do not require the guarantees of these specifications.
8685 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8686 @option{-fassociative-math} and @option{-freciprocal-math}.
8688 The default is @option{-fno-unsafe-math-optimizations}.
8690 @item -fassociative-math
8691 @opindex fassociative-math
8693 Allow re-association of operands in series of floating-point operations.
8694 This violates the ISO C and C++ language standard by possibly changing
8695 computation result.  NOTE: re-ordering may change the sign of zero as
8696 well as ignore NaNs and inhibit or create underflow or overflow (and
8697 thus cannot be used on code that relies on rounding behavior like
8698 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8699 and thus may not be used when ordered comparisons are required.
8700 This option requires that both @option{-fno-signed-zeros} and
8701 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8702 much sense with @option{-frounding-math}. For Fortran the option
8703 is automatically enabled when both @option{-fno-signed-zeros} and
8704 @option{-fno-trapping-math} are in effect.
8706 The default is @option{-fno-associative-math}.
8708 @item -freciprocal-math
8709 @opindex freciprocal-math
8711 Allow the reciprocal of a value to be used instead of dividing by
8712 the value if this enables optimizations.  For example @code{x / y}
8713 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8714 is subject to common subexpression elimination.  Note that this loses
8715 precision and increases the number of flops operating on the value.
8717 The default is @option{-fno-reciprocal-math}.
8719 @item -ffinite-math-only
8720 @opindex ffinite-math-only
8721 Allow optimizations for floating-point arithmetic that assume
8722 that arguments and results are not NaNs or +-Infs.
8724 This option is not turned on by any @option{-O} option since
8725 it can result in incorrect output for programs that depend on
8726 an exact implementation of IEEE or ISO rules/specifications for
8727 math functions. It may, however, yield faster code for programs
8728 that do not require the guarantees of these specifications.
8730 The default is @option{-fno-finite-math-only}.
8732 @item -fno-signed-zeros
8733 @opindex fno-signed-zeros
8734 Allow optimizations for floating-point arithmetic that ignore the
8735 signedness of zero.  IEEE arithmetic specifies the behavior of
8736 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8737 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8738 This option implies that the sign of a zero result isn't significant.
8740 The default is @option{-fsigned-zeros}.
8742 @item -fno-trapping-math
8743 @opindex fno-trapping-math
8744 Compile code assuming that floating-point operations cannot generate
8745 user-visible traps.  These traps include division by zero, overflow,
8746 underflow, inexact result and invalid operation.  This option requires
8747 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8748 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8750 This option should never be turned on by any @option{-O} option since
8751 it can result in incorrect output for programs that depend on
8752 an exact implementation of IEEE or ISO rules/specifications for
8753 math functions.
8755 The default is @option{-ftrapping-math}.
8757 @item -frounding-math
8758 @opindex frounding-math
8759 Disable transformations and optimizations that assume default floating-point
8760 rounding behavior.  This is round-to-zero for all floating point
8761 to integer conversions, and round-to-nearest for all other arithmetic
8762 truncations.  This option should be specified for programs that change
8763 the FP rounding mode dynamically, or that may be executed with a
8764 non-default rounding mode.  This option disables constant folding of
8765 floating-point expressions at compile time (which may be affected by
8766 rounding mode) and arithmetic transformations that are unsafe in the
8767 presence of sign-dependent rounding modes.
8769 The default is @option{-fno-rounding-math}.
8771 This option is experimental and does not currently guarantee to
8772 disable all GCC optimizations that are affected by rounding mode.
8773 Future versions of GCC may provide finer control of this setting
8774 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8775 will be used to specify the default state for @code{FENV_ACCESS}.
8777 @item -fsignaling-nans
8778 @opindex fsignaling-nans
8779 Compile code assuming that IEEE signaling NaNs may generate user-visible
8780 traps during floating-point operations.  Setting this option disables
8781 optimizations that may change the number of exceptions visible with
8782 signaling NaNs.  This option implies @option{-ftrapping-math}.
8784 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8785 be defined.
8787 The default is @option{-fno-signaling-nans}.
8789 This option is experimental and does not currently guarantee to
8790 disable all GCC optimizations that affect signaling NaN behavior.
8792 @item -fsingle-precision-constant
8793 @opindex fsingle-precision-constant
8794 Treat floating-point constants as single precision instead of
8795 implicitly converting them to double-precision constants.
8797 @item -fcx-limited-range
8798 @opindex fcx-limited-range
8799 When enabled, this option states that a range reduction step is not
8800 needed when performing complex division.  Also, there is no checking
8801 whether the result of a complex multiplication or division is @code{NaN
8802 + I*NaN}, with an attempt to rescue the situation in that case.  The
8803 default is @option{-fno-cx-limited-range}, but is enabled by
8804 @option{-ffast-math}.
8806 This option controls the default setting of the ISO C99
8807 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8808 all languages.
8810 @item -fcx-fortran-rules
8811 @opindex fcx-fortran-rules
8812 Complex multiplication and division follow Fortran rules.  Range
8813 reduction is done as part of complex division, but there is no checking
8814 whether the result of a complex multiplication or division is @code{NaN
8815 + I*NaN}, with an attempt to rescue the situation in that case.
8817 The default is @option{-fno-cx-fortran-rules}.
8819 @end table
8821 The following options control optimizations that may improve
8822 performance, but are not enabled by any @option{-O} options.  This
8823 section includes experimental options that may produce broken code.
8825 @table @gcctabopt
8826 @item -fbranch-probabilities
8827 @opindex fbranch-probabilities
8828 After running a program compiled with @option{-fprofile-arcs}
8829 (@pxref{Debugging Options,, Options for Debugging Your Program or
8830 @command{gcc}}), you can compile it a second time using
8831 @option{-fbranch-probabilities}, to improve optimizations based on
8832 the number of times each branch was taken.  When a program
8833 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8834 counts to a file called @file{@var{sourcename}.gcda} for each source
8835 file.  The information in this data file is very dependent on the
8836 structure of the generated code, so you must use the same source code
8837 and the same optimization options for both compilations.
8839 With @option{-fbranch-probabilities}, GCC puts a
8840 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8841 These can be used to improve optimization.  Currently, they are only
8842 used in one place: in @file{reorg.c}, instead of guessing which path a
8843 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8844 exactly determine which path is taken more often.
8846 @item -fprofile-values
8847 @opindex fprofile-values
8848 If combined with @option{-fprofile-arcs}, it adds code so that some
8849 data about values of expressions in the program is gathered.
8851 With @option{-fbranch-probabilities}, it reads back the data gathered
8852 from profiling values of expressions for usage in optimizations.
8854 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8856 @item -fvpt
8857 @opindex fvpt
8858 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8859 to add code to gather information about values of expressions.
8861 With @option{-fbranch-probabilities}, it reads back the data gathered
8862 and actually performs the optimizations based on them.
8863 Currently the optimizations include specialization of division operations
8864 using the knowledge about the value of the denominator.
8866 @item -frename-registers
8867 @opindex frename-registers
8868 Attempt to avoid false dependencies in scheduled code by making use
8869 of registers left over after register allocation.  This optimization
8870 most benefits processors with lots of registers.  Depending on the
8871 debug information format adopted by the target, however, it can
8872 make debugging impossible, since variables no longer stay in
8873 a ``home register''.
8875 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8877 @item -ftracer
8878 @opindex ftracer
8879 Perform tail duplication to enlarge superblock size.  This transformation
8880 simplifies the control flow of the function allowing other optimizations to do
8881 a better job.
8883 Enabled with @option{-fprofile-use}.
8885 @item -funroll-loops
8886 @opindex funroll-loops
8887 Unroll loops whose number of iterations can be determined at compile time or
8888 upon entry to the loop.  @option{-funroll-loops} implies
8889 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8890 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8891 a small constant number of iterations).  This option makes code larger, and may
8892 or may not make it run faster.
8894 Enabled with @option{-fprofile-use}.
8896 @item -funroll-all-loops
8897 @opindex funroll-all-loops
8898 Unroll all loops, even if their number of iterations is uncertain when
8899 the loop is entered.  This usually makes programs run more slowly.
8900 @option{-funroll-all-loops} implies the same options as
8901 @option{-funroll-loops}.
8903 @item -fpeel-loops
8904 @opindex fpeel-loops
8905 Peels loops for which there is enough information that they do not
8906 roll much (from profile feedback).  It also turns on complete loop peeling
8907 (i.e.@: complete removal of loops with small constant number of iterations).
8909 Enabled with @option{-fprofile-use}.
8911 @item -fmove-loop-invariants
8912 @opindex fmove-loop-invariants
8913 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8914 at level @option{-O1}
8916 @item -funswitch-loops
8917 @opindex funswitch-loops
8918 Move branches with loop invariant conditions out of the loop, with duplicates
8919 of the loop on both branches (modified according to result of the condition).
8921 @item -ffunction-sections
8922 @itemx -fdata-sections
8923 @opindex ffunction-sections
8924 @opindex fdata-sections
8925 Place each function or data item into its own section in the output
8926 file if the target supports arbitrary sections.  The name of the
8927 function or the name of the data item determines the section's name
8928 in the output file.
8930 Use these options on systems where the linker can perform optimizations
8931 to improve locality of reference in the instruction space.  Most systems
8932 using the ELF object format and SPARC processors running Solaris 2 have
8933 linkers with such optimizations.  AIX may have these optimizations in
8934 the future.
8936 Only use these options when there are significant benefits from doing
8937 so.  When you specify these options, the assembler and linker
8938 create larger object and executable files and are also slower.
8939 You cannot use @code{gprof} on all systems if you
8940 specify this option, and you may have problems with debugging if
8941 you specify both this option and @option{-g}.
8943 @item -fbranch-target-load-optimize
8944 @opindex fbranch-target-load-optimize
8945 Perform branch target register load optimization before prologue / epilogue
8946 threading.
8947 The use of target registers can typically be exposed only during reload,
8948 thus hoisting loads out of loops and doing inter-block scheduling needs
8949 a separate optimization pass.
8951 @item -fbranch-target-load-optimize2
8952 @opindex fbranch-target-load-optimize2
8953 Perform branch target register load optimization after prologue / epilogue
8954 threading.
8956 @item -fbtr-bb-exclusive
8957 @opindex fbtr-bb-exclusive
8958 When performing branch target register load optimization, don't reuse
8959 branch target registers within any basic block.
8961 @item -fstack-protector
8962 @opindex fstack-protector
8963 Emit extra code to check for buffer overflows, such as stack smashing
8964 attacks.  This is done by adding a guard variable to functions with
8965 vulnerable objects.  This includes functions that call @code{alloca}, and
8966 functions with buffers larger than 8 bytes.  The guards are initialized
8967 when a function is entered and then checked when the function exits.
8968 If a guard check fails, an error message is printed and the program exits.
8970 @item -fstack-protector-all
8971 @opindex fstack-protector-all
8972 Like @option{-fstack-protector} except that all functions are protected.
8974 @item -fstack-protector-strong
8975 @opindex fstack-protector-strong
8976 Like @option{-fstack-protector} but includes additional functions to
8977 be protected --- those that have local array definitions, or have
8978 references to local frame addresses.
8980 @item -fsection-anchors
8981 @opindex fsection-anchors
8982 Try to reduce the number of symbolic address calculations by using
8983 shared ``anchor'' symbols to address nearby objects.  This transformation
8984 can help to reduce the number of GOT entries and GOT accesses on some
8985 targets.
8987 For example, the implementation of the following function @code{foo}:
8989 @smallexample
8990 static int a, b, c;
8991 int foo (void) @{ return a + b + c; @}
8992 @end smallexample
8994 @noindent
8995 usually calculates the addresses of all three variables, but if you
8996 compile it with @option{-fsection-anchors}, it accesses the variables
8997 from a common anchor point instead.  The effect is similar to the
8998 following pseudocode (which isn't valid C):
9000 @smallexample
9001 int foo (void)
9003   register int *xr = &x;
9004   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9006 @end smallexample
9008 Not all targets support this option.
9010 @item --param @var{name}=@var{value}
9011 @opindex param
9012 In some places, GCC uses various constants to control the amount of
9013 optimization that is done.  For example, GCC does not inline functions
9014 that contain more than a certain number of instructions.  You can
9015 control some of these constants on the command line using the
9016 @option{--param} option.
9018 The names of specific parameters, and the meaning of the values, are
9019 tied to the internals of the compiler, and are subject to change
9020 without notice in future releases.
9022 In each case, the @var{value} is an integer.  The allowable choices for
9023 @var{name} are:
9025 @table @gcctabopt
9026 @item predictable-branch-outcome
9027 When branch is predicted to be taken with probability lower than this threshold
9028 (in percent), then it is considered well predictable. The default is 10.
9030 @item max-crossjump-edges
9031 The maximum number of incoming edges to consider for cross-jumping.
9032 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9033 the number of edges incoming to each block.  Increasing values mean
9034 more aggressive optimization, making the compilation time increase with
9035 probably small improvement in executable size.
9037 @item min-crossjump-insns
9038 The minimum number of instructions that must be matched at the end
9039 of two blocks before cross-jumping is performed on them.  This
9040 value is ignored in the case where all instructions in the block being
9041 cross-jumped from are matched.  The default value is 5.
9043 @item max-grow-copy-bb-insns
9044 The maximum code size expansion factor when copying basic blocks
9045 instead of jumping.  The expansion is relative to a jump instruction.
9046 The default value is 8.
9048 @item max-goto-duplication-insns
9049 The maximum number of instructions to duplicate to a block that jumps
9050 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9051 passes, GCC factors computed gotos early in the compilation process,
9052 and unfactors them as late as possible.  Only computed jumps at the
9053 end of a basic blocks with no more than max-goto-duplication-insns are
9054 unfactored.  The default value is 8.
9056 @item max-delay-slot-insn-search
9057 The maximum number of instructions to consider when looking for an
9058 instruction to fill a delay slot.  If more than this arbitrary number of
9059 instructions are searched, the time savings from filling the delay slot
9060 are minimal, so stop searching.  Increasing values mean more
9061 aggressive optimization, making the compilation time increase with probably
9062 small improvement in execution time.
9064 @item max-delay-slot-live-search
9065 When trying to fill delay slots, the maximum number of instructions to
9066 consider when searching for a block with valid live register
9067 information.  Increasing this arbitrarily chosen value means more
9068 aggressive optimization, increasing the compilation time.  This parameter
9069 should be removed when the delay slot code is rewritten to maintain the
9070 control-flow graph.
9072 @item max-gcse-memory
9073 The approximate maximum amount of memory that can be allocated in
9074 order to perform the global common subexpression elimination
9075 optimization.  If more memory than specified is required, the
9076 optimization is not done.
9078 @item max-gcse-insertion-ratio
9079 If the ratio of expression insertions to deletions is larger than this value
9080 for any expression, then RTL PRE inserts or removes the expression and thus
9081 leaves partially redundant computations in the instruction stream.  The default value is 20.
9083 @item max-pending-list-length
9084 The maximum number of pending dependencies scheduling allows
9085 before flushing the current state and starting over.  Large functions
9086 with few branches or calls can create excessively large lists which
9087 needlessly consume memory and resources.
9089 @item max-modulo-backtrack-attempts
9090 The maximum number of backtrack attempts the scheduler should make
9091 when modulo scheduling a loop.  Larger values can exponentially increase
9092 compilation time.
9094 @item max-inline-insns-single
9095 Several parameters control the tree inliner used in GCC@.
9096 This number sets the maximum number of instructions (counted in GCC's
9097 internal representation) in a single function that the tree inliner
9098 considers for inlining.  This only affects functions declared
9099 inline and methods implemented in a class declaration (C++).
9100 The default value is 400.
9102 @item max-inline-insns-auto
9103 When you use @option{-finline-functions} (included in @option{-O3}),
9104 a lot of functions that would otherwise not be considered for inlining
9105 by the compiler are investigated.  To those functions, a different
9106 (more restrictive) limit compared to functions declared inline can
9107 be applied.
9108 The default value is 40.
9110 @item inline-min-speedup
9111 When estimated performance improvement of caller + callee runtime exceeds this
9112 threshold (in precent), the function can be inlined regardless the limit on
9113 @option{--param max-inline-insns-single} and @option{--param
9114 max-inline-insns-auto}.
9116 @item large-function-insns
9117 The limit specifying really large functions.  For functions larger than this
9118 limit after inlining, inlining is constrained by
9119 @option{--param large-function-growth}.  This parameter is useful primarily
9120 to avoid extreme compilation time caused by non-linear algorithms used by the
9121 back end.
9122 The default value is 2700.
9124 @item large-function-growth
9125 Specifies maximal growth of large function caused by inlining in percents.
9126 The default value is 100 which limits large function growth to 2.0 times
9127 the original size.
9129 @item large-unit-insns
9130 The limit specifying large translation unit.  Growth caused by inlining of
9131 units larger than this limit is limited by @option{--param inline-unit-growth}.
9132 For small units this might be too tight.
9133 For example, consider a unit consisting of function A
9134 that is inline and B that just calls A three times.  If B is small relative to
9135 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9136 large units consisting of small inlineable functions, however, the overall unit
9137 growth limit is needed to avoid exponential explosion of code size.  Thus for
9138 smaller units, the size is increased to @option{--param large-unit-insns}
9139 before applying @option{--param inline-unit-growth}.  The default is 10000.
9141 @item inline-unit-growth
9142 Specifies maximal overall growth of the compilation unit caused by inlining.
9143 The default value is 30 which limits unit growth to 1.3 times the original
9144 size.
9146 @item ipcp-unit-growth
9147 Specifies maximal overall growth of the compilation unit caused by
9148 interprocedural constant propagation.  The default value is 10 which limits
9149 unit growth to 1.1 times the original size.
9151 @item large-stack-frame
9152 The limit specifying large stack frames.  While inlining the algorithm is trying
9153 to not grow past this limit too much.  The default value is 256 bytes.
9155 @item large-stack-frame-growth
9156 Specifies maximal growth of large stack frames caused by inlining in percents.
9157 The default value is 1000 which limits large stack frame growth to 11 times
9158 the original size.
9160 @item max-inline-insns-recursive
9161 @itemx max-inline-insns-recursive-auto
9162 Specifies the maximum number of instructions an out-of-line copy of a
9163 self-recursive inline
9164 function can grow into by performing recursive inlining.
9166 For functions declared inline, @option{--param max-inline-insns-recursive} is
9167 taken into account.  For functions not declared inline, recursive inlining
9168 happens only when @option{-finline-functions} (included in @option{-O3}) is
9169 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9170 default value is 450.
9172 @item max-inline-recursive-depth
9173 @itemx max-inline-recursive-depth-auto
9174 Specifies the maximum recursion depth used for recursive inlining.
9176 For functions declared inline, @option{--param max-inline-recursive-depth} is
9177 taken into account.  For functions not declared inline, recursive inlining
9178 happens only when @option{-finline-functions} (included in @option{-O3}) is
9179 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9180 default value is 8.
9182 @item min-inline-recursive-probability
9183 Recursive inlining is profitable only for function having deep recursion
9184 in average and can hurt for function having little recursion depth by
9185 increasing the prologue size or complexity of function body to other
9186 optimizers.
9188 When profile feedback is available (see @option{-fprofile-generate}) the actual
9189 recursion depth can be guessed from probability that function recurses via a
9190 given call expression.  This parameter limits inlining only to call expressions
9191 whose probability exceeds the given threshold (in percents).
9192 The default value is 10.
9194 @item early-inlining-insns
9195 Specify growth that the early inliner can make.  In effect it increases
9196 the amount of inlining for code having a large abstraction penalty.
9197 The default value is 10.
9199 @item max-early-inliner-iterations
9200 @itemx max-early-inliner-iterations
9201 Limit of iterations of the early inliner.  This basically bounds
9202 the number of nested indirect calls the early inliner can resolve.
9203 Deeper chains are still handled by late inlining.
9205 @item comdat-sharing-probability
9206 @itemx comdat-sharing-probability
9207 Probability (in percent) that C++ inline function with comdat visibility
9208 are shared across multiple compilation units.  The default value is 20.
9210 @item min-vect-loop-bound
9211 The minimum number of iterations under which loops are not vectorized
9212 when @option{-ftree-vectorize} is used.  The number of iterations after
9213 vectorization needs to be greater than the value specified by this option
9214 to allow vectorization.  The default value is 0.
9216 @item gcse-cost-distance-ratio
9217 Scaling factor in calculation of maximum distance an expression
9218 can be moved by GCSE optimizations.  This is currently supported only in the
9219 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9220 is with simple expressions, i.e., the expressions that have cost
9221 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9222 hoisting of simple expressions.  The default value is 10.
9224 @item gcse-unrestricted-cost
9225 Cost, roughly measured as the cost of a single typical machine
9226 instruction, at which GCSE optimizations do not constrain
9227 the distance an expression can travel.  This is currently
9228 supported only in the code hoisting pass.  The lesser the cost,
9229 the more aggressive code hoisting is.  Specifying 0 
9230 allows all expressions to travel unrestricted distances.
9231 The default value is 3.
9233 @item max-hoist-depth
9234 The depth of search in the dominator tree for expressions to hoist.
9235 This is used to avoid quadratic behavior in hoisting algorithm.
9236 The value of 0 does not limit on the search, but may slow down compilation
9237 of huge functions.  The default value is 30.
9239 @item max-tail-merge-comparisons
9240 The maximum amount of similar bbs to compare a bb with.  This is used to
9241 avoid quadratic behavior in tree tail merging.  The default value is 10.
9243 @item max-tail-merge-iterations
9244 The maximum amount of iterations of the pass over the function.  This is used to
9245 limit compilation time in tree tail merging.  The default value is 2.
9247 @item max-unrolled-insns
9248 The maximum number of instructions that a loop may have to be unrolled.
9249 If a loop is unrolled, this parameter also determines how many times
9250 the loop code is unrolled.
9252 @item max-average-unrolled-insns
9253 The maximum number of instructions biased by probabilities of their execution
9254 that a loop may have to be unrolled.  If a loop is unrolled,
9255 this parameter also determines how many times the loop code is unrolled.
9257 @item max-unroll-times
9258 The maximum number of unrollings of a single loop.
9260 @item max-peeled-insns
9261 The maximum number of instructions that a loop may have to be peeled.
9262 If a loop is peeled, this parameter also determines how many times
9263 the loop code is peeled.
9265 @item max-peel-times
9266 The maximum number of peelings of a single loop.
9268 @item max-peel-branches
9269 The maximum number of branches on the hot path through the peeled sequence.
9271 @item max-completely-peeled-insns
9272 The maximum number of insns of a completely peeled loop.
9274 @item max-completely-peel-times
9275 The maximum number of iterations of a loop to be suitable for complete peeling.
9277 @item max-completely-peel-loop-nest-depth
9278 The maximum depth of a loop nest suitable for complete peeling.
9280 @item max-unswitch-insns
9281 The maximum number of insns of an unswitched loop.
9283 @item max-unswitch-level
9284 The maximum number of branches unswitched in a single loop.
9286 @item lim-expensive
9287 The minimum cost of an expensive expression in the loop invariant motion.
9289 @item iv-consider-all-candidates-bound
9290 Bound on number of candidates for induction variables, below which
9291 all candidates are considered for each use in induction variable
9292 optimizations.  If there are more candidates than this,
9293 only the most relevant ones are considered to avoid quadratic time complexity.
9295 @item iv-max-considered-uses
9296 The induction variable optimizations give up on loops that contain more
9297 induction variable uses.
9299 @item iv-always-prune-cand-set-bound
9300 If the number of candidates in the set is smaller than this value,
9301 always try to remove unnecessary ivs from the set
9302 when adding a new one.
9304 @item scev-max-expr-size
9305 Bound on size of expressions used in the scalar evolutions analyzer.
9306 Large expressions slow the analyzer.
9308 @item scev-max-expr-complexity
9309 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9310 Complex expressions slow the analyzer.
9312 @item omega-max-vars
9313 The maximum number of variables in an Omega constraint system.
9314 The default value is 128.
9316 @item omega-max-geqs
9317 The maximum number of inequalities in an Omega constraint system.
9318 The default value is 256.
9320 @item omega-max-eqs
9321 The maximum number of equalities in an Omega constraint system.
9322 The default value is 128.
9324 @item omega-max-wild-cards
9325 The maximum number of wildcard variables that the Omega solver is
9326 able to insert.  The default value is 18.
9328 @item omega-hash-table-size
9329 The size of the hash table in the Omega solver.  The default value is
9330 550.
9332 @item omega-max-keys
9333 The maximal number of keys used by the Omega solver.  The default
9334 value is 500.
9336 @item omega-eliminate-redundant-constraints
9337 When set to 1, use expensive methods to eliminate all redundant
9338 constraints.  The default value is 0.
9340 @item vect-max-version-for-alignment-checks
9341 The maximum number of run-time checks that can be performed when
9342 doing loop versioning for alignment in the vectorizer.  See option
9343 @option{-ftree-vect-loop-version} for more information.
9345 @item vect-max-version-for-alias-checks
9346 The maximum number of run-time checks that can be performed when
9347 doing loop versioning for alias in the vectorizer.  See option
9348 @option{-ftree-vect-loop-version} for more information.
9350 @item max-iterations-to-track
9351 The maximum number of iterations of a loop the brute-force algorithm
9352 for analysis of the number of iterations of the loop tries to evaluate.
9354 @item hot-bb-count-ws-permille
9355 A basic block profile count is considered hot if it contributes to 
9356 the given permillage (i.e. 0...1000) of the entire profiled execution.
9358 @item hot-bb-frequency-fraction
9359 Select fraction of the entry block frequency of executions of basic block in
9360 function given basic block needs to have to be considered hot.
9362 @item max-predicted-iterations
9363 The maximum number of loop iterations we predict statically.  This is useful
9364 in cases where a function contains a single loop with known bound and
9365 another loop with unknown bound.
9366 The known number of iterations is predicted correctly, while
9367 the unknown number of iterations average to roughly 10.  This means that the
9368 loop without bounds appears artificially cold relative to the other one.
9370 @item align-threshold
9372 Select fraction of the maximal frequency of executions of a basic block in
9373 a function to align the basic block.
9375 @item align-loop-iterations
9377 A loop expected to iterate at least the selected number of iterations is
9378 aligned.
9380 @item tracer-dynamic-coverage
9381 @itemx tracer-dynamic-coverage-feedback
9383 This value is used to limit superblock formation once the given percentage of
9384 executed instructions is covered.  This limits unnecessary code size
9385 expansion.
9387 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9388 feedback is available.  The real profiles (as opposed to statically estimated
9389 ones) are much less balanced allowing the threshold to be larger value.
9391 @item tracer-max-code-growth
9392 Stop tail duplication once code growth has reached given percentage.  This is
9393 a rather artificial limit, as most of the duplicates are eliminated later in
9394 cross jumping, so it may be set to much higher values than is the desired code
9395 growth.
9397 @item tracer-min-branch-ratio
9399 Stop reverse growth when the reverse probability of best edge is less than this
9400 threshold (in percent).
9402 @item tracer-min-branch-ratio
9403 @itemx tracer-min-branch-ratio-feedback
9405 Stop forward growth if the best edge has probability lower than this
9406 threshold.
9408 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9409 compilation for profile feedback and one for compilation without.  The value
9410 for compilation with profile feedback needs to be more conservative (higher) in
9411 order to make tracer effective.
9413 @item max-cse-path-length
9415 The maximum number of basic blocks on path that CSE considers.
9416 The default is 10.
9418 @item max-cse-insns
9419 The maximum number of instructions CSE processes before flushing.
9420 The default is 1000.
9422 @item ggc-min-expand
9424 GCC uses a garbage collector to manage its own memory allocation.  This
9425 parameter specifies the minimum percentage by which the garbage
9426 collector's heap should be allowed to expand between collections.
9427 Tuning this may improve compilation speed; it has no effect on code
9428 generation.
9430 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9431 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9432 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9433 GCC is not able to calculate RAM on a particular platform, the lower
9434 bound of 30% is used.  Setting this parameter and
9435 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9436 every opportunity.  This is extremely slow, but can be useful for
9437 debugging.
9439 @item ggc-min-heapsize
9441 Minimum size of the garbage collector's heap before it begins bothering
9442 to collect garbage.  The first collection occurs after the heap expands
9443 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9444 tuning this may improve compilation speed, and has no effect on code
9445 generation.
9447 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9448 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9449 with a lower bound of 4096 (four megabytes) and an upper bound of
9450 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9451 particular platform, the lower bound is used.  Setting this parameter
9452 very large effectively disables garbage collection.  Setting this
9453 parameter and @option{ggc-min-expand} to zero causes a full collection
9454 to occur at every opportunity.
9456 @item max-reload-search-insns
9457 The maximum number of instruction reload should look backward for equivalent
9458 register.  Increasing values mean more aggressive optimization, making the
9459 compilation time increase with probably slightly better performance.
9460 The default value is 100.
9462 @item max-cselib-memory-locations
9463 The maximum number of memory locations cselib should take into account.
9464 Increasing values mean more aggressive optimization, making the compilation time
9465 increase with probably slightly better performance.  The default value is 500.
9467 @item reorder-blocks-duplicate
9468 @itemx reorder-blocks-duplicate-feedback
9470 Used by the basic block reordering pass to decide whether to use unconditional
9471 branch or duplicate the code on its destination.  Code is duplicated when its
9472 estimated size is smaller than this value multiplied by the estimated size of
9473 unconditional jump in the hot spots of the program.
9475 The @option{reorder-block-duplicate-feedback} is used only when profile
9476 feedback is available.  It may be set to higher values than
9477 @option{reorder-block-duplicate} since information about the hot spots is more
9478 accurate.
9480 @item max-sched-ready-insns
9481 The maximum number of instructions ready to be issued the scheduler should
9482 consider at any given time during the first scheduling pass.  Increasing
9483 values mean more thorough searches, making the compilation time increase
9484 with probably little benefit.  The default value is 100.
9486 @item max-sched-region-blocks
9487 The maximum number of blocks in a region to be considered for
9488 interblock scheduling.  The default value is 10.
9490 @item max-pipeline-region-blocks
9491 The maximum number of blocks in a region to be considered for
9492 pipelining in the selective scheduler.  The default value is 15.
9494 @item max-sched-region-insns
9495 The maximum number of insns in a region to be considered for
9496 interblock scheduling.  The default value is 100.
9498 @item max-pipeline-region-insns
9499 The maximum number of insns in a region to be considered for
9500 pipelining in the selective scheduler.  The default value is 200.
9502 @item min-spec-prob
9503 The minimum probability (in percents) of reaching a source block
9504 for interblock speculative scheduling.  The default value is 40.
9506 @item max-sched-extend-regions-iters
9507 The maximum number of iterations through CFG to extend regions.
9508 A value of 0 (the default) disables region extensions.
9510 @item max-sched-insn-conflict-delay
9511 The maximum conflict delay for an insn to be considered for speculative motion.
9512 The default value is 3.
9514 @item sched-spec-prob-cutoff
9515 The minimal probability of speculation success (in percents), so that
9516 speculative insns are scheduled.
9517 The default value is 40.
9519 @item sched-spec-state-edge-prob-cutoff
9520 The minimum probability an edge must have for the scheduler to save its
9521 state across it.
9522 The default value is 10.
9524 @item sched-mem-true-dep-cost
9525 Minimal distance (in CPU cycles) between store and load targeting same
9526 memory locations.  The default value is 1.
9528 @item selsched-max-lookahead
9529 The maximum size of the lookahead window of selective scheduling.  It is a
9530 depth of search for available instructions.
9531 The default value is 50.
9533 @item selsched-max-sched-times
9534 The maximum number of times that an instruction is scheduled during
9535 selective scheduling.  This is the limit on the number of iterations
9536 through which the instruction may be pipelined.  The default value is 2.
9538 @item selsched-max-insns-to-rename
9539 The maximum number of best instructions in the ready list that are considered
9540 for renaming in the selective scheduler.  The default value is 2.
9542 @item sms-min-sc
9543 The minimum value of stage count that swing modulo scheduler
9544 generates.  The default value is 2.
9546 @item max-last-value-rtl
9547 The maximum size measured as number of RTLs that can be recorded in an expression
9548 in combiner for a pseudo register as last known value of that register.  The default
9549 is 10000.
9551 @item integer-share-limit
9552 Small integer constants can use a shared data structure, reducing the
9553 compiler's memory usage and increasing its speed.  This sets the maximum
9554 value of a shared integer constant.  The default value is 256.
9556 @item ssp-buffer-size
9557 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9558 protection when @option{-fstack-protection} is used.
9560 @item max-jump-thread-duplication-stmts
9561 Maximum number of statements allowed in a block that needs to be
9562 duplicated when threading jumps.
9564 @item max-fields-for-field-sensitive
9565 Maximum number of fields in a structure treated in
9566 a field sensitive manner during pointer analysis.  The default is zero
9567 for @option{-O0} and @option{-O1},
9568 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9570 @item prefetch-latency
9571 Estimate on average number of instructions that are executed before
9572 prefetch finishes.  The distance prefetched ahead is proportional
9573 to this constant.  Increasing this number may also lead to less
9574 streams being prefetched (see @option{simultaneous-prefetches}).
9576 @item simultaneous-prefetches
9577 Maximum number of prefetches that can run at the same time.
9579 @item l1-cache-line-size
9580 The size of cache line in L1 cache, in bytes.
9582 @item l1-cache-size
9583 The size of L1 cache, in kilobytes.
9585 @item l2-cache-size
9586 The size of L2 cache, in kilobytes.
9588 @item min-insn-to-prefetch-ratio
9589 The minimum ratio between the number of instructions and the
9590 number of prefetches to enable prefetching in a loop.
9592 @item prefetch-min-insn-to-mem-ratio
9593 The minimum ratio between the number of instructions and the
9594 number of memory references to enable prefetching in a loop.
9596 @item use-canonical-types
9597 Whether the compiler should use the ``canonical'' type system.  By
9598 default, this should always be 1, which uses a more efficient internal
9599 mechanism for comparing types in C++ and Objective-C++.  However, if
9600 bugs in the canonical type system are causing compilation failures,
9601 set this value to 0 to disable canonical types.
9603 @item switch-conversion-max-branch-ratio
9604 Switch initialization conversion refuses to create arrays that are
9605 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9606 branches in the switch.
9608 @item max-partial-antic-length
9609 Maximum length of the partial antic set computed during the tree
9610 partial redundancy elimination optimization (@option{-ftree-pre}) when
9611 optimizing at @option{-O3} and above.  For some sorts of source code
9612 the enhanced partial redundancy elimination optimization can run away,
9613 consuming all of the memory available on the host machine.  This
9614 parameter sets a limit on the length of the sets that are computed,
9615 which prevents the runaway behavior.  Setting a value of 0 for
9616 this parameter allows an unlimited set length.
9618 @item sccvn-max-scc-size
9619 Maximum size of a strongly connected component (SCC) during SCCVN
9620 processing.  If this limit is hit, SCCVN processing for the whole
9621 function is not done and optimizations depending on it are
9622 disabled.  The default maximum SCC size is 10000.
9624 @item sccvn-max-alias-queries-per-access
9625 Maximum number of alias-oracle queries we perform when looking for
9626 redundancies for loads and stores.  If this limit is hit the search
9627 is aborted and the load or store is not considered redundant.  The
9628 number of queries is algorithmically limited to the number of
9629 stores on all paths from the load to the function entry.
9630 The default maxmimum number of queries is 1000.
9632 @item ira-max-loops-num
9633 IRA uses regional register allocation by default.  If a function
9634 contains more loops than the number given by this parameter, only at most
9635 the given number of the most frequently-executed loops form regions
9636 for regional register allocation.  The default value of the
9637 parameter is 100.
9639 @item ira-max-conflict-table-size 
9640 Although IRA uses a sophisticated algorithm to compress the conflict
9641 table, the table can still require excessive amounts of memory for
9642 huge functions.  If the conflict table for a function could be more
9643 than the size in MB given by this parameter, the register allocator
9644 instead uses a faster, simpler, and lower-quality
9645 algorithm that does not require building a pseudo-register conflict table.  
9646 The default value of the parameter is 2000.
9648 @item ira-loop-reserved-regs
9649 IRA can be used to evaluate more accurate register pressure in loops
9650 for decisions to move loop invariants (see @option{-O3}).  The number
9651 of available registers reserved for some other purposes is given
9652 by this parameter.  The default value of the parameter is 2, which is
9653 the minimal number of registers needed by typical instructions.
9654 This value is the best found from numerous experiments.
9656 @item loop-invariant-max-bbs-in-loop
9657 Loop invariant motion can be very expensive, both in compilation time and
9658 in amount of needed compile-time memory, with very large loops.  Loops
9659 with more basic blocks than this parameter won't have loop invariant
9660 motion optimization performed on them.  The default value of the
9661 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9663 @item loop-max-datarefs-for-datadeps
9664 Building data dapendencies is expensive for very large loops.  This
9665 parameter limits the number of data references in loops that are
9666 considered for data dependence analysis.  These large loops are no
9667 handled by the optimizations using loop data dependencies.
9668 The default value is 1000.
9670 @item max-vartrack-size
9671 Sets a maximum number of hash table slots to use during variable
9672 tracking dataflow analysis of any function.  If this limit is exceeded
9673 with variable tracking at assignments enabled, analysis for that
9674 function is retried without it, after removing all debug insns from
9675 the function.  If the limit is exceeded even without debug insns, var
9676 tracking analysis is completely disabled for the function.  Setting
9677 the parameter to zero makes it unlimited.
9679 @item max-vartrack-expr-depth
9680 Sets a maximum number of recursion levels when attempting to map
9681 variable names or debug temporaries to value expressions.  This trades
9682 compilation time for more complete debug information.  If this is set too
9683 low, value expressions that are available and could be represented in
9684 debug information may end up not being used; setting this higher may
9685 enable the compiler to find more complex debug expressions, but compile
9686 time and memory use may grow.  The default is 12.
9688 @item min-nondebug-insn-uid
9689 Use uids starting at this parameter for nondebug insns.  The range below
9690 the parameter is reserved exclusively for debug insns created by
9691 @option{-fvar-tracking-assignments}, but debug insns may get
9692 (non-overlapping) uids above it if the reserved range is exhausted.
9694 @item ipa-sra-ptr-growth-factor
9695 IPA-SRA replaces a pointer to an aggregate with one or more new
9696 parameters only when their cumulative size is less or equal to
9697 @option{ipa-sra-ptr-growth-factor} times the size of the original
9698 pointer parameter.
9700 @item tm-max-aggregate-size
9701 When making copies of thread-local variables in a transaction, this
9702 parameter specifies the size in bytes after which variables are
9703 saved with the logging functions as opposed to save/restore code
9704 sequence pairs.  This option only applies when using
9705 @option{-fgnu-tm}.
9707 @item graphite-max-nb-scop-params
9708 To avoid exponential effects in the Graphite loop transforms, the
9709 number of parameters in a Static Control Part (SCoP) is bounded.  The
9710 default value is 10 parameters.  A variable whose value is unknown at
9711 compilation time and defined outside a SCoP is a parameter of the SCoP.
9713 @item graphite-max-bbs-per-function
9714 To avoid exponential effects in the detection of SCoPs, the size of
9715 the functions analyzed by Graphite is bounded.  The default value is
9716 100 basic blocks.
9718 @item loop-block-tile-size
9719 Loop blocking or strip mining transforms, enabled with
9720 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9721 loop in the loop nest by a given number of iterations.  The strip
9722 length can be changed using the @option{loop-block-tile-size}
9723 parameter.  The default value is 51 iterations.
9725 @item ipa-cp-value-list-size
9726 IPA-CP attempts to track all possible values and types passed to a function's
9727 parameter in order to propagate them and perform devirtualization.
9728 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9729 stores per one formal parameter of a function.
9731 @item lto-partitions
9732 Specify desired number of partitions produced during WHOPR compilation.
9733 The number of partitions should exceed the number of CPUs used for compilation.
9734 The default value is 32.
9736 @item lto-minpartition
9737 Size of minimal partition for WHOPR (in estimated instructions).
9738 This prevents expenses of splitting very small programs into too many
9739 partitions.
9741 @item cxx-max-namespaces-for-diagnostic-help
9742 The maximum number of namespaces to consult for suggestions when C++
9743 name lookup fails for an identifier.  The default is 1000.
9745 @item sink-frequency-threshold
9746 The maximum relative execution frequency (in percents) of the target block
9747 relative to a statement's original block to allow statement sinking of a
9748 statement.  Larger numbers result in more aggressive statement sinking.
9749 The default value is 75.  A small positive adjustment is applied for
9750 statements with memory operands as those are even more profitable so sink.
9752 @item max-stores-to-sink
9753 The maximum number of conditional stores paires that can be sunk.  Set to 0
9754 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9755 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9757 @item allow-load-data-races
9758 Allow optimizers to introduce new data races on loads.
9759 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9760 unless implicitly set by the @option{-fmemory-model=} option.
9762 @item allow-store-data-races
9763 Allow optimizers to introduce new data races on stores.
9764 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9765 unless implicitly set by the @option{-fmemory-model=} option.
9767 @item allow-packed-load-data-races
9768 Allow optimizers to introduce new data races on packed data loads.
9769 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9770 unless implicitly set by the @option{-fmemory-model=} option.
9772 @item allow-packed-store-data-races
9773 Allow optimizers to introduce new data races on packed data stores.
9774 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9775 unless implicitly set by the @option{-fmemory-model=} option.
9777 @item case-values-threshold
9778 The smallest number of different values for which it is best to use a
9779 jump-table instead of a tree of conditional branches.  If the value is
9780 0, use the default for the machine.  The default is 0.
9782 @item tree-reassoc-width
9783 Set the maximum number of instructions executed in parallel in
9784 reassociated tree. This parameter overrides target dependent
9785 heuristics used by default if has non zero value.
9787 @item sched-pressure-algorithm
9788 Choose between the two available implementations of
9789 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9790 and is the more likely to prevent instructions from being reordered.
9791 Algorithm 2 was designed to be a compromise between the relatively
9792 conservative approach taken by algorithm 1 and the rather aggressive
9793 approach taken by the default scheduler.  It relies more heavily on
9794 having a regular register file and accurate register pressure classes.
9795 See @file{haifa-sched.c} in the GCC sources for more details.
9797 The default choice depends on the target.
9799 @item max-slsr-cand-scan
9800 Set the maximum number of existing candidates that will be considered when
9801 seeking a basis for a new straight-line strength reduction candidate.
9803 @end table
9804 @end table
9806 @node Preprocessor Options
9807 @section Options Controlling the Preprocessor
9808 @cindex preprocessor options
9809 @cindex options, preprocessor
9811 These options control the C preprocessor, which is run on each C source
9812 file before actual compilation.
9814 If you use the @option{-E} option, nothing is done except preprocessing.
9815 Some of these options make sense only together with @option{-E} because
9816 they cause the preprocessor output to be unsuitable for actual
9817 compilation.
9819 @table @gcctabopt
9820 @item -Wp,@var{option}
9821 @opindex Wp
9822 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9823 and pass @var{option} directly through to the preprocessor.  If
9824 @var{option} contains commas, it is split into multiple options at the
9825 commas.  However, many options are modified, translated or interpreted
9826 by the compiler driver before being passed to the preprocessor, and
9827 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9828 interface is undocumented and subject to change, so whenever possible
9829 you should avoid using @option{-Wp} and let the driver handle the
9830 options instead.
9832 @item -Xpreprocessor @var{option}
9833 @opindex Xpreprocessor
9834 Pass @var{option} as an option to the preprocessor.  You can use this to
9835 supply system-specific preprocessor options that GCC does not 
9836 recognize.
9838 If you want to pass an option that takes an argument, you must use
9839 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9841 @item -no-integrated-cpp
9842 @opindex no-integrated-cpp
9843 Perform preprocessing as a separate pass before compilation.
9844 By default, GCC performs preprocessing as an integrated part of
9845 input tokenization and parsing.
9846 If this option is provided, the appropriate language front end
9847 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9848 and Objective-C, respectively) is instead invoked twice,
9849 once for preprocessing only and once for actual compilation
9850 of the preprocessed input.
9851 This option may be useful in conjunction with the @option{-B} or
9852 @option{-wrapper} options to specify an alternate preprocessor or
9853 perform additional processing of the program source between
9854 normal preprocessing and compilation.
9855 @end table
9857 @include cppopts.texi
9859 @node Assembler Options
9860 @section Passing Options to the Assembler
9862 @c prevent bad page break with this line
9863 You can pass options to the assembler.
9865 @table @gcctabopt
9866 @item -Wa,@var{option}
9867 @opindex Wa
9868 Pass @var{option} as an option to the assembler.  If @var{option}
9869 contains commas, it is split into multiple options at the commas.
9871 @item -Xassembler @var{option}
9872 @opindex Xassembler
9873 Pass @var{option} as an option to the assembler.  You can use this to
9874 supply system-specific assembler options that GCC does not
9875 recognize.
9877 If you want to pass an option that takes an argument, you must use
9878 @option{-Xassembler} twice, once for the option and once for the argument.
9880 @end table
9882 @node Link Options
9883 @section Options for Linking
9884 @cindex link options
9885 @cindex options, linking
9887 These options come into play when the compiler links object files into
9888 an executable output file.  They are meaningless if the compiler is
9889 not doing a link step.
9891 @table @gcctabopt
9892 @cindex file names
9893 @item @var{object-file-name}
9894 A file name that does not end in a special recognized suffix is
9895 considered to name an object file or library.  (Object files are
9896 distinguished from libraries by the linker according to the file
9897 contents.)  If linking is done, these object files are used as input
9898 to the linker.
9900 @item -c
9901 @itemx -S
9902 @itemx -E
9903 @opindex c
9904 @opindex S
9905 @opindex E
9906 If any of these options is used, then the linker is not run, and
9907 object file names should not be used as arguments.  @xref{Overall
9908 Options}.
9910 @cindex Libraries
9911 @item -l@var{library}
9912 @itemx -l @var{library}
9913 @opindex l
9914 Search the library named @var{library} when linking.  (The second
9915 alternative with the library as a separate argument is only for
9916 POSIX compliance and is not recommended.)
9918 It makes a difference where in the command you write this option; the
9919 linker searches and processes libraries and object files in the order they
9920 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9921 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9922 to functions in @samp{z}, those functions may not be loaded.
9924 The linker searches a standard list of directories for the library,
9925 which is actually a file named @file{lib@var{library}.a}.  The linker
9926 then uses this file as if it had been specified precisely by name.
9928 The directories searched include several standard system directories
9929 plus any that you specify with @option{-L}.
9931 Normally the files found this way are library files---archive files
9932 whose members are object files.  The linker handles an archive file by
9933 scanning through it for members which define symbols that have so far
9934 been referenced but not defined.  But if the file that is found is an
9935 ordinary object file, it is linked in the usual fashion.  The only
9936 difference between using an @option{-l} option and specifying a file name
9937 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9938 and searches several directories.
9940 @item -lobjc
9941 @opindex lobjc
9942 You need this special case of the @option{-l} option in order to
9943 link an Objective-C or Objective-C++ program.
9945 @item -nostartfiles
9946 @opindex nostartfiles
9947 Do not use the standard system startup files when linking.
9948 The standard system libraries are used normally, unless @option{-nostdlib}
9949 or @option{-nodefaultlibs} is used.
9951 @item -nodefaultlibs
9952 @opindex nodefaultlibs
9953 Do not use the standard system libraries when linking.
9954 Only the libraries you specify are passed to the linker, and options
9955 specifying linkage of the system libraries, such as @code{-static-libgcc}
9956 or @code{-shared-libgcc}, are ignored.  
9957 The standard startup files are used normally, unless @option{-nostartfiles}
9958 is used.  
9960 The compiler may generate calls to @code{memcmp},
9961 @code{memset}, @code{memcpy} and @code{memmove}.
9962 These entries are usually resolved by entries in
9963 libc.  These entry points should be supplied through some other
9964 mechanism when this option is specified.
9966 @item -nostdlib
9967 @opindex nostdlib
9968 Do not use the standard system startup files or libraries when linking.
9969 No startup files and only the libraries you specify are passed to
9970 the linker, and options specifying linkage of the system libraries, such as
9971 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
9973 The compiler may generate calls to @code{memcmp}, @code{memset},
9974 @code{memcpy} and @code{memmove}.
9975 These entries are usually resolved by entries in
9976 libc.  These entry points should be supplied through some other
9977 mechanism when this option is specified.
9979 @cindex @option{-lgcc}, use with @option{-nostdlib}
9980 @cindex @option{-nostdlib} and unresolved references
9981 @cindex unresolved references and @option{-nostdlib}
9982 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9983 @cindex @option{-nodefaultlibs} and unresolved references
9984 @cindex unresolved references and @option{-nodefaultlibs}
9985 One of the standard libraries bypassed by @option{-nostdlib} and
9986 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9987 which GCC uses to overcome shortcomings of particular machines, or special
9988 needs for some languages.
9989 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9990 Collection (GCC) Internals},
9991 for more discussion of @file{libgcc.a}.)
9992 In most cases, you need @file{libgcc.a} even when you want to avoid
9993 other standard libraries.  In other words, when you specify @option{-nostdlib}
9994 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9995 This ensures that you have no unresolved references to internal GCC
9996 library subroutines.
9997 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
9998 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
9999 GNU Compiler Collection (GCC) Internals}.)
10001 @item -pie
10002 @opindex pie
10003 Produce a position independent executable on targets that support it.
10004 For predictable results, you must also specify the same set of options
10005 used for compilation (@option{-fpie}, @option{-fPIE},
10006 or model suboptions) when you specify this linker option.
10008 @item -rdynamic
10009 @opindex rdynamic
10010 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10011 that support it. This instructs the linker to add all symbols, not
10012 only used ones, to the dynamic symbol table. This option is needed
10013 for some uses of @code{dlopen} or to allow obtaining backtraces
10014 from within a program.
10016 @item -s
10017 @opindex s
10018 Remove all symbol table and relocation information from the executable.
10020 @item -static
10021 @opindex static
10022 On systems that support dynamic linking, this prevents linking with the shared
10023 libraries.  On other systems, this option has no effect.
10025 @item -shared
10026 @opindex shared
10027 Produce a shared object which can then be linked with other objects to
10028 form an executable.  Not all systems support this option.  For predictable
10029 results, you must also specify the same set of options used for compilation
10030 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10031 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10032 needs to build supplementary stub code for constructors to work.  On
10033 multi-libbed systems, @samp{gcc -shared} must select the correct support
10034 libraries to link against.  Failing to supply the correct flags may lead
10035 to subtle defects.  Supplying them in cases where they are not necessary
10036 is innocuous.}
10038 @item -shared-libgcc
10039 @itemx -static-libgcc
10040 @opindex shared-libgcc
10041 @opindex static-libgcc
10042 On systems that provide @file{libgcc} as a shared library, these options
10043 force the use of either the shared or static version, respectively.
10044 If no shared version of @file{libgcc} was built when the compiler was
10045 configured, these options have no effect.
10047 There are several situations in which an application should use the
10048 shared @file{libgcc} instead of the static version.  The most common
10049 of these is when the application wishes to throw and catch exceptions
10050 across different shared libraries.  In that case, each of the libraries
10051 as well as the application itself should use the shared @file{libgcc}.
10053 Therefore, the G++ and GCJ drivers automatically add
10054 @option{-shared-libgcc} whenever you build a shared library or a main
10055 executable, because C++ and Java programs typically use exceptions, so
10056 this is the right thing to do.
10058 If, instead, you use the GCC driver to create shared libraries, you may
10059 find that they are not always linked with the shared @file{libgcc}.
10060 If GCC finds, at its configuration time, that you have a non-GNU linker
10061 or a GNU linker that does not support option @option{--eh-frame-hdr},
10062 it links the shared version of @file{libgcc} into shared libraries
10063 by default.  Otherwise, it takes advantage of the linker and optimizes
10064 away the linking with the shared version of @file{libgcc}, linking with
10065 the static version of libgcc by default.  This allows exceptions to
10066 propagate through such shared libraries, without incurring relocation
10067 costs at library load time.
10069 However, if a library or main executable is supposed to throw or catch
10070 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10071 for the languages used in the program, or using the option
10072 @option{-shared-libgcc}, such that it is linked with the shared
10073 @file{libgcc}.
10075 @item -static-libasan
10076 When the @option{-fsanitize=address} option is used to link a program,
10077 the GCC driver automatically links against @option{libasan}.  If
10078 @file{libasan} is available as a shared library, and the @option{-static}
10079 option is not used, then this links against the shared version of
10080 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10081 driver to link @file{libasan} statically, without necessarily linking
10082 other libraries statically.
10084 @item -static-libtsan
10085 When the @option{-fsanitize=thread} option is used to link a program,
10086 the GCC driver automatically links against @option{libtsan}.  If
10087 @file{libtsan} is available as a shared library, and the @option{-static}
10088 option is not used, then this links against the shared version of
10089 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10090 driver to link @file{libtsan} statically, without necessarily linking
10091 other libraries statically.
10093 @item -static-libstdc++
10094 When the @command{g++} program is used to link a C++ program, it
10095 normally automatically links against @option{libstdc++}.  If
10096 @file{libstdc++} is available as a shared library, and the
10097 @option{-static} option is not used, then this links against the
10098 shared version of @file{libstdc++}.  That is normally fine.  However, it
10099 is sometimes useful to freeze the version of @file{libstdc++} used by
10100 the program without going all the way to a fully static link.  The
10101 @option{-static-libstdc++} option directs the @command{g++} driver to
10102 link @file{libstdc++} statically, without necessarily linking other
10103 libraries statically.
10105 @item -symbolic
10106 @opindex symbolic
10107 Bind references to global symbols when building a shared object.  Warn
10108 about any unresolved references (unless overridden by the link editor
10109 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10110 this option.
10112 @item -T @var{script}
10113 @opindex T
10114 @cindex linker script
10115 Use @var{script} as the linker script.  This option is supported by most
10116 systems using the GNU linker.  On some targets, such as bare-board
10117 targets without an operating system, the @option{-T} option may be required
10118 when linking to avoid references to undefined symbols.
10120 @item -Xlinker @var{option}
10121 @opindex Xlinker
10122 Pass @var{option} as an option to the linker.  You can use this to
10123 supply system-specific linker options that GCC does not recognize.
10125 If you want to pass an option that takes a separate argument, you must use
10126 @option{-Xlinker} twice, once for the option and once for the argument.
10127 For example, to pass @option{-assert definitions}, you must write
10128 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10129 @option{-Xlinker "-assert definitions"}, because this passes the entire
10130 string as a single argument, which is not what the linker expects.
10132 When using the GNU linker, it is usually more convenient to pass
10133 arguments to linker options using the @option{@var{option}=@var{value}}
10134 syntax than as separate arguments.  For example, you can specify
10135 @option{-Xlinker -Map=output.map} rather than
10136 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10137 this syntax for command-line options.
10139 @item -Wl,@var{option}
10140 @opindex Wl
10141 Pass @var{option} as an option to the linker.  If @var{option} contains
10142 commas, it is split into multiple options at the commas.  You can use this
10143 syntax to pass an argument to the option.
10144 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10145 linker.  When using the GNU linker, you can also get the same effect with
10146 @option{-Wl,-Map=output.map}.
10148 @item -u @var{symbol}
10149 @opindex u
10150 Pretend the symbol @var{symbol} is undefined, to force linking of
10151 library modules to define it.  You can use @option{-u} multiple times with
10152 different symbols to force loading of additional library modules.
10153 @end table
10155 @node Directory Options
10156 @section Options for Directory Search
10157 @cindex directory options
10158 @cindex options, directory search
10159 @cindex search path
10161 These options specify directories to search for header files, for
10162 libraries and for parts of the compiler:
10164 @table @gcctabopt
10165 @item -I@var{dir}
10166 @opindex I
10167 Add the directory @var{dir} to the head of the list of directories to be
10168 searched for header files.  This can be used to override a system header
10169 file, substituting your own version, since these directories are
10170 searched before the system header file directories.  However, you should
10171 not use this option to add directories that contain vendor-supplied
10172 system header files (use @option{-isystem} for that).  If you use more than
10173 one @option{-I} option, the directories are scanned in left-to-right
10174 order; the standard system directories come after.
10176 If a standard system include directory, or a directory specified with
10177 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10178 option is ignored.  The directory is still searched but as a
10179 system directory at its normal position in the system include chain.
10180 This is to ensure that GCC's procedure to fix buggy system headers and
10181 the ordering for the @code{include_next} directive are not inadvertently changed.
10182 If you really need to change the search order for system directories,
10183 use the @option{-nostdinc} and/or @option{-isystem} options.
10185 @item -iplugindir=@var{dir}
10186 Set the directory to search for plugins that are passed
10187 by @option{-fplugin=@var{name}} instead of
10188 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10189 to be used by the user, but only passed by the driver.
10191 @item -iquote@var{dir}
10192 @opindex iquote
10193 Add the directory @var{dir} to the head of the list of directories to
10194 be searched for header files only for the case of @samp{#include
10195 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10196 otherwise just like @option{-I}.
10198 @item -L@var{dir}
10199 @opindex L
10200 Add directory @var{dir} to the list of directories to be searched
10201 for @option{-l}.
10203 @item -B@var{prefix}
10204 @opindex B
10205 This option specifies where to find the executables, libraries,
10206 include files, and data files of the compiler itself.
10208 The compiler driver program runs one or more of the subprograms
10209 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10210 @var{prefix} as a prefix for each program it tries to run, both with and
10211 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10213 For each subprogram to be run, the compiler driver first tries the
10214 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10215 is not specified, the driver tries two standard prefixes, 
10216 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10217 those results in a file name that is found, the unmodified program
10218 name is searched for using the directories specified in your
10219 @env{PATH} environment variable.
10221 The compiler checks to see if the path provided by the @option{-B}
10222 refers to a directory, and if necessary it adds a directory
10223 separator character at the end of the path.
10225 @option{-B} prefixes that effectively specify directory names also apply
10226 to libraries in the linker, because the compiler translates these
10227 options into @option{-L} options for the linker.  They also apply to
10228 includes files in the preprocessor, because the compiler translates these
10229 options into @option{-isystem} options for the preprocessor.  In this case,
10230 the compiler appends @samp{include} to the prefix.
10232 The runtime support file @file{libgcc.a} can also be searched for using
10233 the @option{-B} prefix, if needed.  If it is not found there, the two
10234 standard prefixes above are tried, and that is all.  The file is left
10235 out of the link if it is not found by those means.
10237 Another way to specify a prefix much like the @option{-B} prefix is to use
10238 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10239 Variables}.
10241 As a special kludge, if the path provided by @option{-B} is
10242 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10243 9, then it is replaced by @file{[dir/]include}.  This is to help
10244 with boot-strapping the compiler.
10246 @item -specs=@var{file}
10247 @opindex specs
10248 Process @var{file} after the compiler reads in the standard @file{specs}
10249 file, in order to override the defaults which the @command{gcc} driver
10250 program uses when determining what switches to pass to @command{cc1},
10251 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10252 @option{-specs=@var{file}} can be specified on the command line, and they
10253 are processed in order, from left to right.
10255 @item --sysroot=@var{dir}
10256 @opindex sysroot
10257 Use @var{dir} as the logical root directory for headers and libraries.
10258 For example, if the compiler normally searches for headers in
10259 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10260 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10262 If you use both this option and the @option{-isysroot} option, then
10263 the @option{--sysroot} option applies to libraries, but the
10264 @option{-isysroot} option applies to header files.
10266 The GNU linker (beginning with version 2.16) has the necessary support
10267 for this option.  If your linker does not support this option, the
10268 header file aspect of @option{--sysroot} still works, but the
10269 library aspect does not.
10271 @item --no-sysroot-suffix
10272 @opindex no-sysroot-suffix
10273 For some targets, a suffix is added to the root directory specified
10274 with @option{--sysroot}, depending on the other options used, so that
10275 headers may for example be found in
10276 @file{@var{dir}/@var{suffix}/usr/include} instead of
10277 @file{@var{dir}/usr/include}.  This option disables the addition of
10278 such a suffix.
10280 @item -I-
10281 @opindex I-
10282 This option has been deprecated.  Please use @option{-iquote} instead for
10283 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10284 Any directories you specify with @option{-I} options before the @option{-I-}
10285 option are searched only for the case of @samp{#include "@var{file}"};
10286 they are not searched for @samp{#include <@var{file}>}.
10288 If additional directories are specified with @option{-I} options after
10289 the @option{-I-}, these directories are searched for all @samp{#include}
10290 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10291 this way.)
10293 In addition, the @option{-I-} option inhibits the use of the current
10294 directory (where the current input file came from) as the first search
10295 directory for @samp{#include "@var{file}"}.  There is no way to
10296 override this effect of @option{-I-}.  With @option{-I.} you can specify
10297 searching the directory that is current when the compiler is
10298 invoked.  That is not exactly the same as what the preprocessor does
10299 by default, but it is often satisfactory.
10301 @option{-I-} does not inhibit the use of the standard system directories
10302 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10303 independent.
10304 @end table
10306 @c man end
10308 @node Spec Files
10309 @section Specifying subprocesses and the switches to pass to them
10310 @cindex Spec Files
10312 @command{gcc} is a driver program.  It performs its job by invoking a
10313 sequence of other programs to do the work of compiling, assembling and
10314 linking.  GCC interprets its command-line parameters and uses these to
10315 deduce which programs it should invoke, and which command-line options
10316 it ought to place on their command lines.  This behavior is controlled
10317 by @dfn{spec strings}.  In most cases there is one spec string for each
10318 program that GCC can invoke, but a few programs have multiple spec
10319 strings to control their behavior.  The spec strings built into GCC can
10320 be overridden by using the @option{-specs=} command-line switch to specify
10321 a spec file.
10323 @dfn{Spec files} are plaintext files that are used to construct spec
10324 strings.  They consist of a sequence of directives separated by blank
10325 lines.  The type of directive is determined by the first non-whitespace
10326 character on the line, which can be one of the following:
10328 @table @code
10329 @item %@var{command}
10330 Issues a @var{command} to the spec file processor.  The commands that can
10331 appear here are:
10333 @table @code
10334 @item %include <@var{file}>
10335 @cindex @code{%include}
10336 Search for @var{file} and insert its text at the current point in the
10337 specs file.
10339 @item %include_noerr <@var{file}>
10340 @cindex @code{%include_noerr}
10341 Just like @samp{%include}, but do not generate an error message if the include
10342 file cannot be found.
10344 @item %rename @var{old_name} @var{new_name}
10345 @cindex @code{%rename}
10346 Rename the spec string @var{old_name} to @var{new_name}.
10348 @end table
10350 @item *[@var{spec_name}]:
10351 This tells the compiler to create, override or delete the named spec
10352 string.  All lines after this directive up to the next directive or
10353 blank line are considered to be the text for the spec string.  If this
10354 results in an empty string then the spec is deleted.  (Or, if the
10355 spec did not exist, then nothing happens.)  Otherwise, if the spec
10356 does not currently exist a new spec is created.  If the spec does
10357 exist then its contents are overridden by the text of this
10358 directive, unless the first character of that text is the @samp{+}
10359 character, in which case the text is appended to the spec.
10361 @item [@var{suffix}]:
10362 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10363 and up to the next directive or blank line are considered to make up the
10364 spec string for the indicated suffix.  When the compiler encounters an
10365 input file with the named suffix, it processes the spec string in
10366 order to work out how to compile that file.  For example:
10368 @smallexample
10369 .ZZ:
10370 z-compile -input %i
10371 @end smallexample
10373 This says that any input file whose name ends in @samp{.ZZ} should be
10374 passed to the program @samp{z-compile}, which should be invoked with the
10375 command-line switch @option{-input} and with the result of performing the
10376 @samp{%i} substitution.  (See below.)
10378 As an alternative to providing a spec string, the text following a
10379 suffix directive can be one of the following:
10381 @table @code
10382 @item @@@var{language}
10383 This says that the suffix is an alias for a known @var{language}.  This is
10384 similar to using the @option{-x} command-line switch to GCC to specify a
10385 language explicitly.  For example:
10387 @smallexample
10388 .ZZ:
10389 @@c++
10390 @end smallexample
10392 Says that .ZZ files are, in fact, C++ source files.
10394 @item #@var{name}
10395 This causes an error messages saying:
10397 @smallexample
10398 @var{name} compiler not installed on this system.
10399 @end smallexample
10400 @end table
10402 GCC already has an extensive list of suffixes built into it.
10403 This directive adds an entry to the end of the list of suffixes, but
10404 since the list is searched from the end backwards, it is effectively
10405 possible to override earlier entries using this technique.
10407 @end table
10409 GCC has the following spec strings built into it.  Spec files can
10410 override these strings or create their own.  Note that individual
10411 targets can also add their own spec strings to this list.
10413 @smallexample
10414 asm          Options to pass to the assembler
10415 asm_final    Options to pass to the assembler post-processor
10416 cpp          Options to pass to the C preprocessor
10417 cc1          Options to pass to the C compiler
10418 cc1plus      Options to pass to the C++ compiler
10419 endfile      Object files to include at the end of the link
10420 link         Options to pass to the linker
10421 lib          Libraries to include on the command line to the linker
10422 libgcc       Decides which GCC support library to pass to the linker
10423 linker       Sets the name of the linker
10424 predefines   Defines to be passed to the C preprocessor
10425 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10426              by default
10427 startfile    Object files to include at the start of the link
10428 @end smallexample
10430 Here is a small example of a spec file:
10432 @smallexample
10433 %rename lib                 old_lib
10435 *lib:
10436 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10437 @end smallexample
10439 This example renames the spec called @samp{lib} to @samp{old_lib} and
10440 then overrides the previous definition of @samp{lib} with a new one.
10441 The new definition adds in some extra command-line options before
10442 including the text of the old definition.
10444 @dfn{Spec strings} are a list of command-line options to be passed to their
10445 corresponding program.  In addition, the spec strings can contain
10446 @samp{%}-prefixed sequences to substitute variable text or to
10447 conditionally insert text into the command line.  Using these constructs
10448 it is possible to generate quite complex command lines.
10450 Here is a table of all defined @samp{%}-sequences for spec
10451 strings.  Note that spaces are not generated automatically around the
10452 results of expanding these sequences.  Therefore you can concatenate them
10453 together or combine them with constant text in a single argument.
10455 @table @code
10456 @item %%
10457 Substitute one @samp{%} into the program name or argument.
10459 @item %i
10460 Substitute the name of the input file being processed.
10462 @item %b
10463 Substitute the basename of the input file being processed.
10464 This is the substring up to (and not including) the last period
10465 and not including the directory.
10467 @item %B
10468 This is the same as @samp{%b}, but include the file suffix (text after
10469 the last period).
10471 @item %d
10472 Marks the argument containing or following the @samp{%d} as a
10473 temporary file name, so that that file is deleted if GCC exits
10474 successfully.  Unlike @samp{%g}, this contributes no text to the
10475 argument.
10477 @item %g@var{suffix}
10478 Substitute a file name that has suffix @var{suffix} and is chosen
10479 once per compilation, and mark the argument in the same way as
10480 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10481 name is now chosen in a way that is hard to predict even when previously
10482 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10483 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10484 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10485 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10486 was simply substituted with a file name chosen once per compilation,
10487 without regard to any appended suffix (which was therefore treated
10488 just like ordinary text), making such attacks more likely to succeed.
10490 @item %u@var{suffix}
10491 Like @samp{%g}, but generates a new temporary file name
10492 each time it appears instead of once per compilation.
10494 @item %U@var{suffix}
10495 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10496 new one if there is no such last file name.  In the absence of any
10497 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10498 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10499 involves the generation of two distinct file names, one
10500 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10501 simply substituted with a file name chosen for the previous @samp{%u},
10502 without regard to any appended suffix.
10504 @item %j@var{suffix}
10505 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10506 writable, and if @option{-save-temps} is not used; 
10507 otherwise, substitute the name
10508 of a temporary file, just like @samp{%u}.  This temporary file is not
10509 meant for communication between processes, but rather as a junk
10510 disposal mechanism.
10512 @item %|@var{suffix}
10513 @itemx %m@var{suffix}
10514 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10515 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10516 all.  These are the two most common ways to instruct a program that it
10517 should read from standard input or write to standard output.  If you
10518 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10519 construct: see for example @file{f/lang-specs.h}.
10521 @item %.@var{SUFFIX}
10522 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10523 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10524 terminated by the next space or %.
10526 @item %w
10527 Marks the argument containing or following the @samp{%w} as the
10528 designated output file of this compilation.  This puts the argument
10529 into the sequence of arguments that @samp{%o} substitutes.
10531 @item %o
10532 Substitutes the names of all the output files, with spaces
10533 automatically placed around them.  You should write spaces
10534 around the @samp{%o} as well or the results are undefined.
10535 @samp{%o} is for use in the specs for running the linker.
10536 Input files whose names have no recognized suffix are not compiled
10537 at all, but they are included among the output files, so they are
10538 linked.
10540 @item %O
10541 Substitutes the suffix for object files.  Note that this is
10542 handled specially when it immediately follows @samp{%g, %u, or %U},
10543 because of the need for those to form complete file names.  The
10544 handling is such that @samp{%O} is treated exactly as if it had already
10545 been substituted, except that @samp{%g, %u, and %U} do not currently
10546 support additional @var{suffix} characters following @samp{%O} as they do
10547 following, for example, @samp{.o}.
10549 @item %p
10550 Substitutes the standard macro predefinitions for the
10551 current target machine.  Use this when running @code{cpp}.
10553 @item %P
10554 Like @samp{%p}, but puts @samp{__} before and after the name of each
10555 predefined macro, except for macros that start with @samp{__} or with
10556 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10559 @item %I
10560 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10561 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10562 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10563 and @option{-imultilib} as necessary.
10565 @item %s
10566 Current argument is the name of a library or startup file of some sort.
10567 Search for that file in a standard list of directories and substitute
10568 the full name found.  The current working directory is included in the
10569 list of directories scanned.
10571 @item %T
10572 Current argument is the name of a linker script.  Search for that file
10573 in the current list of directories to scan for libraries. If the file
10574 is located insert a @option{--script} option into the command line
10575 followed by the full path name found.  If the file is not found then
10576 generate an error message.  Note: the current working directory is not
10577 searched.
10579 @item %e@var{str}
10580 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10581 Use this when inconsistent options are detected.
10583 @item %(@var{name})
10584 Substitute the contents of spec string @var{name} at this point.
10586 @item %x@{@var{option}@}
10587 Accumulate an option for @samp{%X}.
10589 @item %X
10590 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10591 spec string.
10593 @item %Y
10594 Output the accumulated assembler options specified by @option{-Wa}.
10596 @item %Z
10597 Output the accumulated preprocessor options specified by @option{-Wp}.
10599 @item %a
10600 Process the @code{asm} spec.  This is used to compute the
10601 switches to be passed to the assembler.
10603 @item %A
10604 Process the @code{asm_final} spec.  This is a spec string for
10605 passing switches to an assembler post-processor, if such a program is
10606 needed.
10608 @item %l
10609 Process the @code{link} spec.  This is the spec for computing the
10610 command line passed to the linker.  Typically it makes use of the
10611 @samp{%L %G %S %D and %E} sequences.
10613 @item %D
10614 Dump out a @option{-L} option for each directory that GCC believes might
10615 contain startup files.  If the target supports multilibs then the
10616 current multilib directory is prepended to each of these paths.
10618 @item %L
10619 Process the @code{lib} spec.  This is a spec string for deciding which
10620 libraries are included on the command line to the linker.
10622 @item %G
10623 Process the @code{libgcc} spec.  This is a spec string for deciding
10624 which GCC support library is included on the command line to the linker.
10626 @item %S
10627 Process the @code{startfile} spec.  This is a spec for deciding which
10628 object files are the first ones passed to the linker.  Typically
10629 this might be a file named @file{crt0.o}.
10631 @item %E
10632 Process the @code{endfile} spec.  This is a spec string that specifies
10633 the last object files that are passed to the linker.
10635 @item %C
10636 Process the @code{cpp} spec.  This is used to construct the arguments
10637 to be passed to the C preprocessor.
10639 @item %1
10640 Process the @code{cc1} spec.  This is used to construct the options to be
10641 passed to the actual C compiler (@samp{cc1}).
10643 @item %2
10644 Process the @code{cc1plus} spec.  This is used to construct the options to be
10645 passed to the actual C++ compiler (@samp{cc1plus}).
10647 @item %*
10648 Substitute the variable part of a matched option.  See below.
10649 Note that each comma in the substituted string is replaced by
10650 a single space.
10652 @item %<@code{S}
10653 Remove all occurrences of @code{-S} from the command line.  Note---this
10654 command is position dependent.  @samp{%} commands in the spec string
10655 before this one see @code{-S}, @samp{%} commands in the spec string
10656 after this one do not.
10658 @item %:@var{function}(@var{args})
10659 Call the named function @var{function}, passing it @var{args}.
10660 @var{args} is first processed as a nested spec string, then split
10661 into an argument vector in the usual fashion.  The function returns
10662 a string which is processed as if it had appeared literally as part
10663 of the current spec.
10665 The following built-in spec functions are provided:
10667 @table @code
10668 @item @code{getenv}
10669 The @code{getenv} spec function takes two arguments: an environment
10670 variable name and a string.  If the environment variable is not
10671 defined, a fatal error is issued.  Otherwise, the return value is the
10672 value of the environment variable concatenated with the string.  For
10673 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10675 @smallexample
10676 %:getenv(TOPDIR /include)
10677 @end smallexample
10679 expands to @file{/path/to/top/include}.
10681 @item @code{if-exists}
10682 The @code{if-exists} spec function takes one argument, an absolute
10683 pathname to a file.  If the file exists, @code{if-exists} returns the
10684 pathname.  Here is a small example of its usage:
10686 @smallexample
10687 *startfile:
10688 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10689 @end smallexample
10691 @item @code{if-exists-else}
10692 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10693 spec function, except that it takes two arguments.  The first argument is
10694 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10695 returns the pathname.  If it does not exist, it returns the second argument.
10696 This way, @code{if-exists-else} can be used to select one file or another,
10697 based on the existence of the first.  Here is a small example of its usage:
10699 @smallexample
10700 *startfile:
10701 crt0%O%s %:if-exists(crti%O%s) \
10702 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10703 @end smallexample
10705 @item @code{replace-outfile}
10706 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10707 first argument in the outfiles array and replaces it with the second argument.  Here
10708 is a small example of its usage:
10710 @smallexample
10711 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10712 @end smallexample
10714 @item @code{remove-outfile}
10715 The @code{remove-outfile} spec function takes one argument.  It looks for the
10716 first argument in the outfiles array and removes it.  Here is a small example
10717 its usage:
10719 @smallexample
10720 %:remove-outfile(-lm)
10721 @end smallexample
10723 @item @code{pass-through-libs}
10724 The @code{pass-through-libs} spec function takes any number of arguments.  It
10725 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10726 assumes are the names of linker input library archive files) and returns a
10727 result containing all the found arguments each prepended by
10728 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10729 intended to be passed to the LTO linker plugin.
10731 @smallexample
10732 %:pass-through-libs(%G %L %G)
10733 @end smallexample
10735 @item @code{print-asm-header}
10736 The @code{print-asm-header} function takes no arguments and simply
10737 prints a banner like:
10739 @smallexample
10740 Assembler options
10741 =================
10743 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10744 @end smallexample
10746 It is used to separate compiler options from assembler options
10747 in the @option{--target-help} output.
10748 @end table
10750 @item %@{@code{S}@}
10751 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10752 If that switch is not specified, this substitutes nothing.  Note that
10753 the leading dash is omitted when specifying this option, and it is
10754 automatically inserted if the substitution is performed.  Thus the spec
10755 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10756 and outputs the command-line option @option{-foo}.
10758 @item %W@{@code{S}@}
10759 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10760 deleted on failure.
10762 @item %@{@code{S}*@}
10763 Substitutes all the switches specified to GCC whose names start
10764 with @code{-S}, but which also take an argument.  This is used for
10765 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10766 GCC considers @option{-o foo} as being
10767 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10768 text, including the space.  Thus two arguments are generated.
10770 @item %@{@code{S}*&@code{T}*@}
10771 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10772 (the order of @code{S} and @code{T} in the spec is not significant).
10773 There can be any number of ampersand-separated variables; for each the
10774 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10776 @item %@{@code{S}:@code{X}@}
10777 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10779 @item %@{!@code{S}:@code{X}@}
10780 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10782 @item %@{@code{S}*:@code{X}@}
10783 Substitutes @code{X} if one or more switches whose names start with
10784 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10785 once, no matter how many such switches appeared.  However, if @code{%*}
10786 appears somewhere in @code{X}, then @code{X} is substituted once
10787 for each matching switch, with the @code{%*} replaced by the part of
10788 that switch matching the @code{*}.
10790 @item %@{.@code{S}:@code{X}@}
10791 Substitutes @code{X}, if processing a file with suffix @code{S}.
10793 @item %@{!.@code{S}:@code{X}@}
10794 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10796 @item %@{,@code{S}:@code{X}@}
10797 Substitutes @code{X}, if processing a file for language @code{S}.
10799 @item %@{!,@code{S}:@code{X}@}
10800 Substitutes @code{X}, if not processing a file for language @code{S}.
10802 @item %@{@code{S}|@code{P}:@code{X}@}
10803 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10804 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10805 @code{*} sequences as well, although they have a stronger binding than
10806 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10807 alternatives must be starred, and only the first matching alternative
10808 is substituted.
10810 For example, a spec string like this:
10812 @smallexample
10813 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10814 @end smallexample
10816 @noindent
10817 outputs the following command-line options from the following input
10818 command-line options:
10820 @smallexample
10821 fred.c        -foo -baz
10822 jim.d         -bar -boggle
10823 -d fred.c     -foo -baz -boggle
10824 -d jim.d      -bar -baz -boggle
10825 @end smallexample
10827 @item %@{S:X; T:Y; :D@}
10829 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10830 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10831 be as many clauses as you need.  This may be combined with @code{.},
10832 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10835 @end table
10837 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10838 construct may contain other nested @samp{%} constructs or spaces, or
10839 even newlines.  They are processed as usual, as described above.
10840 Trailing white space in @code{X} is ignored.  White space may also
10841 appear anywhere on the left side of the colon in these constructs,
10842 except between @code{.} or @code{*} and the corresponding word.
10844 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10845 handled specifically in these constructs.  If another value of
10846 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10847 @option{-W} switch is found later in the command line, the earlier
10848 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10849 just one letter, which passes all matching options.
10851 The character @samp{|} at the beginning of the predicate text is used to
10852 indicate that a command should be piped to the following command, but
10853 only if @option{-pipe} is specified.
10855 It is built into GCC which switches take arguments and which do not.
10856 (You might think it would be useful to generalize this to allow each
10857 compiler's spec to say which switches take arguments.  But this cannot
10858 be done in a consistent fashion.  GCC cannot even decide which input
10859 files have been specified without knowing which switches take arguments,
10860 and it must know which input files to compile in order to tell which
10861 compilers to run).
10863 GCC also knows implicitly that arguments starting in @option{-l} are to be
10864 treated as compiler output files, and passed to the linker in their
10865 proper position among the other output files.
10867 @c man begin OPTIONS
10869 @node Target Options
10870 @section Specifying Target Machine and Compiler Version
10871 @cindex target options
10872 @cindex cross compiling
10873 @cindex specifying machine version
10874 @cindex specifying compiler version and target machine
10875 @cindex compiler version, specifying
10876 @cindex target machine, specifying
10878 The usual way to run GCC is to run the executable called @command{gcc}, or
10879 @command{@var{machine}-gcc} when cross-compiling, or
10880 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10881 one that was installed last.
10883 @node Submodel Options
10884 @section Hardware Models and Configurations
10885 @cindex submodel options
10886 @cindex specifying hardware config
10887 @cindex hardware models and configurations, specifying
10888 @cindex machine dependent options
10890 Each target machine types can have its own
10891 special options, starting with @samp{-m}, to choose among various
10892 hardware models or configurations---for example, 68010 vs 68020,
10893 floating coprocessor or none.  A single installed version of the
10894 compiler can compile for any model or configuration, according to the
10895 options specified.
10897 Some configurations of the compiler also support additional special
10898 options, usually for compatibility with other compilers on the same
10899 platform.
10901 @c This list is ordered alphanumerically by subsection name.
10902 @c It should be the same order and spelling as these options are listed
10903 @c in Machine Dependent Options
10905 @menu
10906 * AArch64 Options::
10907 * Adapteva Epiphany Options::
10908 * ARM Options::
10909 * AVR Options::
10910 * Blackfin Options::
10911 * C6X Options::
10912 * CRIS Options::
10913 * CR16 Options::
10914 * Darwin Options::
10915 * DEC Alpha Options::
10916 * FR30 Options::
10917 * FRV Options::
10918 * GNU/Linux Options::
10919 * H8/300 Options::
10920 * HPPA Options::
10921 * i386 and x86-64 Options::
10922 * i386 and x86-64 Windows Options::
10923 * IA-64 Options::
10924 * LM32 Options::
10925 * M32C Options::
10926 * M32R/D Options::
10927 * M680x0 Options::
10928 * MCore Options::
10929 * MeP Options::
10930 * MicroBlaze Options::
10931 * MIPS Options::
10932 * MMIX Options::
10933 * MN10300 Options::
10934 * Moxie Options::
10935 * PDP-11 Options::
10936 * picoChip Options::
10937 * PowerPC Options::
10938 * RL78 Options::
10939 * RS/6000 and PowerPC Options::
10940 * RX Options::
10941 * S/390 and zSeries Options::
10942 * Score Options::
10943 * SH Options::
10944 * Solaris 2 Options::
10945 * SPARC Options::
10946 * SPU Options::
10947 * System V Options::
10948 * TILE-Gx Options::
10949 * TILEPro Options::
10950 * V850 Options::
10951 * VAX Options::
10952 * VMS Options::
10953 * VxWorks Options::
10954 * x86-64 Options::
10955 * Xstormy16 Options::
10956 * Xtensa Options::
10957 * zSeries Options::
10958 @end menu
10960 @node AArch64 Options
10961 @subsection AArch64 Options
10962 @cindex AArch64 Options
10964 These options are defined for AArch64 implementations:
10966 @table @gcctabopt
10968 @item -mbig-endian
10969 @opindex mbig-endian
10970 Generate big-endian code.  This is the default when GCC is configured for an
10971 @samp{aarch64_be-*-*} target.
10973 @item -mgeneral-regs-only
10974 @opindex mgeneral-regs-only
10975 Generate code which uses only the general registers.
10977 @item -mlittle-endian
10978 @opindex mlittle-endian
10979 Generate little-endian code.  This is the default when GCC is configured for an
10980 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
10982 @item -mcmodel=tiny
10983 @opindex mcmodel=tiny
10984 Generate code for the tiny code model.  The program and its statically defined
10985 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
10986 be statically or dynamically linked.  This model is not fully implemented and
10987 mostly treated as @samp{small}.
10989 @item -mcmodel=small
10990 @opindex mcmodel=small
10991 Generate code for the small code model.  The program and its statically defined
10992 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
10993 be statically or dynamically linked.  This is the default code model.
10995 @item -mcmodel=large
10996 @opindex mcmodel=large
10997 Generate code for the large code model.  This makes no assumptions about
10998 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
10999 statically linked only.
11001 @item -mstrict-align
11002 @opindex mstrict-align
11003 Do not assume that unaligned memory references will be handled by the system.
11005 @item -momit-leaf-frame-pointer
11006 @itemx -mno-omit-leaf-frame-pointer
11007 @opindex momit-leaf-frame-pointer
11008 @opindex mno-omit-leaf-frame-pointer
11009 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11010 default.
11012 @item -mtls-dialect=desc
11013 @opindex mtls-dialect=desc
11014 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11015 of TLS variables.  This is the default.
11017 @item -mtls-dialect=traditional
11018 @opindex mtls-dialect=traditional
11019 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11020 of TLS variables.
11022 @item -march=@var{name}
11023 @opindex march
11024 Specify the name of the target architecture, optionally suffixed by one or
11025 more feature modifiers.  This option has the form
11026 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11027 only value for @var{arch} is @samp{armv8-a}.  The possible values for
11028 @var{feature} are documented in the sub-section below.
11030 Where conflicting feature modifiers are specified, the right-most feature is
11031 used.
11033 GCC uses this name to determine what kind of instructions it can emit when
11034 generating assembly code.  This option can be used in conjunction with or
11035 instead of the @option{-mcpu=} option.
11037 @item -mcpu=@var{name}
11038 @opindex mcpu
11039 Specify the name of the target processor, optionally suffixed by one or more
11040 feature modifiers.  This option has the form
11041 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11042 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
11043 possible values for @var{feature} are documented in the sub-section
11044 below.
11046 Where conflicting feature modifiers are specified, the right-most feature is
11047 used.
11049 GCC uses this name to determine what kind of instructions it can emit when
11050 generating assembly code.
11052 @item -mtune=@var{name}
11053 @opindex mtune
11054 Specify the name of the processor to tune the performance for.  The code will
11055 be tuned as if the target processor were of the type specified in this option,
11056 but still using instructions compatible with the target processor specified
11057 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
11058 modifiers.
11060 @end table
11062 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11063 @cindex @option{-march} feature modifiers
11064 @cindex @option{-mcpu} feature modifiers
11065 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11066 the following:
11068 @table @samp
11069 @item crypto
11070 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11071 @item fp
11072 Enable floating-point instructions.
11073 @item simd
11074 Enable Advanced SIMD instructions.  This implies floating-point instructions
11075 are enabled.  This is the default for all current possible values for options
11076 @option{-march} and @option{-mcpu=}.
11077 @end table
11079 @node Adapteva Epiphany Options
11080 @subsection Adapteva Epiphany Options
11082 These @samp{-m} options are defined for Adapteva Epiphany:
11084 @table @gcctabopt
11085 @item -mhalf-reg-file
11086 @opindex mhalf-reg-file
11087 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11088 That allows code to run on hardware variants that lack these registers.
11090 @item -mprefer-short-insn-regs
11091 @opindex mprefer-short-insn-regs
11092 Preferrentially allocate registers that allow short instruction generation.
11093 This can result in increased instruction count, so this may either reduce or
11094 increase overall code size.
11096 @item -mbranch-cost=@var{num}
11097 @opindex mbranch-cost
11098 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11099 This cost is only a heuristic and is not guaranteed to produce
11100 consistent results across releases.
11102 @item -mcmove
11103 @opindex mcmove
11104 Enable the generation of conditional moves.
11106 @item -mnops=@var{num}
11107 @opindex mnops
11108 Emit @var{num} NOPs before every other generated instruction.
11110 @item -mno-soft-cmpsf
11111 @opindex mno-soft-cmpsf
11112 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11113 and test the flags.  This is faster than a software comparison, but can
11114 get incorrect results in the presence of NaNs, or when two different small
11115 numbers are compared such that their difference is calculated as zero.
11116 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11117 software comparisons.
11119 @item -mstack-offset=@var{num}
11120 @opindex mstack-offset
11121 Set the offset between the top of the stack and the stack pointer.
11122 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11123 can be used by leaf functions without stack allocation.
11124 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11125 Note also that this option changes the ABI; compiling a program with a
11126 different stack offset than the libraries have been compiled with
11127 generally does not work.
11128 This option can be useful if you want to evaluate if a different stack
11129 offset would give you better code, but to actually use a different stack
11130 offset to build working programs, it is recommended to configure the
11131 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11133 @item -mno-round-nearest
11134 @opindex mno-round-nearest
11135 Make the scheduler assume that the rounding mode has been set to
11136 truncating.  The default is @option{-mround-nearest}.
11138 @item -mlong-calls
11139 @opindex mlong-calls
11140 If not otherwise specified by an attribute, assume all calls might be beyond
11141 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11142 function address into a register before performing a (otherwise direct) call.
11143 This is the default.
11145 @item -mshort-calls
11146 @opindex short-calls
11147 If not otherwise specified by an attribute, assume all direct calls are
11148 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11149 for direct calls.  The default is @option{-mlong-calls}.
11151 @item -msmall16
11152 @opindex msmall16
11153 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11154 apply to function addresses for which @option{-mlong-calls} semantics
11155 are in effect.
11157 @item -mfp-mode=@var{mode}
11158 @opindex mfp-mode
11159 Set the prevailing mode of the floating-point unit.
11160 This determines the floating-point mode that is provided and expected
11161 at function call and return time.  Making this mode match the mode you
11162 predominantly need at function start can make your programs smaller and
11163 faster by avoiding unnecessary mode switches.
11165 @var{mode} can be set to one the following values:
11167 @table @samp
11168 @item caller
11169 Any mode at function entry is valid, and retained or restored when
11170 the function returns, and when it calls other functions.
11171 This mode is useful for compiling libraries or other compilation units
11172 you might want to incorporate into different programs with different
11173 prevailing FPU modes, and the convenience of being able to use a single
11174 object file outweighs the size and speed overhead for any extra
11175 mode switching that might be needed, compared with what would be needed
11176 with a more specific choice of prevailing FPU mode.
11178 @item truncate
11179 This is the mode used for floating-point calculations with
11180 truncating (i.e.@: round towards zero) rounding mode.  That includes
11181 conversion from floating point to integer.
11183 @item round-nearest
11184 This is the mode used for floating-point calculations with
11185 round-to-nearest-or-even rounding mode.
11187 @item int
11188 This is the mode used to perform integer calculations in the FPU, e.g.@:
11189 integer multiply, or integer multiply-and-accumulate.
11190 @end table
11192 The default is @option{-mfp-mode=caller}
11194 @item -mnosplit-lohi
11195 @itemx -mno-postinc
11196 @itemx -mno-postmodify
11197 @opindex mnosplit-lohi
11198 @opindex mno-postinc
11199 @opindex mno-postmodify
11200 Code generation tweaks that disable, respectively, splitting of 32-bit
11201 loads, generation of post-increment addresses, and generation of
11202 post-modify addresses.  The defaults are @option{msplit-lohi},
11203 @option{-mpost-inc}, and @option{-mpost-modify}.
11205 @item -mnovect-double
11206 @opindex mno-vect-double
11207 Change the preferred SIMD mode to SImode.  The default is
11208 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11210 @item -max-vect-align=@var{num}
11211 @opindex max-vect-align
11212 The maximum alignment for SIMD vector mode types.
11213 @var{num} may be 4 or 8.  The default is 8.
11214 Note that this is an ABI change, even though many library function
11215 interfaces are unaffected if they don't use SIMD vector modes
11216 in places that affect size and/or alignment of relevant types.
11218 @item -msplit-vecmove-early
11219 @opindex msplit-vecmove-early
11220 Split vector moves into single word moves before reload.  In theory this
11221 can give better register allocation, but so far the reverse seems to be
11222 generally the case.
11224 @item -m1reg-@var{reg}
11225 @opindex m1reg-
11226 Specify a register to hold the constant @minus{}1, which makes loading small negative
11227 constants and certain bitmasks faster.
11228 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11229 which specify use of that register as a fixed register,
11230 and @samp{none}, which means that no register is used for this
11231 purpose.  The default is @option{-m1reg-none}.
11233 @end table
11235 @node ARM Options
11236 @subsection ARM Options
11237 @cindex ARM options
11239 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11240 architectures:
11242 @table @gcctabopt
11243 @item -mabi=@var{name}
11244 @opindex mabi
11245 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11246 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11248 @item -mapcs-frame
11249 @opindex mapcs-frame
11250 Generate a stack frame that is compliant with the ARM Procedure Call
11251 Standard for all functions, even if this is not strictly necessary for
11252 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11253 with this option causes the stack frames not to be generated for
11254 leaf functions.  The default is @option{-mno-apcs-frame}.
11256 @item -mapcs
11257 @opindex mapcs
11258 This is a synonym for @option{-mapcs-frame}.
11260 @ignore
11261 @c not currently implemented
11262 @item -mapcs-stack-check
11263 @opindex mapcs-stack-check
11264 Generate code to check the amount of stack space available upon entry to
11265 every function (that actually uses some stack space).  If there is
11266 insufficient space available then either the function
11267 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11268 called, depending upon the amount of stack space required.  The runtime
11269 system is required to provide these functions.  The default is
11270 @option{-mno-apcs-stack-check}, since this produces smaller code.
11272 @c not currently implemented
11273 @item -mapcs-float
11274 @opindex mapcs-float
11275 Pass floating-point arguments using the floating-point registers.  This is
11276 one of the variants of the APCS@.  This option is recommended if the
11277 target hardware has a floating-point unit or if a lot of floating-point
11278 arithmetic is going to be performed by the code.  The default is
11279 @option{-mno-apcs-float}, since the size of integer-only code is 
11280 slightly increased if @option{-mapcs-float} is used.
11282 @c not currently implemented
11283 @item -mapcs-reentrant
11284 @opindex mapcs-reentrant
11285 Generate reentrant, position-independent code.  The default is
11286 @option{-mno-apcs-reentrant}.
11287 @end ignore
11289 @item -mthumb-interwork
11290 @opindex mthumb-interwork
11291 Generate code that supports calling between the ARM and Thumb
11292 instruction sets.  Without this option, on pre-v5 architectures, the
11293 two instruction sets cannot be reliably used inside one program.  The
11294 default is @option{-mno-thumb-interwork}, since slightly larger code
11295 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11296 configurations this option is meaningless.
11298 @item -mno-sched-prolog
11299 @opindex mno-sched-prolog
11300 Prevent the reordering of instructions in the function prologue, or the
11301 merging of those instruction with the instructions in the function's
11302 body.  This means that all functions start with a recognizable set
11303 of instructions (or in fact one of a choice from a small set of
11304 different function prologues), and this information can be used to
11305 locate the start of functions inside an executable piece of code.  The
11306 default is @option{-msched-prolog}.
11308 @item -mfloat-abi=@var{name}
11309 @opindex mfloat-abi
11310 Specifies which floating-point ABI to use.  Permissible values
11311 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11313 Specifying @samp{soft} causes GCC to generate output containing
11314 library calls for floating-point operations.
11315 @samp{softfp} allows the generation of code using hardware floating-point
11316 instructions, but still uses the soft-float calling conventions.
11317 @samp{hard} allows generation of floating-point instructions
11318 and uses FPU-specific calling conventions.
11320 The default depends on the specific target configuration.  Note that
11321 the hard-float and soft-float ABIs are not link-compatible; you must
11322 compile your entire program with the same ABI, and link with a
11323 compatible set of libraries.
11325 @item -mlittle-endian
11326 @opindex mlittle-endian
11327 Generate code for a processor running in little-endian mode.  This is
11328 the default for all standard configurations.
11330 @item -mbig-endian
11331 @opindex mbig-endian
11332 Generate code for a processor running in big-endian mode; the default is
11333 to compile code for a little-endian processor.
11335 @item -mwords-little-endian
11336 @opindex mwords-little-endian
11337 This option only applies when generating code for big-endian processors.
11338 Generate code for a little-endian word order but a big-endian byte
11339 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11340 option should only be used if you require compatibility with code for
11341 big-endian ARM processors generated by versions of the compiler prior to
11342 2.8.  This option is now deprecated.
11344 @item -mcpu=@var{name}
11345 @opindex mcpu
11346 This specifies the name of the target ARM processor.  GCC uses this name
11347 to determine what kind of instructions it can emit when generating
11348 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
11349 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
11350 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
11351 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
11352 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
11353 @samp{arm720},
11354 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
11355 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
11356 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
11357 @samp{strongarm1110},
11358 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
11359 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
11360 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
11361 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
11362 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
11363 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
11364 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
11365 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
11366 @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-r4}, @samp{cortex-r4f},
11367 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
11368 @samp{cortex-m1},
11369 @samp{cortex-m0},
11370 @samp{cortex-m0plus},
11371 @samp{marvell-pj4},
11372 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
11373 @samp{fa526}, @samp{fa626},
11374 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
11377 @option{-mcpu=generic-@var{arch}} is also permissible, and is
11378 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
11379 See @option{-mtune} for more information.
11381 @option{-mcpu=native} causes the compiler to auto-detect the CPU
11382 of the build computer.  At present, this feature is only supported on
11383 Linux, and not all architectures are recognized.  If the auto-detect is
11384 unsuccessful the option has no effect.
11386 @item -mtune=@var{name}
11387 @opindex mtune
11388 This option is very similar to the @option{-mcpu=} option, except that
11389 instead of specifying the actual target processor type, and hence
11390 restricting which instructions can be used, it specifies that GCC should
11391 tune the performance of the code as if the target were of the type
11392 specified in this option, but still choosing the instructions it
11393 generates based on the CPU specified by a @option{-mcpu=} option.
11394 For some ARM implementations better performance can be obtained by using
11395 this option.
11397 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
11398 performance for a blend of processors within architecture @var{arch}.
11399 The aim is to generate code that run well on the current most popular
11400 processors, balancing between optimizations that benefit some CPUs in the
11401 range, and avoiding performance pitfalls of other CPUs.  The effects of
11402 this option may change in future GCC versions as CPU models come and go.
11404 @option{-mtune=native} causes the compiler to auto-detect the CPU
11405 of the build computer.  At present, this feature is only supported on
11406 Linux, and not all architectures are recognized.  If the auto-detect is
11407 unsuccessful the option has no effect.
11409 @item -march=@var{name}
11410 @opindex march
11411 This specifies the name of the target ARM architecture.  GCC uses this
11412 name to determine what kind of instructions it can emit when generating
11413 assembly code.  This option can be used in conjunction with or instead
11414 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
11415 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
11416 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
11417 @samp{armv6}, @samp{armv6j},
11418 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
11419 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
11420 @samp{armv8-a},
11421 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
11423 @option{-march=native} causes the compiler to auto-detect the architecture
11424 of the build computer.  At present, this feature is only supported on
11425 Linux, and not all architectures are recognized.  If the auto-detect is
11426 unsuccessful the option has no effect.
11428 @item -mfpu=@var{name}
11429 @opindex mfpu
11430 This specifies what floating-point hardware (or hardware emulation) is
11431 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
11432 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
11433 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
11434 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
11435 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
11437 If @option{-msoft-float} is specified this specifies the format of
11438 floating-point values.
11440 If the selected floating-point hardware includes the NEON extension
11441 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
11442 operations are not generated by GCC's auto-vectorization pass unless
11443 @option{-funsafe-math-optimizations} is also specified.  This is
11444 because NEON hardware does not fully implement the IEEE 754 standard for
11445 floating-point arithmetic (in particular denormal values are treated as
11446 zero), so the use of NEON instructions may lead to a loss of precision.
11448 @item -mfp16-format=@var{name}
11449 @opindex mfp16-format
11450 Specify the format of the @code{__fp16} half-precision floating-point type.
11451 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
11452 the default is @samp{none}, in which case the @code{__fp16} type is not
11453 defined.  @xref{Half-Precision}, for more information.
11455 @item -mstructure-size-boundary=@var{n}
11456 @opindex mstructure-size-boundary
11457 The sizes of all structures and unions are rounded up to a multiple
11458 of the number of bits set by this option.  Permissible values are 8, 32
11459 and 64.  The default value varies for different toolchains.  For the COFF
11460 targeted toolchain the default value is 8.  A value of 64 is only allowed
11461 if the underlying ABI supports it.
11463 Specifying a larger number can produce faster, more efficient code, but
11464 can also increase the size of the program.  Different values are potentially
11465 incompatible.  Code compiled with one value cannot necessarily expect to
11466 work with code or libraries compiled with another value, if they exchange
11467 information using structures or unions.
11469 @item -mabort-on-noreturn
11470 @opindex mabort-on-noreturn
11471 Generate a call to the function @code{abort} at the end of a
11472 @code{noreturn} function.  It is executed if the function tries to
11473 return.
11475 @item -mlong-calls
11476 @itemx -mno-long-calls
11477 @opindex mlong-calls
11478 @opindex mno-long-calls
11479 Tells the compiler to perform function calls by first loading the
11480 address of the function into a register and then performing a subroutine
11481 call on this register.  This switch is needed if the target function
11482 lies outside of the 64-megabyte addressing range of the offset-based
11483 version of subroutine call instruction.
11485 Even if this switch is enabled, not all function calls are turned
11486 into long calls.  The heuristic is that static functions, functions
11487 that have the @samp{short-call} attribute, functions that are inside
11488 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
11489 definitions have already been compiled within the current compilation
11490 unit are not turned into long calls.  The exceptions to this rule are
11491 that weak function definitions, functions with the @samp{long-call}
11492 attribute or the @samp{section} attribute, and functions that are within
11493 the scope of a @samp{#pragma long_calls} directive are always
11494 turned into long calls.
11496 This feature is not enabled by default.  Specifying
11497 @option{-mno-long-calls} restores the default behavior, as does
11498 placing the function calls within the scope of a @samp{#pragma
11499 long_calls_off} directive.  Note these switches have no effect on how
11500 the compiler generates code to handle function calls via function
11501 pointers.
11503 @item -msingle-pic-base
11504 @opindex msingle-pic-base
11505 Treat the register used for PIC addressing as read-only, rather than
11506 loading it in the prologue for each function.  The runtime system is
11507 responsible for initializing this register with an appropriate value
11508 before execution begins.
11510 @item -mpic-register=@var{reg}
11511 @opindex mpic-register
11512 Specify the register to be used for PIC addressing.  The default is R10
11513 unless stack-checking is enabled, when R9 is used.
11515 @item -mpoke-function-name
11516 @opindex mpoke-function-name
11517 Write the name of each function into the text section, directly
11518 preceding the function prologue.  The generated code is similar to this:
11520 @smallexample
11521      t0
11522          .ascii "arm_poke_function_name", 0
11523          .align
11524      t1
11525          .word 0xff000000 + (t1 - t0)
11526      arm_poke_function_name
11527          mov     ip, sp
11528          stmfd   sp!, @{fp, ip, lr, pc@}
11529          sub     fp, ip, #4
11530 @end smallexample
11532 When performing a stack backtrace, code can inspect the value of
11533 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11534 location @code{pc - 12} and the top 8 bits are set, then we know that
11535 there is a function name embedded immediately preceding this location
11536 and has length @code{((pc[-3]) & 0xff000000)}.
11538 @item -mthumb
11539 @itemx -marm
11540 @opindex marm
11541 @opindex mthumb
11543 Select between generating code that executes in ARM and Thumb
11544 states.  The default for most configurations is to generate code
11545 that executes in ARM state, but the default can be changed by
11546 configuring GCC with the @option{--with-mode=}@var{state}
11547 configure option.
11549 @item -mtpcs-frame
11550 @opindex mtpcs-frame
11551 Generate a stack frame that is compliant with the Thumb Procedure Call
11552 Standard for all non-leaf functions.  (A leaf function is one that does
11553 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11555 @item -mtpcs-leaf-frame
11556 @opindex mtpcs-leaf-frame
11557 Generate a stack frame that is compliant with the Thumb Procedure Call
11558 Standard for all leaf functions.  (A leaf function is one that does
11559 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11561 @item -mcallee-super-interworking
11562 @opindex mcallee-super-interworking
11563 Gives all externally visible functions in the file being compiled an ARM
11564 instruction set header which switches to Thumb mode before executing the
11565 rest of the function.  This allows these functions to be called from
11566 non-interworking code.  This option is not valid in AAPCS configurations
11567 because interworking is enabled by default.
11569 @item -mcaller-super-interworking
11570 @opindex mcaller-super-interworking
11571 Allows calls via function pointers (including virtual functions) to
11572 execute correctly regardless of whether the target code has been
11573 compiled for interworking or not.  There is a small overhead in the cost
11574 of executing a function pointer if this option is enabled.  This option
11575 is not valid in AAPCS configurations because interworking is enabled
11576 by default.
11578 @item -mtp=@var{name}
11579 @opindex mtp
11580 Specify the access model for the thread local storage pointer.  The valid
11581 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11582 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11583 (supported in the arm6k architecture), and @option{auto}, which uses the
11584 best available method for the selected processor.  The default setting is
11585 @option{auto}.
11587 @item -mtls-dialect=@var{dialect}
11588 @opindex mtls-dialect
11589 Specify the dialect to use for accessing thread local storage.  Two
11590 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11591 @samp{gnu} dialect selects the original GNU scheme for supporting
11592 local and global dynamic TLS models.  The @samp{gnu2} dialect
11593 selects the GNU descriptor scheme, which provides better performance
11594 for shared libraries.  The GNU descriptor scheme is compatible with
11595 the original scheme, but does require new assembler, linker and
11596 library support.  Initial and local exec TLS models are unaffected by
11597 this option and always use the original scheme.
11599 @item -mword-relocations
11600 @opindex mword-relocations
11601 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11602 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11603 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11604 is specified.
11606 @item -mfix-cortex-m3-ldrd
11607 @opindex mfix-cortex-m3-ldrd
11608 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11609 with overlapping destination and base registers are used.  This option avoids
11610 generating these instructions.  This option is enabled by default when
11611 @option{-mcpu=cortex-m3} is specified.
11613 @item -munaligned-access
11614 @itemx -mno-unaligned-access
11615 @opindex munaligned-access
11616 @opindex mno-unaligned-access
11617 Enables (or disables) reading and writing of 16- and 32- bit values
11618 from addresses that are not 16- or 32- bit aligned.  By default
11619 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11620 architectures, and enabled for all other architectures.  If unaligned
11621 access is not enabled then words in packed data structures will be
11622 accessed a byte at a time.
11624 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11625 generated object file to either true or false, depending upon the
11626 setting of this option.  If unaligned access is enabled then the
11627 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11628 defined.
11630 @item -mneon-for-64bits
11631 @opindex mneon-for-64bits
11632 Enables using Neon to handle scalar 64-bits operations. This is
11633 disabled by default since the cost of moving data from core registers
11634 to Neon is high.
11635 @end table
11637 @node AVR Options
11638 @subsection AVR Options
11639 @cindex AVR Options
11641 These options are defined for AVR implementations:
11643 @table @gcctabopt
11644 @item -mmcu=@var{mcu}
11645 @opindex mmcu
11646 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11648 The default for this option is@tie{}@code{avr2}.
11650 GCC supports the following AVR devices and ISAs:
11652 @include avr-mmcu.texi
11654 @item -maccumulate-args
11655 @opindex maccumulate-args
11656 Accumulate outgoing function arguments and acquire/release the needed
11657 stack space for outgoing function arguments once in function
11658 prologue/epilogue.  Without this option, outgoing arguments are pushed
11659 before calling a function and popped afterwards.
11661 Popping the arguments after the function call can be expensive on
11662 AVR so that accumulating the stack space might lead to smaller
11663 executables because arguments need not to be removed from the
11664 stack after such a function call.
11666 This option can lead to reduced code size for functions that perform
11667 several calls to functions that get their arguments on the stack like
11668 calls to printf-like functions.
11670 @item -mbranch-cost=@var{cost}
11671 @opindex mbranch-cost
11672 Set the branch costs for conditional branch instructions to
11673 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11674 integers. The default branch cost is 0.
11676 @item -mcall-prologues
11677 @opindex mcall-prologues
11678 Functions prologues/epilogues are expanded as calls to appropriate
11679 subroutines.  Code size is smaller.
11681 @item -mint8
11682 @opindex mint8
11683 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11684 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11685 and @code{long long} is 4 bytes.  Please note that this option does not
11686 conform to the C standards, but it results in smaller code
11687 size.
11689 @item -mno-interrupts
11690 @opindex mno-interrupts
11691 Generated code is not compatible with hardware interrupts.
11692 Code size is smaller.
11694 @item -mrelax
11695 @opindex mrelax
11696 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11697 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11698 Setting @code{-mrelax} just adds the @code{--relax} option to the
11699 linker command line when the linker is called.
11701 Jump relaxing is performed by the linker because jump offsets are not
11702 known before code is located. Therefore, the assembler code generated by the
11703 compiler is the same, but the instructions in the executable may
11704 differ from instructions in the assembler code.
11706 Relaxing must be turned on if linker stubs are needed, see the
11707 section on @code{EIND} and linker stubs below.
11709 @item -msp8
11710 @opindex msp8
11711 Treat the stack pointer register as an 8-bit register,
11712 i.e.@: assume the high byte of the stack pointer is zero.
11713 In general, you don't need to set this option by hand.
11715 This option is used internally by the compiler to select and
11716 build multilibs for architectures @code{avr2} and @code{avr25}.
11717 These architectures mix devices with and without @code{SPH}.
11718 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11719 the compiler driver will add or remove this option from the compiler
11720 proper's command line, because the compiler then knows if the device
11721 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11722 register or not.
11724 @item -mstrict-X
11725 @opindex mstrict-X
11726 Use address register @code{X} in a way proposed by the hardware.  This means
11727 that @code{X} is only used in indirect, post-increment or
11728 pre-decrement addressing.
11730 Without this option, the @code{X} register may be used in the same way
11731 as @code{Y} or @code{Z} which then is emulated by additional
11732 instructions.  
11733 For example, loading a value with @code{X+const} addressing with a
11734 small non-negative @code{const < 64} to a register @var{Rn} is
11735 performed as
11737 @example
11738 adiw r26, const   ; X += const
11739 ld   @var{Rn}, X        ; @var{Rn} = *X
11740 sbiw r26, const   ; X -= const
11741 @end example
11743 @item -mtiny-stack
11744 @opindex mtiny-stack
11745 Only change the lower 8@tie{}bits of the stack pointer.
11747 @item -Waddr-space-convert
11748 @opindex Waddr-space-convert
11749 Warn about conversions between address spaces in the case where the
11750 resulting address space is not contained in the incoming address space.
11751 @end table
11753 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11754 @cindex @code{EIND}
11755 Pointers in the implementation are 16@tie{}bits wide.
11756 The address of a function or label is represented as word address so
11757 that indirect jumps and calls can target any code address in the
11758 range of 64@tie{}Ki words.
11760 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11761 bytes of program memory space, there is a special function register called
11762 @code{EIND} that serves as most significant part of the target address
11763 when @code{EICALL} or @code{EIJMP} instructions are used.
11765 Indirect jumps and calls on these devices are handled as follows by
11766 the compiler and are subject to some limitations:
11768 @itemize @bullet
11770 @item
11771 The compiler never sets @code{EIND}.
11773 @item
11774 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11775 instructions or might read @code{EIND} directly in order to emulate an
11776 indirect call/jump by means of a @code{RET} instruction.
11778 @item
11779 The compiler assumes that @code{EIND} never changes during the startup
11780 code or during the application. In particular, @code{EIND} is not
11781 saved/restored in function or interrupt service routine
11782 prologue/epilogue.
11784 @item
11785 For indirect calls to functions and computed goto, the linker
11786 generates @emph{stubs}. Stubs are jump pads sometimes also called
11787 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11788 The stub contains a direct jump to the desired address.
11790 @item
11791 Linker relaxation must be turned on so that the linker will generate
11792 the stubs correctly an all situaltion. See the compiler option
11793 @code{-mrelax} and the linler option @code{--relax}.
11794 There are corner cases where the linker is supposed to generate stubs
11795 but aborts without relaxation and without a helpful error message.
11797 @item
11798 The default linker script is arranged for code with @code{EIND = 0}.
11799 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11800 linker script has to be used in order to place the sections whose
11801 name start with @code{.trampolines} into the segment where @code{EIND}
11802 points to.
11804 @item
11805 The startup code from libgcc never sets @code{EIND}.
11806 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11807 For the impact of AVR-LibC on @code{EIND}, see the
11808 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
11810 @item
11811 It is legitimate for user-specific startup code to set up @code{EIND}
11812 early, for example by means of initialization code located in
11813 section @code{.init3}. Such code runs prior to general startup code
11814 that initializes RAM and calls constructors, but after the bit
11815 of startup code from AVR-LibC that sets @code{EIND} to the segment
11816 where the vector table is located.
11817 @example
11818 #include <avr/io.h>
11820 static void
11821 __attribute__((section(".init3"),naked,used,no_instrument_function))
11822 init3_set_eind (void)
11824   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11825                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11827 @end example
11829 @noindent
11830 The @code{__trampolines_start} symbol is defined in the linker script.
11832 @item
11833 Stubs are generated automatically by the linker if
11834 the following two conditions are met:
11835 @itemize @minus
11837 @item The address of a label is taken by means of the @code{gs} modifier
11838 (short for @emph{generate stubs}) like so:
11839 @example
11840 LDI r24, lo8(gs(@var{func}))
11841 LDI r25, hi8(gs(@var{func}))
11842 @end example
11843 @item The final location of that label is in a code segment
11844 @emph{outside} the segment where the stubs are located.
11845 @end itemize
11847 @item
11848 The compiler emits such @code{gs} modifiers for code labels in the
11849 following situations:
11850 @itemize @minus
11851 @item Taking address of a function or code label.
11852 @item Computed goto.
11853 @item If prologue-save function is used, see @option{-mcall-prologues}
11854 command-line option.
11855 @item Switch/case dispatch tables. If you do not want such dispatch
11856 tables you can specify the @option{-fno-jump-tables} command-line option.
11857 @item C and C++ constructors/destructors called during startup/shutdown.
11858 @item If the tools hit a @code{gs()} modifier explained above.
11859 @end itemize
11861 @item
11862 Jumping to non-symbolic addresses like so is @emph{not} supported:
11864 @example
11865 int main (void)
11867     /* Call function at word address 0x2 */
11868     return ((int(*)(void)) 0x2)();
11870 @end example
11872 Instead, a stub has to be set up, i.e.@: the function has to be called
11873 through a symbol (@code{func_4} in the example):
11875 @example
11876 int main (void)
11878     extern int func_4 (void);
11880     /* Call function at byte address 0x4 */
11881     return func_4();
11883 @end example
11885 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11886 Alternatively, @code{func_4} can be defined in the linker script.
11887 @end itemize
11889 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11890 @cindex @code{RAMPD}
11891 @cindex @code{RAMPX}
11892 @cindex @code{RAMPY}
11893 @cindex @code{RAMPZ}
11894 Some AVR devices support memories larger than the 64@tie{}KiB range
11895 that can be accessed with 16-bit pointers.  To access memory locations
11896 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11897 register is used as high part of the address:
11898 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11899 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11900 register, respectively, to get a wide address. Similarly,
11901 @code{RAMPD} is used together with direct addressing.
11903 @itemize
11904 @item
11905 The startup code initializes the @code{RAMP} special function
11906 registers with zero.
11908 @item
11909 If a @ref{AVR Named Address Spaces,named address space} other than
11910 generic or @code{__flash} is used, then @code{RAMPZ} is set
11911 as needed before the operation.
11913 @item
11914 If the device supports RAM larger than 64@tie{KiB} and the compiler
11915 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11916 is reset to zero after the operation.
11918 @item
11919 If the device comes with a specific @code{RAMP} register, the ISR
11920 prologue/epilogue saves/restores that SFR and initializes it with
11921 zero in case the ISR code might (implicitly) use it.
11923 @item
11924 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
11925 If you use inline assembler to read from locations outside the
11926 16-bit address range and change one of the @code{RAMP} registers,
11927 you must reset it to zero after the access.
11929 @end itemize
11931 @subsubsection AVR Built-in Macros
11933 GCC defines several built-in macros so that the user code can test
11934 for the presence or absence of features.  Almost any of the following
11935 built-in macros are deduced from device capabilities and thus
11936 triggered by the @code{-mmcu=} command-line option.
11938 For even more AVR-specific built-in macros see
11939 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
11941 @table @code
11943 @item __AVR_ARCH__
11944 Build-in macro that resolves to a decimal number that identifies the
11945 architecture and depends on the @code{-mmcu=@var{mcu}} option.
11946 Possible values are:
11948 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
11949 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
11950 @code{105}, @code{106}, @code{107}
11952 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
11953 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
11954 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
11955 @code{avrxmega6}, @code{avrxmega7}, respectively.
11956 If @var{mcu} specifies a device, this built-in macro is set
11957 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
11958 defined to @code{4}.
11960 @item __AVR_@var{Device}__
11961 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
11962 the device's name. For example, @code{-mmcu=atmega8} defines the
11963 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
11964 @code{__AVR_ATtiny261A__}, etc.
11966 The built-in macros' names follow
11967 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
11968 the device name as from the AVR user manual. The difference between
11969 @var{Device} in the built-in macro and @var{device} in
11970 @code{-mmcu=@var{device}} is that the latter is always lowercase.
11972 If @var{device} is not a device but only a core architecture like
11973 @code{avr51}, this macro will not be defined.
11975 @item __AVR_XMEGA__
11976 The device / architecture belongs to the XMEGA family of devices.
11978 @item __AVR_HAVE_ELPM__
11979 The device has the the @code{ELPM} instruction.
11981 @item __AVR_HAVE_ELPMX__
11982 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
11983 R@var{n},Z+} instructions.
11985 @item __AVR_HAVE_MOVW__
11986 The device has the @code{MOVW} instruction to perform 16-bit
11987 register-register moves.
11989 @item __AVR_HAVE_LPMX__
11990 The device has the @code{LPM R@var{n},Z} and
11991 @code{LPM R@var{n},Z+} instructions.
11993 @item __AVR_HAVE_MUL__
11994 The device has a hardware multiplier. 
11996 @item __AVR_HAVE_JMP_CALL__
11997 The device has the @code{JMP} and @code{CALL} instructions.
11998 This is the case for devices with at least 16@tie{}KiB of program
11999 memory.
12001 @item __AVR_HAVE_EIJMP_EICALL__
12002 @itemx __AVR_3_BYTE_PC__
12003 The device has the @code{EIJMP} and @code{EICALL} instructions.
12004 This is the case for devices with more than 128@tie{}KiB of program memory.
12005 This also means that the program counter
12006 (PC) is 3@tie{}bytes wide.
12008 @item __AVR_2_BYTE_PC__
12009 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
12010 with up to 128@tie{}KiB of program memory.
12012 @item __AVR_HAVE_8BIT_SP__
12013 @itemx __AVR_HAVE_16BIT_SP__
12014 The stack pointer (SP) register is treated as 8-bit respectively
12015 16-bit register by the compiler.
12016 The definition of these macros is affected by @code{-mtiny-stack}.
12018 @item __AVR_HAVE_SPH__
12019 @itemx __AVR_SP8__
12020 The device has the SPH (high part of stack pointer) special function
12021 register or has an 8-bit stack pointer, respectively.
12022 The definition of these macros is affected by @code{-mmcu=} and
12023 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
12024 by @code{-msp8}.
12026 @item __AVR_HAVE_RAMPD__
12027 @itemx __AVR_HAVE_RAMPX__
12028 @itemx __AVR_HAVE_RAMPY__
12029 @itemx __AVR_HAVE_RAMPZ__
12030 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
12031 @code{RAMPZ} special function register, respectively.
12033 @item __NO_INTERRUPTS__
12034 This macro reflects the @code{-mno-interrupts} command line option.
12036 @item __AVR_ERRATA_SKIP__
12037 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
12038 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
12039 instructions because of a hardware erratum.  Skip instructions are
12040 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
12041 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
12042 set.
12044 @item __AVR_SFR_OFFSET__=@var{offset}
12045 Instructions that can address I/O special function registers directly
12046 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
12047 address as if addressed by an instruction to access RAM like @code{LD}
12048 or @code{STS}. This offset depends on the device architecture and has
12049 to be subtracted from the RAM address in order to get the
12050 respective I/O@tie{}address.
12052 @item __WITH_AVRLIBC__
12053 The compiler is configured to be used together with AVR-Libc.
12054 See the @code{--with-avrlibc} configure option.
12056 @end table
12058 @node Blackfin Options
12059 @subsection Blackfin Options
12060 @cindex Blackfin Options
12062 @table @gcctabopt
12063 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
12064 @opindex mcpu=
12065 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
12066 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
12067 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
12068 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
12069 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
12070 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
12071 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
12072 @samp{bf561}, @samp{bf592}.
12074 The optional @var{sirevision} specifies the silicon revision of the target
12075 Blackfin processor.  Any workarounds available for the targeted silicon revision
12076 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
12077 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
12078 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
12079 hexadecimal digits representing the major and minor numbers in the silicon
12080 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
12081 is not defined.  If @var{sirevision} is @samp{any}, the
12082 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
12083 If this optional @var{sirevision} is not used, GCC assumes the latest known
12084 silicon revision of the targeted Blackfin processor.
12086 GCC defines a preprocessor macro for the specified @var{cpu}.
12087 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
12088 provided by libgloss to be linked in if @option{-msim} is not given.
12090 Without this option, @samp{bf532} is used as the processor by default.
12092 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
12093 only the preprocessor macro is defined.
12095 @item -msim
12096 @opindex msim
12097 Specifies that the program will be run on the simulator.  This causes
12098 the simulator BSP provided by libgloss to be linked in.  This option
12099 has effect only for @samp{bfin-elf} toolchain.
12100 Certain other options, such as @option{-mid-shared-library} and
12101 @option{-mfdpic}, imply @option{-msim}.
12103 @item -momit-leaf-frame-pointer
12104 @opindex momit-leaf-frame-pointer
12105 Don't keep the frame pointer in a register for leaf functions.  This
12106 avoids the instructions to save, set up and restore frame pointers and
12107 makes an extra register available in leaf functions.  The option
12108 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
12109 which might make debugging harder.
12111 @item -mspecld-anomaly
12112 @opindex mspecld-anomaly
12113 When enabled, the compiler ensures that the generated code does not
12114 contain speculative loads after jump instructions. If this option is used,
12115 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
12117 @item -mno-specld-anomaly
12118 @opindex mno-specld-anomaly
12119 Don't generate extra code to prevent speculative loads from occurring.
12121 @item -mcsync-anomaly
12122 @opindex mcsync-anomaly
12123 When enabled, the compiler ensures that the generated code does not
12124 contain CSYNC or SSYNC instructions too soon after conditional branches.
12125 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
12127 @item -mno-csync-anomaly
12128 @opindex mno-csync-anomaly
12129 Don't generate extra code to prevent CSYNC or SSYNC instructions from
12130 occurring too soon after a conditional branch.
12132 @item -mlow-64k
12133 @opindex mlow-64k
12134 When enabled, the compiler is free to take advantage of the knowledge that
12135 the entire program fits into the low 64k of memory.
12137 @item -mno-low-64k
12138 @opindex mno-low-64k
12139 Assume that the program is arbitrarily large.  This is the default.
12141 @item -mstack-check-l1
12142 @opindex mstack-check-l1
12143 Do stack checking using information placed into L1 scratchpad memory by the
12144 uClinux kernel.
12146 @item -mid-shared-library
12147 @opindex mid-shared-library
12148 Generate code that supports shared libraries via the library ID method.
12149 This allows for execute in place and shared libraries in an environment
12150 without virtual memory management.  This option implies @option{-fPIC}.
12151 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12153 @item -mno-id-shared-library
12154 @opindex mno-id-shared-library
12155 Generate code that doesn't assume ID-based shared libraries are being used.
12156 This is the default.
12158 @item -mleaf-id-shared-library
12159 @opindex mleaf-id-shared-library
12160 Generate code that supports shared libraries via the library ID method,
12161 but assumes that this library or executable won't link against any other
12162 ID shared libraries.  That allows the compiler to use faster code for jumps
12163 and calls.
12165 @item -mno-leaf-id-shared-library
12166 @opindex mno-leaf-id-shared-library
12167 Do not assume that the code being compiled won't link against any ID shared
12168 libraries.  Slower code is generated for jump and call insns.
12170 @item -mshared-library-id=n
12171 @opindex mshared-library-id
12172 Specifies the identification number of the ID-based shared library being
12173 compiled.  Specifying a value of 0 generates more compact code; specifying
12174 other values forces the allocation of that number to the current
12175 library but is no more space- or time-efficient than omitting this option.
12177 @item -msep-data
12178 @opindex msep-data
12179 Generate code that allows the data segment to be located in a different
12180 area of memory from the text segment.  This allows for execute in place in
12181 an environment without virtual memory management by eliminating relocations
12182 against the text section.
12184 @item -mno-sep-data
12185 @opindex mno-sep-data
12186 Generate code that assumes that the data segment follows the text segment.
12187 This is the default.
12189 @item -mlong-calls
12190 @itemx -mno-long-calls
12191 @opindex mlong-calls
12192 @opindex mno-long-calls
12193 Tells the compiler to perform function calls by first loading the
12194 address of the function into a register and then performing a subroutine
12195 call on this register.  This switch is needed if the target function
12196 lies outside of the 24-bit addressing range of the offset-based
12197 version of subroutine call instruction.
12199 This feature is not enabled by default.  Specifying
12200 @option{-mno-long-calls} restores the default behavior.  Note these
12201 switches have no effect on how the compiler generates code to handle
12202 function calls via function pointers.
12204 @item -mfast-fp
12205 @opindex mfast-fp
12206 Link with the fast floating-point library. This library relaxes some of
12207 the IEEE floating-point standard's rules for checking inputs against
12208 Not-a-Number (NAN), in the interest of performance.
12210 @item -minline-plt
12211 @opindex minline-plt
12212 Enable inlining of PLT entries in function calls to functions that are
12213 not known to bind locally.  It has no effect without @option{-mfdpic}.
12215 @item -mmulticore
12216 @opindex mmulticore
12217 Build a standalone application for multicore Blackfin processors. 
12218 This option causes proper start files and link scripts supporting 
12219 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12220 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12222 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12223 selects the one-application-per-core programming model.  Without
12224 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12225 programming model is used. In this model, the main function of Core B
12226 should be named as @code{coreb_main}.
12228 If this option is not used, the single-core application programming
12229 model is used.
12231 @item -mcorea
12232 @opindex mcorea
12233 Build a standalone application for Core A of BF561 when using
12234 the one-application-per-core programming model. Proper start files
12235 and link scripts are used to support Core A, and the macro
12236 @code{__BFIN_COREA} is defined.
12237 This option can only be used in conjunction with @option{-mmulticore}.
12239 @item -mcoreb
12240 @opindex mcoreb
12241 Build a standalone application for Core B of BF561 when using
12242 the one-application-per-core programming model. Proper start files
12243 and link scripts are used to support Core B, and the macro
12244 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12245 should be used instead of @code{main}. 
12246 This option can only be used in conjunction with @option{-mmulticore}.
12248 @item -msdram
12249 @opindex msdram
12250 Build a standalone application for SDRAM. Proper start files and
12251 link scripts are used to put the application into SDRAM, and the macro
12252 @code{__BFIN_SDRAM} is defined.
12253 The loader should initialize SDRAM before loading the application.
12255 @item -micplb
12256 @opindex micplb
12257 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12258 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12259 are enabled; for standalone applications the default is off.
12260 @end table
12262 @node C6X Options
12263 @subsection C6X Options
12264 @cindex C6X Options
12266 @table @gcctabopt
12267 @item -march=@var{name}
12268 @opindex march
12269 This specifies the name of the target architecture.  GCC uses this
12270 name to determine what kind of instructions it can emit when generating
12271 assembly code.  Permissible names are: @samp{c62x},
12272 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12274 @item -mbig-endian
12275 @opindex mbig-endian
12276 Generate code for a big-endian target.
12278 @item -mlittle-endian
12279 @opindex mlittle-endian
12280 Generate code for a little-endian target.  This is the default.
12282 @item -msim
12283 @opindex msim
12284 Choose startup files and linker script suitable for the simulator.
12286 @item -msdata=default
12287 @opindex msdata=default
12288 Put small global and static data in the @samp{.neardata} section,
12289 which is pointed to by register @code{B14}.  Put small uninitialized
12290 global and static data in the @samp{.bss} section, which is adjacent
12291 to the @samp{.neardata} section.  Put small read-only data into the
12292 @samp{.rodata} section.  The corresponding sections used for large
12293 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12295 @item -msdata=all
12296 @opindex msdata=all
12297 Put all data, not just small objects, into the sections reserved for
12298 small data, and use addressing relative to the @code{B14} register to
12299 access them.
12301 @item -msdata=none
12302 @opindex msdata=none
12303 Make no use of the sections reserved for small data, and use absolute
12304 addresses to access all data.  Put all initialized global and static
12305 data in the @samp{.fardata} section, and all uninitialized data in the
12306 @samp{.far} section.  Put all constant data into the @samp{.const}
12307 section.
12308 @end table
12310 @node CRIS Options
12311 @subsection CRIS Options
12312 @cindex CRIS Options
12314 These options are defined specifically for the CRIS ports.
12316 @table @gcctabopt
12317 @item -march=@var{architecture-type}
12318 @itemx -mcpu=@var{architecture-type}
12319 @opindex march
12320 @opindex mcpu
12321 Generate code for the specified architecture.  The choices for
12322 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12323 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12324 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12325 @samp{v10}.
12327 @item -mtune=@var{architecture-type}
12328 @opindex mtune
12329 Tune to @var{architecture-type} everything applicable about the generated
12330 code, except for the ABI and the set of available instructions.  The
12331 choices for @var{architecture-type} are the same as for
12332 @option{-march=@var{architecture-type}}.
12334 @item -mmax-stack-frame=@var{n}
12335 @opindex mmax-stack-frame
12336 Warn when the stack frame of a function exceeds @var{n} bytes.
12338 @item -metrax4
12339 @itemx -metrax100
12340 @opindex metrax4
12341 @opindex metrax100
12342 The options @option{-metrax4} and @option{-metrax100} are synonyms for
12343 @option{-march=v3} and @option{-march=v8} respectively.
12345 @item -mmul-bug-workaround
12346 @itemx -mno-mul-bug-workaround
12347 @opindex mmul-bug-workaround
12348 @opindex mno-mul-bug-workaround
12349 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
12350 models where it applies.  This option is active by default.
12352 @item -mpdebug
12353 @opindex mpdebug
12354 Enable CRIS-specific verbose debug-related information in the assembly
12355 code.  This option also has the effect of turning off the @samp{#NO_APP}
12356 formatted-code indicator to the assembler at the beginning of the
12357 assembly file.
12359 @item -mcc-init
12360 @opindex mcc-init
12361 Do not use condition-code results from previous instruction; always emit
12362 compare and test instructions before use of condition codes.
12364 @item -mno-side-effects
12365 @opindex mno-side-effects
12366 Do not emit instructions with side effects in addressing modes other than
12367 post-increment.
12369 @item -mstack-align
12370 @itemx -mno-stack-align
12371 @itemx -mdata-align
12372 @itemx -mno-data-align
12373 @itemx -mconst-align
12374 @itemx -mno-const-align
12375 @opindex mstack-align
12376 @opindex mno-stack-align
12377 @opindex mdata-align
12378 @opindex mno-data-align
12379 @opindex mconst-align
12380 @opindex mno-const-align
12381 These options (@samp{no-} options) arrange (eliminate arrangements) for the
12382 stack frame, individual data and constants to be aligned for the maximum
12383 single data access size for the chosen CPU model.  The default is to
12384 arrange for 32-bit alignment.  ABI details such as structure layout are
12385 not affected by these options.
12387 @item -m32-bit
12388 @itemx -m16-bit
12389 @itemx -m8-bit
12390 @opindex m32-bit
12391 @opindex m16-bit
12392 @opindex m8-bit
12393 Similar to the stack- data- and const-align options above, these options
12394 arrange for stack frame, writable data and constants to all be 32-bit,
12395 16-bit or 8-bit aligned.  The default is 32-bit alignment.
12397 @item -mno-prologue-epilogue
12398 @itemx -mprologue-epilogue
12399 @opindex mno-prologue-epilogue
12400 @opindex mprologue-epilogue
12401 With @option{-mno-prologue-epilogue}, the normal function prologue and
12402 epilogue which set up the stack frame are omitted and no return
12403 instructions or return sequences are generated in the code.  Use this
12404 option only together with visual inspection of the compiled code: no
12405 warnings or errors are generated when call-saved registers must be saved,
12406 or storage for local variables needs to be allocated.
12408 @item -mno-gotplt
12409 @itemx -mgotplt
12410 @opindex mno-gotplt
12411 @opindex mgotplt
12412 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
12413 instruction sequences that load addresses for functions from the PLT part
12414 of the GOT rather than (traditional on other architectures) calls to the
12415 PLT@.  The default is @option{-mgotplt}.
12417 @item -melf
12418 @opindex melf
12419 Legacy no-op option only recognized with the cris-axis-elf and
12420 cris-axis-linux-gnu targets.
12422 @item -mlinux
12423 @opindex mlinux
12424 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
12426 @item -sim
12427 @opindex sim
12428 This option, recognized for the cris-axis-elf, arranges
12429 to link with input-output functions from a simulator library.  Code,
12430 initialized data and zero-initialized data are allocated consecutively.
12432 @item -sim2
12433 @opindex sim2
12434 Like @option{-sim}, but pass linker options to locate initialized data at
12435 0x40000000 and zero-initialized data at 0x80000000.
12436 @end table
12438 @node CR16 Options
12439 @subsection CR16 Options
12440 @cindex CR16 Options
12442 These options are defined specifically for the CR16 ports.
12444 @table @gcctabopt
12446 @item -mmac
12447 @opindex mmac
12448 Enable the use of multiply-accumulate instructions. Disabled by default.
12450 @item -mcr16cplus
12451 @itemx -mcr16c
12452 @opindex mcr16cplus
12453 @opindex mcr16c
12454 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
12455 is default.
12457 @item -msim
12458 @opindex msim
12459 Links the library libsim.a which is in compatible with simulator. Applicable
12460 to ELF compiler only.
12462 @item -mint32
12463 @opindex mint32
12464 Choose integer type as 32-bit wide.
12466 @item -mbit-ops
12467 @opindex mbit-ops
12468 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
12470 @item -mdata-model=@var{model}
12471 @opindex mdata-model
12472 Choose a data model. The choices for @var{model} are @samp{near},
12473 @samp{far} or @samp{medium}. @samp{medium} is default.
12474 However, @samp{far} is not valid with @option{-mcr16c}, as the
12475 CR16C architecture does not support the far data model.
12476 @end table
12478 @node Darwin Options
12479 @subsection Darwin Options
12480 @cindex Darwin options
12482 These options are defined for all architectures running the Darwin operating
12483 system.
12485 FSF GCC on Darwin does not create ``fat'' object files; it creates
12486 an object file for the single architecture that GCC was built to
12487 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
12488 @option{-arch} options are used; it does so by running the compiler or
12489 linker multiple times and joining the results together with
12490 @file{lipo}.
12492 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
12493 @samp{i686}) is determined by the flags that specify the ISA
12494 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
12495 @option{-force_cpusubtype_ALL} option can be used to override this.
12497 The Darwin tools vary in their behavior when presented with an ISA
12498 mismatch.  The assembler, @file{as}, only permits instructions to
12499 be used that are valid for the subtype of the file it is generating,
12500 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
12501 The linker for shared libraries, @file{/usr/bin/libtool}, fails
12502 and prints an error if asked to create a shared library with a less
12503 restrictive subtype than its input files (for instance, trying to put
12504 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
12505 for executables, @command{ld}, quietly gives the executable the most
12506 restrictive subtype of any of its input files.
12508 @table @gcctabopt
12509 @item -F@var{dir}
12510 @opindex F
12511 Add the framework directory @var{dir} to the head of the list of
12512 directories to be searched for header files.  These directories are
12513 interleaved with those specified by @option{-I} options and are
12514 scanned in a left-to-right order.
12516 A framework directory is a directory with frameworks in it.  A
12517 framework is a directory with a @file{Headers} and/or
12518 @file{PrivateHeaders} directory contained directly in it that ends
12519 in @file{.framework}.  The name of a framework is the name of this
12520 directory excluding the @file{.framework}.  Headers associated with
12521 the framework are found in one of those two directories, with
12522 @file{Headers} being searched first.  A subframework is a framework
12523 directory that is in a framework's @file{Frameworks} directory.
12524 Includes of subframework headers can only appear in a header of a
12525 framework that contains the subframework, or in a sibling subframework
12526 header.  Two subframeworks are siblings if they occur in the same
12527 framework.  A subframework should not have the same name as a
12528 framework; a warning is issued if this is violated.  Currently a
12529 subframework cannot have subframeworks; in the future, the mechanism
12530 may be extended to support this.  The standard frameworks can be found
12531 in @file{/System/Library/Frameworks} and
12532 @file{/Library/Frameworks}.  An example include looks like
12533 @code{#include <Framework/header.h>}, where @file{Framework} denotes
12534 the name of the framework and @file{header.h} is found in the
12535 @file{PrivateHeaders} or @file{Headers} directory.
12537 @item -iframework@var{dir}
12538 @opindex iframework
12539 Like @option{-F} except the directory is a treated as a system
12540 directory.  The main difference between this @option{-iframework} and
12541 @option{-F} is that with @option{-iframework} the compiler does not
12542 warn about constructs contained within header files found via
12543 @var{dir}.  This option is valid only for the C family of languages.
12545 @item -gused
12546 @opindex gused
12547 Emit debugging information for symbols that are used.  For stabs
12548 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12549 This is by default ON@.
12551 @item -gfull
12552 @opindex gfull
12553 Emit debugging information for all symbols and types.
12555 @item -mmacosx-version-min=@var{version}
12556 The earliest version of MacOS X that this executable will run on
12557 is @var{version}.  Typical values of @var{version} include @code{10.1},
12558 @code{10.2}, and @code{10.3.9}.
12560 If the compiler was built to use the system's headers by default,
12561 then the default for this option is the system version on which the
12562 compiler is running, otherwise the default is to make choices that
12563 are compatible with as many systems and code bases as possible.
12565 @item -mkernel
12566 @opindex mkernel
12567 Enable kernel development mode.  The @option{-mkernel} option sets
12568 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12569 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12570 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12571 applicable.  This mode also sets @option{-mno-altivec},
12572 @option{-msoft-float}, @option{-fno-builtin} and
12573 @option{-mlong-branch} for PowerPC targets.
12575 @item -mone-byte-bool
12576 @opindex mone-byte-bool
12577 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12578 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12579 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12580 option has no effect on x86.
12582 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12583 to generate code that is not binary compatible with code generated
12584 without that switch.  Using this switch may require recompiling all
12585 other modules in a program, including system libraries.  Use this
12586 switch to conform to a non-default data model.
12588 @item -mfix-and-continue
12589 @itemx -ffix-and-continue
12590 @itemx -findirect-data
12591 @opindex mfix-and-continue
12592 @opindex ffix-and-continue
12593 @opindex findirect-data
12594 Generate code suitable for fast turnaround development, such as to
12595 allow GDB to dynamically load @code{.o} files into already-running
12596 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12597 are provided for backwards compatibility.
12599 @item -all_load
12600 @opindex all_load
12601 Loads all members of static archive libraries.
12602 See man ld(1) for more information.
12604 @item -arch_errors_fatal
12605 @opindex arch_errors_fatal
12606 Cause the errors having to do with files that have the wrong architecture
12607 to be fatal.
12609 @item -bind_at_load
12610 @opindex bind_at_load
12611 Causes the output file to be marked such that the dynamic linker will
12612 bind all undefined references when the file is loaded or launched.
12614 @item -bundle
12615 @opindex bundle
12616 Produce a Mach-o bundle format file.
12617 See man ld(1) for more information.
12619 @item -bundle_loader @var{executable}
12620 @opindex bundle_loader
12621 This option specifies the @var{executable} that will load the build
12622 output file being linked.  See man ld(1) for more information.
12624 @item -dynamiclib
12625 @opindex dynamiclib
12626 When passed this option, GCC produces a dynamic library instead of
12627 an executable when linking, using the Darwin @file{libtool} command.
12629 @item -force_cpusubtype_ALL
12630 @opindex force_cpusubtype_ALL
12631 This causes GCC's output file to have the @var{ALL} subtype, instead of
12632 one controlled by the @option{-mcpu} or @option{-march} option.
12634 @item -allowable_client  @var{client_name}
12635 @itemx -client_name
12636 @itemx -compatibility_version
12637 @itemx -current_version
12638 @itemx -dead_strip
12639 @itemx -dependency-file
12640 @itemx -dylib_file
12641 @itemx -dylinker_install_name
12642 @itemx -dynamic
12643 @itemx -exported_symbols_list
12644 @itemx -filelist
12645 @need 800
12646 @itemx -flat_namespace
12647 @itemx -force_flat_namespace
12648 @itemx -headerpad_max_install_names
12649 @itemx -image_base
12650 @itemx -init
12651 @itemx -install_name
12652 @itemx -keep_private_externs
12653 @itemx -multi_module
12654 @itemx -multiply_defined
12655 @itemx -multiply_defined_unused
12656 @need 800
12657 @itemx -noall_load
12658 @itemx -no_dead_strip_inits_and_terms
12659 @itemx -nofixprebinding
12660 @itemx -nomultidefs
12661 @itemx -noprebind
12662 @itemx -noseglinkedit
12663 @itemx -pagezero_size
12664 @itemx -prebind
12665 @itemx -prebind_all_twolevel_modules
12666 @itemx -private_bundle
12667 @need 800
12668 @itemx -read_only_relocs
12669 @itemx -sectalign
12670 @itemx -sectobjectsymbols
12671 @itemx -whyload
12672 @itemx -seg1addr
12673 @itemx -sectcreate
12674 @itemx -sectobjectsymbols
12675 @itemx -sectorder
12676 @itemx -segaddr
12677 @itemx -segs_read_only_addr
12678 @need 800
12679 @itemx -segs_read_write_addr
12680 @itemx -seg_addr_table
12681 @itemx -seg_addr_table_filename
12682 @itemx -seglinkedit
12683 @itemx -segprot
12684 @itemx -segs_read_only_addr
12685 @itemx -segs_read_write_addr
12686 @itemx -single_module
12687 @itemx -static
12688 @itemx -sub_library
12689 @need 800
12690 @itemx -sub_umbrella
12691 @itemx -twolevel_namespace
12692 @itemx -umbrella
12693 @itemx -undefined
12694 @itemx -unexported_symbols_list
12695 @itemx -weak_reference_mismatches
12696 @itemx -whatsloaded
12697 @opindex allowable_client
12698 @opindex client_name
12699 @opindex compatibility_version
12700 @opindex current_version
12701 @opindex dead_strip
12702 @opindex dependency-file
12703 @opindex dylib_file
12704 @opindex dylinker_install_name
12705 @opindex dynamic
12706 @opindex exported_symbols_list
12707 @opindex filelist
12708 @opindex flat_namespace
12709 @opindex force_flat_namespace
12710 @opindex headerpad_max_install_names
12711 @opindex image_base
12712 @opindex init
12713 @opindex install_name
12714 @opindex keep_private_externs
12715 @opindex multi_module
12716 @opindex multiply_defined
12717 @opindex multiply_defined_unused
12718 @opindex noall_load
12719 @opindex no_dead_strip_inits_and_terms
12720 @opindex nofixprebinding
12721 @opindex nomultidefs
12722 @opindex noprebind
12723 @opindex noseglinkedit
12724 @opindex pagezero_size
12725 @opindex prebind
12726 @opindex prebind_all_twolevel_modules
12727 @opindex private_bundle
12728 @opindex read_only_relocs
12729 @opindex sectalign
12730 @opindex sectobjectsymbols
12731 @opindex whyload
12732 @opindex seg1addr
12733 @opindex sectcreate
12734 @opindex sectobjectsymbols
12735 @opindex sectorder
12736 @opindex segaddr
12737 @opindex segs_read_only_addr
12738 @opindex segs_read_write_addr
12739 @opindex seg_addr_table
12740 @opindex seg_addr_table_filename
12741 @opindex seglinkedit
12742 @opindex segprot
12743 @opindex segs_read_only_addr
12744 @opindex segs_read_write_addr
12745 @opindex single_module
12746 @opindex static
12747 @opindex sub_library
12748 @opindex sub_umbrella
12749 @opindex twolevel_namespace
12750 @opindex umbrella
12751 @opindex undefined
12752 @opindex unexported_symbols_list
12753 @opindex weak_reference_mismatches
12754 @opindex whatsloaded
12755 These options are passed to the Darwin linker.  The Darwin linker man page
12756 describes them in detail.
12757 @end table
12759 @node DEC Alpha Options
12760 @subsection DEC Alpha Options
12762 These @samp{-m} options are defined for the DEC Alpha implementations:
12764 @table @gcctabopt
12765 @item -mno-soft-float
12766 @itemx -msoft-float
12767 @opindex mno-soft-float
12768 @opindex msoft-float
12769 Use (do not use) the hardware floating-point instructions for
12770 floating-point operations.  When @option{-msoft-float} is specified,
12771 functions in @file{libgcc.a} are used to perform floating-point
12772 operations.  Unless they are replaced by routines that emulate the
12773 floating-point operations, or compiled in such a way as to call such
12774 emulations routines, these routines issue floating-point
12775 operations.   If you are compiling for an Alpha without floating-point
12776 operations, you must ensure that the library is built so as not to call
12777 them.
12779 Note that Alpha implementations without floating-point operations are
12780 required to have floating-point registers.
12782 @item -mfp-reg
12783 @itemx -mno-fp-regs
12784 @opindex mfp-reg
12785 @opindex mno-fp-regs
12786 Generate code that uses (does not use) the floating-point register set.
12787 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12788 register set is not used, floating-point operands are passed in integer
12789 registers as if they were integers and floating-point results are passed
12790 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12791 so any function with a floating-point argument or return value called by code
12792 compiled with @option{-mno-fp-regs} must also be compiled with that
12793 option.
12795 A typical use of this option is building a kernel that does not use,
12796 and hence need not save and restore, any floating-point registers.
12798 @item -mieee
12799 @opindex mieee
12800 The Alpha architecture implements floating-point hardware optimized for
12801 maximum performance.  It is mostly compliant with the IEEE floating-point
12802 standard.  However, for full compliance, software assistance is
12803 required.  This option generates code fully IEEE-compliant code
12804 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12805 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12806 defined during compilation.  The resulting code is less efficient but is
12807 able to correctly support denormalized numbers and exceptional IEEE
12808 values such as not-a-number and plus/minus infinity.  Other Alpha
12809 compilers call this option @option{-ieee_with_no_inexact}.
12811 @item -mieee-with-inexact
12812 @opindex mieee-with-inexact
12813 This is like @option{-mieee} except the generated code also maintains
12814 the IEEE @var{inexact-flag}.  Turning on this option causes the
12815 generated code to implement fully-compliant IEEE math.  In addition to
12816 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12817 macro.  On some Alpha implementations the resulting code may execute
12818 significantly slower than the code generated by default.  Since there is
12819 very little code that depends on the @var{inexact-flag}, you should
12820 normally not specify this option.  Other Alpha compilers call this
12821 option @option{-ieee_with_inexact}.
12823 @item -mfp-trap-mode=@var{trap-mode}
12824 @opindex mfp-trap-mode
12825 This option controls what floating-point related traps are enabled.
12826 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12827 The trap mode can be set to one of four values:
12829 @table @samp
12830 @item n
12831 This is the default (normal) setting.  The only traps that are enabled
12832 are the ones that cannot be disabled in software (e.g., division by zero
12833 trap).
12835 @item u
12836 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12837 as well.
12839 @item su
12840 Like @samp{u}, but the instructions are marked to be safe for software
12841 completion (see Alpha architecture manual for details).
12843 @item sui
12844 Like @samp{su}, but inexact traps are enabled as well.
12845 @end table
12847 @item -mfp-rounding-mode=@var{rounding-mode}
12848 @opindex mfp-rounding-mode
12849 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12850 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12853 @table @samp
12854 @item n
12855 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12856 the nearest machine number or towards the even machine number in case
12857 of a tie.
12859 @item m
12860 Round towards minus infinity.
12862 @item c
12863 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12865 @item d
12866 Dynamic rounding mode.  A field in the floating-point control register
12867 (@var{fpcr}, see Alpha architecture reference manual) controls the
12868 rounding mode in effect.  The C library initializes this register for
12869 rounding towards plus infinity.  Thus, unless your program modifies the
12870 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12871 @end table
12873 @item -mtrap-precision=@var{trap-precision}
12874 @opindex mtrap-precision
12875 In the Alpha architecture, floating-point traps are imprecise.  This
12876 means without software assistance it is impossible to recover from a
12877 floating trap and program execution normally needs to be terminated.
12878 GCC can generate code that can assist operating system trap handlers
12879 in determining the exact location that caused a floating-point trap.
12880 Depending on the requirements of an application, different levels of
12881 precisions can be selected:
12883 @table @samp
12884 @item p
12885 Program precision.  This option is the default and means a trap handler
12886 can only identify which program caused a floating-point exception.
12888 @item f
12889 Function precision.  The trap handler can determine the function that
12890 caused a floating-point exception.
12892 @item i
12893 Instruction precision.  The trap handler can determine the exact
12894 instruction that caused a floating-point exception.
12895 @end table
12897 Other Alpha compilers provide the equivalent options called
12898 @option{-scope_safe} and @option{-resumption_safe}.
12900 @item -mieee-conformant
12901 @opindex mieee-conformant
12902 This option marks the generated code as IEEE conformant.  You must not
12903 use this option unless you also specify @option{-mtrap-precision=i} and either
12904 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12905 is to emit the line @samp{.eflag 48} in the function prologue of the
12906 generated assembly file.
12908 @item -mbuild-constants
12909 @opindex mbuild-constants
12910 Normally GCC examines a 32- or 64-bit integer constant to
12911 see if it can construct it from smaller constants in two or three
12912 instructions.  If it cannot, it outputs the constant as a literal and
12913 generates code to load it from the data segment at run time.
12915 Use this option to require GCC to construct @emph{all} integer constants
12916 using code, even if it takes more instructions (the maximum is six).
12918 You typically use this option to build a shared library dynamic
12919 loader.  Itself a shared library, it must relocate itself in memory
12920 before it can find the variables and constants in its own data segment.
12922 @item -mbwx
12923 @itemx -mno-bwx
12924 @itemx -mcix
12925 @itemx -mno-cix
12926 @itemx -mfix
12927 @itemx -mno-fix
12928 @itemx -mmax
12929 @itemx -mno-max
12930 @opindex mbwx
12931 @opindex mno-bwx
12932 @opindex mcix
12933 @opindex mno-cix
12934 @opindex mfix
12935 @opindex mno-fix
12936 @opindex mmax
12937 @opindex mno-max
12938 Indicate whether GCC should generate code to use the optional BWX,
12939 CIX, FIX and MAX instruction sets.  The default is to use the instruction
12940 sets supported by the CPU type specified via @option{-mcpu=} option or that
12941 of the CPU on which GCC was built if none is specified.
12943 @item -mfloat-vax
12944 @itemx -mfloat-ieee
12945 @opindex mfloat-vax
12946 @opindex mfloat-ieee
12947 Generate code that uses (does not use) VAX F and G floating-point
12948 arithmetic instead of IEEE single and double precision.
12950 @item -mexplicit-relocs
12951 @itemx -mno-explicit-relocs
12952 @opindex mexplicit-relocs
12953 @opindex mno-explicit-relocs
12954 Older Alpha assemblers provided no way to generate symbol relocations
12955 except via assembler macros.  Use of these macros does not allow
12956 optimal instruction scheduling.  GNU binutils as of version 2.12
12957 supports a new syntax that allows the compiler to explicitly mark
12958 which relocations should apply to which instructions.  This option
12959 is mostly useful for debugging, as GCC detects the capabilities of
12960 the assembler when it is built and sets the default accordingly.
12962 @item -msmall-data
12963 @itemx -mlarge-data
12964 @opindex msmall-data
12965 @opindex mlarge-data
12966 When @option{-mexplicit-relocs} is in effect, static data is
12967 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
12968 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
12969 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
12970 16-bit relocations off of the @code{$gp} register.  This limits the
12971 size of the small data area to 64KB, but allows the variables to be
12972 directly accessed via a single instruction.
12974 The default is @option{-mlarge-data}.  With this option the data area
12975 is limited to just below 2GB@.  Programs that require more than 2GB of
12976 data must use @code{malloc} or @code{mmap} to allocate the data in the
12977 heap instead of in the program's data segment.
12979 When generating code for shared libraries, @option{-fpic} implies
12980 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
12982 @item -msmall-text
12983 @itemx -mlarge-text
12984 @opindex msmall-text
12985 @opindex mlarge-text
12986 When @option{-msmall-text} is used, the compiler assumes that the
12987 code of the entire program (or shared library) fits in 4MB, and is
12988 thus reachable with a branch instruction.  When @option{-msmall-data}
12989 is used, the compiler can assume that all local symbols share the
12990 same @code{$gp} value, and thus reduce the number of instructions
12991 required for a function call from 4 to 1.
12993 The default is @option{-mlarge-text}.
12995 @item -mcpu=@var{cpu_type}
12996 @opindex mcpu
12997 Set the instruction set and instruction scheduling parameters for
12998 machine type @var{cpu_type}.  You can specify either the @samp{EV}
12999 style name or the corresponding chip number.  GCC supports scheduling
13000 parameters for the EV4, EV5 and EV6 family of processors and
13001 chooses the default values for the instruction set from the processor
13002 you specify.  If you do not specify a processor type, GCC defaults
13003 to the processor on which the compiler was built.
13005 Supported values for @var{cpu_type} are
13007 @table @samp
13008 @item ev4
13009 @itemx ev45
13010 @itemx 21064
13011 Schedules as an EV4 and has no instruction set extensions.
13013 @item ev5
13014 @itemx 21164
13015 Schedules as an EV5 and has no instruction set extensions.
13017 @item ev56
13018 @itemx 21164a
13019 Schedules as an EV5 and supports the BWX extension.
13021 @item pca56
13022 @itemx 21164pc
13023 @itemx 21164PC
13024 Schedules as an EV5 and supports the BWX and MAX extensions.
13026 @item ev6
13027 @itemx 21264
13028 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
13030 @item ev67
13031 @itemx 21264a
13032 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
13033 @end table
13035 Native toolchains also support the value @samp{native},
13036 which selects the best architecture option for the host processor.
13037 @option{-mcpu=native} has no effect if GCC does not recognize
13038 the processor.
13040 @item -mtune=@var{cpu_type}
13041 @opindex mtune
13042 Set only the instruction scheduling parameters for machine type
13043 @var{cpu_type}.  The instruction set is not changed.
13045 Native toolchains also support the value @samp{native},
13046 which selects the best architecture option for the host processor.
13047 @option{-mtune=native} has no effect if GCC does not recognize
13048 the processor.
13050 @item -mmemory-latency=@var{time}
13051 @opindex mmemory-latency
13052 Sets the latency the scheduler should assume for typical memory
13053 references as seen by the application.  This number is highly
13054 dependent on the memory access patterns used by the application
13055 and the size of the external cache on the machine.
13057 Valid options for @var{time} are
13059 @table @samp
13060 @item @var{number}
13061 A decimal number representing clock cycles.
13063 @item L1
13064 @itemx L2
13065 @itemx L3
13066 @itemx main
13067 The compiler contains estimates of the number of clock cycles for
13068 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
13069 (also called Dcache, Scache, and Bcache), as well as to main memory.
13070 Note that L3 is only valid for EV5.
13072 @end table
13073 @end table
13075 @node FR30 Options
13076 @subsection FR30 Options
13077 @cindex FR30 Options
13079 These options are defined specifically for the FR30 port.
13081 @table @gcctabopt
13083 @item -msmall-model
13084 @opindex msmall-model
13085 Use the small address space model.  This can produce smaller code, but
13086 it does assume that all symbolic values and addresses fit into a
13087 20-bit range.
13089 @item -mno-lsim
13090 @opindex mno-lsim
13091 Assume that runtime support has been provided and so there is no need
13092 to include the simulator library (@file{libsim.a}) on the linker
13093 command line.
13095 @end table
13097 @node FRV Options
13098 @subsection FRV Options
13099 @cindex FRV Options
13101 @table @gcctabopt
13102 @item -mgpr-32
13103 @opindex mgpr-32
13105 Only use the first 32 general-purpose registers.
13107 @item -mgpr-64
13108 @opindex mgpr-64
13110 Use all 64 general-purpose registers.
13112 @item -mfpr-32
13113 @opindex mfpr-32
13115 Use only the first 32 floating-point registers.
13117 @item -mfpr-64
13118 @opindex mfpr-64
13120 Use all 64 floating-point registers.
13122 @item -mhard-float
13123 @opindex mhard-float
13125 Use hardware instructions for floating-point operations.
13127 @item -msoft-float
13128 @opindex msoft-float
13130 Use library routines for floating-point operations.
13132 @item -malloc-cc
13133 @opindex malloc-cc
13135 Dynamically allocate condition code registers.
13137 @item -mfixed-cc
13138 @opindex mfixed-cc
13140 Do not try to dynamically allocate condition code registers, only
13141 use @code{icc0} and @code{fcc0}.
13143 @item -mdword
13144 @opindex mdword
13146 Change ABI to use double word insns.
13148 @item -mno-dword
13149 @opindex mno-dword
13151 Do not use double word instructions.
13153 @item -mdouble
13154 @opindex mdouble
13156 Use floating-point double instructions.
13158 @item -mno-double
13159 @opindex mno-double
13161 Do not use floating-point double instructions.
13163 @item -mmedia
13164 @opindex mmedia
13166 Use media instructions.
13168 @item -mno-media
13169 @opindex mno-media
13171 Do not use media instructions.
13173 @item -mmuladd
13174 @opindex mmuladd
13176 Use multiply and add/subtract instructions.
13178 @item -mno-muladd
13179 @opindex mno-muladd
13181 Do not use multiply and add/subtract instructions.
13183 @item -mfdpic
13184 @opindex mfdpic
13186 Select the FDPIC ABI, which uses function descriptors to represent
13187 pointers to functions.  Without any PIC/PIE-related options, it
13188 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
13189 assumes GOT entries and small data are within a 12-bit range from the
13190 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
13191 are computed with 32 bits.
13192 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13194 @item -minline-plt
13195 @opindex minline-plt
13197 Enable inlining of PLT entries in function calls to functions that are
13198 not known to bind locally.  It has no effect without @option{-mfdpic}.
13199 It's enabled by default if optimizing for speed and compiling for
13200 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13201 optimization option such as @option{-O3} or above is present in the
13202 command line.
13204 @item -mTLS
13205 @opindex mTLS
13207 Assume a large TLS segment when generating thread-local code.
13209 @item -mtls
13210 @opindex mtls
13212 Do not assume a large TLS segment when generating thread-local code.
13214 @item -mgprel-ro
13215 @opindex mgprel-ro
13217 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13218 that is known to be in read-only sections.  It's enabled by default,
13219 except for @option{-fpic} or @option{-fpie}: even though it may help
13220 make the global offset table smaller, it trades 1 instruction for 4.
13221 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13222 one of which may be shared by multiple symbols, and it avoids the need
13223 for a GOT entry for the referenced symbol, so it's more likely to be a
13224 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13226 @item -multilib-library-pic
13227 @opindex multilib-library-pic
13229 Link with the (library, not FD) pic libraries.  It's implied by
13230 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13231 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13232 it explicitly.
13234 @item -mlinked-fp
13235 @opindex mlinked-fp
13237 Follow the EABI requirement of always creating a frame pointer whenever
13238 a stack frame is allocated.  This option is enabled by default and can
13239 be disabled with @option{-mno-linked-fp}.
13241 @item -mlong-calls
13242 @opindex mlong-calls
13244 Use indirect addressing to call functions outside the current
13245 compilation unit.  This allows the functions to be placed anywhere
13246 within the 32-bit address space.
13248 @item -malign-labels
13249 @opindex malign-labels
13251 Try to align labels to an 8-byte boundary by inserting NOPs into the
13252 previous packet.  This option only has an effect when VLIW packing
13253 is enabled.  It doesn't create new packets; it merely adds NOPs to
13254 existing ones.
13256 @item -mlibrary-pic
13257 @opindex mlibrary-pic
13259 Generate position-independent EABI code.
13261 @item -macc-4
13262 @opindex macc-4
13264 Use only the first four media accumulator registers.
13266 @item -macc-8
13267 @opindex macc-8
13269 Use all eight media accumulator registers.
13271 @item -mpack
13272 @opindex mpack
13274 Pack VLIW instructions.
13276 @item -mno-pack
13277 @opindex mno-pack
13279 Do not pack VLIW instructions.
13281 @item -mno-eflags
13282 @opindex mno-eflags
13284 Do not mark ABI switches in e_flags.
13286 @item -mcond-move
13287 @opindex mcond-move
13289 Enable the use of conditional-move instructions (default).
13291 This switch is mainly for debugging the compiler and will likely be removed
13292 in a future version.
13294 @item -mno-cond-move
13295 @opindex mno-cond-move
13297 Disable the use of conditional-move instructions.
13299 This switch is mainly for debugging the compiler and will likely be removed
13300 in a future version.
13302 @item -mscc
13303 @opindex mscc
13305 Enable the use of conditional set instructions (default).
13307 This switch is mainly for debugging the compiler and will likely be removed
13308 in a future version.
13310 @item -mno-scc
13311 @opindex mno-scc
13313 Disable the use of conditional set instructions.
13315 This switch is mainly for debugging the compiler and will likely be removed
13316 in a future version.
13318 @item -mcond-exec
13319 @opindex mcond-exec
13321 Enable the use of conditional execution (default).
13323 This switch is mainly for debugging the compiler and will likely be removed
13324 in a future version.
13326 @item -mno-cond-exec
13327 @opindex mno-cond-exec
13329 Disable the use of conditional execution.
13331 This switch is mainly for debugging the compiler and will likely be removed
13332 in a future version.
13334 @item -mvliw-branch
13335 @opindex mvliw-branch
13337 Run a pass to pack branches into VLIW instructions (default).
13339 This switch is mainly for debugging the compiler and will likely be removed
13340 in a future version.
13342 @item -mno-vliw-branch
13343 @opindex mno-vliw-branch
13345 Do not run a pass to pack branches into VLIW instructions.
13347 This switch is mainly for debugging the compiler and will likely be removed
13348 in a future version.
13350 @item -mmulti-cond-exec
13351 @opindex mmulti-cond-exec
13353 Enable optimization of @code{&&} and @code{||} in conditional execution
13354 (default).
13356 This switch is mainly for debugging the compiler and will likely be removed
13357 in a future version.
13359 @item -mno-multi-cond-exec
13360 @opindex mno-multi-cond-exec
13362 Disable optimization of @code{&&} and @code{||} in conditional execution.
13364 This switch is mainly for debugging the compiler and will likely be removed
13365 in a future version.
13367 @item -mnested-cond-exec
13368 @opindex mnested-cond-exec
13370 Enable nested conditional execution optimizations (default).
13372 This switch is mainly for debugging the compiler and will likely be removed
13373 in a future version.
13375 @item -mno-nested-cond-exec
13376 @opindex mno-nested-cond-exec
13378 Disable nested conditional execution optimizations.
13380 This switch is mainly for debugging the compiler and will likely be removed
13381 in a future version.
13383 @item -moptimize-membar
13384 @opindex moptimize-membar
13386 This switch removes redundant @code{membar} instructions from the
13387 compiler-generated code.  It is enabled by default.
13389 @item -mno-optimize-membar
13390 @opindex mno-optimize-membar
13392 This switch disables the automatic removal of redundant @code{membar}
13393 instructions from the generated code.
13395 @item -mtomcat-stats
13396 @opindex mtomcat-stats
13398 Cause gas to print out tomcat statistics.
13400 @item -mcpu=@var{cpu}
13401 @opindex mcpu
13403 Select the processor type for which to generate code.  Possible values are
13404 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
13405 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
13407 @end table
13409 @node GNU/Linux Options
13410 @subsection GNU/Linux Options
13412 These @samp{-m} options are defined for GNU/Linux targets:
13414 @table @gcctabopt
13415 @item -mglibc
13416 @opindex mglibc
13417 Use the GNU C library.  This is the default except
13418 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
13420 @item -muclibc
13421 @opindex muclibc
13422 Use uClibc C library.  This is the default on
13423 @samp{*-*-linux-*uclibc*} targets.
13425 @item -mbionic
13426 @opindex mbionic
13427 Use Bionic C library.  This is the default on
13428 @samp{*-*-linux-*android*} targets.
13430 @item -mandroid
13431 @opindex mandroid
13432 Compile code compatible with Android platform.  This is the default on
13433 @samp{*-*-linux-*android*} targets.
13435 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
13436 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
13437 this option makes the GCC driver pass Android-specific options to the linker.
13438 Finally, this option causes the preprocessor macro @code{__ANDROID__}
13439 to be defined.
13441 @item -tno-android-cc
13442 @opindex tno-android-cc
13443 Disable compilation effects of @option{-mandroid}, i.e., do not enable
13444 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
13445 @option{-fno-rtti} by default.
13447 @item -tno-android-ld
13448 @opindex tno-android-ld
13449 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
13450 linking options to the linker.
13452 @end table
13454 @node H8/300 Options
13455 @subsection H8/300 Options
13457 These @samp{-m} options are defined for the H8/300 implementations:
13459 @table @gcctabopt
13460 @item -mrelax
13461 @opindex mrelax
13462 Shorten some address references at link time, when possible; uses the
13463 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
13464 ld, Using ld}, for a fuller description.
13466 @item -mh
13467 @opindex mh
13468 Generate code for the H8/300H@.
13470 @item -ms
13471 @opindex ms
13472 Generate code for the H8S@.
13474 @item -mn
13475 @opindex mn
13476 Generate code for the H8S and H8/300H in the normal mode.  This switch
13477 must be used either with @option{-mh} or @option{-ms}.
13479 @item -ms2600
13480 @opindex ms2600
13481 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
13483 @item -mexr
13484 @opindex mexr
13485 Extended registers are stored on stack before execution of function
13486 with monitor attribute. Default option is @option{-mexr}.
13487 This option is valid only for H8S targets.
13489 @item -mno-exr
13490 @opindex mno-exr
13491 Extended registers are not stored on stack before execution of function 
13492 with monitor attribute. Default option is @option{-mno-exr}. 
13493 This option is valid only for H8S targets.
13495 @item -mint32
13496 @opindex mint32
13497 Make @code{int} data 32 bits by default.
13499 @item -malign-300
13500 @opindex malign-300
13501 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
13502 The default for the H8/300H and H8S is to align longs and floats on
13503 4-byte boundaries.
13504 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
13505 This option has no effect on the H8/300.
13506 @end table
13508 @node HPPA Options
13509 @subsection HPPA Options
13510 @cindex HPPA Options
13512 These @samp{-m} options are defined for the HPPA family of computers:
13514 @table @gcctabopt
13515 @item -march=@var{architecture-type}
13516 @opindex march
13517 Generate code for the specified architecture.  The choices for
13518 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
13519 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
13520 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
13521 architecture option for your machine.  Code compiled for lower numbered
13522 architectures runs on higher numbered architectures, but not the
13523 other way around.
13525 @item -mpa-risc-1-0
13526 @itemx -mpa-risc-1-1
13527 @itemx -mpa-risc-2-0
13528 @opindex mpa-risc-1-0
13529 @opindex mpa-risc-1-1
13530 @opindex mpa-risc-2-0
13531 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
13533 @item -mjump-in-delay
13534 @opindex mjump-in-delay
13535 Fill delay slots of function calls with unconditional jump instructions
13536 by modifying the return pointer for the function call to be the target
13537 of the conditional jump.
13539 @item -mdisable-fpregs
13540 @opindex mdisable-fpregs
13541 Prevent floating-point registers from being used in any manner.  This is
13542 necessary for compiling kernels that perform lazy context switching of
13543 floating-point registers.  If you use this option and attempt to perform
13544 floating-point operations, the compiler aborts.
13546 @item -mdisable-indexing
13547 @opindex mdisable-indexing
13548 Prevent the compiler from using indexing address modes.  This avoids some
13549 rather obscure problems when compiling MIG generated code under MACH@.
13551 @item -mno-space-regs
13552 @opindex mno-space-regs
13553 Generate code that assumes the target has no space registers.  This allows
13554 GCC to generate faster indirect calls and use unscaled index address modes.
13556 Such code is suitable for level 0 PA systems and kernels.
13558 @item -mfast-indirect-calls
13559 @opindex mfast-indirect-calls
13560 Generate code that assumes calls never cross space boundaries.  This
13561 allows GCC to emit code that performs faster indirect calls.
13563 This option does not work in the presence of shared libraries or nested
13564 functions.
13566 @item -mfixed-range=@var{register-range}
13567 @opindex mfixed-range
13568 Generate code treating the given register range as fixed registers.
13569 A fixed register is one that the register allocator cannot use.  This is
13570 useful when compiling kernel code.  A register range is specified as
13571 two registers separated by a dash.  Multiple register ranges can be
13572 specified separated by a comma.
13574 @item -mlong-load-store
13575 @opindex mlong-load-store
13576 Generate 3-instruction load and store sequences as sometimes required by
13577 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13578 the HP compilers.
13580 @item -mportable-runtime
13581 @opindex mportable-runtime
13582 Use the portable calling conventions proposed by HP for ELF systems.
13584 @item -mgas
13585 @opindex mgas
13586 Enable the use of assembler directives only GAS understands.
13588 @item -mschedule=@var{cpu-type}
13589 @opindex mschedule
13590 Schedule code according to the constraints for the machine type
13591 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13592 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13593 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13594 proper scheduling option for your machine.  The default scheduling is
13595 @samp{8000}.
13597 @item -mlinker-opt
13598 @opindex mlinker-opt
13599 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13600 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13601 linkers in which they give bogus error messages when linking some programs.
13603 @item -msoft-float
13604 @opindex msoft-float
13605 Generate output containing library calls for floating point.
13606 @strong{Warning:} the requisite libraries are not available for all HPPA
13607 targets.  Normally the facilities of the machine's usual C compiler are
13608 used, but this cannot be done directly in cross-compilation.  You must make
13609 your own arrangements to provide suitable library functions for
13610 cross-compilation.
13612 @option{-msoft-float} changes the calling convention in the output file;
13613 therefore, it is only useful if you compile @emph{all} of a program with
13614 this option.  In particular, you need to compile @file{libgcc.a}, the
13615 library that comes with GCC, with @option{-msoft-float} in order for
13616 this to work.
13618 @item -msio
13619 @opindex msio
13620 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13621 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13622 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13623 options are available under HP-UX and HI-UX@.
13625 @item -mgnu-ld
13626 @opindex mgnu-ld
13627 Use options specific to GNU @command{ld}.
13628 This passes @option{-shared} to @command{ld} when
13629 building a shared library.  It is the default when GCC is configured,
13630 explicitly or implicitly, with the GNU linker.  This option does not
13631 affect which @command{ld} is called; it only changes what parameters
13632 are passed to that @command{ld}.
13633 The @command{ld} that is called is determined by the
13634 @option{--with-ld} configure option, GCC's program search path, and
13635 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13636 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13637 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13639 @item -mhp-ld
13640 @opindex mhp-ld
13641 Use options specific to HP @command{ld}.
13642 This passes @option{-b} to @command{ld} when building
13643 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13644 links.  It is the default when GCC is configured, explicitly or
13645 implicitly, with the HP linker.  This option does not affect
13646 which @command{ld} is called; it only changes what parameters are passed to that
13647 @command{ld}.
13648 The @command{ld} that is called is determined by the @option{--with-ld}
13649 configure option, GCC's program search path, and finally by the user's
13650 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13651 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13652 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13654 @item -mlong-calls
13655 @opindex mno-long-calls
13656 Generate code that uses long call sequences.  This ensures that a call
13657 is always able to reach linker generated stubs.  The default is to generate
13658 long calls only when the distance from the call site to the beginning
13659 of the function or translation unit, as the case may be, exceeds a
13660 predefined limit set by the branch type being used.  The limits for
13661 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13662 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13663 240,000 bytes.
13665 Distances are measured from the beginning of functions when using the
13666 @option{-ffunction-sections} option, or when using the @option{-mgas}
13667 and @option{-mno-portable-runtime} options together under HP-UX with
13668 the SOM linker.
13670 It is normally not desirable to use this option as it degrades
13671 performance.  However, it may be useful in large applications,
13672 particularly when partial linking is used to build the application.
13674 The types of long calls used depends on the capabilities of the
13675 assembler and linker, and the type of code being generated.  The
13676 impact on systems that support long absolute calls, and long pic
13677 symbol-difference or pc-relative calls should be relatively small.
13678 However, an indirect call is used on 32-bit ELF systems in pic code
13679 and it is quite long.
13681 @item -munix=@var{unix-std}
13682 @opindex march
13683 Generate compiler predefines and select a startfile for the specified
13684 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13685 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13686 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13687 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13688 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13689 and later.
13691 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13692 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13693 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13694 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13695 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13696 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13698 It is @emph{important} to note that this option changes the interfaces
13699 for various library routines.  It also affects the operational behavior
13700 of the C library.  Thus, @emph{extreme} care is needed in using this
13701 option.
13703 Library code that is intended to operate with more than one UNIX
13704 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13705 as appropriate.  Most GNU software doesn't provide this capability.
13707 @item -nolibdld
13708 @opindex nolibdld
13709 Suppress the generation of link options to search libdld.sl when the
13710 @option{-static} option is specified on HP-UX 10 and later.
13712 @item -static
13713 @opindex static
13714 The HP-UX implementation of setlocale in libc has a dependency on
13715 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13716 when the @option{-static} option is specified, special link options
13717 are needed to resolve this dependency.
13719 On HP-UX 10 and later, the GCC driver adds the necessary options to
13720 link with libdld.sl when the @option{-static} option is specified.
13721 This causes the resulting binary to be dynamic.  On the 64-bit port,
13722 the linkers generate dynamic binaries by default in any case.  The
13723 @option{-nolibdld} option can be used to prevent the GCC driver from
13724 adding these link options.
13726 @item -threads
13727 @opindex threads
13728 Add support for multithreading with the @dfn{dce thread} library
13729 under HP-UX@.  This option sets flags for both the preprocessor and
13730 linker.
13731 @end table
13733 @node i386 and x86-64 Options
13734 @subsection Intel 386 and AMD x86-64 Options
13735 @cindex i386 Options
13736 @cindex x86-64 Options
13737 @cindex Intel 386 Options
13738 @cindex AMD x86-64 Options
13740 These @samp{-m} options are defined for the i386 and x86-64 family of
13741 computers:
13743 @table @gcctabopt
13745 @item -march=@var{cpu-type}
13746 @opindex march
13747 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13748 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13749 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13750 to generate code that may not run at all on processors other than the one
13751 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13752 @option{-mtune=@var{cpu-type}}.
13754 The choices for @var{cpu-type} are:
13756 @table @samp
13757 @item native
13758 This selects the CPU to generate code for at compilation time by determining
13759 the processor type of the compiling machine.  Using @option{-march=native}
13760 enables all instruction subsets supported by the local machine (hence
13761 the result might not run on different machines).  Using @option{-mtune=native}
13762 produces code optimized for the local machine under the constraints
13763 of the selected instruction set.  
13765 @item i386
13766 Original Intel i386 CPU@.
13768 @item i486
13769 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13771 @item i586
13772 @itemx pentium
13773 Intel Pentium CPU with no MMX support.
13775 @item pentium-mmx
13776 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13778 @item pentiumpro
13779 Intel Pentium Pro CPU@.
13781 @item i686
13782 When used with @option{-march}, the Pentium Pro
13783 instruction set is used, so the code runs on all i686 family chips.
13784 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13786 @item pentium2
13787 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13788 support.
13790 @item pentium3
13791 @itemx pentium3m
13792 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13793 set support.
13795 @item pentium-m
13796 Intel Pentium M; low-power version of Intel Pentium III CPU
13797 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13799 @item pentium4
13800 @itemx pentium4m
13801 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13803 @item prescott
13804 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13805 set support.
13807 @item nocona
13808 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13809 SSE2 and SSE3 instruction set support.
13811 @item core2
13812 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13813 instruction set support.
13815 @item corei7
13816 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13817 and SSE4.2 instruction set support.
13819 @item corei7-avx
13820 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13821 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13823 @item core-avx-i
13824 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13825 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13826 set support.
13828 @item atom
13829 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13830 instruction set support.
13832 @item k6
13833 AMD K6 CPU with MMX instruction set support.
13835 @item k6-2
13836 @itemx k6-3
13837 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13839 @item athlon
13840 @itemx athlon-tbird
13841 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13842 support.
13844 @item athlon-4
13845 @itemx athlon-xp
13846 @itemx athlon-mp
13847 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13848 instruction set support.
13850 @item k8
13851 @itemx opteron
13852 @itemx athlon64
13853 @itemx athlon-fx
13854 Processors based on the AMD K8 core with x86-64 instruction set support,
13855 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13856 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13857 instruction set extensions.)
13859 @item k8-sse3
13860 @itemx opteron-sse3
13861 @itemx athlon64-sse3
13862 Improved versions of AMD K8 cores with SSE3 instruction set support.
13864 @item amdfam10
13865 @itemx barcelona
13866 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13867 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13868 instruction set extensions.)
13870 @item bdver1
13871 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13872 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13873 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13874 @item bdver2
13875 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13876 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13877 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13878 extensions.)
13879 @item bdver3
13880 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13881 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13882 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13883 extensions.
13885 @item btver1
13886 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13887 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13888 instruction set extensions.)
13890 @item btver2
13891 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
13892 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
13893 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
13895 @item winchip-c6
13896 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13897 set support.
13899 @item winchip2
13900 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13901 instruction set support.
13903 @item c3
13904 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13905 implemented for this chip.)
13907 @item c3-2
13908 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13909 (No scheduling is
13910 implemented for this chip.)
13912 @item geode
13913 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
13914 @end table
13916 @item -mtune=@var{cpu-type}
13917 @opindex mtune
13918 Tune to @var{cpu-type} everything applicable about the generated code, except
13919 for the ABI and the set of available instructions.  
13920 While picking a specific @var{cpu-type} schedules things appropriately
13921 for that particular chip, the compiler does not generate any code that
13922 cannot run on the default machine type unless you use a
13923 @option{-march=@var{cpu-type}} option.
13924 For example, if GCC is configured for i686-pc-linux-gnu
13925 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
13926 but still runs on i686 machines.
13928 The choices for @var{cpu-type} are the same as for @option{-march}.
13929 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
13931 @table @samp
13932 @item generic
13933 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
13934 If you know the CPU on which your code will run, then you should use
13935 the corresponding @option{-mtune} or @option{-march} option instead of
13936 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
13937 of your application will have, then you should use this option.
13939 As new processors are deployed in the marketplace, the behavior of this
13940 option will change.  Therefore, if you upgrade to a newer version of
13941 GCC, code generation controlled by this option will change to reflect
13942 the processors
13943 that are most common at the time that version of GCC is released.
13945 There is no @option{-march=generic} option because @option{-march}
13946 indicates the instruction set the compiler can use, and there is no
13947 generic instruction set applicable to all processors.  In contrast,
13948 @option{-mtune} indicates the processor (or, in this case, collection of
13949 processors) for which the code is optimized.
13950 @end table
13952 @item -mcpu=@var{cpu-type}
13953 @opindex mcpu
13954 A deprecated synonym for @option{-mtune}.
13956 @item -mfpmath=@var{unit}
13957 @opindex mfpmath
13958 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
13959 for @var{unit} are:
13961 @table @samp
13962 @item 387
13963 Use the standard 387 floating-point coprocessor present on the majority of chips and
13964 emulated otherwise.  Code compiled with this option runs almost everywhere.
13965 The temporary results are computed in 80-bit precision instead of the precision
13966 specified by the type, resulting in slightly different results compared to most
13967 of other chips.  See @option{-ffloat-store} for more detailed description.
13969 This is the default choice for i386 compiler.
13971 @item sse
13972 Use scalar floating-point instructions present in the SSE instruction set.
13973 This instruction set is supported by Pentium III and newer chips,
13974 and in the AMD line
13975 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
13976 instruction set supports only single-precision arithmetic, thus the double and
13977 extended-precision arithmetic are still done using 387.  A later version, present
13978 only in Pentium 4 and AMD x86-64 chips, supports double-precision
13979 arithmetic too.
13981 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
13982 or @option{-msse2} switches to enable SSE extensions and make this option
13983 effective.  For the x86-64 compiler, these extensions are enabled by default.
13985 The resulting code should be considerably faster in the majority of cases and avoid
13986 the numerical instability problems of 387 code, but may break some existing
13987 code that expects temporaries to be 80 bits.
13989 This is the default choice for the x86-64 compiler.
13991 @item sse,387
13992 @itemx sse+387
13993 @itemx both
13994 Attempt to utilize both instruction sets at once.  This effectively doubles the
13995 amount of available registers, and on chips with separate execution units for
13996 387 and SSE the execution resources too.  Use this option with care, as it is
13997 still experimental, because the GCC register allocator does not model separate
13998 functional units well, resulting in unstable performance.
13999 @end table
14001 @item -masm=@var{dialect}
14002 @opindex masm=@var{dialect}
14003 Output assembly instructions using selected @var{dialect}.  Supported
14004 choices are @samp{intel} or @samp{att} (the default).  Darwin does
14005 not support @samp{intel}.
14007 @item -mieee-fp
14008 @itemx -mno-ieee-fp
14009 @opindex mieee-fp
14010 @opindex mno-ieee-fp
14011 Control whether or not the compiler uses IEEE floating-point
14012 comparisons.  These correctly handle the case where the result of a
14013 comparison is unordered.
14015 @item -msoft-float
14016 @opindex msoft-float
14017 Generate output containing library calls for floating point.
14019 @strong{Warning:} the requisite libraries are not part of GCC@.
14020 Normally the facilities of the machine's usual C compiler are used, but
14021 this can't be done directly in cross-compilation.  You must make your
14022 own arrangements to provide suitable library functions for
14023 cross-compilation.
14025 On machines where a function returns floating-point results in the 80387
14026 register stack, some floating-point opcodes may be emitted even if
14027 @option{-msoft-float} is used.
14029 @item -mno-fp-ret-in-387
14030 @opindex mno-fp-ret-in-387
14031 Do not use the FPU registers for return values of functions.
14033 The usual calling convention has functions return values of types
14034 @code{float} and @code{double} in an FPU register, even if there
14035 is no FPU@.  The idea is that the operating system should emulate
14036 an FPU@.
14038 The option @option{-mno-fp-ret-in-387} causes such values to be returned
14039 in ordinary CPU registers instead.
14041 @item -mno-fancy-math-387
14042 @opindex mno-fancy-math-387
14043 Some 387 emulators do not support the @code{sin}, @code{cos} and
14044 @code{sqrt} instructions for the 387.  Specify this option to avoid
14045 generating those instructions.  This option is the default on FreeBSD,
14046 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
14047 indicates that the target CPU always has an FPU and so the
14048 instruction does not need emulation.  These
14049 instructions are not generated unless you also use the
14050 @option{-funsafe-math-optimizations} switch.
14052 @item -malign-double
14053 @itemx -mno-align-double
14054 @opindex malign-double
14055 @opindex mno-align-double
14056 Control whether GCC aligns @code{double}, @code{long double}, and
14057 @code{long long} variables on a two-word boundary or a one-word
14058 boundary.  Aligning @code{double} variables on a two-word boundary
14059 produces code that runs somewhat faster on a Pentium at the
14060 expense of more memory.
14062 On x86-64, @option{-malign-double} is enabled by default.
14064 @strong{Warning:} if you use the @option{-malign-double} switch,
14065 structures containing the above types are aligned differently than
14066 the published application binary interface specifications for the 386
14067 and are not binary compatible with structures in code compiled
14068 without that switch.
14070 @item -m96bit-long-double
14071 @itemx -m128bit-long-double
14072 @opindex m96bit-long-double
14073 @opindex m128bit-long-double
14074 These switches control the size of @code{long double} type.  The i386
14075 application binary interface specifies the size to be 96 bits,
14076 so @option{-m96bit-long-double} is the default in 32-bit mode.
14078 Modern architectures (Pentium and newer) prefer @code{long double}
14079 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
14080 conforming to the ABI, this is not possible.  So specifying
14081 @option{-m128bit-long-double} aligns @code{long double}
14082 to a 16-byte boundary by padding the @code{long double} with an additional
14083 32-bit zero.
14085 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
14086 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
14088 Notice that neither of these options enable any extra precision over the x87
14089 standard of 80 bits for a @code{long double}.
14091 @strong{Warning:} if you override the default value for your target ABI, this
14092 changes the size of 
14093 structures and arrays containing @code{long double} variables,
14094 as well as modifying the function calling convention for functions taking
14095 @code{long double}.  Hence they are not binary-compatible
14096 with code compiled without that switch.
14098 @item -mlong-double-64
14099 @itemx -mlong-double-80
14100 @opindex mlong-double-64
14101 @opindex mlong-double-80
14102 These switches control the size of @code{long double} type. A size
14103 of 64 bits makes the @code{long double} type equivalent to the @code{double}
14104 type. This is the default for Bionic C library.
14106 @strong{Warning:} if you override the default value for your target ABI, this
14107 changes the size of
14108 structures and arrays containing @code{long double} variables,
14109 as well as modifying the function calling convention for functions taking
14110 @code{long double}.  Hence they are not binary-compatible
14111 with code compiled without that switch.
14113 @item -mlarge-data-threshold=@var{threshold}
14114 @opindex mlarge-data-threshold
14115 When @option{-mcmodel=medium} is specified, data objects larger than
14116 @var{threshold} are placed in the large data section.  This value must be the
14117 same across all objects linked into the binary, and defaults to 65535.
14119 @item -mrtd
14120 @opindex mrtd
14121 Use a different function-calling convention, in which functions that
14122 take a fixed number of arguments return with the @code{ret @var{num}}
14123 instruction, which pops their arguments while returning.  This saves one
14124 instruction in the caller since there is no need to pop the arguments
14125 there.
14127 You can specify that an individual function is called with this calling
14128 sequence with the function attribute @samp{stdcall}.  You can also
14129 override the @option{-mrtd} option by using the function attribute
14130 @samp{cdecl}.  @xref{Function Attributes}.
14132 @strong{Warning:} this calling convention is incompatible with the one
14133 normally used on Unix, so you cannot use it if you need to call
14134 libraries compiled with the Unix compiler.
14136 Also, you must provide function prototypes for all functions that
14137 take variable numbers of arguments (including @code{printf});
14138 otherwise incorrect code is generated for calls to those
14139 functions.
14141 In addition, seriously incorrect code results if you call a
14142 function with too many arguments.  (Normally, extra arguments are
14143 harmlessly ignored.)
14145 @item -mregparm=@var{num}
14146 @opindex mregparm
14147 Control how many registers are used to pass integer arguments.  By
14148 default, no registers are used to pass arguments, and at most 3
14149 registers can be used.  You can control this behavior for a specific
14150 function by using the function attribute @samp{regparm}.
14151 @xref{Function Attributes}.
14153 @strong{Warning:} if you use this switch, and
14154 @var{num} is nonzero, then you must build all modules with the same
14155 value, including any libraries.  This includes the system libraries and
14156 startup modules.
14158 @item -msseregparm
14159 @opindex msseregparm
14160 Use SSE register passing conventions for float and double arguments
14161 and return values.  You can control this behavior for a specific
14162 function by using the function attribute @samp{sseregparm}.
14163 @xref{Function Attributes}.
14165 @strong{Warning:} if you use this switch then you must build all
14166 modules with the same value, including any libraries.  This includes
14167 the system libraries and startup modules.
14169 @item -mvect8-ret-in-mem
14170 @opindex mvect8-ret-in-mem
14171 Return 8-byte vectors in memory instead of MMX registers.  This is the
14172 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
14173 Studio compilers until version 12.  Later compiler versions (starting
14174 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
14175 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
14176 you need to remain compatible with existing code produced by those
14177 previous compiler versions or older versions of GCC@.
14179 @item -mpc32
14180 @itemx -mpc64
14181 @itemx -mpc80
14182 @opindex mpc32
14183 @opindex mpc64
14184 @opindex mpc80
14186 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
14187 is specified, the significands of results of floating-point operations are
14188 rounded to 24 bits (single precision); @option{-mpc64} rounds the
14189 significands of results of floating-point operations to 53 bits (double
14190 precision) and @option{-mpc80} rounds the significands of results of
14191 floating-point operations to 64 bits (extended double precision), which is
14192 the default.  When this option is used, floating-point operations in higher
14193 precisions are not available to the programmer without setting the FPU
14194 control word explicitly.
14196 Setting the rounding of floating-point operations to less than the default
14197 80 bits can speed some programs by 2% or more.  Note that some mathematical
14198 libraries assume that extended-precision (80-bit) floating-point operations
14199 are enabled by default; routines in such libraries could suffer significant
14200 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14201 when this option is used to set the precision to less than extended precision.
14203 @item -mstackrealign
14204 @opindex mstackrealign
14205 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14206 option generates an alternate prologue and epilogue that realigns the
14207 run-time stack if necessary.  This supports mixing legacy codes that keep
14208 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14209 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14210 applicable to individual functions.
14212 @item -mpreferred-stack-boundary=@var{num}
14213 @opindex mpreferred-stack-boundary
14214 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14215 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14216 the default is 4 (16 bytes or 128 bits).
14218 @strong{Warning:} When generating code for the x86-64 architecture with
14219 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14220 used to keep the stack boundary aligned to 8 byte boundary.  Since
14221 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14222 intended to be used in controlled environment where stack space is
14223 important limitation.  This option will lead to wrong code when functions
14224 compiled with 16 byte stack alignment (such as functions from a standard
14225 library) are called with misaligned stack.  In this case, SSE
14226 instructions may lead to misaligned memory access traps.  In addition,
14227 variable arguments will be handled incorrectly for 16 byte aligned
14228 objects (including x87 long double and __int128), leading to wrong
14229 results.  You must build all modules with
14230 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14231 includes the system libraries and startup modules.
14233 @item -mincoming-stack-boundary=@var{num}
14234 @opindex mincoming-stack-boundary
14235 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14236 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14237 the one specified by @option{-mpreferred-stack-boundary} is used.
14239 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14240 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14241 suffer significant run time performance penalties.  On Pentium III, the
14242 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14243 properly if it is not 16-byte aligned.
14245 To ensure proper alignment of this values on the stack, the stack boundary
14246 must be as aligned as that required by any value stored on the stack.
14247 Further, every function must be generated such that it keeps the stack
14248 aligned.  Thus calling a function compiled with a higher preferred
14249 stack boundary from a function compiled with a lower preferred stack
14250 boundary most likely misaligns the stack.  It is recommended that
14251 libraries that use callbacks always use the default setting.
14253 This extra alignment does consume extra stack space, and generally
14254 increases code size.  Code that is sensitive to stack space usage, such
14255 as embedded systems and operating system kernels, may want to reduce the
14256 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14258 @item -mmmx
14259 @itemx -mno-mmx
14260 @itemx -msse
14261 @itemx -mno-sse
14262 @itemx -msse2
14263 @itemx -mno-sse2
14264 @itemx -msse3
14265 @itemx -mno-sse3
14266 @itemx -mssse3
14267 @itemx -mno-ssse3
14268 @itemx -msse4.1
14269 @need 800
14270 @itemx -mno-sse4.1
14271 @itemx -msse4.2
14272 @itemx -mno-sse4.2
14273 @itemx -msse4
14274 @itemx -mno-sse4
14275 @itemx -mavx
14276 @itemx -mno-avx
14277 @itemx -mavx2
14278 @itemx -mno-avx2
14279 @itemx -maes
14280 @itemx -mno-aes
14281 @itemx -mpclmul
14282 @need 800
14283 @itemx -mno-pclmul
14284 @itemx -mfsgsbase
14285 @itemx -mno-fsgsbase
14286 @itemx -mrdrnd
14287 @itemx -mno-rdrnd
14288 @itemx -mf16c
14289 @itemx -mno-f16c
14290 @itemx -mfma
14291 @itemx -mno-fma
14292 @itemx -msse4a
14293 @itemx -mno-sse4a
14294 @itemx -mfma4
14295 @need 800
14296 @itemx -mno-fma4
14297 @itemx -mxop
14298 @itemx -mno-xop
14299 @itemx -mlwp
14300 @itemx -mno-lwp
14301 @itemx -m3dnow
14302 @itemx -mno-3dnow
14303 @itemx -mpopcnt
14304 @itemx -mno-popcnt
14305 @itemx -mabm
14306 @itemx -mno-abm
14307 @itemx -mbmi
14308 @itemx -mbmi2
14309 @itemx -mno-bmi
14310 @itemx -mno-bmi2
14311 @itemx -mlzcnt
14312 @itemx -mno-lzcnt
14313 @itemx -mrtm
14314 @itemx -mtbm
14315 @itemx -mno-tbm
14316 @opindex mmmx
14317 @opindex mno-mmx
14318 @opindex msse
14319 @opindex mno-sse
14320 @opindex m3dnow
14321 @opindex mno-3dnow
14322 These switches enable or disable the use of instructions in the MMX, SSE,
14323 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
14324 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT, RTM or 3DNow!@:
14325 extended instruction sets.
14326 These extensions are also available as built-in functions: see
14327 @ref{X86 Built-in Functions}, for details of the functions enabled and
14328 disabled by these switches.
14330 To generate SSE/SSE2 instructions automatically from floating-point
14331 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
14333 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
14334 generates new AVX instructions or AVX equivalence for all SSEx instructions
14335 when needed.
14337 These options enable GCC to use these extended instructions in
14338 generated code, even without @option{-mfpmath=sse}.  Applications that
14339 perform run-time CPU detection must compile separate files for each
14340 supported architecture, using the appropriate flags.  In particular,
14341 the file containing the CPU detection code should be compiled without
14342 these options.
14344 @item -mcld
14345 @opindex mcld
14346 This option instructs GCC to emit a @code{cld} instruction in the prologue
14347 of functions that use string instructions.  String instructions depend on
14348 the DF flag to select between autoincrement or autodecrement mode.  While the
14349 ABI specifies the DF flag to be cleared on function entry, some operating
14350 systems violate this specification by not clearing the DF flag in their
14351 exception dispatchers.  The exception handler can be invoked with the DF flag
14352 set, which leads to wrong direction mode when string instructions are used.
14353 This option can be enabled by default on 32-bit x86 targets by configuring
14354 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
14355 instructions can be suppressed with the @option{-mno-cld} compiler option
14356 in this case.
14358 @item -mvzeroupper
14359 @opindex mvzeroupper
14360 This option instructs GCC to emit a @code{vzeroupper} instruction
14361 before a transfer of control flow out of the function to minimize
14362 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
14363 intrinsics.
14365 @item -mprefer-avx128
14366 @opindex mprefer-avx128
14367 This option instructs GCC to use 128-bit AVX instructions instead of
14368 256-bit AVX instructions in the auto-vectorizer.
14370 @item -mcx16
14371 @opindex mcx16
14372 This option enables GCC to generate @code{CMPXCHG16B} instructions.
14373 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
14374 (or oword) data types.  
14375 This is useful for high-resolution counters that can be updated
14376 by multiple processors (or cores).  This instruction is generated as part of
14377 atomic built-in functions: see @ref{__sync Builtins} or
14378 @ref{__atomic Builtins} for details.
14380 @item -msahf
14381 @opindex msahf
14382 This option enables generation of @code{SAHF} instructions in 64-bit code.
14383 Early Intel Pentium 4 CPUs with Intel 64 support,
14384 prior to the introduction of Pentium 4 G1 step in December 2005,
14385 lacked the @code{LAHF} and @code{SAHF} instructions
14386 which were supported by AMD64.
14387 These are load and store instructions, respectively, for certain status flags.
14388 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
14389 @code{drem}, and @code{remainder} built-in functions;
14390 see @ref{Other Builtins} for details.
14392 @item -mmovbe
14393 @opindex mmovbe
14394 This option enables use of the @code{movbe} instruction to implement
14395 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
14397 @item -mcrc32
14398 @opindex mcrc32
14399 This option enables built-in functions @code{__builtin_ia32_crc32qi},
14400 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
14401 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
14403 @item -mrecip
14404 @opindex mrecip
14405 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
14406 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
14407 with an additional Newton-Raphson step
14408 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
14409 (and their vectorized
14410 variants) for single-precision floating-point arguments.  These instructions
14411 are generated only when @option{-funsafe-math-optimizations} is enabled
14412 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
14413 Note that while the throughput of the sequence is higher than the throughput
14414 of the non-reciprocal instruction, the precision of the sequence can be
14415 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
14417 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
14418 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
14419 combination), and doesn't need @option{-mrecip}.
14421 Also note that GCC emits the above sequence with additional Newton-Raphson step
14422 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
14423 already with @option{-ffast-math} (or the above option combination), and
14424 doesn't need @option{-mrecip}.
14426 @item -mrecip=@var{opt}
14427 @opindex mrecip=opt
14428 This option controls which reciprocal estimate instructions
14429 may be used.  @var{opt} is a comma-separated list of options, which may
14430 be preceded by a @samp{!} to invert the option:
14432 @table @samp
14433 @item all
14434 Enable all estimate instructions.
14436 @item default
14437 Enable the default instructions, equivalent to @option{-mrecip}.
14439 @item none
14440 Disable all estimate instructions, equivalent to @option{-mno-recip}.
14442 @item div
14443 Enable the approximation for scalar division.
14445 @item vec-div
14446 Enable the approximation for vectorized division.
14448 @item sqrt
14449 Enable the approximation for scalar square root.
14451 @item vec-sqrt
14452 Enable the approximation for vectorized square root.
14453 @end table
14455 So, for example, @option{-mrecip=all,!sqrt} enables
14456 all of the reciprocal approximations, except for square root.
14458 @item -mveclibabi=@var{type}
14459 @opindex mveclibabi
14460 Specifies the ABI type to use for vectorizing intrinsics using an
14461 external library.  Supported values for @var{type} are @samp{svml} 
14462 for the Intel short
14463 vector math library and @samp{acml} for the AMD math core library.
14464 To use this option, both @option{-ftree-vectorize} and
14465 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
14466 ABI-compatible library must be specified at link time.
14468 GCC currently emits calls to @code{vmldExp2},
14469 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
14470 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
14471 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
14472 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
14473 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
14474 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
14475 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
14476 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
14477 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
14478 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
14479 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
14480 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
14481 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
14482 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
14483 when @option{-mveclibabi=acml} is used.  
14485 @item -mabi=@var{name}
14486 @opindex mabi
14487 Generate code for the specified calling convention.  Permissible values
14488 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
14489 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
14490 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
14491 You can control this behavior for a specific function by
14492 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
14493 @xref{Function Attributes}.
14495 @item -mtls-dialect=@var{type}
14496 @opindex mtls-dialect
14497 Generate code to access thread-local storage using the @samp{gnu} or
14498 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
14499 @samp{gnu2} is more efficient, but it may add compile- and run-time
14500 requirements that cannot be satisfied on all systems.
14502 @item -mpush-args
14503 @itemx -mno-push-args
14504 @opindex mpush-args
14505 @opindex mno-push-args
14506 Use PUSH operations to store outgoing parameters.  This method is shorter
14507 and usually equally fast as method using SUB/MOV operations and is enabled
14508 by default.  In some cases disabling it may improve performance because of
14509 improved scheduling and reduced dependencies.
14511 @item -maccumulate-outgoing-args
14512 @opindex maccumulate-outgoing-args
14513 If enabled, the maximum amount of space required for outgoing arguments is
14514 computed in the function prologue.  This is faster on most modern CPUs
14515 because of reduced dependencies, improved scheduling and reduced stack usage
14516 when the preferred stack boundary is not equal to 2.  The drawback is a notable
14517 increase in code size.  This switch implies @option{-mno-push-args}.
14519 @item -mthreads
14520 @opindex mthreads
14521 Support thread-safe exception handling on MinGW.  Programs that rely
14522 on thread-safe exception handling must compile and link all code with the
14523 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
14524 @code{-D_MT}; when linking, it links in a special thread helper library
14525 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
14527 @item -mno-align-stringops
14528 @opindex mno-align-stringops
14529 Do not align the destination of inlined string operations.  This switch reduces
14530 code size and improves performance in case the destination is already aligned,
14531 but GCC doesn't know about it.
14533 @item -minline-all-stringops
14534 @opindex minline-all-stringops
14535 By default GCC inlines string operations only when the destination is 
14536 known to be aligned to least a 4-byte boundary.  
14537 This enables more inlining and increases code
14538 size, but may improve performance of code that depends on fast
14539 @code{memcpy}, @code{strlen},
14540 and @code{memset} for short lengths.
14542 @item -minline-stringops-dynamically
14543 @opindex minline-stringops-dynamically
14544 For string operations of unknown size, use run-time checks with
14545 inline code for small blocks and a library call for large blocks.
14547 @item -mstringop-strategy=@var{alg}
14548 @opindex mstringop-strategy=@var{alg}
14549 Override the internal decision heuristic for the particular algorithm to use
14550 for inlining string operations.  The allowed values for @var{alg} are:
14552 @table @samp
14553 @item rep_byte
14554 @itemx rep_4byte
14555 @itemx rep_8byte
14556 Expand using i386 @code{rep} prefix of the specified size.
14558 @item byte_loop
14559 @itemx loop
14560 @itemx unrolled_loop
14561 Expand into an inline loop.
14563 @item libcall
14564 Always use a library call.
14565 @end table
14567 @item -momit-leaf-frame-pointer
14568 @opindex momit-leaf-frame-pointer
14569 Don't keep the frame pointer in a register for leaf functions.  This
14570 avoids the instructions to save, set up, and restore frame pointers and
14571 makes an extra register available in leaf functions.  The option
14572 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14573 which might make debugging harder.
14575 @item -mtls-direct-seg-refs
14576 @itemx -mno-tls-direct-seg-refs
14577 @opindex mtls-direct-seg-refs
14578 Controls whether TLS variables may be accessed with offsets from the
14579 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14580 or whether the thread base pointer must be added.  Whether or not this
14581 is valid depends on the operating system, and whether it maps the
14582 segment to cover the entire TLS area.
14584 For systems that use the GNU C Library, the default is on.
14586 @item -msse2avx
14587 @itemx -mno-sse2avx
14588 @opindex msse2avx
14589 Specify that the assembler should encode SSE instructions with VEX
14590 prefix.  The option @option{-mavx} turns this on by default.
14592 @item -mfentry
14593 @itemx -mno-fentry
14594 @opindex mfentry
14595 If profiling is active (@option{-pg}), put the profiling
14596 counter call before the prologue.
14597 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14598 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14600 @item -m8bit-idiv
14601 @itemx -mno-8bit-idiv
14602 @opindex 8bit-idiv
14603 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14604 much faster than 32-bit/64-bit integer divide.  This option generates a
14605 run-time check.  If both dividend and divisor are within range of 0
14606 to 255, 8-bit unsigned integer divide is used instead of
14607 32-bit/64-bit integer divide.
14609 @item -mavx256-split-unaligned-load
14610 @itemx -mavx256-split-unaligned-store
14611 @opindex avx256-split-unaligned-load
14612 @opindex avx256-split-unaligned-store
14613 Split 32-byte AVX unaligned load and store.
14615 @item -mstack-protector-guard=@var{guard}
14616 @opindex mstack-protector-guard=@var{guard}
14617 Generate stack protection code using canary at @var{guard}.  Supported
14618 locations are @samp{global} for global canary or @samp{tls} for per-thread
14619 canary in the TLS block (the default).  This option has effect only when
14620 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
14622 @end table
14624 These @samp{-m} switches are supported in addition to the above
14625 on x86-64 processors in 64-bit environments.
14627 @table @gcctabopt
14628 @item -m32
14629 @itemx -m64
14630 @itemx -mx32
14631 @opindex m32
14632 @opindex m64
14633 @opindex mx32
14634 Generate code for a 32-bit or 64-bit environment.
14635 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14636 to 32 bits, and
14637 generates code that runs on any i386 system.
14639 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14640 types to 64 bits, and generates code for the x86-64 architecture.
14641 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14642 and @option{-mdynamic-no-pic} options.
14644 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14645 to 32 bits, and
14646 generates code for the x86-64 architecture.
14648 @item -mno-red-zone
14649 @opindex mno-red-zone
14650 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14651 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14652 stack pointer that is not modified by signal or interrupt handlers
14653 and therefore can be used for temporary data without adjusting the stack
14654 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14656 @item -mcmodel=small
14657 @opindex mcmodel=small
14658 Generate code for the small code model: the program and its symbols must
14659 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14660 Programs can be statically or dynamically linked.  This is the default
14661 code model.
14663 @item -mcmodel=kernel
14664 @opindex mcmodel=kernel
14665 Generate code for the kernel code model.  The kernel runs in the
14666 negative 2 GB of the address space.
14667 This model has to be used for Linux kernel code.
14669 @item -mcmodel=medium
14670 @opindex mcmodel=medium
14671 Generate code for the medium model: the program is linked in the lower 2
14672 GB of the address space.  Small symbols are also placed there.  Symbols
14673 with sizes larger than @option{-mlarge-data-threshold} are put into
14674 large data or BSS sections and can be located above 2GB.  Programs can
14675 be statically or dynamically linked.
14677 @item -mcmodel=large
14678 @opindex mcmodel=large
14679 Generate code for the large model.  This model makes no assumptions
14680 about addresses and sizes of sections.
14682 @item -maddress-mode=long
14683 @opindex maddress-mode=long
14684 Generate code for long address mode.  This is only supported for 64-bit
14685 and x32 environments.  It is the default address mode for 64-bit
14686 environments.
14688 @item -maddress-mode=short
14689 @opindex maddress-mode=short
14690 Generate code for short address mode.  This is only supported for 32-bit
14691 and x32 environments.  It is the default address mode for 32-bit and
14692 x32 environments.
14693 @end table
14695 @node i386 and x86-64 Windows Options
14696 @subsection i386 and x86-64 Windows Options
14697 @cindex i386 and x86-64 Windows Options
14699 These additional options are available for Microsoft Windows targets:
14701 @table @gcctabopt
14702 @item -mconsole
14703 @opindex mconsole
14704 This option
14705 specifies that a console application is to be generated, by
14706 instructing the linker to set the PE header subsystem type
14707 required for console applications.
14708 This option is available for Cygwin and MinGW targets and is
14709 enabled by default on those targets.
14711 @item -mdll
14712 @opindex mdll
14713 This option is available for Cygwin and MinGW targets.  It
14714 specifies that a DLL---a dynamic link library---is to be
14715 generated, enabling the selection of the required runtime
14716 startup object and entry point.
14718 @item -mnop-fun-dllimport
14719 @opindex mnop-fun-dllimport
14720 This option is available for Cygwin and MinGW targets.  It
14721 specifies that the @code{dllimport} attribute should be ignored.
14723 @item -mthread
14724 @opindex mthread
14725 This option is available for MinGW targets. It specifies
14726 that MinGW-specific thread support is to be used.
14728 @item -municode
14729 @opindex municode
14730 This option is available for MinGW-w64 targets.  It causes
14731 the @code{UNICODE} preprocessor macro to be predefined, and
14732 chooses Unicode-capable runtime startup code.
14734 @item -mwin32
14735 @opindex mwin32
14736 This option is available for Cygwin and MinGW targets.  It
14737 specifies that the typical Microsoft Windows predefined macros are to
14738 be set in the pre-processor, but does not influence the choice
14739 of runtime library/startup code.
14741 @item -mwindows
14742 @opindex mwindows
14743 This option is available for Cygwin and MinGW targets.  It
14744 specifies that a GUI application is to be generated by
14745 instructing the linker to set the PE header subsystem type
14746 appropriately.
14748 @item -fno-set-stack-executable
14749 @opindex fno-set-stack-executable
14750 This option is available for MinGW targets. It specifies that
14751 the executable flag for the stack used by nested functions isn't
14752 set. This is necessary for binaries running in kernel mode of
14753 Microsoft Windows, as there the User32 API, which is used to set executable
14754 privileges, isn't available.
14756 @item -fwritable-relocated-rdata
14757 @opindex fno-writable-relocated-rdata
14758 This option is available for MinGW and Cygwin targets.  It specifies
14759 that relocated-data in read-only section is put into .data
14760 section.  This is a necessary for older runtimes not supporting
14761 modification of .rdata sections for pseudo-relocation.
14763 @item -mpe-aligned-commons
14764 @opindex mpe-aligned-commons
14765 This option is available for Cygwin and MinGW targets.  It
14766 specifies that the GNU extension to the PE file format that
14767 permits the correct alignment of COMMON variables should be
14768 used when generating code.  It is enabled by default if
14769 GCC detects that the target assembler found during configuration
14770 supports the feature.
14771 @end table
14773 See also under @ref{i386 and x86-64 Options} for standard options.
14775 @node IA-64 Options
14776 @subsection IA-64 Options
14777 @cindex IA-64 Options
14779 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14781 @table @gcctabopt
14782 @item -mbig-endian
14783 @opindex mbig-endian
14784 Generate code for a big-endian target.  This is the default for HP-UX@.
14786 @item -mlittle-endian
14787 @opindex mlittle-endian
14788 Generate code for a little-endian target.  This is the default for AIX5
14789 and GNU/Linux.
14791 @item -mgnu-as
14792 @itemx -mno-gnu-as
14793 @opindex mgnu-as
14794 @opindex mno-gnu-as
14795 Generate (or don't) code for the GNU assembler.  This is the default.
14796 @c Also, this is the default if the configure option @option{--with-gnu-as}
14797 @c is used.
14799 @item -mgnu-ld
14800 @itemx -mno-gnu-ld
14801 @opindex mgnu-ld
14802 @opindex mno-gnu-ld
14803 Generate (or don't) code for the GNU linker.  This is the default.
14804 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14805 @c is used.
14807 @item -mno-pic
14808 @opindex mno-pic
14809 Generate code that does not use a global pointer register.  The result
14810 is not position independent code, and violates the IA-64 ABI@.
14812 @item -mvolatile-asm-stop
14813 @itemx -mno-volatile-asm-stop
14814 @opindex mvolatile-asm-stop
14815 @opindex mno-volatile-asm-stop
14816 Generate (or don't) a stop bit immediately before and after volatile asm
14817 statements.
14819 @item -mregister-names
14820 @itemx -mno-register-names
14821 @opindex mregister-names
14822 @opindex mno-register-names
14823 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14824 the stacked registers.  This may make assembler output more readable.
14826 @item -mno-sdata
14827 @itemx -msdata
14828 @opindex mno-sdata
14829 @opindex msdata
14830 Disable (or enable) optimizations that use the small data section.  This may
14831 be useful for working around optimizer bugs.
14833 @item -mconstant-gp
14834 @opindex mconstant-gp
14835 Generate code that uses a single constant global pointer value.  This is
14836 useful when compiling kernel code.
14838 @item -mauto-pic
14839 @opindex mauto-pic
14840 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14841 This is useful when compiling firmware code.
14843 @item -minline-float-divide-min-latency
14844 @opindex minline-float-divide-min-latency
14845 Generate code for inline divides of floating-point values
14846 using the minimum latency algorithm.
14848 @item -minline-float-divide-max-throughput
14849 @opindex minline-float-divide-max-throughput
14850 Generate code for inline divides of floating-point values
14851 using the maximum throughput algorithm.
14853 @item -mno-inline-float-divide
14854 @opindex mno-inline-float-divide
14855 Do not generate inline code for divides of floating-point values.
14857 @item -minline-int-divide-min-latency
14858 @opindex minline-int-divide-min-latency
14859 Generate code for inline divides of integer values
14860 using the minimum latency algorithm.
14862 @item -minline-int-divide-max-throughput
14863 @opindex minline-int-divide-max-throughput
14864 Generate code for inline divides of integer values
14865 using the maximum throughput algorithm.
14867 @item -mno-inline-int-divide
14868 @opindex mno-inline-int-divide
14869 Do not generate inline code for divides of integer values.
14871 @item -minline-sqrt-min-latency
14872 @opindex minline-sqrt-min-latency
14873 Generate code for inline square roots
14874 using the minimum latency algorithm.
14876 @item -minline-sqrt-max-throughput
14877 @opindex minline-sqrt-max-throughput
14878 Generate code for inline square roots
14879 using the maximum throughput algorithm.
14881 @item -mno-inline-sqrt
14882 @opindex mno-inline-sqrt
14883 Do not generate inline code for @code{sqrt}.
14885 @item -mfused-madd
14886 @itemx -mno-fused-madd
14887 @opindex mfused-madd
14888 @opindex mno-fused-madd
14889 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14890 instructions.  The default is to use these instructions.
14892 @item -mno-dwarf2-asm
14893 @itemx -mdwarf2-asm
14894 @opindex mno-dwarf2-asm
14895 @opindex mdwarf2-asm
14896 Don't (or do) generate assembler code for the DWARF 2 line number debugging
14897 info.  This may be useful when not using the GNU assembler.
14899 @item -mearly-stop-bits
14900 @itemx -mno-early-stop-bits
14901 @opindex mearly-stop-bits
14902 @opindex mno-early-stop-bits
14903 Allow stop bits to be placed earlier than immediately preceding the
14904 instruction that triggered the stop bit.  This can improve instruction
14905 scheduling, but does not always do so.
14907 @item -mfixed-range=@var{register-range}
14908 @opindex mfixed-range
14909 Generate code treating the given register range as fixed registers.
14910 A fixed register is one that the register allocator cannot use.  This is
14911 useful when compiling kernel code.  A register range is specified as
14912 two registers separated by a dash.  Multiple register ranges can be
14913 specified separated by a comma.
14915 @item -mtls-size=@var{tls-size}
14916 @opindex mtls-size
14917 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
14920 @item -mtune=@var{cpu-type}
14921 @opindex mtune
14922 Tune the instruction scheduling for a particular CPU, Valid values are
14923 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
14924 and @samp{mckinley}.
14926 @item -milp32
14927 @itemx -mlp64
14928 @opindex milp32
14929 @opindex mlp64
14930 Generate code for a 32-bit or 64-bit environment.
14931 The 32-bit environment sets int, long and pointer to 32 bits.
14932 The 64-bit environment sets int to 32 bits and long and pointer
14933 to 64 bits.  These are HP-UX specific flags.
14935 @item -mno-sched-br-data-spec
14936 @itemx -msched-br-data-spec
14937 @opindex mno-sched-br-data-spec
14938 @opindex msched-br-data-spec
14939 (Dis/En)able data speculative scheduling before reload.
14940 This results in generation of @code{ld.a} instructions and
14941 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14942 The default is 'disable'.
14944 @item -msched-ar-data-spec
14945 @itemx -mno-sched-ar-data-spec
14946 @opindex msched-ar-data-spec
14947 @opindex mno-sched-ar-data-spec
14948 (En/Dis)able data speculative scheduling after reload.
14949 This results in generation of @code{ld.a} instructions and
14950 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14951 The default is 'enable'.
14953 @item -mno-sched-control-spec
14954 @itemx -msched-control-spec
14955 @opindex mno-sched-control-spec
14956 @opindex msched-control-spec
14957 (Dis/En)able control speculative scheduling.  This feature is
14958 available only during region scheduling (i.e.@: before reload).
14959 This results in generation of the @code{ld.s} instructions and
14960 the corresponding check instructions @code{chk.s}.
14961 The default is 'disable'.
14963 @item -msched-br-in-data-spec
14964 @itemx -mno-sched-br-in-data-spec
14965 @opindex msched-br-in-data-spec
14966 @opindex mno-sched-br-in-data-spec
14967 (En/Dis)able speculative scheduling of the instructions that
14968 are dependent on the data speculative loads before reload.
14969 This is effective only with @option{-msched-br-data-spec} enabled.
14970 The default is 'enable'.
14972 @item -msched-ar-in-data-spec
14973 @itemx -mno-sched-ar-in-data-spec
14974 @opindex msched-ar-in-data-spec
14975 @opindex mno-sched-ar-in-data-spec
14976 (En/Dis)able speculative scheduling of the instructions that
14977 are dependent on the data speculative loads after reload.
14978 This is effective only with @option{-msched-ar-data-spec} enabled.
14979 The default is 'enable'.
14981 @item -msched-in-control-spec
14982 @itemx -mno-sched-in-control-spec
14983 @opindex msched-in-control-spec
14984 @opindex mno-sched-in-control-spec
14985 (En/Dis)able speculative scheduling of the instructions that
14986 are dependent on the control speculative loads.
14987 This is effective only with @option{-msched-control-spec} enabled.
14988 The default is 'enable'.
14990 @item -mno-sched-prefer-non-data-spec-insns
14991 @itemx -msched-prefer-non-data-spec-insns
14992 @opindex mno-sched-prefer-non-data-spec-insns
14993 @opindex msched-prefer-non-data-spec-insns
14994 If enabled, data-speculative instructions are chosen for schedule
14995 only if there are no other choices at the moment.  This makes
14996 the use of the data speculation much more conservative.
14997 The default is 'disable'.
14999 @item -mno-sched-prefer-non-control-spec-insns
15000 @itemx -msched-prefer-non-control-spec-insns
15001 @opindex mno-sched-prefer-non-control-spec-insns
15002 @opindex msched-prefer-non-control-spec-insns
15003 If enabled, control-speculative instructions are chosen for schedule
15004 only if there are no other choices at the moment.  This makes
15005 the use of the control speculation much more conservative.
15006 The default is 'disable'.
15008 @item -mno-sched-count-spec-in-critical-path
15009 @itemx -msched-count-spec-in-critical-path
15010 @opindex mno-sched-count-spec-in-critical-path
15011 @opindex msched-count-spec-in-critical-path
15012 If enabled, speculative dependencies are considered during
15013 computation of the instructions priorities.  This makes the use of the
15014 speculation a bit more conservative.
15015 The default is 'disable'.
15017 @item -msched-spec-ldc
15018 @opindex msched-spec-ldc
15019 Use a simple data speculation check.  This option is on by default.
15021 @item -msched-control-spec-ldc
15022 @opindex msched-spec-ldc
15023 Use a simple check for control speculation.  This option is on by default.
15025 @item -msched-stop-bits-after-every-cycle
15026 @opindex msched-stop-bits-after-every-cycle
15027 Place a stop bit after every cycle when scheduling.  This option is on
15028 by default.
15030 @item -msched-fp-mem-deps-zero-cost
15031 @opindex msched-fp-mem-deps-zero-cost
15032 Assume that floating-point stores and loads are not likely to cause a conflict
15033 when placed into the same instruction group.  This option is disabled by
15034 default.
15036 @item -msel-sched-dont-check-control-spec
15037 @opindex msel-sched-dont-check-control-spec
15038 Generate checks for control speculation in selective scheduling.
15039 This flag is disabled by default.
15041 @item -msched-max-memory-insns=@var{max-insns}
15042 @opindex msched-max-memory-insns
15043 Limit on the number of memory insns per instruction group, giving lower
15044 priority to subsequent memory insns attempting to schedule in the same
15045 instruction group. Frequently useful to prevent cache bank conflicts.
15046 The default value is 1.
15048 @item -msched-max-memory-insns-hard-limit
15049 @opindex msched-max-memory-insns-hard-limit
15050 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
15051 disallowing more than that number in an instruction group.
15052 Otherwise, the limit is ``soft'', meaning that non-memory operations
15053 are preferred when the limit is reached, but memory operations may still
15054 be scheduled.
15056 @end table
15058 @node LM32 Options
15059 @subsection LM32 Options
15060 @cindex LM32 options
15062 These @option{-m} options are defined for the LatticeMico32 architecture:
15064 @table @gcctabopt
15065 @item -mbarrel-shift-enabled
15066 @opindex mbarrel-shift-enabled
15067 Enable barrel-shift instructions.
15069 @item -mdivide-enabled
15070 @opindex mdivide-enabled
15071 Enable divide and modulus instructions.
15073 @item -mmultiply-enabled
15074 @opindex multiply-enabled
15075 Enable multiply instructions.
15077 @item -msign-extend-enabled
15078 @opindex msign-extend-enabled
15079 Enable sign extend instructions.
15081 @item -muser-enabled
15082 @opindex muser-enabled
15083 Enable user-defined instructions.
15085 @end table
15087 @node M32C Options
15088 @subsection M32C Options
15089 @cindex M32C options
15091 @table @gcctabopt
15092 @item -mcpu=@var{name}
15093 @opindex mcpu=
15094 Select the CPU for which code is generated.  @var{name} may be one of
15095 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
15096 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
15097 the M32C/80 series.
15099 @item -msim
15100 @opindex msim
15101 Specifies that the program will be run on the simulator.  This causes
15102 an alternate runtime library to be linked in which supports, for
15103 example, file I/O@.  You must not use this option when generating
15104 programs that will run on real hardware; you must provide your own
15105 runtime library for whatever I/O functions are needed.
15107 @item -memregs=@var{number}
15108 @opindex memregs=
15109 Specifies the number of memory-based pseudo-registers GCC uses
15110 during code generation.  These pseudo-registers are used like real
15111 registers, so there is a tradeoff between GCC's ability to fit the
15112 code into available registers, and the performance penalty of using
15113 memory instead of registers.  Note that all modules in a program must
15114 be compiled with the same value for this option.  Because of that, you
15115 must not use this option with GCC's default runtime libraries.
15117 @end table
15119 @node M32R/D Options
15120 @subsection M32R/D Options
15121 @cindex M32R/D options
15123 These @option{-m} options are defined for Renesas M32R/D architectures:
15125 @table @gcctabopt
15126 @item -m32r2
15127 @opindex m32r2
15128 Generate code for the M32R/2@.
15130 @item -m32rx
15131 @opindex m32rx
15132 Generate code for the M32R/X@.
15134 @item -m32r
15135 @opindex m32r
15136 Generate code for the M32R@.  This is the default.
15138 @item -mmodel=small
15139 @opindex mmodel=small
15140 Assume all objects live in the lower 16MB of memory (so that their addresses
15141 can be loaded with the @code{ld24} instruction), and assume all subroutines
15142 are reachable with the @code{bl} instruction.
15143 This is the default.
15145 The addressability of a particular object can be set with the
15146 @code{model} attribute.
15148 @item -mmodel=medium
15149 @opindex mmodel=medium
15150 Assume objects may be anywhere in the 32-bit address space (the compiler
15151 generates @code{seth/add3} instructions to load their addresses), and
15152 assume all subroutines are reachable with the @code{bl} instruction.
15154 @item -mmodel=large
15155 @opindex mmodel=large
15156 Assume objects may be anywhere in the 32-bit address space (the compiler
15157 generates @code{seth/add3} instructions to load their addresses), and
15158 assume subroutines may not be reachable with the @code{bl} instruction
15159 (the compiler generates the much slower @code{seth/add3/jl}
15160 instruction sequence).
15162 @item -msdata=none
15163 @opindex msdata=none
15164 Disable use of the small data area.  Variables are put into
15165 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
15166 @code{section} attribute has been specified).
15167 This is the default.
15169 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
15170 Objects may be explicitly put in the small data area with the
15171 @code{section} attribute using one of these sections.
15173 @item -msdata=sdata
15174 @opindex msdata=sdata
15175 Put small global and static data in the small data area, but do not
15176 generate special code to reference them.
15178 @item -msdata=use
15179 @opindex msdata=use
15180 Put small global and static data in the small data area, and generate
15181 special instructions to reference them.
15183 @item -G @var{num}
15184 @opindex G
15185 @cindex smaller data references
15186 Put global and static objects less than or equal to @var{num} bytes
15187 into the small data or BSS sections instead of the normal data or BSS
15188 sections.  The default value of @var{num} is 8.
15189 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
15190 for this option to have any effect.
15192 All modules should be compiled with the same @option{-G @var{num}} value.
15193 Compiling with different values of @var{num} may or may not work; if it
15194 doesn't the linker gives an error message---incorrect code is not
15195 generated.
15197 @item -mdebug
15198 @opindex mdebug
15199 Makes the M32R-specific code in the compiler display some statistics
15200 that might help in debugging programs.
15202 @item -malign-loops
15203 @opindex malign-loops
15204 Align all loops to a 32-byte boundary.
15206 @item -mno-align-loops
15207 @opindex mno-align-loops
15208 Do not enforce a 32-byte alignment for loops.  This is the default.
15210 @item -missue-rate=@var{number}
15211 @opindex missue-rate=@var{number}
15212 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15213 or 2.
15215 @item -mbranch-cost=@var{number}
15216 @opindex mbranch-cost=@var{number}
15217 @var{number} can only be 1 or 2.  If it is 1 then branches are
15218 preferred over conditional code, if it is 2, then the opposite applies.
15220 @item -mflush-trap=@var{number}
15221 @opindex mflush-trap=@var{number}
15222 Specifies the trap number to use to flush the cache.  The default is
15223 12.  Valid numbers are between 0 and 15 inclusive.
15225 @item -mno-flush-trap
15226 @opindex mno-flush-trap
15227 Specifies that the cache cannot be flushed by using a trap.
15229 @item -mflush-func=@var{name}
15230 @opindex mflush-func=@var{name}
15231 Specifies the name of the operating system function to call to flush
15232 the cache.  The default is @emph{_flush_cache}, but a function call
15233 is only used if a trap is not available.
15235 @item -mno-flush-func
15236 @opindex mno-flush-func
15237 Indicates that there is no OS function for flushing the cache.
15239 @end table
15241 @node M680x0 Options
15242 @subsection M680x0 Options
15243 @cindex M680x0 options
15245 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15246 The default settings depend on which architecture was selected when
15247 the compiler was configured; the defaults for the most common choices
15248 are given below.
15250 @table @gcctabopt
15251 @item -march=@var{arch}
15252 @opindex march
15253 Generate code for a specific M680x0 or ColdFire instruction set
15254 architecture.  Permissible values of @var{arch} for M680x0
15255 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15256 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15257 architectures are selected according to Freescale's ISA classification
15258 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15259 @samp{isab} and @samp{isac}.
15261 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15262 code for a ColdFire target.  The @var{arch} in this macro is one of the
15263 @option{-march} arguments given above.
15265 When used together, @option{-march} and @option{-mtune} select code
15266 that runs on a family of similar processors but that is optimized
15267 for a particular microarchitecture.
15269 @item -mcpu=@var{cpu}
15270 @opindex mcpu
15271 Generate code for a specific M680x0 or ColdFire processor.
15272 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15273 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15274 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15275 below, which also classifies the CPUs into families:
15277 @multitable @columnfractions 0.20 0.80
15278 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15279 @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}
15280 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
15281 @item @samp{5206e} @tab @samp{5206e}
15282 @item @samp{5208} @tab @samp{5207} @samp{5208}
15283 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
15284 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
15285 @item @samp{5216} @tab @samp{5214} @samp{5216}
15286 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
15287 @item @samp{5225} @tab @samp{5224} @samp{5225}
15288 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
15289 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
15290 @item @samp{5249} @tab @samp{5249}
15291 @item @samp{5250} @tab @samp{5250}
15292 @item @samp{5271} @tab @samp{5270} @samp{5271}
15293 @item @samp{5272} @tab @samp{5272}
15294 @item @samp{5275} @tab @samp{5274} @samp{5275}
15295 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
15296 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
15297 @item @samp{5307} @tab @samp{5307}
15298 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
15299 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
15300 @item @samp{5407} @tab @samp{5407}
15301 @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}
15302 @end multitable
15304 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
15305 @var{arch} is compatible with @var{cpu}.  Other combinations of
15306 @option{-mcpu} and @option{-march} are rejected.
15308 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
15309 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
15310 where the value of @var{family} is given by the table above.
15312 @item -mtune=@var{tune}
15313 @opindex mtune
15314 Tune the code for a particular microarchitecture within the
15315 constraints set by @option{-march} and @option{-mcpu}.
15316 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
15317 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
15318 and @samp{cpu32}.  The ColdFire microarchitectures
15319 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
15321 You can also use @option{-mtune=68020-40} for code that needs
15322 to run relatively well on 68020, 68030 and 68040 targets.
15323 @option{-mtune=68020-60} is similar but includes 68060 targets
15324 as well.  These two options select the same tuning decisions as
15325 @option{-m68020-40} and @option{-m68020-60} respectively.
15327 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
15328 when tuning for 680x0 architecture @var{arch}.  It also defines
15329 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
15330 option is used.  If GCC is tuning for a range of architectures,
15331 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
15332 it defines the macros for every architecture in the range.
15334 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
15335 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
15336 of the arguments given above.
15338 @item -m68000
15339 @itemx -mc68000
15340 @opindex m68000
15341 @opindex mc68000
15342 Generate output for a 68000.  This is the default
15343 when the compiler is configured for 68000-based systems.
15344 It is equivalent to @option{-march=68000}.
15346 Use this option for microcontrollers with a 68000 or EC000 core,
15347 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15349 @item -m68010
15350 @opindex m68010
15351 Generate output for a 68010.  This is the default
15352 when the compiler is configured for 68010-based systems.
15353 It is equivalent to @option{-march=68010}.
15355 @item -m68020
15356 @itemx -mc68020
15357 @opindex m68020
15358 @opindex mc68020
15359 Generate output for a 68020.  This is the default
15360 when the compiler is configured for 68020-based systems.
15361 It is equivalent to @option{-march=68020}.
15363 @item -m68030
15364 @opindex m68030
15365 Generate output for a 68030.  This is the default when the compiler is
15366 configured for 68030-based systems.  It is equivalent to
15367 @option{-march=68030}.
15369 @item -m68040
15370 @opindex m68040
15371 Generate output for a 68040.  This is the default when the compiler is
15372 configured for 68040-based systems.  It is equivalent to
15373 @option{-march=68040}.
15375 This option inhibits the use of 68881/68882 instructions that have to be
15376 emulated by software on the 68040.  Use this option if your 68040 does not
15377 have code to emulate those instructions.
15379 @item -m68060
15380 @opindex m68060
15381 Generate output for a 68060.  This is the default when the compiler is
15382 configured for 68060-based systems.  It is equivalent to
15383 @option{-march=68060}.
15385 This option inhibits the use of 68020 and 68881/68882 instructions that
15386 have to be emulated by software on the 68060.  Use this option if your 68060
15387 does not have code to emulate those instructions.
15389 @item -mcpu32
15390 @opindex mcpu32
15391 Generate output for a CPU32.  This is the default
15392 when the compiler is configured for CPU32-based systems.
15393 It is equivalent to @option{-march=cpu32}.
15395 Use this option for microcontrollers with a
15396 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
15397 68336, 68340, 68341, 68349 and 68360.
15399 @item -m5200
15400 @opindex m5200
15401 Generate output for a 520X ColdFire CPU@.  This is the default
15402 when the compiler is configured for 520X-based systems.
15403 It is equivalent to @option{-mcpu=5206}, and is now deprecated
15404 in favor of that option.
15406 Use this option for microcontroller with a 5200 core, including
15407 the MCF5202, MCF5203, MCF5204 and MCF5206.
15409 @item -m5206e
15410 @opindex m5206e
15411 Generate output for a 5206e ColdFire CPU@.  The option is now
15412 deprecated in favor of the equivalent @option{-mcpu=5206e}.
15414 @item -m528x
15415 @opindex m528x
15416 Generate output for a member of the ColdFire 528X family.
15417 The option is now deprecated in favor of the equivalent
15418 @option{-mcpu=528x}.
15420 @item -m5307
15421 @opindex m5307
15422 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
15423 in favor of the equivalent @option{-mcpu=5307}.
15425 @item -m5407
15426 @opindex m5407
15427 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
15428 in favor of the equivalent @option{-mcpu=5407}.
15430 @item -mcfv4e
15431 @opindex mcfv4e
15432 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
15433 This includes use of hardware floating-point instructions.
15434 The option is equivalent to @option{-mcpu=547x}, and is now
15435 deprecated in favor of that option.
15437 @item -m68020-40
15438 @opindex m68020-40
15439 Generate output for a 68040, without using any of the new instructions.
15440 This results in code that can run relatively efficiently on either a
15441 68020/68881 or a 68030 or a 68040.  The generated code does use the
15442 68881 instructions that are emulated on the 68040.
15444 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
15446 @item -m68020-60
15447 @opindex m68020-60
15448 Generate output for a 68060, without using any of the new instructions.
15449 This results in code that can run relatively efficiently on either a
15450 68020/68881 or a 68030 or a 68040.  The generated code does use the
15451 68881 instructions that are emulated on the 68060.
15453 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
15455 @item -mhard-float
15456 @itemx -m68881
15457 @opindex mhard-float
15458 @opindex m68881
15459 Generate floating-point instructions.  This is the default for 68020
15460 and above, and for ColdFire devices that have an FPU@.  It defines the
15461 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
15462 on ColdFire targets.
15464 @item -msoft-float
15465 @opindex msoft-float
15466 Do not generate floating-point instructions; use library calls instead.
15467 This is the default for 68000, 68010, and 68832 targets.  It is also
15468 the default for ColdFire devices that have no FPU.
15470 @item -mdiv
15471 @itemx -mno-div
15472 @opindex mdiv
15473 @opindex mno-div
15474 Generate (do not generate) ColdFire hardware divide and remainder
15475 instructions.  If @option{-march} is used without @option{-mcpu},
15476 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
15477 architectures.  Otherwise, the default is taken from the target CPU
15478 (either the default CPU, or the one specified by @option{-mcpu}).  For
15479 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
15480 @option{-mcpu=5206e}.
15482 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
15484 @item -mshort
15485 @opindex mshort
15486 Consider type @code{int} to be 16 bits wide, like @code{short int}.
15487 Additionally, parameters passed on the stack are also aligned to a
15488 16-bit boundary even on targets whose API mandates promotion to 32-bit.
15490 @item -mno-short
15491 @opindex mno-short
15492 Do not consider type @code{int} to be 16 bits wide.  This is the default.
15494 @item -mnobitfield
15495 @itemx -mno-bitfield
15496 @opindex mnobitfield
15497 @opindex mno-bitfield
15498 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
15499 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
15501 @item -mbitfield
15502 @opindex mbitfield
15503 Do use the bit-field instructions.  The @option{-m68020} option implies
15504 @option{-mbitfield}.  This is the default if you use a configuration
15505 designed for a 68020.
15507 @item -mrtd
15508 @opindex mrtd
15509 Use a different function-calling convention, in which functions
15510 that take a fixed number of arguments return with the @code{rtd}
15511 instruction, which pops their arguments while returning.  This
15512 saves one instruction in the caller since there is no need to pop
15513 the arguments there.
15515 This calling convention is incompatible with the one normally
15516 used on Unix, so you cannot use it if you need to call libraries
15517 compiled with the Unix compiler.
15519 Also, you must provide function prototypes for all functions that
15520 take variable numbers of arguments (including @code{printf});
15521 otherwise incorrect code is generated for calls to those
15522 functions.
15524 In addition, seriously incorrect code results if you call a
15525 function with too many arguments.  (Normally, extra arguments are
15526 harmlessly ignored.)
15528 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
15529 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15531 @item -mno-rtd
15532 @opindex mno-rtd
15533 Do not use the calling conventions selected by @option{-mrtd}.
15534 This is the default.
15536 @item -malign-int
15537 @itemx -mno-align-int
15538 @opindex malign-int
15539 @opindex mno-align-int
15540 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
15541 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
15542 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
15543 Aligning variables on 32-bit boundaries produces code that runs somewhat
15544 faster on processors with 32-bit busses at the expense of more memory.
15546 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
15547 aligns structures containing the above types differently than
15548 most published application binary interface specifications for the m68k.
15550 @item -mpcrel
15551 @opindex mpcrel
15552 Use the pc-relative addressing mode of the 68000 directly, instead of
15553 using a global offset table.  At present, this option implies @option{-fpic},
15554 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
15555 not presently supported with @option{-mpcrel}, though this could be supported for
15556 68020 and higher processors.
15558 @item -mno-strict-align
15559 @itemx -mstrict-align
15560 @opindex mno-strict-align
15561 @opindex mstrict-align
15562 Do not (do) assume that unaligned memory references are handled by
15563 the system.
15565 @item -msep-data
15566 Generate code that allows the data segment to be located in a different
15567 area of memory from the text segment.  This allows for execute-in-place in
15568 an environment without virtual memory management.  This option implies
15569 @option{-fPIC}.
15571 @item -mno-sep-data
15572 Generate code that assumes that the data segment follows the text segment.
15573 This is the default.
15575 @item -mid-shared-library
15576 Generate code that supports shared libraries via the library ID method.
15577 This allows for execute-in-place and shared libraries in an environment
15578 without virtual memory management.  This option implies @option{-fPIC}.
15580 @item -mno-id-shared-library
15581 Generate code that doesn't assume ID-based shared libraries are being used.
15582 This is the default.
15584 @item -mshared-library-id=n
15585 Specifies the identification number of the ID-based shared library being
15586 compiled.  Specifying a value of 0 generates more compact code; specifying
15587 other values forces the allocation of that number to the current
15588 library, but is no more space- or time-efficient than omitting this option.
15590 @item -mxgot
15591 @itemx -mno-xgot
15592 @opindex mxgot
15593 @opindex mno-xgot
15594 When generating position-independent code for ColdFire, generate code
15595 that works if the GOT has more than 8192 entries.  This code is
15596 larger and slower than code generated without this option.  On M680x0
15597 processors, this option is not needed; @option{-fPIC} suffices.
15599 GCC normally uses a single instruction to load values from the GOT@.
15600 While this is relatively efficient, it only works if the GOT
15601 is smaller than about 64k.  Anything larger causes the linker
15602 to report an error such as:
15604 @cindex relocation truncated to fit (ColdFire)
15605 @smallexample
15606 relocation truncated to fit: R_68K_GOT16O foobar
15607 @end smallexample
15609 If this happens, you should recompile your code with @option{-mxgot}.
15610 It should then work with very large GOTs.  However, code generated with
15611 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15612 the value of a global symbol.
15614 Note that some linkers, including newer versions of the GNU linker,
15615 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15616 you should only need to use @option{-mxgot} when compiling a single
15617 object file that accesses more than 8192 GOT entries.  Very few do.
15619 These options have no effect unless GCC is generating
15620 position-independent code.
15622 @end table
15624 @node MCore Options
15625 @subsection MCore Options
15626 @cindex MCore options
15628 These are the @samp{-m} options defined for the Motorola M*Core
15629 processors.
15631 @table @gcctabopt
15633 @item -mhardlit
15634 @itemx -mno-hardlit
15635 @opindex mhardlit
15636 @opindex mno-hardlit
15637 Inline constants into the code stream if it can be done in two
15638 instructions or less.
15640 @item -mdiv
15641 @itemx -mno-div
15642 @opindex mdiv
15643 @opindex mno-div
15644 Use the divide instruction.  (Enabled by default).
15646 @item -mrelax-immediate
15647 @itemx -mno-relax-immediate
15648 @opindex mrelax-immediate
15649 @opindex mno-relax-immediate
15650 Allow arbitrary-sized immediates in bit operations.
15652 @item -mwide-bitfields
15653 @itemx -mno-wide-bitfields
15654 @opindex mwide-bitfields
15655 @opindex mno-wide-bitfields
15656 Always treat bit-fields as @code{int}-sized.
15658 @item -m4byte-functions
15659 @itemx -mno-4byte-functions
15660 @opindex m4byte-functions
15661 @opindex mno-4byte-functions
15662 Force all functions to be aligned to a 4-byte boundary.
15664 @item -mcallgraph-data
15665 @itemx -mno-callgraph-data
15666 @opindex mcallgraph-data
15667 @opindex mno-callgraph-data
15668 Emit callgraph information.
15670 @item -mslow-bytes
15671 @itemx -mno-slow-bytes
15672 @opindex mslow-bytes
15673 @opindex mno-slow-bytes
15674 Prefer word access when reading byte quantities.
15676 @item -mlittle-endian
15677 @itemx -mbig-endian
15678 @opindex mlittle-endian
15679 @opindex mbig-endian
15680 Generate code for a little-endian target.
15682 @item -m210
15683 @itemx -m340
15684 @opindex m210
15685 @opindex m340
15686 Generate code for the 210 processor.
15688 @item -mno-lsim
15689 @opindex mno-lsim
15690 Assume that runtime support has been provided and so omit the
15691 simulator library (@file{libsim.a)} from the linker command line.
15693 @item -mstack-increment=@var{size}
15694 @opindex mstack-increment
15695 Set the maximum amount for a single stack increment operation.  Large
15696 values can increase the speed of programs that contain functions
15697 that need a large amount of stack space, but they can also trigger a
15698 segmentation fault if the stack is extended too much.  The default
15699 value is 0x1000.
15701 @end table
15703 @node MeP Options
15704 @subsection MeP Options
15705 @cindex MeP options
15707 @table @gcctabopt
15709 @item -mabsdiff
15710 @opindex mabsdiff
15711 Enables the @code{abs} instruction, which is the absolute difference
15712 between two registers.
15714 @item -mall-opts
15715 @opindex mall-opts
15716 Enables all the optional instructions---average, multiply, divide, bit
15717 operations, leading zero, absolute difference, min/max, clip, and
15718 saturation.
15721 @item -maverage
15722 @opindex maverage
15723 Enables the @code{ave} instruction, which computes the average of two
15724 registers.
15726 @item -mbased=@var{n}
15727 @opindex mbased=
15728 Variables of size @var{n} bytes or smaller are placed in the
15729 @code{.based} section by default.  Based variables use the @code{$tp}
15730 register as a base register, and there is a 128-byte limit to the
15731 @code{.based} section.
15733 @item -mbitops
15734 @opindex mbitops
15735 Enables the bit operation instructions---bit test (@code{btstm}), set
15736 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15737 test-and-set (@code{tas}).
15739 @item -mc=@var{name}
15740 @opindex mc=
15741 Selects which section constant data is placed in.  @var{name} may
15742 be @code{tiny}, @code{near}, or @code{far}.
15744 @item -mclip
15745 @opindex mclip
15746 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15747 useful unless you also provide @code{-mminmax}.
15749 @item -mconfig=@var{name}
15750 @opindex mconfig=
15751 Selects one of the built-in core configurations.  Each MeP chip has
15752 one or more modules in it; each module has a core CPU and a variety of
15753 coprocessors, optional instructions, and peripherals.  The
15754 @code{MeP-Integrator} tool, not part of GCC, provides these
15755 configurations through this option; using this option is the same as
15756 using all the corresponding command-line options.  The default
15757 configuration is @code{default}.
15759 @item -mcop
15760 @opindex mcop
15761 Enables the coprocessor instructions.  By default, this is a 32-bit
15762 coprocessor.  Note that the coprocessor is normally enabled via the
15763 @code{-mconfig=} option.
15765 @item -mcop32
15766 @opindex mcop32
15767 Enables the 32-bit coprocessor's instructions.
15769 @item -mcop64
15770 @opindex mcop64
15771 Enables the 64-bit coprocessor's instructions.
15773 @item -mivc2
15774 @opindex mivc2
15775 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15777 @item -mdc
15778 @opindex mdc
15779 Causes constant variables to be placed in the @code{.near} section.
15781 @item -mdiv
15782 @opindex mdiv
15783 Enables the @code{div} and @code{divu} instructions.
15785 @item -meb
15786 @opindex meb
15787 Generate big-endian code.
15789 @item -mel
15790 @opindex mel
15791 Generate little-endian code.
15793 @item -mio-volatile
15794 @opindex mio-volatile
15795 Tells the compiler that any variable marked with the @code{io}
15796 attribute is to be considered volatile.
15798 @item -ml
15799 @opindex ml
15800 Causes variables to be assigned to the @code{.far} section by default.
15802 @item -mleadz
15803 @opindex mleadz
15804 Enables the @code{leadz} (leading zero) instruction.
15806 @item -mm
15807 @opindex mm
15808 Causes variables to be assigned to the @code{.near} section by default.
15810 @item -mminmax
15811 @opindex mminmax
15812 Enables the @code{min} and @code{max} instructions.
15814 @item -mmult
15815 @opindex mmult
15816 Enables the multiplication and multiply-accumulate instructions.
15818 @item -mno-opts
15819 @opindex mno-opts
15820 Disables all the optional instructions enabled by @code{-mall-opts}.
15822 @item -mrepeat
15823 @opindex mrepeat
15824 Enables the @code{repeat} and @code{erepeat} instructions, used for
15825 low-overhead looping.
15827 @item -ms
15828 @opindex ms
15829 Causes all variables to default to the @code{.tiny} section.  Note
15830 that there is a 65536-byte limit to this section.  Accesses to these
15831 variables use the @code{%gp} base register.
15833 @item -msatur
15834 @opindex msatur
15835 Enables the saturation instructions.  Note that the compiler does not
15836 currently generate these itself, but this option is included for
15837 compatibility with other tools, like @code{as}.
15839 @item -msdram
15840 @opindex msdram
15841 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15843 @item -msim
15844 @opindex msim
15845 Link the simulator runtime libraries.
15847 @item -msimnovec
15848 @opindex msimnovec
15849 Link the simulator runtime libraries, excluding built-in support
15850 for reset and exception vectors and tables.
15852 @item -mtf
15853 @opindex mtf
15854 Causes all functions to default to the @code{.far} section.  Without
15855 this option, functions default to the @code{.near} section.
15857 @item -mtiny=@var{n}
15858 @opindex mtiny=
15859 Variables that are @var{n} bytes or smaller are allocated to the
15860 @code{.tiny} section.  These variables use the @code{$gp} base
15861 register.  The default for this option is 4, but note that there's a
15862 65536-byte limit to the @code{.tiny} section.
15864 @end table
15866 @node MicroBlaze Options
15867 @subsection MicroBlaze Options
15868 @cindex MicroBlaze Options
15870 @table @gcctabopt
15872 @item -msoft-float
15873 @opindex msoft-float
15874 Use software emulation for floating point (default).
15876 @item -mhard-float
15877 @opindex mhard-float
15878 Use hardware floating-point instructions.
15880 @item -mmemcpy
15881 @opindex mmemcpy
15882 Do not optimize block moves, use @code{memcpy}.
15884 @item -mno-clearbss
15885 @opindex mno-clearbss
15886 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15888 @item -mcpu=@var{cpu-type}
15889 @opindex mcpu=
15890 Use features of, and schedule code for, the given CPU.
15891 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15892 where @var{X} is a major version, @var{YY} is the minor version, and
15893 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
15894 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
15896 @item -mxl-soft-mul
15897 @opindex mxl-soft-mul
15898 Use software multiply emulation (default).
15900 @item -mxl-soft-div
15901 @opindex mxl-soft-div
15902 Use software emulation for divides (default).
15904 @item -mxl-barrel-shift
15905 @opindex mxl-barrel-shift
15906 Use the hardware barrel shifter.
15908 @item -mxl-pattern-compare
15909 @opindex mxl-pattern-compare
15910 Use pattern compare instructions.
15912 @item -msmall-divides
15913 @opindex msmall-divides
15914 Use table lookup optimization for small signed integer divisions.
15916 @item -mxl-stack-check
15917 @opindex mxl-stack-check
15918 This option is deprecated.  Use @option{-fstack-check} instead.
15920 @item -mxl-gp-opt
15921 @opindex mxl-gp-opt
15922 Use GP-relative @code{.sdata}/@code{.sbss} sections.
15924 @item -mxl-multiply-high
15925 @opindex mxl-multiply-high
15926 Use multiply high instructions for high part of 32x32 multiply.
15928 @item -mxl-float-convert
15929 @opindex mxl-float-convert
15930 Use hardware floating-point conversion instructions.
15932 @item -mxl-float-sqrt
15933 @opindex mxl-float-sqrt
15934 Use hardware floating-point square root instruction.
15936 @item -mbig-endian
15937 @opindex mbig-endian
15938 Generate code for a big-endian target.
15940 @item -mlittle-endian
15941 @opindex mlittle-endian
15942 Generate code for a little-endian target.
15944 @item -mxl-reorder
15945 @opindex mxl-reorder
15946 Use reorder instructions (swap and byte reversed load/store).
15948 @item -mxl-mode-@var{app-model}
15949 Select application model @var{app-model}.  Valid models are
15950 @table @samp
15951 @item executable
15952 normal executable (default), uses startup code @file{crt0.o}.
15954 @item xmdstub
15955 for use with Xilinx Microprocessor Debugger (XMD) based
15956 software intrusive debug agent called xmdstub. This uses startup file
15957 @file{crt1.o} and sets the start address of the program to 0x800.
15959 @item bootstrap
15960 for applications that are loaded using a bootloader.
15961 This model uses startup file @file{crt2.o} which does not contain a processor
15962 reset vector handler. This is suitable for transferring control on a
15963 processor reset to the bootloader rather than the application.
15965 @item novectors
15966 for applications that do not require any of the
15967 MicroBlaze vectors. This option may be useful for applications running
15968 within a monitoring application. This model uses @file{crt3.o} as a startup file.
15969 @end table
15971 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
15972 @option{-mxl-mode-@var{app-model}}.
15974 @end table
15976 @node MIPS Options
15977 @subsection MIPS Options
15978 @cindex MIPS options
15980 @table @gcctabopt
15982 @item -EB
15983 @opindex EB
15984 Generate big-endian code.
15986 @item -EL
15987 @opindex EL
15988 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
15989 configurations.
15991 @item -march=@var{arch}
15992 @opindex march
15993 Generate code that runs on @var{arch}, which can be the name of a
15994 generic MIPS ISA, or the name of a particular processor.
15995 The ISA names are:
15996 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
15997 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
15998 The processor names are:
15999 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
16000 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
16001 @samp{5kc}, @samp{5kf},
16002 @samp{20kc},
16003 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
16004 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
16005 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
16006 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
16007 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
16008 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
16009 @samp{m4k},
16010 @samp{m14k}, @samp{m14ke}, @samp{m14kec},
16011 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
16012 @samp{orion},
16013 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
16014 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
16015 @samp{rm7000}, @samp{rm9000},
16016 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
16017 @samp{sb1},
16018 @samp{sr71000},
16019 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
16020 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
16021 @samp{xlr} and @samp{xlp}.
16022 The special value @samp{from-abi} selects the
16023 most compatible architecture for the selected ABI (that is,
16024 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
16026 The native Linux/GNU toolchain also supports the value @samp{native},
16027 which selects the best architecture option for the host processor.
16028 @option{-march=native} has no effect if GCC does not recognize
16029 the processor.
16031 In processor names, a final @samp{000} can be abbreviated as @samp{k}
16032 (for example, @option{-march=r2k}).  Prefixes are optional, and
16033 @samp{vr} may be written @samp{r}.
16035 Names of the form @samp{@var{n}f2_1} refer to processors with
16036 FPUs clocked at half the rate of the core, names of the form
16037 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
16038 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
16039 processors with FPUs clocked a ratio of 3:2 with respect to the core.
16040 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
16041 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
16042 accepted as synonyms for @samp{@var{n}f1_1}.
16044 GCC defines two macros based on the value of this option.  The first
16045 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
16046 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
16047 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
16048 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
16049 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
16051 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
16052 above.  In other words, it has the full prefix and does not
16053 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
16054 the macro names the resolved architecture (either @samp{"mips1"} or
16055 @samp{"mips3"}).  It names the default architecture when no
16056 @option{-march} option is given.
16058 @item -mtune=@var{arch}
16059 @opindex mtune
16060 Optimize for @var{arch}.  Among other things, this option controls
16061 the way instructions are scheduled, and the perceived cost of arithmetic
16062 operations.  The list of @var{arch} values is the same as for
16063 @option{-march}.
16065 When this option is not used, GCC optimizes for the processor
16066 specified by @option{-march}.  By using @option{-march} and
16067 @option{-mtune} together, it is possible to generate code that
16068 runs on a family of processors, but optimize the code for one
16069 particular member of that family.
16071 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
16072 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
16073 @option{-march} ones described above.
16075 @item -mips1
16076 @opindex mips1
16077 Equivalent to @option{-march=mips1}.
16079 @item -mips2
16080 @opindex mips2
16081 Equivalent to @option{-march=mips2}.
16083 @item -mips3
16084 @opindex mips3
16085 Equivalent to @option{-march=mips3}.
16087 @item -mips4
16088 @opindex mips4
16089 Equivalent to @option{-march=mips4}.
16091 @item -mips32
16092 @opindex mips32
16093 Equivalent to @option{-march=mips32}.
16095 @item -mips32r2
16096 @opindex mips32r2
16097 Equivalent to @option{-march=mips32r2}.
16099 @item -mips64
16100 @opindex mips64
16101 Equivalent to @option{-march=mips64}.
16103 @item -mips64r2
16104 @opindex mips64r2
16105 Equivalent to @option{-march=mips64r2}.
16107 @item -mips16
16108 @itemx -mno-mips16
16109 @opindex mips16
16110 @opindex mno-mips16
16111 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16112 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16114 MIPS16 code generation can also be controlled on a per-function basis
16115 by means of @code{mips16} and @code{nomips16} attributes.
16116 @xref{Function Attributes}, for more information.
16118 @item -mflip-mips16
16119 @opindex mflip-mips16
16120 Generate MIPS16 code on alternating functions.  This option is provided
16121 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16122 not intended for ordinary use in compiling user code.
16124 @item -minterlink-compressed
16125 @item -mno-interlink-compressed
16126 @opindex minterlink-compressed
16127 @opindex mno-interlink-compressed
16128 Require (do not require) that code using the standard (uncompressed) MIPS ISA
16129 be link-compatible with MIPS16 and microMIPS code, and vice versa.
16131 For example, code using the standard ISA encoding cannot jump directly
16132 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
16133 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
16134 knows that the target of the jump is not compressed.
16136 @item -minterlink-mips16
16137 @itemx -mno-interlink-mips16
16138 @opindex minterlink-mips16
16139 @opindex mno-interlink-mips16
16140 Aliases of @option{-minterlink-compressed} and
16141 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
16142 and are retained for backwards compatiblity.
16144 @item -mabi=32
16145 @itemx -mabi=o64
16146 @itemx -mabi=n32
16147 @itemx -mabi=64
16148 @itemx -mabi=eabi
16149 @opindex mabi=32
16150 @opindex mabi=o64
16151 @opindex mabi=n32
16152 @opindex mabi=64
16153 @opindex mabi=eabi
16154 Generate code for the given ABI@.
16156 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
16157 generates 64-bit code when you select a 64-bit architecture, but you
16158 can use @option{-mgp32} to get 32-bit code instead.
16160 For information about the O64 ABI, see
16161 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
16163 GCC supports a variant of the o32 ABI in which floating-point registers
16164 are 64 rather than 32 bits wide.  You can select this combination with
16165 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
16166 and @code{mfhc1} instructions and is therefore only supported for
16167 MIPS32R2 processors.
16169 The register assignments for arguments and return values remain the
16170 same, but each scalar value is passed in a single 64-bit register
16171 rather than a pair of 32-bit registers.  For example, scalar
16172 floating-point values are returned in @samp{$f0} only, not a
16173 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
16174 remains the same, but all 64 bits are saved.
16176 @item -mabicalls
16177 @itemx -mno-abicalls
16178 @opindex mabicalls
16179 @opindex mno-abicalls
16180 Generate (do not generate) code that is suitable for SVR4-style
16181 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
16182 systems.
16184 @item -mshared
16185 @itemx -mno-shared
16186 Generate (do not generate) code that is fully position-independent,
16187 and that can therefore be linked into shared libraries.  This option
16188 only affects @option{-mabicalls}.
16190 All @option{-mabicalls} code has traditionally been position-independent,
16191 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
16192 as an extension, the GNU toolchain allows executables to use absolute
16193 accesses for locally-binding symbols.  It can also use shorter GP
16194 initialization sequences and generate direct calls to locally-defined
16195 functions.  This mode is selected by @option{-mno-shared}.
16197 @option{-mno-shared} depends on binutils 2.16 or higher and generates
16198 objects that can only be linked by the GNU linker.  However, the option
16199 does not affect the ABI of the final executable; it only affects the ABI
16200 of relocatable objects.  Using @option{-mno-shared} generally makes
16201 executables both smaller and quicker.
16203 @option{-mshared} is the default.
16205 @item -mplt
16206 @itemx -mno-plt
16207 @opindex mplt
16208 @opindex mno-plt
16209 Assume (do not assume) that the static and dynamic linkers
16210 support PLTs and copy relocations.  This option only affects
16211 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
16212 has no effect without @option{-msym32}.
16214 You can make @option{-mplt} the default by configuring
16215 GCC with @option{--with-mips-plt}.  The default is
16216 @option{-mno-plt} otherwise.
16218 @item -mxgot
16219 @itemx -mno-xgot
16220 @opindex mxgot
16221 @opindex mno-xgot
16222 Lift (do not lift) the usual restrictions on the size of the global
16223 offset table.
16225 GCC normally uses a single instruction to load values from the GOT@.
16226 While this is relatively efficient, it only works if the GOT
16227 is smaller than about 64k.  Anything larger causes the linker
16228 to report an error such as:
16230 @cindex relocation truncated to fit (MIPS)
16231 @smallexample
16232 relocation truncated to fit: R_MIPS_GOT16 foobar
16233 @end smallexample
16235 If this happens, you should recompile your code with @option{-mxgot}.
16236 This works with very large GOTs, although the code is also
16237 less efficient, since it takes three instructions to fetch the
16238 value of a global symbol.
16240 Note that some linkers can create multiple GOTs.  If you have such a
16241 linker, you should only need to use @option{-mxgot} when a single object
16242 file accesses more than 64k's worth of GOT entries.  Very few do.
16244 These options have no effect unless GCC is generating position
16245 independent code.
16247 @item -mgp32
16248 @opindex mgp32
16249 Assume that general-purpose registers are 32 bits wide.
16251 @item -mgp64
16252 @opindex mgp64
16253 Assume that general-purpose registers are 64 bits wide.
16255 @item -mfp32
16256 @opindex mfp32
16257 Assume that floating-point registers are 32 bits wide.
16259 @item -mfp64
16260 @opindex mfp64
16261 Assume that floating-point registers are 64 bits wide.
16263 @item -mhard-float
16264 @opindex mhard-float
16265 Use floating-point coprocessor instructions.
16267 @item -msoft-float
16268 @opindex msoft-float
16269 Do not use floating-point coprocessor instructions.  Implement
16270 floating-point calculations using library calls instead.
16272 @item -mno-float
16273 @opindex mno-float
16274 Equivalent to @option{-msoft-float}, but additionally asserts that the
16275 program being compiled does not perform any floating-point operations.
16276 This option is presently supported only by some bare-metal MIPS
16277 configurations, where it may select a special set of libraries
16278 that lack all floating-point support (including, for example, the
16279 floating-point @code{printf} formats).  
16280 If code compiled with @code{-mno-float} accidentally contains
16281 floating-point operations, it is likely to suffer a link-time
16282 or run-time failure.
16284 @item -msingle-float
16285 @opindex msingle-float
16286 Assume that the floating-point coprocessor only supports single-precision
16287 operations.
16289 @item -mdouble-float
16290 @opindex mdouble-float
16291 Assume that the floating-point coprocessor supports double-precision
16292 operations.  This is the default.
16294 @item -mllsc
16295 @itemx -mno-llsc
16296 @opindex mllsc
16297 @opindex mno-llsc
16298 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
16299 implement atomic memory built-in functions.  When neither option is
16300 specified, GCC uses the instructions if the target architecture
16301 supports them.
16303 @option{-mllsc} is useful if the runtime environment can emulate the
16304 instructions and @option{-mno-llsc} can be useful when compiling for
16305 nonstandard ISAs.  You can make either option the default by
16306 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
16307 respectively.  @option{--with-llsc} is the default for some
16308 configurations; see the installation documentation for details.
16310 @item -mdsp
16311 @itemx -mno-dsp
16312 @opindex mdsp
16313 @opindex mno-dsp
16314 Use (do not use) revision 1 of the MIPS DSP ASE@.
16315 @xref{MIPS DSP Built-in Functions}.  This option defines the
16316 preprocessor macro @samp{__mips_dsp}.  It also defines
16317 @samp{__mips_dsp_rev} to 1.
16319 @item -mdspr2
16320 @itemx -mno-dspr2
16321 @opindex mdspr2
16322 @opindex mno-dspr2
16323 Use (do not use) revision 2 of the MIPS DSP ASE@.
16324 @xref{MIPS DSP Built-in Functions}.  This option defines the
16325 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
16326 It also defines @samp{__mips_dsp_rev} to 2.
16328 @item -msmartmips
16329 @itemx -mno-smartmips
16330 @opindex msmartmips
16331 @opindex mno-smartmips
16332 Use (do not use) the MIPS SmartMIPS ASE.
16334 @item -mpaired-single
16335 @itemx -mno-paired-single
16336 @opindex mpaired-single
16337 @opindex mno-paired-single
16338 Use (do not use) paired-single floating-point instructions.
16339 @xref{MIPS Paired-Single Support}.  This option requires
16340 hardware floating-point support to be enabled.
16342 @item -mdmx
16343 @itemx -mno-mdmx
16344 @opindex mdmx
16345 @opindex mno-mdmx
16346 Use (do not use) MIPS Digital Media Extension instructions.
16347 This option can only be used when generating 64-bit code and requires
16348 hardware floating-point support to be enabled.
16350 @item -mips3d
16351 @itemx -mno-mips3d
16352 @opindex mips3d
16353 @opindex mno-mips3d
16354 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
16355 The option @option{-mips3d} implies @option{-mpaired-single}.
16357 @item -mmicromips
16358 @itemx -mno-micromips
16359 @opindex mmicromips
16360 @opindex mno-mmicromips
16361 Generate (do not generate) microMIPS code.
16363 MicroMIPS code generation can also be controlled on a per-function basis
16364 by means of @code{micromips} and @code{nomicromips} attributes.
16365 @xref{Function Attributes}, for more information.
16367 @item -mmt
16368 @itemx -mno-mt
16369 @opindex mmt
16370 @opindex mno-mt
16371 Use (do not use) MT Multithreading instructions.
16373 @item -mmcu
16374 @itemx -mno-mcu
16375 @opindex mmcu
16376 @opindex mno-mcu
16377 Use (do not use) the MIPS MCU ASE instructions.
16379 @item -mlong64
16380 @opindex mlong64
16381 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
16382 an explanation of the default and the way that the pointer size is
16383 determined.
16385 @item -mlong32
16386 @opindex mlong32
16387 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
16389 The default size of @code{int}s, @code{long}s and pointers depends on
16390 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
16391 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
16392 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
16393 or the same size as integer registers, whichever is smaller.
16395 @item -msym32
16396 @itemx -mno-sym32
16397 @opindex msym32
16398 @opindex mno-sym32
16399 Assume (do not assume) that all symbols have 32-bit values, regardless
16400 of the selected ABI@.  This option is useful in combination with
16401 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
16402 to generate shorter and faster references to symbolic addresses.
16404 @item -G @var{num}
16405 @opindex G
16406 Put definitions of externally-visible data in a small data section
16407 if that data is no bigger than @var{num} bytes.  GCC can then generate
16408 more efficient accesses to the data; see @option{-mgpopt} for details.
16410 The default @option{-G} option depends on the configuration.
16412 @item -mlocal-sdata
16413 @itemx -mno-local-sdata
16414 @opindex mlocal-sdata
16415 @opindex mno-local-sdata
16416 Extend (do not extend) the @option{-G} behavior to local data too,
16417 such as to static variables in C@.  @option{-mlocal-sdata} is the
16418 default for all configurations.
16420 If the linker complains that an application is using too much small data,
16421 you might want to try rebuilding the less performance-critical parts with
16422 @option{-mno-local-sdata}.  You might also want to build large
16423 libraries with @option{-mno-local-sdata}, so that the libraries leave
16424 more room for the main program.
16426 @item -mextern-sdata
16427 @itemx -mno-extern-sdata
16428 @opindex mextern-sdata
16429 @opindex mno-extern-sdata
16430 Assume (do not assume) that externally-defined data is in
16431 a small data section if the size of that data is within the @option{-G} limit.
16432 @option{-mextern-sdata} is the default for all configurations.
16434 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
16435 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
16436 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
16437 is placed in a small data section.  If @var{Var} is defined by another
16438 module, you must either compile that module with a high-enough
16439 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
16440 definition.  If @var{Var} is common, you must link the application
16441 with a high-enough @option{-G} setting.
16443 The easiest way of satisfying these restrictions is to compile
16444 and link every module with the same @option{-G} option.  However,
16445 you may wish to build a library that supports several different
16446 small data limits.  You can do this by compiling the library with
16447 the highest supported @option{-G} setting and additionally using
16448 @option{-mno-extern-sdata} to stop the library from making assumptions
16449 about externally-defined data.
16451 @item -mgpopt
16452 @itemx -mno-gpopt
16453 @opindex mgpopt
16454 @opindex mno-gpopt
16455 Use (do not use) GP-relative accesses for symbols that are known to be
16456 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
16457 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
16458 configurations.
16460 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
16461 might not hold the value of @code{_gp}.  For example, if the code is
16462 part of a library that might be used in a boot monitor, programs that
16463 call boot monitor routines pass an unknown value in @code{$gp}.
16464 (In such situations, the boot monitor itself is usually compiled
16465 with @option{-G0}.)
16467 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
16468 @option{-mno-extern-sdata}.
16470 @item -membedded-data
16471 @itemx -mno-embedded-data
16472 @opindex membedded-data
16473 @opindex mno-embedded-data
16474 Allocate variables to the read-only data section first if possible, then
16475 next in the small data section if possible, otherwise in data.  This gives
16476 slightly slower code than the default, but reduces the amount of RAM required
16477 when executing, and thus may be preferred for some embedded systems.
16479 @item -muninit-const-in-rodata
16480 @itemx -mno-uninit-const-in-rodata
16481 @opindex muninit-const-in-rodata
16482 @opindex mno-uninit-const-in-rodata
16483 Put uninitialized @code{const} variables in the read-only data section.
16484 This option is only meaningful in conjunction with @option{-membedded-data}.
16486 @item -mcode-readable=@var{setting}
16487 @opindex mcode-readable
16488 Specify whether GCC may generate code that reads from executable sections.
16489 There are three possible settings:
16491 @table @gcctabopt
16492 @item -mcode-readable=yes
16493 Instructions may freely access executable sections.  This is the
16494 default setting.
16496 @item -mcode-readable=pcrel
16497 MIPS16 PC-relative load instructions can access executable sections,
16498 but other instructions must not do so.  This option is useful on 4KSc
16499 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
16500 It is also useful on processors that can be configured to have a dual
16501 instruction/data SRAM interface and that, like the M4K, automatically
16502 redirect PC-relative loads to the instruction RAM.
16504 @item -mcode-readable=no
16505 Instructions must not access executable sections.  This option can be
16506 useful on targets that are configured to have a dual instruction/data
16507 SRAM interface but that (unlike the M4K) do not automatically redirect
16508 PC-relative loads to the instruction RAM.
16509 @end table
16511 @item -msplit-addresses
16512 @itemx -mno-split-addresses
16513 @opindex msplit-addresses
16514 @opindex mno-split-addresses
16515 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
16516 relocation operators.  This option has been superseded by
16517 @option{-mexplicit-relocs} but is retained for backwards compatibility.
16519 @item -mexplicit-relocs
16520 @itemx -mno-explicit-relocs
16521 @opindex mexplicit-relocs
16522 @opindex mno-explicit-relocs
16523 Use (do not use) assembler relocation operators when dealing with symbolic
16524 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
16525 is to use assembler macros instead.
16527 @option{-mexplicit-relocs} is the default if GCC was configured
16528 to use an assembler that supports relocation operators.
16530 @item -mcheck-zero-division
16531 @itemx -mno-check-zero-division
16532 @opindex mcheck-zero-division
16533 @opindex mno-check-zero-division
16534 Trap (do not trap) on integer division by zero.
16536 The default is @option{-mcheck-zero-division}.
16538 @item -mdivide-traps
16539 @itemx -mdivide-breaks
16540 @opindex mdivide-traps
16541 @opindex mdivide-breaks
16542 MIPS systems check for division by zero by generating either a
16543 conditional trap or a break instruction.  Using traps results in
16544 smaller code, but is only supported on MIPS II and later.  Also, some
16545 versions of the Linux kernel have a bug that prevents trap from
16546 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
16547 allow conditional traps on architectures that support them and
16548 @option{-mdivide-breaks} to force the use of breaks.
16550 The default is usually @option{-mdivide-traps}, but this can be
16551 overridden at configure time using @option{--with-divide=breaks}.
16552 Divide-by-zero checks can be completely disabled using
16553 @option{-mno-check-zero-division}.
16555 @item -mmemcpy
16556 @itemx -mno-memcpy
16557 @opindex mmemcpy
16558 @opindex mno-memcpy
16559 Force (do not force) the use of @code{memcpy()} for non-trivial block
16560 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
16561 most constant-sized copies.
16563 @item -mlong-calls
16564 @itemx -mno-long-calls
16565 @opindex mlong-calls
16566 @opindex mno-long-calls
16567 Disable (do not disable) use of the @code{jal} instruction.  Calling
16568 functions using @code{jal} is more efficient but requires the caller
16569 and callee to be in the same 256 megabyte segment.
16571 This option has no effect on abicalls code.  The default is
16572 @option{-mno-long-calls}.
16574 @item -mmad
16575 @itemx -mno-mad
16576 @opindex mmad
16577 @opindex mno-mad
16578 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
16579 instructions, as provided by the R4650 ISA@.
16581 @item -mimadd
16582 @itemx -mno-imadd
16583 @opindex mimadd
16584 @opindex mno-imadd
16585 Enable (disable) use of the @code{madd} and @code{msub} integer
16586 instructions.  The default is @option{-mimadd} on architectures
16587 that support @code{madd} and @code{msub} except for the 74k 
16588 architecture where it was found to generate slower code.
16590 @item -mfused-madd
16591 @itemx -mno-fused-madd
16592 @opindex mfused-madd
16593 @opindex mno-fused-madd
16594 Enable (disable) use of the floating-point multiply-accumulate
16595 instructions, when they are available.  The default is
16596 @option{-mfused-madd}.
16598 On the R8000 CPU when multiply-accumulate instructions are used,
16599 the intermediate product is calculated to infinite precision
16600 and is not subject to the FCSR Flush to Zero bit.  This may be
16601 undesirable in some circumstances.  On other processors the result
16602 is numerically identical to the equivalent computation using
16603 separate multiply, add, subtract and negate instructions.
16605 @item -nocpp
16606 @opindex nocpp
16607 Tell the MIPS assembler to not run its preprocessor over user
16608 assembler files (with a @samp{.s} suffix) when assembling them.
16610 @item -mfix-24k
16611 @item -mno-fix-24k
16612 @opindex mfix-24k
16613 @opindex mno-fix-24k
16614 Work around the 24K E48 (lost data on stores during refill) errata.
16615 The workarounds are implemented by the assembler rather than by GCC@.
16617 @item -mfix-r4000
16618 @itemx -mno-fix-r4000
16619 @opindex mfix-r4000
16620 @opindex mno-fix-r4000
16621 Work around certain R4000 CPU errata:
16622 @itemize @minus
16623 @item
16624 A double-word or a variable shift may give an incorrect result if executed
16625 immediately after starting an integer division.
16626 @item
16627 A double-word or a variable shift may give an incorrect result if executed
16628 while an integer multiplication is in progress.
16629 @item
16630 An integer division may give an incorrect result if started in a delay slot
16631 of a taken branch or a jump.
16632 @end itemize
16634 @item -mfix-r4400
16635 @itemx -mno-fix-r4400
16636 @opindex mfix-r4400
16637 @opindex mno-fix-r4400
16638 Work around certain R4400 CPU errata:
16639 @itemize @minus
16640 @item
16641 A double-word or a variable shift may give an incorrect result if executed
16642 immediately after starting an integer division.
16643 @end itemize
16645 @item -mfix-r10000
16646 @itemx -mno-fix-r10000
16647 @opindex mfix-r10000
16648 @opindex mno-fix-r10000
16649 Work around certain R10000 errata:
16650 @itemize @minus
16651 @item
16652 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16653 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16654 @end itemize
16656 This option can only be used if the target architecture supports
16657 branch-likely instructions.  @option{-mfix-r10000} is the default when
16658 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16659 otherwise.
16661 @item -mfix-vr4120
16662 @itemx -mno-fix-vr4120
16663 @opindex mfix-vr4120
16664 Work around certain VR4120 errata:
16665 @itemize @minus
16666 @item
16667 @code{dmultu} does not always produce the correct result.
16668 @item
16669 @code{div} and @code{ddiv} do not always produce the correct result if one
16670 of the operands is negative.
16671 @end itemize
16672 The workarounds for the division errata rely on special functions in
16673 @file{libgcc.a}.  At present, these functions are only provided by
16674 the @code{mips64vr*-elf} configurations.
16676 Other VR4120 errata require a NOP to be inserted between certain pairs of
16677 instructions.  These errata are handled by the assembler, not by GCC itself.
16679 @item -mfix-vr4130
16680 @opindex mfix-vr4130
16681 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16682 workarounds are implemented by the assembler rather than by GCC,
16683 although GCC avoids using @code{mflo} and @code{mfhi} if the
16684 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16685 instructions are available instead.
16687 @item -mfix-sb1
16688 @itemx -mno-fix-sb1
16689 @opindex mfix-sb1
16690 Work around certain SB-1 CPU core errata.
16691 (This flag currently works around the SB-1 revision 2
16692 ``F1'' and ``F2'' floating-point errata.)
16694 @item -mr10k-cache-barrier=@var{setting}
16695 @opindex mr10k-cache-barrier
16696 Specify whether GCC should insert cache barriers to avoid the
16697 side-effects of speculation on R10K processors.
16699 In common with many processors, the R10K tries to predict the outcome
16700 of a conditional branch and speculatively executes instructions from
16701 the ``taken'' branch.  It later aborts these instructions if the
16702 predicted outcome is wrong.  However, on the R10K, even aborted
16703 instructions can have side effects.
16705 This problem only affects kernel stores and, depending on the system,
16706 kernel loads.  As an example, a speculatively-executed store may load
16707 the target memory into cache and mark the cache line as dirty, even if
16708 the store itself is later aborted.  If a DMA operation writes to the
16709 same area of memory before the ``dirty'' line is flushed, the cached
16710 data overwrites the DMA-ed data.  See the R10K processor manual
16711 for a full description, including other potential problems.
16713 One workaround is to insert cache barrier instructions before every memory
16714 access that might be speculatively executed and that might have side
16715 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16716 controls GCC's implementation of this workaround.  It assumes that
16717 aborted accesses to any byte in the following regions does not have
16718 side effects:
16720 @enumerate
16721 @item
16722 the memory occupied by the current function's stack frame;
16724 @item
16725 the memory occupied by an incoming stack argument;
16727 @item
16728 the memory occupied by an object with a link-time-constant address.
16729 @end enumerate
16731 It is the kernel's responsibility to ensure that speculative
16732 accesses to these regions are indeed safe.
16734 If the input program contains a function declaration such as:
16736 @smallexample
16737 void foo (void);
16738 @end smallexample
16740 then the implementation of @code{foo} must allow @code{j foo} and
16741 @code{jal foo} to be executed speculatively.  GCC honors this
16742 restriction for functions it compiles itself.  It expects non-GCC
16743 functions (such as hand-written assembly code) to do the same.
16745 The option has three forms:
16747 @table @gcctabopt
16748 @item -mr10k-cache-barrier=load-store
16749 Insert a cache barrier before a load or store that might be
16750 speculatively executed and that might have side effects even
16751 if aborted.
16753 @item -mr10k-cache-barrier=store
16754 Insert a cache barrier before a store that might be speculatively
16755 executed and that might have side effects even if aborted.
16757 @item -mr10k-cache-barrier=none
16758 Disable the insertion of cache barriers.  This is the default setting.
16759 @end table
16761 @item -mflush-func=@var{func}
16762 @itemx -mno-flush-func
16763 @opindex mflush-func
16764 Specifies the function to call to flush the I and D caches, or to not
16765 call any such function.  If called, the function must take the same
16766 arguments as the common @code{_flush_func()}, that is, the address of the
16767 memory range for which the cache is being flushed, the size of the
16768 memory range, and the number 3 (to flush both caches).  The default
16769 depends on the target GCC was configured for, but commonly is either
16770 @samp{_flush_func} or @samp{__cpu_flush}.
16772 @item mbranch-cost=@var{num}
16773 @opindex mbranch-cost
16774 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16775 This cost is only a heuristic and is not guaranteed to produce
16776 consistent results across releases.  A zero cost redundantly selects
16777 the default, which is based on the @option{-mtune} setting.
16779 @item -mbranch-likely
16780 @itemx -mno-branch-likely
16781 @opindex mbranch-likely
16782 @opindex mno-branch-likely
16783 Enable or disable use of Branch Likely instructions, regardless of the
16784 default for the selected architecture.  By default, Branch Likely
16785 instructions may be generated if they are supported by the selected
16786 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16787 and processors that implement those architectures; for those, Branch
16788 Likely instructions are not be generated by default because the MIPS32
16789 and MIPS64 architectures specifically deprecate their use.
16791 @item -mfp-exceptions
16792 @itemx -mno-fp-exceptions
16793 @opindex mfp-exceptions
16794 Specifies whether FP exceptions are enabled.  This affects how
16795 FP instructions are scheduled for some processors.
16796 The default is that FP exceptions are
16797 enabled.
16799 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16800 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16801 FP pipe.
16803 @item -mvr4130-align
16804 @itemx -mno-vr4130-align
16805 @opindex mvr4130-align
16806 The VR4130 pipeline is two-way superscalar, but can only issue two
16807 instructions together if the first one is 8-byte aligned.  When this
16808 option is enabled, GCC aligns pairs of instructions that it
16809 thinks should execute in parallel.
16811 This option only has an effect when optimizing for the VR4130.
16812 It normally makes code faster, but at the expense of making it bigger.
16813 It is enabled by default at optimization level @option{-O3}.
16815 @item -msynci
16816 @itemx -mno-synci
16817 @opindex msynci
16818 Enable (disable) generation of @code{synci} instructions on
16819 architectures that support it.  The @code{synci} instructions (if
16820 enabled) are generated when @code{__builtin___clear_cache()} is
16821 compiled.
16823 This option defaults to @code{-mno-synci}, but the default can be
16824 overridden by configuring with @code{--with-synci}.
16826 When compiling code for single processor systems, it is generally safe
16827 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16828 does not invalidate the instruction caches on all cores and may lead
16829 to undefined behavior.
16831 @item -mrelax-pic-calls
16832 @itemx -mno-relax-pic-calls
16833 @opindex mrelax-pic-calls
16834 Try to turn PIC calls that are normally dispatched via register
16835 @code{$25} into direct calls.  This is only possible if the linker can
16836 resolve the destination at link-time and if the destination is within
16837 range for a direct call.
16839 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16840 an assembler and a linker that support the @code{.reloc} assembly
16841 directive and @code{-mexplicit-relocs} is in effect.  With
16842 @code{-mno-explicit-relocs}, this optimization can be performed by the
16843 assembler and the linker alone without help from the compiler.
16845 @item -mmcount-ra-address
16846 @itemx -mno-mcount-ra-address
16847 @opindex mmcount-ra-address
16848 @opindex mno-mcount-ra-address
16849 Emit (do not emit) code that allows @code{_mcount} to modify the
16850 calling function's return address.  When enabled, this option extends
16851 the usual @code{_mcount} interface with a new @var{ra-address}
16852 parameter, which has type @code{intptr_t *} and is passed in register
16853 @code{$12}.  @code{_mcount} can then modify the return address by
16854 doing both of the following:
16855 @itemize
16856 @item
16857 Returning the new address in register @code{$31}.
16858 @item
16859 Storing the new address in @code{*@var{ra-address}},
16860 if @var{ra-address} is nonnull.
16861 @end itemize
16863 The default is @option{-mno-mcount-ra-address}.
16865 @end table
16867 @node MMIX Options
16868 @subsection MMIX Options
16869 @cindex MMIX Options
16871 These options are defined for the MMIX:
16873 @table @gcctabopt
16874 @item -mlibfuncs
16875 @itemx -mno-libfuncs
16876 @opindex mlibfuncs
16877 @opindex mno-libfuncs
16878 Specify that intrinsic library functions are being compiled, passing all
16879 values in registers, no matter the size.
16881 @item -mepsilon
16882 @itemx -mno-epsilon
16883 @opindex mepsilon
16884 @opindex mno-epsilon
16885 Generate floating-point comparison instructions that compare with respect
16886 to the @code{rE} epsilon register.
16888 @item -mabi=mmixware
16889 @itemx -mabi=gnu
16890 @opindex mabi=mmixware
16891 @opindex mabi=gnu
16892 Generate code that passes function parameters and return values that (in
16893 the called function) are seen as registers @code{$0} and up, as opposed to
16894 the GNU ABI which uses global registers @code{$231} and up.
16896 @item -mzero-extend
16897 @itemx -mno-zero-extend
16898 @opindex mzero-extend
16899 @opindex mno-zero-extend
16900 When reading data from memory in sizes shorter than 64 bits, use (do not
16901 use) zero-extending load instructions by default, rather than
16902 sign-extending ones.
16904 @item -mknuthdiv
16905 @itemx -mno-knuthdiv
16906 @opindex mknuthdiv
16907 @opindex mno-knuthdiv
16908 Make the result of a division yielding a remainder have the same sign as
16909 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
16910 remainder follows the sign of the dividend.  Both methods are
16911 arithmetically valid, the latter being almost exclusively used.
16913 @item -mtoplevel-symbols
16914 @itemx -mno-toplevel-symbols
16915 @opindex mtoplevel-symbols
16916 @opindex mno-toplevel-symbols
16917 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
16918 code can be used with the @code{PREFIX} assembly directive.
16920 @item -melf
16921 @opindex melf
16922 Generate an executable in the ELF format, rather than the default
16923 @samp{mmo} format used by the @command{mmix} simulator.
16925 @item -mbranch-predict
16926 @itemx -mno-branch-predict
16927 @opindex mbranch-predict
16928 @opindex mno-branch-predict
16929 Use (do not use) the probable-branch instructions, when static branch
16930 prediction indicates a probable branch.
16932 @item -mbase-addresses
16933 @itemx -mno-base-addresses
16934 @opindex mbase-addresses
16935 @opindex mno-base-addresses
16936 Generate (do not generate) code that uses @emph{base addresses}.  Using a
16937 base address automatically generates a request (handled by the assembler
16938 and the linker) for a constant to be set up in a global register.  The
16939 register is used for one or more base address requests within the range 0
16940 to 255 from the value held in the register.  The generally leads to short
16941 and fast code, but the number of different data items that can be
16942 addressed is limited.  This means that a program that uses lots of static
16943 data may require @option{-mno-base-addresses}.
16945 @item -msingle-exit
16946 @itemx -mno-single-exit
16947 @opindex msingle-exit
16948 @opindex mno-single-exit
16949 Force (do not force) generated code to have a single exit point in each
16950 function.
16951 @end table
16953 @node MN10300 Options
16954 @subsection MN10300 Options
16955 @cindex MN10300 options
16957 These @option{-m} options are defined for Matsushita MN10300 architectures:
16959 @table @gcctabopt
16960 @item -mmult-bug
16961 @opindex mmult-bug
16962 Generate code to avoid bugs in the multiply instructions for the MN10300
16963 processors.  This is the default.
16965 @item -mno-mult-bug
16966 @opindex mno-mult-bug
16967 Do not generate code to avoid bugs in the multiply instructions for the
16968 MN10300 processors.
16970 @item -mam33
16971 @opindex mam33
16972 Generate code using features specific to the AM33 processor.
16974 @item -mno-am33
16975 @opindex mno-am33
16976 Do not generate code using features specific to the AM33 processor.  This
16977 is the default.
16979 @item -mam33-2
16980 @opindex mam33-2
16981 Generate code using features specific to the AM33/2.0 processor.
16983 @item -mam34
16984 @opindex mam34
16985 Generate code using features specific to the AM34 processor.
16987 @item -mtune=@var{cpu-type}
16988 @opindex mtune
16989 Use the timing characteristics of the indicated CPU type when
16990 scheduling instructions.  This does not change the targeted processor
16991 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
16992 @samp{am33-2} or @samp{am34}.
16994 @item -mreturn-pointer-on-d0
16995 @opindex mreturn-pointer-on-d0
16996 When generating a function that returns a pointer, return the pointer
16997 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
16998 only in @code{a0}, and attempts to call such functions without a prototype
16999 result in errors.  Note that this option is on by default; use
17000 @option{-mno-return-pointer-on-d0} to disable it.
17002 @item -mno-crt0
17003 @opindex mno-crt0
17004 Do not link in the C run-time initialization object file.
17006 @item -mrelax
17007 @opindex mrelax
17008 Indicate to the linker that it should perform a relaxation optimization pass
17009 to shorten branches, calls and absolute memory addresses.  This option only
17010 has an effect when used on the command line for the final link step.
17012 This option makes symbolic debugging impossible.
17014 @item -mliw
17015 @opindex mliw
17016 Allow the compiler to generate @emph{Long Instruction Word}
17017 instructions if the target is the @samp{AM33} or later.  This is the
17018 default.  This option defines the preprocessor macro @samp{__LIW__}.
17020 @item -mnoliw
17021 @opindex mnoliw
17022 Do not allow the compiler to generate @emph{Long Instruction Word}
17023 instructions.  This option defines the preprocessor macro
17024 @samp{__NO_LIW__}.
17026 @item -msetlb
17027 @opindex msetlb
17028 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
17029 instructions if the target is the @samp{AM33} or later.  This is the
17030 default.  This option defines the preprocessor macro @samp{__SETLB__}.
17032 @item -mnosetlb
17033 @opindex mnosetlb
17034 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
17035 instructions.  This option defines the preprocessor macro
17036 @samp{__NO_SETLB__}.
17038 @end table
17040 @node Moxie Options
17041 @subsection Moxie Options
17042 @cindex Moxie Options
17044 @table @gcctabopt
17046 @item -meb
17047 @opindex meb
17048 Generate big-endian code.  This is the default for @samp{moxie-*-*}
17049 configurations.
17051 @item -mel
17052 @opindex mel
17053 Generate little-endian code.
17055 @item -mno-crt0
17056 @opindex mno-crt0
17057 Do not link in the C run-time initialization object file.
17059 @end table
17061 @node PDP-11 Options
17062 @subsection PDP-11 Options
17063 @cindex PDP-11 Options
17065 These options are defined for the PDP-11:
17067 @table @gcctabopt
17068 @item -mfpu
17069 @opindex mfpu
17070 Use hardware FPP floating point.  This is the default.  (FIS floating
17071 point on the PDP-11/40 is not supported.)
17073 @item -msoft-float
17074 @opindex msoft-float
17075 Do not use hardware floating point.
17077 @item -mac0
17078 @opindex mac0
17079 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
17081 @item -mno-ac0
17082 @opindex mno-ac0
17083 Return floating-point results in memory.  This is the default.
17085 @item -m40
17086 @opindex m40
17087 Generate code for a PDP-11/40.
17089 @item -m45
17090 @opindex m45
17091 Generate code for a PDP-11/45.  This is the default.
17093 @item -m10
17094 @opindex m10
17095 Generate code for a PDP-11/10.
17097 @item -mbcopy-builtin
17098 @opindex mbcopy-builtin
17099 Use inline @code{movmemhi} patterns for copying memory.  This is the
17100 default.
17102 @item -mbcopy
17103 @opindex mbcopy
17104 Do not use inline @code{movmemhi} patterns for copying memory.
17106 @item -mint16
17107 @itemx -mno-int32
17108 @opindex mint16
17109 @opindex mno-int32
17110 Use 16-bit @code{int}.  This is the default.
17112 @item -mint32
17113 @itemx -mno-int16
17114 @opindex mint32
17115 @opindex mno-int16
17116 Use 32-bit @code{int}.
17118 @item -mfloat64
17119 @itemx -mno-float32
17120 @opindex mfloat64
17121 @opindex mno-float32
17122 Use 64-bit @code{float}.  This is the default.
17124 @item -mfloat32
17125 @itemx -mno-float64
17126 @opindex mfloat32
17127 @opindex mno-float64
17128 Use 32-bit @code{float}.
17130 @item -mabshi
17131 @opindex mabshi
17132 Use @code{abshi2} pattern.  This is the default.
17134 @item -mno-abshi
17135 @opindex mno-abshi
17136 Do not use @code{abshi2} pattern.
17138 @item -mbranch-expensive
17139 @opindex mbranch-expensive
17140 Pretend that branches are expensive.  This is for experimenting with
17141 code generation only.
17143 @item -mbranch-cheap
17144 @opindex mbranch-cheap
17145 Do not pretend that branches are expensive.  This is the default.
17147 @item -munix-asm
17148 @opindex munix-asm
17149 Use Unix assembler syntax.  This is the default when configured for
17150 @samp{pdp11-*-bsd}.
17152 @item -mdec-asm
17153 @opindex mdec-asm
17154 Use DEC assembler syntax.  This is the default when configured for any
17155 PDP-11 target other than @samp{pdp11-*-bsd}.
17156 @end table
17158 @node picoChip Options
17159 @subsection picoChip Options
17160 @cindex picoChip options
17162 These @samp{-m} options are defined for picoChip implementations:
17164 @table @gcctabopt
17166 @item -mae=@var{ae_type}
17167 @opindex mcpu
17168 Set the instruction set, register set, and instruction scheduling
17169 parameters for array element type @var{ae_type}.  Supported values
17170 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
17172 @option{-mae=ANY} selects a completely generic AE type.  Code
17173 generated with this option runs on any of the other AE types.  The
17174 code is not as efficient as it would be if compiled for a specific
17175 AE type, and some types of operation (e.g., multiplication) do not
17176 work properly on all types of AE.
17178 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
17179 for compiled code, and is the default.
17181 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
17182 option may suffer from poor performance of byte (char) manipulation,
17183 since the DSP AE does not provide hardware support for byte load/stores.
17185 @item -msymbol-as-address
17186 Enable the compiler to directly use a symbol name as an address in a
17187 load/store instruction, without first loading it into a
17188 register.  Typically, the use of this option generates larger
17189 programs, which run faster than when the option isn't used.  However, the
17190 results vary from program to program, so it is left as a user option,
17191 rather than being permanently enabled.
17193 @item -mno-inefficient-warnings
17194 Disables warnings about the generation of inefficient code.  These
17195 warnings can be generated, for example, when compiling code that
17196 performs byte-level memory operations on the MAC AE type.  The MAC AE has
17197 no hardware support for byte-level memory operations, so all byte
17198 load/stores must be synthesized from word load/store operations.  This is
17199 inefficient and a warning is generated to indicate
17200 that you should rewrite the code to avoid byte operations, or to target
17201 an AE type that has the necessary hardware support.  This option disables
17202 these warnings.
17204 @end table
17206 @node PowerPC Options
17207 @subsection PowerPC Options
17208 @cindex PowerPC options
17210 These are listed under @xref{RS/6000 and PowerPC Options}.
17212 @node RL78 Options
17213 @subsection RL78 Options
17214 @cindex RL78 Options
17216 @table @gcctabopt
17218 @item -msim
17219 @opindex msim
17220 Links in additional target libraries to support operation within a
17221 simulator.
17223 @item -mmul=none
17224 @itemx -mmul=g13
17225 @itemx -mmul=rl78
17226 @opindex mmul
17227 Specifies the type of hardware multiplication support to be used.  The
17228 default is @code{none}, which uses software multiplication functions.
17229 The @code{g13} option is for the hardware multiply/divide peripheral
17230 only on the RL78/G13 targets.  The @code{rl78} option is for the
17231 standard hardware multiplication defined in the RL78 software manual.
17233 @end table
17235 @node RS/6000 and PowerPC Options
17236 @subsection IBM RS/6000 and PowerPC Options
17237 @cindex RS/6000 and PowerPC Options
17238 @cindex IBM RS/6000 and PowerPC Options
17240 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
17241 @table @gcctabopt
17242 @item -mpowerpc-gpopt
17243 @itemx -mno-powerpc-gpopt
17244 @itemx -mpowerpc-gfxopt
17245 @itemx -mno-powerpc-gfxopt
17246 @need 800
17247 @itemx -mpowerpc64
17248 @itemx -mno-powerpc64
17249 @itemx -mmfcrf
17250 @itemx -mno-mfcrf
17251 @itemx -mpopcntb
17252 @itemx -mno-popcntb
17253 @itemx -mpopcntd
17254 @itemx -mno-popcntd
17255 @itemx -mfprnd
17256 @itemx -mno-fprnd
17257 @need 800
17258 @itemx -mcmpb
17259 @itemx -mno-cmpb
17260 @itemx -mmfpgpr
17261 @itemx -mno-mfpgpr
17262 @itemx -mhard-dfp
17263 @itemx -mno-hard-dfp
17264 @opindex mpowerpc-gpopt
17265 @opindex mno-powerpc-gpopt
17266 @opindex mpowerpc-gfxopt
17267 @opindex mno-powerpc-gfxopt
17268 @opindex mpowerpc64
17269 @opindex mno-powerpc64
17270 @opindex mmfcrf
17271 @opindex mno-mfcrf
17272 @opindex mpopcntb
17273 @opindex mno-popcntb
17274 @opindex mpopcntd
17275 @opindex mno-popcntd
17276 @opindex mfprnd
17277 @opindex mno-fprnd
17278 @opindex mcmpb
17279 @opindex mno-cmpb
17280 @opindex mmfpgpr
17281 @opindex mno-mfpgpr
17282 @opindex mhard-dfp
17283 @opindex mno-hard-dfp
17284 You use these options to specify which instructions are available on the
17285 processor you are using.  The default value of these options is
17286 determined when configuring GCC@.  Specifying the
17287 @option{-mcpu=@var{cpu_type}} overrides the specification of these
17288 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
17289 rather than the options listed above.
17291 Specifying @option{-mpowerpc-gpopt} allows
17292 GCC to use the optional PowerPC architecture instructions in the
17293 General Purpose group, including floating-point square root.  Specifying
17294 @option{-mpowerpc-gfxopt} allows GCC to
17295 use the optional PowerPC architecture instructions in the Graphics
17296 group, including floating-point select.
17298 The @option{-mmfcrf} option allows GCC to generate the move from
17299 condition register field instruction implemented on the POWER4
17300 processor and other processors that support the PowerPC V2.01
17301 architecture.
17302 The @option{-mpopcntb} option allows GCC to generate the popcount and
17303 double-precision FP reciprocal estimate instruction implemented on the
17304 POWER5 processor and other processors that support the PowerPC V2.02
17305 architecture.
17306 The @option{-mpopcntd} option allows GCC to generate the popcount
17307 instruction implemented on the POWER7 processor and other processors
17308 that support the PowerPC V2.06 architecture.
17309 The @option{-mfprnd} option allows GCC to generate the FP round to
17310 integer instructions implemented on the POWER5+ processor and other
17311 processors that support the PowerPC V2.03 architecture.
17312 The @option{-mcmpb} option allows GCC to generate the compare bytes
17313 instruction implemented on the POWER6 processor and other processors
17314 that support the PowerPC V2.05 architecture.
17315 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
17316 general-purpose register instructions implemented on the POWER6X
17317 processor and other processors that support the extended PowerPC V2.05
17318 architecture.
17319 The @option{-mhard-dfp} option allows GCC to generate the decimal
17320 floating-point instructions implemented on some POWER processors.
17322 The @option{-mpowerpc64} option allows GCC to generate the additional
17323 64-bit instructions that are found in the full PowerPC64 architecture
17324 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
17325 @option{-mno-powerpc64}.
17327 @item -mcpu=@var{cpu_type}
17328 @opindex mcpu
17329 Set architecture type, register usage, and
17330 instruction scheduling parameters for machine type @var{cpu_type}.
17331 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
17332 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
17333 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
17334 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
17335 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
17336 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
17337 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
17338 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
17339 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
17340 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
17341 @samp{powerpc64}, and @samp{rs64}.
17343 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
17344 PowerPC and 64-bit PowerPC architecture machine
17345 types, with an appropriate, generic processor model assumed for
17346 scheduling purposes.
17348 The other options specify a specific processor.  Code generated under
17349 those options runs best on that processor, and may not run at all on
17350 others.
17352 The @option{-mcpu} options automatically enable or disable the
17353 following options:
17355 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
17356 -mpopcntb -mpopcntd  -mpowerpc64 @gol
17357 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
17358 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
17359 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector -mquad-memory}
17361 The particular options set for any particular CPU varies between
17362 compiler versions, depending on what setting seems to produce optimal
17363 code for that CPU; it doesn't necessarily reflect the actual hardware's
17364 capabilities.  If you wish to set an individual option to a particular
17365 value, you may specify it after the @option{-mcpu} option, like
17366 @option{-mcpu=970 -mno-altivec}.
17368 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
17369 not enabled or disabled by the @option{-mcpu} option at present because
17370 AIX does not have full support for these options.  You may still
17371 enable or disable them individually if you're sure it'll work in your
17372 environment.
17374 @item -mtune=@var{cpu_type}
17375 @opindex mtune
17376 Set the instruction scheduling parameters for machine type
17377 @var{cpu_type}, but do not set the architecture type or register usage,
17378 as @option{-mcpu=@var{cpu_type}} does.  The same
17379 values for @var{cpu_type} are used for @option{-mtune} as for
17380 @option{-mcpu}.  If both are specified, the code generated uses the
17381 architecture and registers set by @option{-mcpu}, but the
17382 scheduling parameters set by @option{-mtune}.
17384 @item -mcmodel=small
17385 @opindex mcmodel=small
17386 Generate PowerPC64 code for the small model: The TOC is limited to
17387 64k.
17389 @item -mcmodel=medium
17390 @opindex mcmodel=medium
17391 Generate PowerPC64 code for the medium model: The TOC and other static
17392 data may be up to a total of 4G in size.
17394 @item -mcmodel=large
17395 @opindex mcmodel=large
17396 Generate PowerPC64 code for the large model: The TOC may be up to 4G
17397 in size.  Other data and code is only limited by the 64-bit address
17398 space.
17400 @item -maltivec
17401 @itemx -mno-altivec
17402 @opindex maltivec
17403 @opindex mno-altivec
17404 Generate code that uses (does not use) AltiVec instructions, and also
17405 enable the use of built-in functions that allow more direct access to
17406 the AltiVec instruction set.  You may also need to set
17407 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
17408 enhancements.
17410 @item -mvrsave
17411 @itemx -mno-vrsave
17412 @opindex mvrsave
17413 @opindex mno-vrsave
17414 Generate VRSAVE instructions when generating AltiVec code.
17416 @item -mgen-cell-microcode
17417 @opindex mgen-cell-microcode
17418 Generate Cell microcode instructions.
17420 @item -mwarn-cell-microcode
17421 @opindex mwarn-cell-microcode
17422 Warn when a Cell microcode instruction is emitted.  An example
17423 of a Cell microcode instruction is a variable shift.
17425 @item -msecure-plt
17426 @opindex msecure-plt
17427 Generate code that allows @command{ld} and @command{ld.so}
17428 to build executables and shared
17429 libraries with non-executable @code{.plt} and @code{.got} sections.
17430 This is a PowerPC
17431 32-bit SYSV ABI option.
17433 @item -mbss-plt
17434 @opindex mbss-plt
17435 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
17436 fills in, and
17437 requires @code{.plt} and @code{.got}
17438 sections that are both writable and executable.
17439 This is a PowerPC 32-bit SYSV ABI option.
17441 @item -misel
17442 @itemx -mno-isel
17443 @opindex misel
17444 @opindex mno-isel
17445 This switch enables or disables the generation of ISEL instructions.
17447 @item -misel=@var{yes/no}
17448 This switch has been deprecated.  Use @option{-misel} and
17449 @option{-mno-isel} instead.
17451 @item -mspe
17452 @itemx -mno-spe
17453 @opindex mspe
17454 @opindex mno-spe
17455 This switch enables or disables the generation of SPE simd
17456 instructions.
17458 @item -mpaired
17459 @itemx -mno-paired
17460 @opindex mpaired
17461 @opindex mno-paired
17462 This switch enables or disables the generation of PAIRED simd
17463 instructions.
17465 @item -mspe=@var{yes/no}
17466 This option has been deprecated.  Use @option{-mspe} and
17467 @option{-mno-spe} instead.
17469 @item -mvsx
17470 @itemx -mno-vsx
17471 @opindex mvsx
17472 @opindex mno-vsx
17473 Generate code that uses (does not use) vector/scalar (VSX)
17474 instructions, and also enable the use of built-in functions that allow
17475 more direct access to the VSX instruction set.
17477 @item -mcrypto
17478 @itemx -mno-crypto
17479 @opindex mcrypto
17480 @opindex mno-crypto
17481 Enable the use (disable) of the built-in functions that allow direct
17482 access to the cryptographic instructions that were added in version
17483 2.07 of the PowerPC ISA.
17485 @item -mdirect-move
17486 @itemx -mno-direct-move
17487 @opindex mdirect-move
17488 @opindex mno-direct-move
17489 Generate code that uses (does not use) the instructions to move data
17490 between the general purpose registers and the vector/scalar (VSX)
17491 registers that were added in version 2.07 of the PowerPC ISA.
17493 @item -mpower8-fusion
17494 @itemx -mno-power8-fusion
17495 @opindex mpower8-fusion
17496 @opindex mno-power8-fusion
17497 Generate code that keeps (does not keeps) some integer operations
17498 adjacent so that the instructions can be fused together on power8 and
17499 later processors.
17501 @item -mpower8-vector
17502 @itemx -mno-power8-vector
17503 @opindex mpower8-vector
17504 @opindex mno-power8-vector
17505 Generate code that uses (does not use) the vector and scalar
17506 instructions that were added in version 2.07 of the PowerPC ISA.  Also
17507 enable the use of built-in functions that allow more direct access to
17508 the vector instructions.
17510 @item -mquad-memory
17511 @itemx -mno-quad-memory
17512 @opindex mquad-memory
17513 @opindex mno-quad-memory
17514 Generate code that uses (does not use) the quad word memory
17515 instructions.  The @option{-mquad-memory} option requires use of
17516 64-bit mode.
17518 @item -mfloat-gprs=@var{yes/single/double/no}
17519 @itemx -mfloat-gprs
17520 @opindex mfloat-gprs
17521 This switch enables or disables the generation of floating-point
17522 operations on the general-purpose registers for architectures that
17523 support it.
17525 The argument @var{yes} or @var{single} enables the use of
17526 single-precision floating-point operations.
17528 The argument @var{double} enables the use of single and
17529 double-precision floating-point operations.
17531 The argument @var{no} disables floating-point operations on the
17532 general-purpose registers.
17534 This option is currently only available on the MPC854x.
17536 @item -m32
17537 @itemx -m64
17538 @opindex m32
17539 @opindex m64
17540 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
17541 targets (including GNU/Linux).  The 32-bit environment sets int, long
17542 and pointer to 32 bits and generates code that runs on any PowerPC
17543 variant.  The 64-bit environment sets int to 32 bits and long and
17544 pointer to 64 bits, and generates code for PowerPC64, as for
17545 @option{-mpowerpc64}.
17547 @item -mfull-toc
17548 @itemx -mno-fp-in-toc
17549 @itemx -mno-sum-in-toc
17550 @itemx -mminimal-toc
17551 @opindex mfull-toc
17552 @opindex mno-fp-in-toc
17553 @opindex mno-sum-in-toc
17554 @opindex mminimal-toc
17555 Modify generation of the TOC (Table Of Contents), which is created for
17556 every executable file.  The @option{-mfull-toc} option is selected by
17557 default.  In that case, GCC allocates at least one TOC entry for
17558 each unique non-automatic variable reference in your program.  GCC
17559 also places floating-point constants in the TOC@.  However, only
17560 16,384 entries are available in the TOC@.
17562 If you receive a linker error message that saying you have overflowed
17563 the available TOC space, you can reduce the amount of TOC space used
17564 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
17565 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
17566 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
17567 generate code to calculate the sum of an address and a constant at
17568 run time instead of putting that sum into the TOC@.  You may specify one
17569 or both of these options.  Each causes GCC to produce very slightly
17570 slower and larger code at the expense of conserving TOC space.
17572 If you still run out of space in the TOC even when you specify both of
17573 these options, specify @option{-mminimal-toc} instead.  This option causes
17574 GCC to make only one TOC entry for every file.  When you specify this
17575 option, GCC produces code that is slower and larger but which
17576 uses extremely little TOC space.  You may wish to use this option
17577 only on files that contain less frequently-executed code.
17579 @item -maix64
17580 @itemx -maix32
17581 @opindex maix64
17582 @opindex maix32
17583 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
17584 @code{long} type, and the infrastructure needed to support them.
17585 Specifying @option{-maix64} implies @option{-mpowerpc64},
17586 while @option{-maix32} disables the 64-bit ABI and
17587 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
17589 @item -mxl-compat
17590 @itemx -mno-xl-compat
17591 @opindex mxl-compat
17592 @opindex mno-xl-compat
17593 Produce code that conforms more closely to IBM XL compiler semantics
17594 when using AIX-compatible ABI@.  Pass floating-point arguments to
17595 prototyped functions beyond the register save area (RSA) on the stack
17596 in addition to argument FPRs.  Do not assume that most significant
17597 double in 128-bit long double value is properly rounded when comparing
17598 values and converting to double.  Use XL symbol names for long double
17599 support routines.
17601 The AIX calling convention was extended but not initially documented to
17602 handle an obscure K&R C case of calling a function that takes the
17603 address of its arguments with fewer arguments than declared.  IBM XL
17604 compilers access floating-point arguments that do not fit in the
17605 RSA from the stack when a subroutine is compiled without
17606 optimization.  Because always storing floating-point arguments on the
17607 stack is inefficient and rarely needed, this option is not enabled by
17608 default and only is necessary when calling subroutines compiled by IBM
17609 XL compilers without optimization.
17611 @item -mpe
17612 @opindex mpe
17613 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
17614 application written to use message passing with special startup code to
17615 enable the application to run.  The system must have PE installed in the
17616 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
17617 must be overridden with the @option{-specs=} option to specify the
17618 appropriate directory location.  The Parallel Environment does not
17619 support threads, so the @option{-mpe} option and the @option{-pthread}
17620 option are incompatible.
17622 @item -malign-natural
17623 @itemx -malign-power
17624 @opindex malign-natural
17625 @opindex malign-power
17626 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
17627 @option{-malign-natural} overrides the ABI-defined alignment of larger
17628 types, such as floating-point doubles, on their natural size-based boundary.
17629 The option @option{-malign-power} instructs GCC to follow the ABI-specified
17630 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
17632 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
17633 is not supported.
17635 @item -msoft-float
17636 @itemx -mhard-float
17637 @opindex msoft-float
17638 @opindex mhard-float
17639 Generate code that does not use (uses) the floating-point register set.
17640 Software floating-point emulation is provided if you use the
17641 @option{-msoft-float} option, and pass the option to GCC when linking.
17643 @item -msingle-float
17644 @itemx -mdouble-float
17645 @opindex msingle-float
17646 @opindex mdouble-float
17647 Generate code for single- or double-precision floating-point operations.
17648 @option{-mdouble-float} implies @option{-msingle-float}.
17650 @item -msimple-fpu
17651 @opindex msimple-fpu
17652 Do not generate @code{sqrt} and @code{div} instructions for hardware
17653 floating-point unit.
17655 @item -mfpu=@var{name}
17656 @opindex mfpu
17657 Specify type of floating-point unit.  Valid values for @var{name} are
17658 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
17659 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
17660 @samp{sp_full} (equivalent to @option{-msingle-float}),
17661 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17663 @item -mxilinx-fpu
17664 @opindex mxilinx-fpu
17665 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17667 @item -mmultiple
17668 @itemx -mno-multiple
17669 @opindex mmultiple
17670 @opindex mno-multiple
17671 Generate code that uses (does not use) the load multiple word
17672 instructions and the store multiple word instructions.  These
17673 instructions are generated by default on POWER systems, and not
17674 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17675 PowerPC systems, since those instructions do not work when the
17676 processor is in little-endian mode.  The exceptions are PPC740 and
17677 PPC750 which permit these instructions in little-endian mode.
17679 @item -mstring
17680 @itemx -mno-string
17681 @opindex mstring
17682 @opindex mno-string
17683 Generate code that uses (does not use) the load string instructions
17684 and the store string word instructions to save multiple registers and
17685 do small block moves.  These instructions are generated by default on
17686 POWER systems, and not generated on PowerPC systems.  Do not use
17687 @option{-mstring} on little-endian PowerPC systems, since those
17688 instructions do not work when the processor is in little-endian mode.
17689 The exceptions are PPC740 and PPC750 which permit these instructions
17690 in little-endian mode.
17692 @item -mupdate
17693 @itemx -mno-update
17694 @opindex mupdate
17695 @opindex mno-update
17696 Generate code that uses (does not use) the load or store instructions
17697 that update the base register to the address of the calculated memory
17698 location.  These instructions are generated by default.  If you use
17699 @option{-mno-update}, there is a small window between the time that the
17700 stack pointer is updated and the address of the previous frame is
17701 stored, which means code that walks the stack frame across interrupts or
17702 signals may get corrupted data.
17704 @item -mavoid-indexed-addresses
17705 @itemx -mno-avoid-indexed-addresses
17706 @opindex mavoid-indexed-addresses
17707 @opindex mno-avoid-indexed-addresses
17708 Generate code that tries to avoid (not avoid) the use of indexed load
17709 or store instructions. These instructions can incur a performance
17710 penalty on Power6 processors in certain situations, such as when
17711 stepping through large arrays that cross a 16M boundary.  This option
17712 is enabled by default when targeting Power6 and disabled otherwise.
17714 @item -mfused-madd
17715 @itemx -mno-fused-madd
17716 @opindex mfused-madd
17717 @opindex mno-fused-madd
17718 Generate code that uses (does not use) the floating-point multiply and
17719 accumulate instructions.  These instructions are generated by default
17720 if hardware floating point is used.  The machine-dependent
17721 @option{-mfused-madd} option is now mapped to the machine-independent
17722 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
17723 mapped to @option{-ffp-contract=off}.
17725 @item -mmulhw
17726 @itemx -mno-mulhw
17727 @opindex mmulhw
17728 @opindex mno-mulhw
17729 Generate code that uses (does not use) the half-word multiply and
17730 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
17731 These instructions are generated by default when targeting those
17732 processors.
17734 @item -mdlmzb
17735 @itemx -mno-dlmzb
17736 @opindex mdlmzb
17737 @opindex mno-dlmzb
17738 Generate code that uses (does not use) the string-search @samp{dlmzb}
17739 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
17740 generated by default when targeting those processors.
17742 @item -mno-bit-align
17743 @itemx -mbit-align
17744 @opindex mno-bit-align
17745 @opindex mbit-align
17746 On System V.4 and embedded PowerPC systems do not (do) force structures
17747 and unions that contain bit-fields to be aligned to the base type of the
17748 bit-field.
17750 For example, by default a structure containing nothing but 8
17751 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17752 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17753 the structure is aligned to a 1-byte boundary and is 1 byte in
17754 size.
17756 @item -mno-strict-align
17757 @itemx -mstrict-align
17758 @opindex mno-strict-align
17759 @opindex mstrict-align
17760 On System V.4 and embedded PowerPC systems do not (do) assume that
17761 unaligned memory references are handled by the system.
17763 @item -mrelocatable
17764 @itemx -mno-relocatable
17765 @opindex mrelocatable
17766 @opindex mno-relocatable
17767 Generate code that allows (does not allow) a static executable to be
17768 relocated to a different address at run time.  A simple embedded
17769 PowerPC system loader should relocate the entire contents of
17770 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17771 a table of 32-bit addresses generated by this option.  For this to
17772 work, all objects linked together must be compiled with
17773 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17774 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17776 @item -mrelocatable-lib
17777 @itemx -mno-relocatable-lib
17778 @opindex mrelocatable-lib
17779 @opindex mno-relocatable-lib
17780 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
17781 @code{.fixup} section to allow static executables to be relocated at
17782 run time, but @option{-mrelocatable-lib} does not use the smaller stack
17783 alignment of @option{-mrelocatable}.  Objects compiled with
17784 @option{-mrelocatable-lib} may be linked with objects compiled with
17785 any combination of the @option{-mrelocatable} options.
17787 @item -mno-toc
17788 @itemx -mtoc
17789 @opindex mno-toc
17790 @opindex mtoc
17791 On System V.4 and embedded PowerPC systems do not (do) assume that
17792 register 2 contains a pointer to a global area pointing to the addresses
17793 used in the program.
17795 @item -mlittle
17796 @itemx -mlittle-endian
17797 @opindex mlittle
17798 @opindex mlittle-endian
17799 On System V.4 and embedded PowerPC systems compile code for the
17800 processor in little-endian mode.  The @option{-mlittle-endian} option is
17801 the same as @option{-mlittle}.
17803 @item -mbig
17804 @itemx -mbig-endian
17805 @opindex mbig
17806 @opindex mbig-endian
17807 On System V.4 and embedded PowerPC systems compile code for the
17808 processor in big-endian mode.  The @option{-mbig-endian} option is
17809 the same as @option{-mbig}.
17811 @item -mdynamic-no-pic
17812 @opindex mdynamic-no-pic
17813 On Darwin and Mac OS X systems, compile code so that it is not
17814 relocatable, but that its external references are relocatable.  The
17815 resulting code is suitable for applications, but not shared
17816 libraries.
17818 @item -msingle-pic-base
17819 @opindex msingle-pic-base
17820 Treat the register used for PIC addressing as read-only, rather than
17821 loading it in the prologue for each function.  The runtime system is
17822 responsible for initializing this register with an appropriate value
17823 before execution begins.
17825 @item -mprioritize-restricted-insns=@var{priority}
17826 @opindex mprioritize-restricted-insns
17827 This option controls the priority that is assigned to
17828 dispatch-slot restricted instructions during the second scheduling
17829 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
17830 or @samp{2} to assign no, highest, or second-highest (respectively) 
17831 priority to dispatch-slot restricted
17832 instructions.
17834 @item -msched-costly-dep=@var{dependence_type}
17835 @opindex msched-costly-dep
17836 This option controls which dependences are considered costly
17837 by the target during instruction scheduling.  The argument
17838 @var{dependence_type} takes one of the following values:
17840 @table @asis
17841 @item @samp{no}
17842 No dependence is costly.
17844 @item @samp{all}
17845 All dependences are costly.
17847 @item @samp{true_store_to_load}
17848 A true dependence from store to load is costly.
17850 @item @samp{store_to_load}
17851 Any dependence from store to load is costly.
17853 @item @var{number}
17854 Any dependence for which the latency is greater than or equal to 
17855 @var{number} is costly.
17856 @end table
17858 @item -minsert-sched-nops=@var{scheme}
17859 @opindex minsert-sched-nops
17860 This option controls which NOP insertion scheme is used during
17861 the second scheduling pass.  The argument @var{scheme} takes one of the
17862 following values:
17864 @table @asis
17865 @item @samp{no}
17866 Don't insert NOPs.
17868 @item @samp{pad}
17869 Pad with NOPs any dispatch group that has vacant issue slots,
17870 according to the scheduler's grouping.
17872 @item @samp{regroup_exact}
17873 Insert NOPs to force costly dependent insns into
17874 separate groups.  Insert exactly as many NOPs as needed to force an insn
17875 to a new group, according to the estimated processor grouping.
17877 @item @var{number}
17878 Insert NOPs to force costly dependent insns into
17879 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
17880 @end table
17882 @item -mcall-sysv
17883 @opindex mcall-sysv
17884 On System V.4 and embedded PowerPC systems compile code using calling
17885 conventions that adhere to the March 1995 draft of the System V
17886 Application Binary Interface, PowerPC processor supplement.  This is the
17887 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
17889 @item -mcall-sysv-eabi
17890 @itemx -mcall-eabi
17891 @opindex mcall-sysv-eabi
17892 @opindex mcall-eabi
17893 Specify both @option{-mcall-sysv} and @option{-meabi} options.
17895 @item -mcall-sysv-noeabi
17896 @opindex mcall-sysv-noeabi
17897 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
17899 @item -mcall-aixdesc
17900 @opindex m
17901 On System V.4 and embedded PowerPC systems compile code for the AIX
17902 operating system.
17904 @item -mcall-linux
17905 @opindex mcall-linux
17906 On System V.4 and embedded PowerPC systems compile code for the
17907 Linux-based GNU system.
17909 @item -mcall-freebsd
17910 @opindex mcall-freebsd
17911 On System V.4 and embedded PowerPC systems compile code for the
17912 FreeBSD operating system.
17914 @item -mcall-netbsd
17915 @opindex mcall-netbsd
17916 On System V.4 and embedded PowerPC systems compile code for the
17917 NetBSD operating system.
17919 @item -mcall-openbsd
17920 @opindex mcall-netbsd
17921 On System V.4 and embedded PowerPC systems compile code for the
17922 OpenBSD operating system.
17924 @item -maix-struct-return
17925 @opindex maix-struct-return
17926 Return all structures in memory (as specified by the AIX ABI)@.
17928 @item -msvr4-struct-return
17929 @opindex msvr4-struct-return
17930 Return structures smaller than 8 bytes in registers (as specified by the
17931 SVR4 ABI)@.
17933 @item -mabi=@var{abi-type}
17934 @opindex mabi
17935 Extend the current ABI with a particular extension, or remove such extension.
17936 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
17937 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
17939 @item -mabi=spe
17940 @opindex mabi=spe
17941 Extend the current ABI with SPE ABI extensions.  This does not change
17942 the default ABI, instead it adds the SPE ABI extensions to the current
17943 ABI@.
17945 @item -mabi=no-spe
17946 @opindex mabi=no-spe
17947 Disable Book-E SPE ABI extensions for the current ABI@.
17949 @item -mabi=ibmlongdouble
17950 @opindex mabi=ibmlongdouble
17951 Change the current ABI to use IBM extended-precision long double.
17952 This is a PowerPC 32-bit SYSV ABI option.
17954 @item -mabi=ieeelongdouble
17955 @opindex mabi=ieeelongdouble
17956 Change the current ABI to use IEEE extended-precision long double.
17957 This is a PowerPC 32-bit Linux ABI option.
17959 @item -mprototype
17960 @itemx -mno-prototype
17961 @opindex mprototype
17962 @opindex mno-prototype
17963 On System V.4 and embedded PowerPC systems assume that all calls to
17964 variable argument functions are properly prototyped.  Otherwise, the
17965 compiler must insert an instruction before every non-prototyped call to
17966 set or clear bit 6 of the condition code register (@var{CR}) to
17967 indicate whether floating-point values are passed in the floating-point
17968 registers in case the function takes variable arguments.  With
17969 @option{-mprototype}, only calls to prototyped variable argument functions
17970 set or clear the bit.
17972 @item -msim
17973 @opindex msim
17974 On embedded PowerPC systems, assume that the startup module is called
17975 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
17976 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
17977 configurations.
17979 @item -mmvme
17980 @opindex mmvme
17981 On embedded PowerPC systems, assume that the startup module is called
17982 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
17983 @file{libc.a}.
17985 @item -mads
17986 @opindex mads
17987 On embedded PowerPC systems, assume that the startup module is called
17988 @file{crt0.o} and the standard C libraries are @file{libads.a} and
17989 @file{libc.a}.
17991 @item -myellowknife
17992 @opindex myellowknife
17993 On embedded PowerPC systems, assume that the startup module is called
17994 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
17995 @file{libc.a}.
17997 @item -mvxworks
17998 @opindex mvxworks
17999 On System V.4 and embedded PowerPC systems, specify that you are
18000 compiling for a VxWorks system.
18002 @item -memb
18003 @opindex memb
18004 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
18005 header to indicate that @samp{eabi} extended relocations are used.
18007 @item -meabi
18008 @itemx -mno-eabi
18009 @opindex meabi
18010 @opindex mno-eabi
18011 On System V.4 and embedded PowerPC systems do (do not) adhere to the
18012 Embedded Applications Binary Interface (EABI), which is a set of
18013 modifications to the System V.4 specifications.  Selecting @option{-meabi}
18014 means that the stack is aligned to an 8-byte boundary, a function
18015 @code{__eabi} is called from @code{main} to set up the EABI
18016 environment, and the @option{-msdata} option can use both @code{r2} and
18017 @code{r13} to point to two separate small data areas.  Selecting
18018 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
18019 no EABI initialization function is called from @code{main}, and the
18020 @option{-msdata} option only uses @code{r13} to point to a single
18021 small data area.  The @option{-meabi} option is on by default if you
18022 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
18024 @item -msdata=eabi
18025 @opindex msdata=eabi
18026 On System V.4 and embedded PowerPC systems, put small initialized
18027 @code{const} global and static data in the @samp{.sdata2} section, which
18028 is pointed to by register @code{r2}.  Put small initialized
18029 non-@code{const} global and static data in the @samp{.sdata} section,
18030 which is pointed to by register @code{r13}.  Put small uninitialized
18031 global and static data in the @samp{.sbss} section, which is adjacent to
18032 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
18033 incompatible with the @option{-mrelocatable} option.  The
18034 @option{-msdata=eabi} option also sets the @option{-memb} option.
18036 @item -msdata=sysv
18037 @opindex msdata=sysv
18038 On System V.4 and embedded PowerPC systems, put small global and static
18039 data in the @samp{.sdata} section, which is pointed to by register
18040 @code{r13}.  Put small uninitialized global and static data in the
18041 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
18042 The @option{-msdata=sysv} option is incompatible with the
18043 @option{-mrelocatable} option.
18045 @item -msdata=default
18046 @itemx -msdata
18047 @opindex msdata=default
18048 @opindex msdata
18049 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
18050 compile code the same as @option{-msdata=eabi}, otherwise compile code the
18051 same as @option{-msdata=sysv}.
18053 @item -msdata=data
18054 @opindex msdata=data
18055 On System V.4 and embedded PowerPC systems, put small global
18056 data in the @samp{.sdata} section.  Put small uninitialized global
18057 data in the @samp{.sbss} section.  Do not use register @code{r13}
18058 to address small data however.  This is the default behavior unless
18059 other @option{-msdata} options are used.
18061 @item -msdata=none
18062 @itemx -mno-sdata
18063 @opindex msdata=none
18064 @opindex mno-sdata
18065 On embedded PowerPC systems, put all initialized global and static data
18066 in the @samp{.data} section, and all uninitialized data in the
18067 @samp{.bss} section.
18069 @item -mblock-move-inline-limit=@var{num}
18070 @opindex mblock-move-inline-limit
18071 Inline all block moves (such as calls to @code{memcpy} or structure
18072 copies) less than or equal to @var{num} bytes.  The minimum value for
18073 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
18074 targets.  The default value is target-specific.
18076 @item -G @var{num}
18077 @opindex G
18078 @cindex smaller data references (PowerPC)
18079 @cindex .sdata/.sdata2 references (PowerPC)
18080 On embedded PowerPC systems, put global and static items less than or
18081 equal to @var{num} bytes into the small data or BSS sections instead of
18082 the normal data or BSS section.  By default, @var{num} is 8.  The
18083 @option{-G @var{num}} switch is also passed to the linker.
18084 All modules should be compiled with the same @option{-G @var{num}} value.
18086 @item -mregnames
18087 @itemx -mno-regnames
18088 @opindex mregnames
18089 @opindex mno-regnames
18090 On System V.4 and embedded PowerPC systems do (do not) emit register
18091 names in the assembly language output using symbolic forms.
18093 @item -mlongcall
18094 @itemx -mno-longcall
18095 @opindex mlongcall
18096 @opindex mno-longcall
18097 By default assume that all calls are far away so that a longer and more
18098 expensive calling sequence is required.  This is required for calls
18099 farther than 32 megabytes (33,554,432 bytes) from the current location.
18100 A short call is generated if the compiler knows
18101 the call cannot be that far away.  This setting can be overridden by
18102 the @code{shortcall} function attribute, or by @code{#pragma
18103 longcall(0)}.
18105 Some linkers are capable of detecting out-of-range calls and generating
18106 glue code on the fly.  On these systems, long calls are unnecessary and
18107 generate slower code.  As of this writing, the AIX linker can do this,
18108 as can the GNU linker for PowerPC/64.  It is planned to add this feature
18109 to the GNU linker for 32-bit PowerPC systems as well.
18111 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
18112 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
18113 addresses represent the callee and the branch island.  The
18114 Darwin/PPC linker prefers the first address and generates a @code{bl
18115 callee} if the PPC @code{bl} instruction reaches the callee directly;
18116 otherwise, the linker generates @code{bl L42} to call the branch
18117 island.  The branch island is appended to the body of the
18118 calling function; it computes the full 32-bit address of the callee
18119 and jumps to it.
18121 On Mach-O (Darwin) systems, this option directs the compiler emit to
18122 the glue for every direct call, and the Darwin linker decides whether
18123 to use or discard it.
18125 In the future, GCC may ignore all longcall specifications
18126 when the linker is known to generate glue.
18128 @item -mtls-markers
18129 @itemx -mno-tls-markers
18130 @opindex mtls-markers
18131 @opindex mno-tls-markers
18132 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
18133 specifying the function argument.  The relocation allows the linker to
18134 reliably associate function call with argument setup instructions for
18135 TLS optimization, which in turn allows GCC to better schedule the
18136 sequence.
18138 @item -pthread
18139 @opindex pthread
18140 Adds support for multithreading with the @dfn{pthreads} library.
18141 This option sets flags for both the preprocessor and linker.
18143 @item -mrecip
18144 @itemx -mno-recip
18145 @opindex mrecip
18146 This option enables use of the reciprocal estimate and
18147 reciprocal square root estimate instructions with additional
18148 Newton-Raphson steps to increase precision instead of doing a divide or
18149 square root and divide for floating-point arguments.  You should use
18150 the @option{-ffast-math} option when using @option{-mrecip} (or at
18151 least @option{-funsafe-math-optimizations},
18152 @option{-finite-math-only}, @option{-freciprocal-math} and
18153 @option{-fno-trapping-math}).  Note that while the throughput of the
18154 sequence is generally higher than the throughput of the non-reciprocal
18155 instruction, the precision of the sequence can be decreased by up to 2
18156 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
18157 roots.
18159 @item -mrecip=@var{opt}
18160 @opindex mrecip=opt
18161 This option controls which reciprocal estimate instructions
18162 may be used.  @var{opt} is a comma-separated list of options, which may
18163 be preceded by a @code{!} to invert the option:
18164 @code{all}: enable all estimate instructions,
18165 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
18166 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
18167 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
18168 @code{divf}: enable the single-precision reciprocal approximation instructions;
18169 @code{divd}: enable the double-precision reciprocal approximation instructions;
18170 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
18171 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
18172 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
18174 So, for example, @option{-mrecip=all,!rsqrtd} enables
18175 all of the reciprocal estimate instructions, except for the
18176 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
18177 which handle the double-precision reciprocal square root calculations.
18179 @item -mrecip-precision
18180 @itemx -mno-recip-precision
18181 @opindex mrecip-precision
18182 Assume (do not assume) that the reciprocal estimate instructions
18183 provide higher-precision estimates than is mandated by the PowerPC
18184 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
18185 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
18186 The double-precision square root estimate instructions are not generated by
18187 default on low-precision machines, since they do not provide an
18188 estimate that converges after three steps.
18190 @item -mveclibabi=@var{type}
18191 @opindex mveclibabi
18192 Specifies the ABI type to use for vectorizing intrinsics using an
18193 external library.  The only type supported at present is @code{mass},
18194 which specifies to use IBM's Mathematical Acceleration Subsystem
18195 (MASS) libraries for vectorizing intrinsics using external libraries.
18196 GCC currently emits calls to @code{acosd2}, @code{acosf4},
18197 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
18198 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
18199 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
18200 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
18201 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
18202 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
18203 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
18204 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
18205 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
18206 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
18207 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
18208 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
18209 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
18210 for power7.  Both @option{-ftree-vectorize} and
18211 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
18212 libraries must be specified at link time.
18214 @item -mfriz
18215 @itemx -mno-friz
18216 @opindex mfriz
18217 Generate (do not generate) the @code{friz} instruction when the
18218 @option{-funsafe-math-optimizations} option is used to optimize
18219 rounding of floating-point values to 64-bit integer and back to floating
18220 point.  The @code{friz} instruction does not return the same value if
18221 the floating-point number is too large to fit in an integer.
18223 @item -mpointers-to-nested-functions
18224 @itemx -mno-pointers-to-nested-functions
18225 @opindex mpointers-to-nested-functions
18226 Generate (do not generate) code to load up the static chain register
18227 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
18228 systems where a function pointer points to a 3-word descriptor giving
18229 the function address, TOC value to be loaded in register @var{r2}, and
18230 static chain value to be loaded in register @var{r11}.  The
18231 @option{-mpointers-to-nested-functions} is on by default.  You cannot
18232 call through pointers to nested functions or pointers
18233 to functions compiled in other languages that use the static chain if
18234 you use the @option{-mno-pointers-to-nested-functions}.
18236 @item -msave-toc-indirect
18237 @itemx -mno-save-toc-indirect
18238 @opindex msave-toc-indirect
18239 Generate (do not generate) code to save the TOC value in the reserved
18240 stack location in the function prologue if the function calls through
18241 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
18242 saved in the prologue, it is saved just before the call through the
18243 pointer.  The @option{-mno-save-toc-indirect} option is the default.
18244 @end table
18246 @node RX Options
18247 @subsection RX Options
18248 @cindex RX Options
18250 These command-line options are defined for RX targets:
18252 @table @gcctabopt
18253 @item -m64bit-doubles
18254 @itemx -m32bit-doubles
18255 @opindex m64bit-doubles
18256 @opindex m32bit-doubles
18257 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18258 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18259 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
18260 works on 32-bit values, which is why the default is
18261 @option{-m32bit-doubles}.
18263 @item -fpu
18264 @itemx -nofpu
18265 @opindex fpu
18266 @opindex nofpu
18267 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
18268 floating-point hardware.  The default is enabled for the @var{RX600}
18269 series and disabled for the @var{RX200} series.
18271 Floating-point instructions are only generated for 32-bit floating-point 
18272 values, however, so the FPU hardware is not used for doubles if the
18273 @option{-m64bit-doubles} option is used.
18275 @emph{Note} If the @option{-fpu} option is enabled then
18276 @option{-funsafe-math-optimizations} is also enabled automatically.
18277 This is because the RX FPU instructions are themselves unsafe.
18279 @item -mcpu=@var{name}
18280 @opindex -mcpu
18281 Selects the type of RX CPU to be targeted.  Currently three types are
18282 supported, the generic @var{RX600} and @var{RX200} series hardware and
18283 the specific @var{RX610} CPU.  The default is @var{RX600}.
18285 The only difference between @var{RX600} and @var{RX610} is that the
18286 @var{RX610} does not support the @code{MVTIPL} instruction.
18288 The @var{RX200} series does not have a hardware floating-point unit
18289 and so @option{-nofpu} is enabled by default when this type is
18290 selected.
18292 @item -mbig-endian-data
18293 @itemx -mlittle-endian-data
18294 @opindex mbig-endian-data
18295 @opindex mlittle-endian-data
18296 Store data (but not code) in the big-endian format.  The default is
18297 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
18298 format.
18300 @item -msmall-data-limit=@var{N}
18301 @opindex msmall-data-limit
18302 Specifies the maximum size in bytes of global and static variables
18303 which can be placed into the small data area.  Using the small data
18304 area can lead to smaller and faster code, but the size of area is
18305 limited and it is up to the programmer to ensure that the area does
18306 not overflow.  Also when the small data area is used one of the RX's
18307 registers (usually @code{r13}) is reserved for use pointing to this
18308 area, so it is no longer available for use by the compiler.  This
18309 could result in slower and/or larger code if variables are pushed onto
18310 the stack instead of being held in this register.
18312 Note, common variables (variables that have not been initialized) and
18313 constants are not placed into the small data area as they are assigned
18314 to other sections in the output executable.
18316 The default value is zero, which disables this feature.  Note, this
18317 feature is not enabled by default with higher optimization levels
18318 (@option{-O2} etc) because of the potentially detrimental effects of
18319 reserving a register.  It is up to the programmer to experiment and
18320 discover whether this feature is of benefit to their program.  See the
18321 description of the @option{-mpid} option for a description of how the
18322 actual register to hold the small data area pointer is chosen.
18324 @item -msim
18325 @itemx -mno-sim
18326 @opindex msim
18327 @opindex mno-sim
18328 Use the simulator runtime.  The default is to use the libgloss
18329 board-specific runtime.
18331 @item -mas100-syntax
18332 @itemx -mno-as100-syntax
18333 @opindex mas100-syntax
18334 @opindex mno-as100-syntax
18335 When generating assembler output use a syntax that is compatible with
18336 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
18337 assembler, but it has some restrictions so it is not generated by default.
18339 @item -mmax-constant-size=@var{N}
18340 @opindex mmax-constant-size
18341 Specifies the maximum size, in bytes, of a constant that can be used as
18342 an operand in a RX instruction.  Although the RX instruction set does
18343 allow constants of up to 4 bytes in length to be used in instructions,
18344 a longer value equates to a longer instruction.  Thus in some
18345 circumstances it can be beneficial to restrict the size of constants
18346 that are used in instructions.  Constants that are too big are instead
18347 placed into a constant pool and referenced via register indirection.
18349 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
18350 or 4 means that constants of any size are allowed.
18352 @item -mrelax
18353 @opindex mrelax
18354 Enable linker relaxation.  Linker relaxation is a process whereby the
18355 linker attempts to reduce the size of a program by finding shorter
18356 versions of various instructions.  Disabled by default.
18358 @item -mint-register=@var{N}
18359 @opindex mint-register
18360 Specify the number of registers to reserve for fast interrupt handler
18361 functions.  The value @var{N} can be between 0 and 4.  A value of 1
18362 means that register @code{r13} is reserved for the exclusive use
18363 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
18364 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
18365 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
18366 A value of 0, the default, does not reserve any registers.
18368 @item -msave-acc-in-interrupts
18369 @opindex msave-acc-in-interrupts
18370 Specifies that interrupt handler functions should preserve the
18371 accumulator register.  This is only necessary if normal code might use
18372 the accumulator register, for example because it performs 64-bit
18373 multiplications.  The default is to ignore the accumulator as this
18374 makes the interrupt handlers faster.
18376 @item -mpid
18377 @itemx -mno-pid
18378 @opindex mpid
18379 @opindex mno-pid
18380 Enables the generation of position independent data.  When enabled any
18381 access to constant data is done via an offset from a base address
18382 held in a register.  This allows the location of constant data to be
18383 determined at run time without requiring the executable to be
18384 relocated, which is a benefit to embedded applications with tight
18385 memory constraints.  Data that can be modified is not affected by this
18386 option.
18388 Note, using this feature reserves a register, usually @code{r13}, for
18389 the constant data base address.  This can result in slower and/or
18390 larger code, especially in complicated functions.
18392 The actual register chosen to hold the constant data base address
18393 depends upon whether the @option{-msmall-data-limit} and/or the
18394 @option{-mint-register} command-line options are enabled.  Starting
18395 with register @code{r13} and proceeding downwards, registers are
18396 allocated first to satisfy the requirements of @option{-mint-register},
18397 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
18398 is possible for the small data area register to be @code{r8} if both
18399 @option{-mint-register=4} and @option{-mpid} are specified on the
18400 command line.
18402 By default this feature is not enabled.  The default can be restored
18403 via the @option{-mno-pid} command-line option.
18405 @item -mno-warn-multiple-fast-interrupts
18406 @itemx -mwarn-multiple-fast-interrupts
18407 @opindex mno-warn-multiple-fast-interrupts
18408 @opindex mwarn-multiple-fast-interrupts
18409 Prevents GCC from issuing a warning message if it finds more than one
18410 fast interrupt handler when it is compiling a file.  The default is to
18411 issue a warning for each extra fast interrupt handler found, as the RX
18412 only supports one such interrupt.
18414 @end table
18416 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
18417 has special significance to the RX port when used with the
18418 @code{interrupt} function attribute.  This attribute indicates a
18419 function intended to process fast interrupts.  GCC ensures
18420 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
18421 and/or @code{r13} and only provided that the normal use of the
18422 corresponding registers have been restricted via the
18423 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
18424 options.
18426 @node S/390 and zSeries Options
18427 @subsection S/390 and zSeries Options
18428 @cindex S/390 and zSeries Options
18430 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
18432 @table @gcctabopt
18433 @item -mhard-float
18434 @itemx -msoft-float
18435 @opindex mhard-float
18436 @opindex msoft-float
18437 Use (do not use) the hardware floating-point instructions and registers
18438 for floating-point operations.  When @option{-msoft-float} is specified,
18439 functions in @file{libgcc.a} are used to perform floating-point
18440 operations.  When @option{-mhard-float} is specified, the compiler
18441 generates IEEE floating-point instructions.  This is the default.
18443 @item -mhard-dfp
18444 @itemx -mno-hard-dfp
18445 @opindex mhard-dfp
18446 @opindex mno-hard-dfp
18447 Use (do not use) the hardware decimal-floating-point instructions for
18448 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
18449 specified, functions in @file{libgcc.a} are used to perform
18450 decimal-floating-point operations.  When @option{-mhard-dfp} is
18451 specified, the compiler generates decimal-floating-point hardware
18452 instructions.  This is the default for @option{-march=z9-ec} or higher.
18454 @item -mlong-double-64
18455 @itemx -mlong-double-128
18456 @opindex mlong-double-64
18457 @opindex mlong-double-128
18458 These switches control the size of @code{long double} type. A size
18459 of 64 bits makes the @code{long double} type equivalent to the @code{double}
18460 type. This is the default.
18462 @item -mbackchain
18463 @itemx -mno-backchain
18464 @opindex mbackchain
18465 @opindex mno-backchain
18466 Store (do not store) the address of the caller's frame as backchain pointer
18467 into the callee's stack frame.
18468 A backchain may be needed to allow debugging using tools that do not understand
18469 DWARF 2 call frame information.
18470 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
18471 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
18472 the backchain is placed into the topmost word of the 96/160 byte register
18473 save area.
18475 In general, code compiled with @option{-mbackchain} is call-compatible with
18476 code compiled with @option{-mmo-backchain}; however, use of the backchain
18477 for debugging purposes usually requires that the whole binary is built with
18478 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
18479 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18480 to build a linux kernel use @option{-msoft-float}.
18482 The default is to not maintain the backchain.
18484 @item -mpacked-stack
18485 @itemx -mno-packed-stack
18486 @opindex mpacked-stack
18487 @opindex mno-packed-stack
18488 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
18489 specified, the compiler uses the all fields of the 96/160 byte register save
18490 area only for their default purpose; unused fields still take up stack space.
18491 When @option{-mpacked-stack} is specified, register save slots are densely
18492 packed at the top of the register save area; unused space is reused for other
18493 purposes, allowing for more efficient use of the available stack space.
18494 However, when @option{-mbackchain} is also in effect, the topmost word of
18495 the save area is always used to store the backchain, and the return address
18496 register is always saved two words below the backchain.
18498 As long as the stack frame backchain is not used, code generated with
18499 @option{-mpacked-stack} is call-compatible with code generated with
18500 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
18501 S/390 or zSeries generated code that uses the stack frame backchain at run
18502 time, not just for debugging purposes.  Such code is not call-compatible
18503 with code compiled with @option{-mpacked-stack}.  Also, note that the
18504 combination of @option{-mbackchain},
18505 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18506 to build a linux kernel use @option{-msoft-float}.
18508 The default is to not use the packed stack layout.
18510 @item -msmall-exec
18511 @itemx -mno-small-exec
18512 @opindex msmall-exec
18513 @opindex mno-small-exec
18514 Generate (or do not generate) code using the @code{bras} instruction
18515 to do subroutine calls.
18516 This only works reliably if the total executable size does not
18517 exceed 64k.  The default is to use the @code{basr} instruction instead,
18518 which does not have this limitation.
18520 @item -m64
18521 @itemx -m31
18522 @opindex m64
18523 @opindex m31
18524 When @option{-m31} is specified, generate code compliant to the
18525 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
18526 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
18527 particular to generate 64-bit instructions.  For the @samp{s390}
18528 targets, the default is @option{-m31}, while the @samp{s390x}
18529 targets default to @option{-m64}.
18531 @item -mzarch
18532 @itemx -mesa
18533 @opindex mzarch
18534 @opindex mesa
18535 When @option{-mzarch} is specified, generate code using the
18536 instructions available on z/Architecture.
18537 When @option{-mesa} is specified, generate code using the
18538 instructions available on ESA/390.  Note that @option{-mesa} is
18539 not possible with @option{-m64}.
18540 When generating code compliant to the GNU/Linux for S/390 ABI,
18541 the default is @option{-mesa}.  When generating code compliant
18542 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
18544 @item -mmvcle
18545 @itemx -mno-mvcle
18546 @opindex mmvcle
18547 @opindex mno-mvcle
18548 Generate (or do not generate) code using the @code{mvcle} instruction
18549 to perform block moves.  When @option{-mno-mvcle} is specified,
18550 use a @code{mvc} loop instead.  This is the default unless optimizing for
18551 size.
18553 @item -mdebug
18554 @itemx -mno-debug
18555 @opindex mdebug
18556 @opindex mno-debug
18557 Print (or do not print) additional debug information when compiling.
18558 The default is to not print debug information.
18560 @item -march=@var{cpu-type}
18561 @opindex march
18562 Generate code that runs on @var{cpu-type}, which is the name of a system
18563 representing a certain processor type.  Possible values for
18564 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
18565 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
18566 When generating code using the instructions available on z/Architecture,
18567 the default is @option{-march=z900}.  Otherwise, the default is
18568 @option{-march=g5}.
18570 @item -mtune=@var{cpu-type}
18571 @opindex mtune
18572 Tune to @var{cpu-type} everything applicable about the generated code,
18573 except for the ABI and the set of available instructions.
18574 The list of @var{cpu-type} values is the same as for @option{-march}.
18575 The default is the value used for @option{-march}.
18577 @item -mtpf-trace
18578 @itemx -mno-tpf-trace
18579 @opindex mtpf-trace
18580 @opindex mno-tpf-trace
18581 Generate code that adds (does not add) in TPF OS specific branches to trace
18582 routines in the operating system.  This option is off by default, even
18583 when compiling for the TPF OS@.
18585 @item -mfused-madd
18586 @itemx -mno-fused-madd
18587 @opindex mfused-madd
18588 @opindex mno-fused-madd
18589 Generate code that uses (does not use) the floating-point multiply and
18590 accumulate instructions.  These instructions are generated by default if
18591 hardware floating point is used.
18593 @item -mwarn-framesize=@var{framesize}
18594 @opindex mwarn-framesize
18595 Emit a warning if the current function exceeds the given frame size.  Because
18596 this is a compile-time check it doesn't need to be a real problem when the program
18597 runs.  It is intended to identify functions that most probably cause
18598 a stack overflow.  It is useful to be used in an environment with limited stack
18599 size e.g.@: the linux kernel.
18601 @item -mwarn-dynamicstack
18602 @opindex mwarn-dynamicstack
18603 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
18604 arrays.  This is generally a bad idea with a limited stack size.
18606 @item -mstack-guard=@var{stack-guard}
18607 @itemx -mstack-size=@var{stack-size}
18608 @opindex mstack-guard
18609 @opindex mstack-size
18610 If these options are provided the S/390 back end emits additional instructions in
18611 the function prologue that trigger a trap if the stack size is @var{stack-guard}
18612 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
18613 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
18614 the frame size of the compiled function is chosen.
18615 These options are intended to be used to help debugging stack overflow problems.
18616 The additionally emitted code causes only little overhead and hence can also be
18617 used in production-like systems without greater performance degradation.  The given
18618 values have to be exact powers of 2 and @var{stack-size} has to be greater than
18619 @var{stack-guard} without exceeding 64k.
18620 In order to be efficient the extra code makes the assumption that the stack starts
18621 at an address aligned to the value given by @var{stack-size}.
18622 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
18623 @end table
18625 @node Score Options
18626 @subsection Score Options
18627 @cindex Score Options
18629 These options are defined for Score implementations:
18631 @table @gcctabopt
18632 @item -meb
18633 @opindex meb
18634 Compile code for big-endian mode.  This is the default.
18636 @item -mel
18637 @opindex mel
18638 Compile code for little-endian mode.
18640 @item -mnhwloop
18641 @opindex mnhwloop
18642 Disable generation of @code{bcnz} instructions.
18644 @item -muls
18645 @opindex muls
18646 Enable generation of unaligned load and store instructions.
18648 @item -mmac
18649 @opindex mmac
18650 Enable the use of multiply-accumulate instructions. Disabled by default.
18652 @item -mscore5
18653 @opindex mscore5
18654 Specify the SCORE5 as the target architecture.
18656 @item -mscore5u
18657 @opindex mscore5u
18658 Specify the SCORE5U of the target architecture.
18660 @item -mscore7
18661 @opindex mscore7
18662 Specify the SCORE7 as the target architecture. This is the default.
18664 @item -mscore7d
18665 @opindex mscore7d
18666 Specify the SCORE7D as the target architecture.
18667 @end table
18669 @node SH Options
18670 @subsection SH Options
18672 These @samp{-m} options are defined for the SH implementations:
18674 @table @gcctabopt
18675 @item -m1
18676 @opindex m1
18677 Generate code for the SH1.
18679 @item -m2
18680 @opindex m2
18681 Generate code for the SH2.
18683 @item -m2e
18684 Generate code for the SH2e.
18686 @item -m2a-nofpu
18687 @opindex m2a-nofpu
18688 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18689 that the floating-point unit is not used.
18691 @item -m2a-single-only
18692 @opindex m2a-single-only
18693 Generate code for the SH2a-FPU, in such a way that no double-precision
18694 floating-point operations are used.
18696 @item -m2a-single
18697 @opindex m2a-single
18698 Generate code for the SH2a-FPU assuming the floating-point unit is in
18699 single-precision mode by default.
18701 @item -m2a
18702 @opindex m2a
18703 Generate code for the SH2a-FPU assuming the floating-point unit is in
18704 double-precision mode by default.
18706 @item -m3
18707 @opindex m3
18708 Generate code for the SH3.
18710 @item -m3e
18711 @opindex m3e
18712 Generate code for the SH3e.
18714 @item -m4-nofpu
18715 @opindex m4-nofpu
18716 Generate code for the SH4 without a floating-point unit.
18718 @item -m4-single-only
18719 @opindex m4-single-only
18720 Generate code for the SH4 with a floating-point unit that only
18721 supports single-precision arithmetic.
18723 @item -m4-single
18724 @opindex m4-single
18725 Generate code for the SH4 assuming the floating-point unit is in
18726 single-precision mode by default.
18728 @item -m4
18729 @opindex m4
18730 Generate code for the SH4.
18732 @item -m4a-nofpu
18733 @opindex m4a-nofpu
18734 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
18735 floating-point unit is not used.
18737 @item -m4a-single-only
18738 @opindex m4a-single-only
18739 Generate code for the SH4a, in such a way that no double-precision
18740 floating-point operations are used.
18742 @item -m4a-single
18743 @opindex m4a-single
18744 Generate code for the SH4a assuming the floating-point unit is in
18745 single-precision mode by default.
18747 @item -m4a
18748 @opindex m4a
18749 Generate code for the SH4a.
18751 @item -m4al
18752 @opindex m4al
18753 Same as @option{-m4a-nofpu}, except that it implicitly passes
18754 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18755 instructions at the moment.
18757 @item -mb
18758 @opindex mb
18759 Compile code for the processor in big-endian mode.
18761 @item -ml
18762 @opindex ml
18763 Compile code for the processor in little-endian mode.
18765 @item -mdalign
18766 @opindex mdalign
18767 Align doubles at 64-bit boundaries.  Note that this changes the calling
18768 conventions, and thus some functions from the standard C library do
18769 not work unless you recompile it first with @option{-mdalign}.
18771 @item -mrelax
18772 @opindex mrelax
18773 Shorten some address references at link time, when possible; uses the
18774 linker option @option{-relax}.
18776 @item -mbigtable
18777 @opindex mbigtable
18778 Use 32-bit offsets in @code{switch} tables.  The default is to use
18779 16-bit offsets.
18781 @item -mbitops
18782 @opindex mbitops
18783 Enable the use of bit manipulation instructions on SH2A.
18785 @item -mfmovd
18786 @opindex mfmovd
18787 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
18788 alignment constraints.
18790 @item -mhitachi
18791 @opindex mhitachi
18792 Comply with the calling conventions defined by Renesas.
18794 @item -mrenesas
18795 @opindex mhitachi
18796 Comply with the calling conventions defined by Renesas.
18798 @item -mno-renesas
18799 @opindex mhitachi
18800 Comply with the calling conventions defined for GCC before the Renesas
18801 conventions were available.  This option is the default for all
18802 targets of the SH toolchain.
18804 @item -mnomacsave
18805 @opindex mnomacsave
18806 Mark the @code{MAC} register as call-clobbered, even if
18807 @option{-mhitachi} is given.
18809 @item -mieee
18810 @itemx -mno-ieee
18811 @opindex mieee
18812 @opindex mnoieee
18813 Control the IEEE compliance of floating-point comparisons, which affects the
18814 handling of cases where the result of a comparison is unordered.  By default
18815 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
18816 enabled @option{-mno-ieee} is implicitly set, which results in faster
18817 floating-point greater-equal and less-equal comparisons.  The implcit settings
18818 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
18820 @item -minline-ic_invalidate
18821 @opindex minline-ic_invalidate
18822 Inline code to invalidate instruction cache entries after setting up
18823 nested function trampolines.
18824 This option has no effect if @option{-musermode} is in effect and the selected
18825 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
18826 instruction.
18827 If the selected code generation option does not allow the use of the @code{icbi}
18828 instruction, and @option{-musermode} is not in effect, the inlined code
18829 manipulates the instruction cache address array directly with an associative
18830 write.  This not only requires privileged mode at run time, but it also
18831 fails if the cache line had been mapped via the TLB and has become unmapped.
18833 @item -misize
18834 @opindex misize
18835 Dump instruction size and location in the assembly code.
18837 @item -mpadstruct
18838 @opindex mpadstruct
18839 This option is deprecated.  It pads structures to multiple of 4 bytes,
18840 which is incompatible with the SH ABI@.
18842 @item -matomic-model=@var{model}
18843 @opindex matomic-model=@var{model}
18844 Sets the model of atomic operations and additional parameters as a comma
18845 separated list.  For details on the atomic built-in functions see
18846 @ref{__atomic Builtins}.  The following models and parameters are supported:
18848 @table @samp
18850 @item none
18851 Disable compiler generated atomic sequences and emit library calls for atomic
18852 operations.  This is the default if the target is not @code{sh-*-linux*}.
18854 @item soft-gusa
18855 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
18856 built-in functions.  The generated atomic sequences require additional support
18857 from the interrupt/exception handling code of the system and are only suitable
18858 for SH3* and SH4* single-core systems.  This option is enabled by default when
18859 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
18860 this option will also partially utilize the hardware atomic instructions
18861 @code{movli.l} and @code{movco.l} to create more efficient code, unless
18862 @samp{strict} is specified.  
18864 @item soft-tcb
18865 Generate software atomic sequences that use a variable in the thread control
18866 block.  This is a variation of the gUSA sequences which can also be used on
18867 SH1* and SH2* targets.  The generated atomic sequences require additional
18868 support from the interrupt/exception handling code of the system and are only
18869 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
18870 parameter has to be specified as well.
18872 @item soft-imask
18873 Generate software atomic sequences that temporarily disable interrupts by
18874 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
18875 in privileged mode and is only suitable for single-core systems.  Additional
18876 support from the interrupt/exception handling code of the system is not
18877 required.  This model is enabled by default when the target is
18878 @code{sh-*-linux*} and SH1* or SH2*.
18880 @item hard-llcs
18881 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
18882 instructions only.  This is only available on SH4A and is suitable for
18883 multi-core systems.  Since the hardware instructions support only 32 bit atomic
18884 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
18885 Code compiled with this option will also be compatible with other software
18886 atomic model interrupt/exception handling systems if executed on an SH4A
18887 system.  Additional support from the interrupt/exception handling code of the
18888 system is not required for this model.
18890 @item gbr-offset=
18891 This parameter specifies the offset in bytes of the variable in the thread
18892 control block structure that should be used by the generated atomic sequences
18893 when the @samp{soft-tcb} model has been selected.  For other models this
18894 parameter is ignored.  The specified value must be an integer multiple of four
18895 and in the range 0-1020.
18897 @item strict
18898 This parameter prevents mixed usage of multiple atomic models, even though they
18899 would be compatible, and will make the compiler generate atomic sequences of the
18900 specified model only.
18902 @end table
18904 @item -mtas
18905 @opindex mtas
18906 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
18907 Notice that depending on the particular hardware and software configuration
18908 this can degrade overall performance due to the operand cache line flushes
18909 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
18910 processors the @code{tas.b} instruction must be used with caution since it
18911 can result in data corruption for certain cache configurations.
18913 @item -mspace
18914 @opindex mspace
18915 Optimize for space instead of speed.  Implied by @option{-Os}.
18917 @item -mprefergot
18918 @opindex mprefergot
18919 When generating position-independent code, emit function calls using
18920 the Global Offset Table instead of the Procedure Linkage Table.
18922 @item -musermode
18923 @opindex musermode
18924 Don't generate privileged mode only code.  This option
18925 implies @option{-mno-inline-ic_invalidate}
18926 if the inlined code would not work in user mode.
18927 This is the default when the target is @code{sh-*-linux*}.
18929 @item -multcost=@var{number}
18930 @opindex multcost=@var{number}
18931 Set the cost to assume for a multiply insn.
18933 @item -mdiv=@var{strategy}
18934 @opindex mdiv=@var{strategy}
18935 Set the division strategy to be used for integer division operations.
18936 For SHmedia @var{strategy} can be one of: 
18938 @table @samp
18940 @item fp 
18941 Performs the operation in floating point.  This has a very high latency,
18942 but needs only a few instructions, so it might be a good choice if
18943 your code has enough easily-exploitable ILP to allow the compiler to
18944 schedule the floating-point instructions together with other instructions.
18945 Division by zero causes a floating-point exception.
18947 @item inv
18948 Uses integer operations to calculate the inverse of the divisor,
18949 and then multiplies the dividend with the inverse.  This strategy allows
18950 CSE and hoisting of the inverse calculation.  Division by zero calculates
18951 an unspecified result, but does not trap.
18953 @item inv:minlat
18954 A variant of @samp{inv} where, if no CSE or hoisting opportunities
18955 have been found, or if the entire operation has been hoisted to the same
18956 place, the last stages of the inverse calculation are intertwined with the
18957 final multiply to reduce the overall latency, at the expense of using a few
18958 more instructions, and thus offering fewer scheduling opportunities with
18959 other code.
18961 @item call
18962 Calls a library function that usually implements the @samp{inv:minlat}
18963 strategy.
18964 This gives high code density for @code{m5-*media-nofpu} compilations.
18966 @item call2
18967 Uses a different entry point of the same library function, where it
18968 assumes that a pointer to a lookup table has already been set up, which
18969 exposes the pointer load to CSE and code hoisting optimizations.
18971 @item inv:call
18972 @itemx inv:call2
18973 @itemx inv:fp
18974 Use the @samp{inv} algorithm for initial
18975 code generation, but if the code stays unoptimized, revert to the @samp{call},
18976 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
18977 potentially-trapping side effect of division by zero is carried by a
18978 separate instruction, so it is possible that all the integer instructions
18979 are hoisted out, but the marker for the side effect stays where it is.
18980 A recombination to floating-point operations or a call is not possible
18981 in that case.
18983 @item inv20u
18984 @itemx inv20l
18985 Variants of the @samp{inv:minlat} strategy.  In the case
18986 that the inverse calculation is not separated from the multiply, they speed
18987 up division where the dividend fits into 20 bits (plus sign where applicable)
18988 by inserting a test to skip a number of operations in this case; this test
18989 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
18990 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
18992 @end table
18994 For targets other than SHmedia @var{strategy} can be one of:
18996 @table @samp
18998 @item call-div1
18999 Calls a library function that uses the single-step division instruction
19000 @code{div1} to perform the operation.  Division by zero calculates an
19001 unspecified result and does not trap.  This is the default except for SH4,
19002 SH2A and SHcompact.
19004 @item call-fp
19005 Calls a library function that performs the operation in double precision
19006 floating point.  Division by zero causes a floating-point exception.  This is
19007 the default for SHcompact with FPU.  Specifying this for targets that do not
19008 have a double precision FPU will default to @code{call-div1}.
19010 @item call-table
19011 Calls a library function that uses a lookup table for small divisors and
19012 the @code{div1} instruction with case distinction for larger divisors.  Division
19013 by zero calculates an unspecified result and does not trap.  This is the default
19014 for SH4.  Specifying this for targets that do not have dynamic shift
19015 instructions will default to @code{call-div1}.
19017 @end table
19019 When a division strategy has not been specified the default strategy will be
19020 selected based on the current target.  For SH2A the default strategy is to
19021 use the @code{divs} and @code{divu} instructions instead of library function
19022 calls.
19024 @item -maccumulate-outgoing-args
19025 @opindex maccumulate-outgoing-args
19026 Reserve space once for outgoing arguments in the function prologue rather
19027 than around each call.  Generally beneficial for performance and size.  Also
19028 needed for unwinding to avoid changing the stack frame around conditional code.
19030 @item -mdivsi3_libfunc=@var{name}
19031 @opindex mdivsi3_libfunc=@var{name}
19032 Set the name of the library function used for 32-bit signed division to
19033 @var{name}.
19034 This only affects the name used in the @samp{call} and @samp{inv:call}
19035 division strategies, and the compiler still expects the same
19036 sets of input/output/clobbered registers as if this option were not present.
19038 @item -mfixed-range=@var{register-range}
19039 @opindex mfixed-range
19040 Generate code treating the given register range as fixed registers.
19041 A fixed register is one that the register allocator can not use.  This is
19042 useful when compiling kernel code.  A register range is specified as
19043 two registers separated by a dash.  Multiple register ranges can be
19044 specified separated by a comma.
19046 @item -mindexed-addressing
19047 @opindex mindexed-addressing
19048 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
19049 This is only safe if the hardware and/or OS implement 32-bit wrap-around
19050 semantics for the indexed addressing mode.  The architecture allows the
19051 implementation of processors with 64-bit MMU, which the OS could use to
19052 get 32-bit addressing, but since no current hardware implementation supports
19053 this or any other way to make the indexed addressing mode safe to use in
19054 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
19056 @item -mgettrcost=@var{number}
19057 @opindex mgettrcost=@var{number}
19058 Set the cost assumed for the @code{gettr} instruction to @var{number}.
19059 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
19061 @item -mpt-fixed
19062 @opindex mpt-fixed
19063 Assume @code{pt*} instructions won't trap.  This generally generates
19064 better-scheduled code, but is unsafe on current hardware.
19065 The current architecture
19066 definition says that @code{ptabs} and @code{ptrel} trap when the target 
19067 anded with 3 is 3.
19068 This has the unintentional effect of making it unsafe to schedule these
19069 instructions before a branch, or hoist them out of a loop.  For example,
19070 @code{__do_global_ctors}, a part of @file{libgcc}
19071 that runs constructors at program
19072 startup, calls functions in a list which is delimited by @minus{}1.  With the
19073 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
19074 That means that all the constructors run a bit more quickly, but when
19075 the loop comes to the end of the list, the program crashes because @code{ptabs}
19076 loads @minus{}1 into a target register.  
19078 Since this option is unsafe for any
19079 hardware implementing the current architecture specification, the default
19080 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
19081 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
19082 this deters register allocation from using target registers for storing
19083 ordinary integers.
19085 @item -minvalid-symbols
19086 @opindex minvalid-symbols
19087 Assume symbols might be invalid.  Ordinary function symbols generated by
19088 the compiler are always valid to load with
19089 @code{movi}/@code{shori}/@code{ptabs} or
19090 @code{movi}/@code{shori}/@code{ptrel},
19091 but with assembler and/or linker tricks it is possible
19092 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
19093 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
19094 It prevents cross-basic-block CSE, hoisting and most scheduling
19095 of symbol loads.  The default is @option{-mno-invalid-symbols}.
19097 @item -mbranch-cost=@var{num}
19098 @opindex mbranch-cost=@var{num}
19099 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
19100 make the compiler try to generate more branch-free code if possible.  
19101 If not specified the value is selected depending on the processor type that
19102 is being compiled for.
19104 @item -mzdcbranch
19105 @itemx -mno-zdcbranch
19106 @opindex mzdcbranch
19107 @opindex mno-zdcbranch
19108 Assume (do not assume) that zero displacement conditional branch instructions
19109 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
19110 compiler will try to prefer zero displacement branch code sequences.  This is
19111 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
19112 disabled by specifying @option{-mno-zdcbranch}.
19114 @item -mcbranchdi
19115 @opindex mcbranchdi
19116 Enable the @code{cbranchdi4} instruction pattern.
19118 @item -mcmpeqdi
19119 @opindex mcmpeqdi
19120 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
19121 is in effect.
19123 @item -mfused-madd
19124 @itemx -mno-fused-madd
19125 @opindex mfused-madd
19126 @opindex mno-fused-madd
19127 Generate code that uses (does not use) the floating-point multiply and
19128 accumulate instructions.  These instructions are generated by default
19129 if hardware floating point is used.  The machine-dependent
19130 @option{-mfused-madd} option is now mapped to the machine-independent
19131 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19132 mapped to @option{-ffp-contract=off}.
19134 @item -mfsca
19135 @itemx -mno-fsca
19136 @opindex mfsca
19137 @opindex mno-fsca
19138 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
19139 and cosine approximations.  The option @code{-mfsca} must be used in
19140 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
19141 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
19142 approximations even if @code{-funsafe-math-optimizations} is in effect.
19144 @item -mfsrra
19145 @itemx -mno-fsrra
19146 @opindex mfsrra
19147 @opindex mno-fsrra
19148 Allow or disallow the compiler to emit the @code{fsrra} instruction for
19149 reciprocal square root approximations.  The option @code{-mfsrra} must be used
19150 in combination with @code{-funsafe-math-optimizations} and
19151 @code{-ffinite-math-only}.  It is enabled by default when generating code for
19152 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
19153 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
19154 in effect.
19156 @item -mpretend-cmove
19157 @opindex mpretend-cmove
19158 Prefer zero-displacement conditional branches for conditional move instruction
19159 patterns.  This can result in faster code on the SH4 processor.
19161 @end table
19163 @node Solaris 2 Options
19164 @subsection Solaris 2 Options
19165 @cindex Solaris 2 options
19167 These @samp{-m} options are supported on Solaris 2:
19169 @table @gcctabopt
19170 @item -mimpure-text
19171 @opindex mimpure-text
19172 @option{-mimpure-text}, used in addition to @option{-shared}, tells
19173 the compiler to not pass @option{-z text} to the linker when linking a
19174 shared object.  Using this option, you can link position-dependent
19175 code into a shared object.
19177 @option{-mimpure-text} suppresses the ``relocations remain against
19178 allocatable but non-writable sections'' linker error message.
19179 However, the necessary relocations trigger copy-on-write, and the
19180 shared object is not actually shared across processes.  Instead of
19181 using @option{-mimpure-text}, you should compile all source code with
19182 @option{-fpic} or @option{-fPIC}.
19184 @end table
19186 These switches are supported in addition to the above on Solaris 2:
19188 @table @gcctabopt
19189 @item -pthreads
19190 @opindex pthreads
19191 Add support for multithreading using the POSIX threads library.  This
19192 option sets flags for both the preprocessor and linker.  This option does
19193 not affect the thread safety of object code produced  by the compiler or
19194 that of libraries supplied with it.
19196 @item -pthread
19197 @opindex pthread
19198 This is a synonym for @option{-pthreads}.
19199 @end table
19201 @node SPARC Options
19202 @subsection SPARC Options
19203 @cindex SPARC options
19205 These @samp{-m} options are supported on the SPARC:
19207 @table @gcctabopt
19208 @item -mno-app-regs
19209 @itemx -mapp-regs
19210 @opindex mno-app-regs
19211 @opindex mapp-regs
19212 Specify @option{-mapp-regs} to generate output using the global registers
19213 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
19214 is the default.
19216 To be fully SVR4 ABI-compliant at the cost of some performance loss,
19217 specify @option{-mno-app-regs}.  You should compile libraries and system
19218 software with this option.
19220 @item -mflat
19221 @itemx -mno-flat
19222 @opindex mflat
19223 @opindex mno-flat
19224 With @option{-mflat}, the compiler does not generate save/restore instructions
19225 and uses a ``flat'' or single register window model.  This model is compatible
19226 with the regular register window model.  The local registers and the input
19227 registers (0--5) are still treated as ``call-saved'' registers and are
19228 saved on the stack as needed.
19230 With @option{-mno-flat} (the default), the compiler generates save/restore
19231 instructions (except for leaf functions).  This is the normal operating mode.
19233 @item -mfpu
19234 @itemx -mhard-float
19235 @opindex mfpu
19236 @opindex mhard-float
19237 Generate output containing floating-point instructions.  This is the
19238 default.
19240 @item -mno-fpu
19241 @itemx -msoft-float
19242 @opindex mno-fpu
19243 @opindex msoft-float
19244 Generate output containing library calls for floating point.
19245 @strong{Warning:} the requisite libraries are not available for all SPARC
19246 targets.  Normally the facilities of the machine's usual C compiler are
19247 used, but this cannot be done directly in cross-compilation.  You must make
19248 your own arrangements to provide suitable library functions for
19249 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
19250 @samp{sparclite-*-*} do provide software floating-point support.
19252 @option{-msoft-float} changes the calling convention in the output file;
19253 therefore, it is only useful if you compile @emph{all} of a program with
19254 this option.  In particular, you need to compile @file{libgcc.a}, the
19255 library that comes with GCC, with @option{-msoft-float} in order for
19256 this to work.
19258 @item -mhard-quad-float
19259 @opindex mhard-quad-float
19260 Generate output containing quad-word (long double) floating-point
19261 instructions.
19263 @item -msoft-quad-float
19264 @opindex msoft-quad-float
19265 Generate output containing library calls for quad-word (long double)
19266 floating-point instructions.  The functions called are those specified
19267 in the SPARC ABI@.  This is the default.
19269 As of this writing, there are no SPARC implementations that have hardware
19270 support for the quad-word floating-point instructions.  They all invoke
19271 a trap handler for one of these instructions, and then the trap handler
19272 emulates the effect of the instruction.  Because of the trap handler overhead,
19273 this is much slower than calling the ABI library routines.  Thus the
19274 @option{-msoft-quad-float} option is the default.
19276 @item -mno-unaligned-doubles
19277 @itemx -munaligned-doubles
19278 @opindex mno-unaligned-doubles
19279 @opindex munaligned-doubles
19280 Assume that doubles have 8-byte alignment.  This is the default.
19282 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
19283 alignment only if they are contained in another type, or if they have an
19284 absolute address.  Otherwise, it assumes they have 4-byte alignment.
19285 Specifying this option avoids some rare compatibility problems with code
19286 generated by other compilers.  It is not the default because it results
19287 in a performance loss, especially for floating-point code.
19289 @item -mno-faster-structs
19290 @itemx -mfaster-structs
19291 @opindex mno-faster-structs
19292 @opindex mfaster-structs
19293 With @option{-mfaster-structs}, the compiler assumes that structures
19294 should have 8-byte alignment.  This enables the use of pairs of
19295 @code{ldd} and @code{std} instructions for copies in structure
19296 assignment, in place of twice as many @code{ld} and @code{st} pairs.
19297 However, the use of this changed alignment directly violates the SPARC
19298 ABI@.  Thus, it's intended only for use on targets where the developer
19299 acknowledges that their resulting code is not directly in line with
19300 the rules of the ABI@.
19302 @item -mcpu=@var{cpu_type}
19303 @opindex mcpu
19304 Set the instruction set, register set, and instruction scheduling parameters
19305 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
19306 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
19307 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
19308 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
19309 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
19310 and @samp{niagara4}.
19312 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
19313 which selects the best architecture option for the host processor.
19314 @option{-mcpu=native} has no effect if GCC does not recognize
19315 the processor.
19317 Default instruction scheduling parameters are used for values that select
19318 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
19319 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
19321 Here is a list of each supported architecture and their supported
19322 implementations.
19324 @table @asis
19325 @item v7
19326 cypress
19328 @item v8
19329 supersparc, hypersparc, leon
19331 @item sparclite
19332 f930, f934, sparclite86x
19334 @item sparclet
19335 tsc701
19337 @item v9
19338 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
19339 @end table
19341 By default (unless configured otherwise), GCC generates code for the V7
19342 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
19343 additionally optimizes it for the Cypress CY7C602 chip, as used in the
19344 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
19345 SPARCStation 1, 2, IPX etc.
19347 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
19348 architecture.  The only difference from V7 code is that the compiler emits
19349 the integer multiply and integer divide instructions which exist in SPARC-V8
19350 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
19351 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
19352 2000 series.
19354 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
19355 the SPARC architecture.  This adds the integer multiply, integer divide step
19356 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
19357 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
19358 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
19359 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
19360 MB86934 chip, which is the more recent SPARClite with FPU@.
19362 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
19363 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
19364 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
19365 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
19366 optimizes it for the TEMIC SPARClet chip.
19368 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
19369 architecture.  This adds 64-bit integer and floating-point move instructions,
19370 3 additional floating-point condition code registers and conditional move
19371 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
19372 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
19373 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
19374 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
19375 @option{-mcpu=niagara}, the compiler additionally optimizes it for
19376 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
19377 additionally optimizes it for Sun UltraSPARC T2 chips. With
19378 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
19379 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
19380 additionally optimizes it for Sun UltraSPARC T4 chips.
19382 @item -mtune=@var{cpu_type}
19383 @opindex mtune
19384 Set the instruction scheduling parameters for machine type
19385 @var{cpu_type}, but do not set the instruction set or register set that the
19386 option @option{-mcpu=@var{cpu_type}} does.
19388 The same values for @option{-mcpu=@var{cpu_type}} can be used for
19389 @option{-mtune=@var{cpu_type}}, but the only useful values are those
19390 that select a particular CPU implementation.  Those are @samp{cypress},
19391 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
19392 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
19393 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
19394 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
19396 @item -mv8plus
19397 @itemx -mno-v8plus
19398 @opindex mv8plus
19399 @opindex mno-v8plus
19400 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
19401 difference from the V8 ABI is that the global and out registers are
19402 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
19403 mode for all SPARC-V9 processors.
19405 @item -mvis
19406 @itemx -mno-vis
19407 @opindex mvis
19408 @opindex mno-vis
19409 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
19410 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
19412 @item -mvis2
19413 @itemx -mno-vis2
19414 @opindex mvis2
19415 @opindex mno-vis2
19416 With @option{-mvis2}, GCC generates code that takes advantage of
19417 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
19418 default is @option{-mvis2} when targeting a cpu that supports such
19419 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
19420 also sets @option{-mvis}.
19422 @item -mvis3
19423 @itemx -mno-vis3
19424 @opindex mvis3
19425 @opindex mno-vis3
19426 With @option{-mvis3}, GCC generates code that takes advantage of
19427 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
19428 default is @option{-mvis3} when targeting a cpu that supports such
19429 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
19430 also sets @option{-mvis2} and @option{-mvis}.
19432 @item -mcbcond
19433 @itemx -mno-cbcond
19434 @opindex mcbcond
19435 @opindex mno-cbcond
19436 With @option{-mcbcond}, GCC generates code that takes advantage of
19437 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
19438 The default is @option{-mcbcond} when targeting a cpu that supports such
19439 instructions, such as niagara-4 and later.
19441 @item -mpopc
19442 @itemx -mno-popc
19443 @opindex mpopc
19444 @opindex mno-popc
19445 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
19446 population count instruction.  The default is @option{-mpopc}
19447 when targeting a cpu that supports such instructions, such as Niagara-2 and
19448 later.
19450 @item -mfmaf
19451 @itemx -mno-fmaf
19452 @opindex mfmaf
19453 @opindex mno-fmaf
19454 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
19455 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
19456 when targeting a cpu that supports such instructions, such as Niagara-3 and
19457 later.
19459 @item -mfix-at697f
19460 @opindex mfix-at697f
19461 Enable the documented workaround for the single erratum of the Atmel AT697F
19462 processor (which corresponds to erratum #13 of the AT697E processor).
19464 @item -mfix-ut699
19465 @opindex mfix-ut699
19466 Enable the documented workarounds for the floating-point errata of the UT699
19467 processor.
19468 @end table
19470 These @samp{-m} options are supported in addition to the above
19471 on SPARC-V9 processors in 64-bit environments:
19473 @table @gcctabopt
19474 @item -m32
19475 @itemx -m64
19476 @opindex m32
19477 @opindex m64
19478 Generate code for a 32-bit or 64-bit environment.
19479 The 32-bit environment sets int, long and pointer to 32 bits.
19480 The 64-bit environment sets int to 32 bits and long and pointer
19481 to 64 bits.
19483 @item -mcmodel=@var{which}
19484 @opindex mcmodel
19485 Set the code model to one of
19487 @table @samp
19488 @item medlow
19489 The Medium/Low code model: 64-bit addresses, programs
19490 must be linked in the low 32 bits of memory.  Programs can be statically
19491 or dynamically linked.
19493 @item medmid
19494 The Medium/Middle code model: 64-bit addresses, programs
19495 must be linked in the low 44 bits of memory, the text and data segments must
19496 be less than 2GB in size and the data segment must be located within 2GB of
19497 the text segment.
19499 @item medany
19500 The Medium/Anywhere code model: 64-bit addresses, programs
19501 may be linked anywhere in memory, the text and data segments must be less
19502 than 2GB in size and the data segment must be located within 2GB of the
19503 text segment.
19505 @item embmedany
19506 The Medium/Anywhere code model for embedded systems:
19507 64-bit addresses, the text and data segments must be less than 2GB in
19508 size, both starting anywhere in memory (determined at link time).  The
19509 global register %g4 points to the base of the data segment.  Programs
19510 are statically linked and PIC is not supported.
19511 @end table
19513 @item -mmemory-model=@var{mem-model}
19514 @opindex mmemory-model
19515 Set the memory model in force on the processor to one of
19517 @table @samp
19518 @item default
19519 The default memory model for the processor and operating system.
19521 @item rmo
19522 Relaxed Memory Order
19524 @item pso
19525 Partial Store Order
19527 @item tso
19528 Total Store Order
19530 @item sc
19531 Sequential Consistency
19532 @end table
19534 These memory models are formally defined in Appendix D of the Sparc V9
19535 architecture manual, as set in the processor's @code{PSTATE.MM} field.
19537 @item -mstack-bias
19538 @itemx -mno-stack-bias
19539 @opindex mstack-bias
19540 @opindex mno-stack-bias
19541 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
19542 frame pointer if present, are offset by @minus{}2047 which must be added back
19543 when making stack frame references.  This is the default in 64-bit mode.
19544 Otherwise, assume no such offset is present.
19545 @end table
19547 @node SPU Options
19548 @subsection SPU Options
19549 @cindex SPU options
19551 These @samp{-m} options are supported on the SPU:
19553 @table @gcctabopt
19554 @item -mwarn-reloc
19555 @itemx -merror-reloc
19556 @opindex mwarn-reloc
19557 @opindex merror-reloc
19559 The loader for SPU does not handle dynamic relocations.  By default, GCC
19560 gives an error when it generates code that requires a dynamic
19561 relocation.  @option{-mno-error-reloc} disables the error,
19562 @option{-mwarn-reloc} generates a warning instead.
19564 @item -msafe-dma
19565 @itemx -munsafe-dma
19566 @opindex msafe-dma
19567 @opindex munsafe-dma
19569 Instructions that initiate or test completion of DMA must not be
19570 reordered with respect to loads and stores of the memory that is being
19571 accessed.
19572 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
19573 memory accesses, but that can lead to inefficient code in places where the
19574 memory is known to not change.  Rather than mark the memory as volatile,
19575 you can use @option{-msafe-dma} to tell the compiler to treat
19576 the DMA instructions as potentially affecting all memory.  
19578 @item -mbranch-hints
19579 @opindex mbranch-hints
19581 By default, GCC generates a branch hint instruction to avoid
19582 pipeline stalls for always-taken or probably-taken branches.  A hint
19583 is not generated closer than 8 instructions away from its branch.
19584 There is little reason to disable them, except for debugging purposes,
19585 or to make an object a little bit smaller.
19587 @item -msmall-mem
19588 @itemx -mlarge-mem
19589 @opindex msmall-mem
19590 @opindex mlarge-mem
19592 By default, GCC generates code assuming that addresses are never larger
19593 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
19594 a full 32-bit address.
19596 @item -mstdmain
19597 @opindex mstdmain
19599 By default, GCC links against startup code that assumes the SPU-style
19600 main function interface (which has an unconventional parameter list).
19601 With @option{-mstdmain}, GCC links your program against startup
19602 code that assumes a C99-style interface to @code{main}, including a
19603 local copy of @code{argv} strings.
19605 @item -mfixed-range=@var{register-range}
19606 @opindex mfixed-range
19607 Generate code treating the given register range as fixed registers.
19608 A fixed register is one that the register allocator cannot use.  This is
19609 useful when compiling kernel code.  A register range is specified as
19610 two registers separated by a dash.  Multiple register ranges can be
19611 specified separated by a comma.
19613 @item -mea32
19614 @itemx -mea64
19615 @opindex mea32
19616 @opindex mea64
19617 Compile code assuming that pointers to the PPU address space accessed
19618 via the @code{__ea} named address space qualifier are either 32 or 64
19619 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
19620 all object code in an executable must be compiled with the same setting.
19622 @item -maddress-space-conversion
19623 @itemx -mno-address-space-conversion
19624 @opindex maddress-space-conversion
19625 @opindex mno-address-space-conversion
19626 Allow/disallow treating the @code{__ea} address space as superset
19627 of the generic address space.  This enables explicit type casts
19628 between @code{__ea} and generic pointer as well as implicit
19629 conversions of generic pointers to @code{__ea} pointers.  The
19630 default is to allow address space pointer conversions.
19632 @item -mcache-size=@var{cache-size}
19633 @opindex mcache-size
19634 This option controls the version of libgcc that the compiler links to an
19635 executable and selects a software-managed cache for accessing variables
19636 in the @code{__ea} address space with a particular cache size.  Possible
19637 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
19638 and @samp{128}.  The default cache size is 64KB.
19640 @item -matomic-updates
19641 @itemx -mno-atomic-updates
19642 @opindex matomic-updates
19643 @opindex mno-atomic-updates
19644 This option controls the version of libgcc that the compiler links to an
19645 executable and selects whether atomic updates to the software-managed
19646 cache of PPU-side variables are used.  If you use atomic updates, changes
19647 to a PPU variable from SPU code using the @code{__ea} named address space
19648 qualifier do not interfere with changes to other PPU variables residing
19649 in the same cache line from PPU code.  If you do not use atomic updates,
19650 such interference may occur; however, writing back cache lines is
19651 more efficient.  The default behavior is to use atomic updates.
19653 @item -mdual-nops
19654 @itemx -mdual-nops=@var{n}
19655 @opindex mdual-nops
19656 By default, GCC inserts nops to increase dual issue when it expects
19657 it to increase performance.  @var{n} can be a value from 0 to 10.  A
19658 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
19659 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
19661 @item -mhint-max-nops=@var{n}
19662 @opindex mhint-max-nops
19663 Maximum number of nops to insert for a branch hint.  A branch hint must
19664 be at least 8 instructions away from the branch it is affecting.  GCC
19665 inserts up to @var{n} nops to enforce this, otherwise it does not
19666 generate the branch hint.
19668 @item -mhint-max-distance=@var{n}
19669 @opindex mhint-max-distance
19670 The encoding of the branch hint instruction limits the hint to be within
19671 256 instructions of the branch it is affecting.  By default, GCC makes
19672 sure it is within 125.
19674 @item -msafe-hints
19675 @opindex msafe-hints
19676 Work around a hardware bug that causes the SPU to stall indefinitely.
19677 By default, GCC inserts the @code{hbrp} instruction to make sure
19678 this stall won't happen.
19680 @end table
19682 @node System V Options
19683 @subsection Options for System V
19685 These additional options are available on System V Release 4 for
19686 compatibility with other compilers on those systems:
19688 @table @gcctabopt
19689 @item -G
19690 @opindex G
19691 Create a shared object.
19692 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
19694 @item -Qy
19695 @opindex Qy
19696 Identify the versions of each tool used by the compiler, in a
19697 @code{.ident} assembler directive in the output.
19699 @item -Qn
19700 @opindex Qn
19701 Refrain from adding @code{.ident} directives to the output file (this is
19702 the default).
19704 @item -YP,@var{dirs}
19705 @opindex YP
19706 Search the directories @var{dirs}, and no others, for libraries
19707 specified with @option{-l}.
19709 @item -Ym,@var{dir}
19710 @opindex Ym
19711 Look in the directory @var{dir} to find the M4 preprocessor.
19712 The assembler uses this option.
19713 @c This is supposed to go with a -Yd for predefined M4 macro files, but
19714 @c the generic assembler that comes with Solaris takes just -Ym.
19715 @end table
19717 @node TILE-Gx Options
19718 @subsection TILE-Gx Options
19719 @cindex TILE-Gx options
19721 These @samp{-m} options are supported on the TILE-Gx:
19723 @table @gcctabopt
19724 @item -mcmodel=small
19725 @opindex mcmodel=small
19726 Generate code for the small model.  The distance for direct calls is
19727 limited to 500M in either direction.  PC-relative addresses are 32
19728 bits.  Absolute addresses support the full address range.
19730 @item -mcmodel=large
19731 @opindex mcmodel=large
19732 Generate code for the large model.  There is no limitation on call
19733 distance, pc-relative addresses, or absolute addresses.
19735 @item -mcpu=@var{name}
19736 @opindex mcpu
19737 Selects the type of CPU to be targeted.  Currently the only supported
19738 type is @samp{tilegx}.
19740 @item -m32
19741 @itemx -m64
19742 @opindex m32
19743 @opindex m64
19744 Generate code for a 32-bit or 64-bit environment.  The 32-bit
19745 environment sets int, long, and pointer to 32 bits.  The 64-bit
19746 environment sets int to 32 bits and long and pointer to 64 bits.
19747 @end table
19749 @node TILEPro Options
19750 @subsection TILEPro Options
19751 @cindex TILEPro options
19753 These @samp{-m} options are supported on the TILEPro:
19755 @table @gcctabopt
19756 @item -mcpu=@var{name}
19757 @opindex mcpu
19758 Selects the type of CPU to be targeted.  Currently the only supported
19759 type is @samp{tilepro}.
19761 @item -m32
19762 @opindex m32
19763 Generate code for a 32-bit environment, which sets int, long, and
19764 pointer to 32 bits.  This is the only supported behavior so the flag
19765 is essentially ignored.
19766 @end table
19768 @node V850 Options
19769 @subsection V850 Options
19770 @cindex V850 Options
19772 These @samp{-m} options are defined for V850 implementations:
19774 @table @gcctabopt
19775 @item -mlong-calls
19776 @itemx -mno-long-calls
19777 @opindex mlong-calls
19778 @opindex mno-long-calls
19779 Treat all calls as being far away (near).  If calls are assumed to be
19780 far away, the compiler always loads the function's address into a
19781 register, and calls indirect through the pointer.
19783 @item -mno-ep
19784 @itemx -mep
19785 @opindex mno-ep
19786 @opindex mep
19787 Do not optimize (do optimize) basic blocks that use the same index
19788 pointer 4 or more times to copy pointer into the @code{ep} register, and
19789 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
19790 option is on by default if you optimize.
19792 @item -mno-prolog-function
19793 @itemx -mprolog-function
19794 @opindex mno-prolog-function
19795 @opindex mprolog-function
19796 Do not use (do use) external functions to save and restore registers
19797 at the prologue and epilogue of a function.  The external functions
19798 are slower, but use less code space if more than one function saves
19799 the same number of registers.  The @option{-mprolog-function} option
19800 is on by default if you optimize.
19802 @item -mspace
19803 @opindex mspace
19804 Try to make the code as small as possible.  At present, this just turns
19805 on the @option{-mep} and @option{-mprolog-function} options.
19807 @item -mtda=@var{n}
19808 @opindex mtda
19809 Put static or global variables whose size is @var{n} bytes or less into
19810 the tiny data area that register @code{ep} points to.  The tiny data
19811 area can hold up to 256 bytes in total (128 bytes for byte references).
19813 @item -msda=@var{n}
19814 @opindex msda
19815 Put static or global variables whose size is @var{n} bytes or less into
19816 the small data area that register @code{gp} points to.  The small data
19817 area can hold up to 64 kilobytes.
19819 @item -mzda=@var{n}
19820 @opindex mzda
19821 Put static or global variables whose size is @var{n} bytes or less into
19822 the first 32 kilobytes of memory.
19824 @item -mv850
19825 @opindex mv850
19826 Specify that the target processor is the V850.
19828 @item -mv850e3v5
19829 @opindex mv850e3v5
19830 Specify that the target processor is the V850E3V5.  The preprocessor
19831 constant @samp{__v850e3v5__} is defined if this option is used.
19833 @item -mv850e2v4
19834 @opindex mv850e2v4
19835 Specify that the target processor is the V850E3V5.  This is an alias for
19836 the @option{-mv850e3v5} option.
19838 @item -mv850e2v3
19839 @opindex mv850e2v3
19840 Specify that the target processor is the V850E2V3.  The preprocessor
19841 constant @samp{__v850e2v3__} is defined if this option is used.
19843 @item -mv850e2
19844 @opindex mv850e2
19845 Specify that the target processor is the V850E2.  The preprocessor
19846 constant @samp{__v850e2__} is defined if this option is used.
19848 @item -mv850e1
19849 @opindex mv850e1
19850 Specify that the target processor is the V850E1.  The preprocessor
19851 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
19852 this option is used.
19854 @item -mv850es
19855 @opindex mv850es
19856 Specify that the target processor is the V850ES.  This is an alias for
19857 the @option{-mv850e1} option.
19859 @item -mv850e
19860 @opindex mv850e
19861 Specify that the target processor is the V850E@.  The preprocessor
19862 constant @samp{__v850e__} is defined if this option is used.
19864 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
19865 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
19866 are defined then a default target processor is chosen and the
19867 relevant @samp{__v850*__} preprocessor constant is defined.
19869 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
19870 defined, regardless of which processor variant is the target.
19872 @item -mdisable-callt
19873 @itemx -mno-disable-callt
19874 @opindex mdisable-callt
19875 @opindex mno-disable-callt
19876 This option suppresses generation of the @code{CALLT} instruction for the
19877 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
19878 architecture.
19880 This option is enabled by default when the RH850 ABI is
19881 in use (see @option{-mrh850-abi}), and disabled by default when the
19882 GCC ABI is in use.  If @code{CALLT} instructions are being generated
19883 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
19885 @item -mrelax
19886 @itemx -mno-relax
19887 @opindex mrelax
19888 @opindex mno-relax
19889 Pass on (or do not pass on) the @option{-mrelax} command line option
19890 to the assembler.
19892 @item -mlong-jumps
19893 @itemx -mno-long-jumps
19894 @opindex mlong-jumps
19895 @opindex mno-long-jumps
19896 Disable (or re-enable) the generation of PC-relative jump instructions.
19898 @item -msoft-float
19899 @itemx -mhard-float
19900 @opindex msoft-float
19901 @opindex mhard-float
19902 Disable (or re-enable) the generation of hardware floating point
19903 instructions.  This option is only significant when the target
19904 architecture is @samp{V850E2V3} or higher.  If hardware floating point
19905 instructions are being generated then the C preprocessor symbol
19906 @code{__FPU_OK__} will be defined, otherwise the symbol
19907 @code{__NO_FPU__} will be defined.
19909 @item -mloop
19910 @opindex mloop
19911 Enables the use of the e3v5 LOOP instruction.  The use of this
19912 instruction is not enabled by default when the e3v5 architecture is
19913 selected because its use is still experimental.
19915 @item -mrh850-abi
19916 @itemx -mghs
19917 @opindex mrh850-abi
19918 @opindex mghs
19919 Enables support for the RH850 version of the V850 ABI.  This is the
19920 default.  With this version of the ABI the following rules apply:
19922 @itemize
19923 @item
19924 Integer sized structures and unions are returned via a memory pointer
19925 rather than a register.
19927 @item
19928 Large structures and unions (more than 8 bytes in size) are passed by
19929 value.
19931 @item
19932 Functions are aligned to 16-bit boundaries.
19934 @item
19935 The @option{-m8byte-align} command line option is supported.
19937 @item
19938 The @option{-mdisable-callt} command line option is enabled by
19939 default.  The @option{-mno-disable-callt} command line option is not
19940 supported.
19941 @end itemize
19943 When this version of the ABI is enabled the C preprocessor symbol
19944 @code{__V850_RH850_ABI__} is defined.
19946 @item -mgcc-abi
19947 @opindex mgcc-abi
19948 Enables support for the old GCC version of the V850 ABI.  With this
19949 version of the ABI the following rules apply:
19951 @itemize
19952 @item
19953 Integer sized structures and unions are returned in register @code{r10}.
19955 @item
19956 Large structures and unions (more than 8 bytes in size) are passed by
19957 reference.
19959 @item
19960 Functions are aligned to 32-bit boundaries, unless optimizing for
19961 size.
19963 @item
19964 The @option{-m8byte-align} command line option is not supported.
19966 @item
19967 The @option{-mdisable-callt} command line option is supported but not
19968 enabled by default.
19969 @end itemize
19971 When this version of the ABI is enabled the C preprocessor symbol
19972 @code{__V850_GCC_ABI__} is defined.
19974 @item -m8byte-align
19975 @itemx -mno-8byte-align
19976 @opindex m8byte-align
19977 @opindex mno-8byte-align
19978 Enables support for @code{doubles} and @code{long long} types to be
19979 aligned on 8-byte boundaries.  The default is to restrict the
19980 alignment of all objects to at most 4-bytes.  When
19981 @option{-m8byte-align} is in effect the C preprocessor symbol
19982 @code{__V850_8BYTE_ALIGN__} will be defined.
19984 @item -mbig-switch
19985 @opindex mbig-switch
19986 Generate code suitable for big switch tables.  Use this option only if
19987 the assembler/linker complain about out of range branches within a switch
19988 table.
19990 @item -mapp-regs
19991 @opindex mapp-regs
19992 This option causes r2 and r5 to be used in the code generated by
19993 the compiler.  This setting is the default.
19995 @item -mno-app-regs
19996 @opindex mno-app-regs
19997 This option causes r2 and r5 to be treated as fixed registers.
19999 @end table
20001 @node VAX Options
20002 @subsection VAX Options
20003 @cindex VAX options
20005 These @samp{-m} options are defined for the VAX:
20007 @table @gcctabopt
20008 @item -munix
20009 @opindex munix
20010 Do not output certain jump instructions (@code{aobleq} and so on)
20011 that the Unix assembler for the VAX cannot handle across long
20012 ranges.
20014 @item -mgnu
20015 @opindex mgnu
20016 Do output those jump instructions, on the assumption that the
20017 GNU assembler is being used.
20019 @item -mg
20020 @opindex mg
20021 Output code for G-format floating-point numbers instead of D-format.
20022 @end table
20024 @node VMS Options
20025 @subsection VMS Options
20027 These @samp{-m} options are defined for the VMS implementations:
20029 @table @gcctabopt
20030 @item -mvms-return-codes
20031 @opindex mvms-return-codes
20032 Return VMS condition codes from @code{main}. The default is to return POSIX-style
20033 condition (e.g.@ error) codes.
20035 @item -mdebug-main=@var{prefix}
20036 @opindex mdebug-main=@var{prefix}
20037 Flag the first routine whose name starts with @var{prefix} as the main
20038 routine for the debugger.
20040 @item -mmalloc64
20041 @opindex mmalloc64
20042 Default to 64-bit memory allocation routines.
20044 @item -mpointer-size=@var{size}
20045 @opindex -mpointer-size=@var{size}
20046 Set the default size of pointers. Possible options for @var{size} are
20047 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
20048 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
20049 The later option disables @code{pragma pointer_size}.
20050 @end table
20052 @node VxWorks Options
20053 @subsection VxWorks Options
20054 @cindex VxWorks Options
20056 The options in this section are defined for all VxWorks targets.
20057 Options specific to the target hardware are listed with the other
20058 options for that target.
20060 @table @gcctabopt
20061 @item -mrtp
20062 @opindex mrtp
20063 GCC can generate code for both VxWorks kernels and real time processes
20064 (RTPs).  This option switches from the former to the latter.  It also
20065 defines the preprocessor macro @code{__RTP__}.
20067 @item -non-static
20068 @opindex non-static
20069 Link an RTP executable against shared libraries rather than static
20070 libraries.  The options @option{-static} and @option{-shared} can
20071 also be used for RTPs (@pxref{Link Options}); @option{-static}
20072 is the default.
20074 @item -Bstatic
20075 @itemx -Bdynamic
20076 @opindex Bstatic
20077 @opindex Bdynamic
20078 These options are passed down to the linker.  They are defined for
20079 compatibility with Diab.
20081 @item -Xbind-lazy
20082 @opindex Xbind-lazy
20083 Enable lazy binding of function calls.  This option is equivalent to
20084 @option{-Wl,-z,now} and is defined for compatibility with Diab.
20086 @item -Xbind-now
20087 @opindex Xbind-now
20088 Disable lazy binding of function calls.  This option is the default and
20089 is defined for compatibility with Diab.
20090 @end table
20092 @node x86-64 Options
20093 @subsection x86-64 Options
20094 @cindex x86-64 options
20096 These are listed under @xref{i386 and x86-64 Options}.
20098 @node Xstormy16 Options
20099 @subsection Xstormy16 Options
20100 @cindex Xstormy16 Options
20102 These options are defined for Xstormy16:
20104 @table @gcctabopt
20105 @item -msim
20106 @opindex msim
20107 Choose startup files and linker script suitable for the simulator.
20108 @end table
20110 @node Xtensa Options
20111 @subsection Xtensa Options
20112 @cindex Xtensa Options
20114 These options are supported for Xtensa targets:
20116 @table @gcctabopt
20117 @item -mconst16
20118 @itemx -mno-const16
20119 @opindex mconst16
20120 @opindex mno-const16
20121 Enable or disable use of @code{CONST16} instructions for loading
20122 constant values.  The @code{CONST16} instruction is currently not a
20123 standard option from Tensilica.  When enabled, @code{CONST16}
20124 instructions are always used in place of the standard @code{L32R}
20125 instructions.  The use of @code{CONST16} is enabled by default only if
20126 the @code{L32R} instruction is not available.
20128 @item -mfused-madd
20129 @itemx -mno-fused-madd
20130 @opindex mfused-madd
20131 @opindex mno-fused-madd
20132 Enable or disable use of fused multiply/add and multiply/subtract
20133 instructions in the floating-point option.  This has no effect if the
20134 floating-point option is not also enabled.  Disabling fused multiply/add
20135 and multiply/subtract instructions forces the compiler to use separate
20136 instructions for the multiply and add/subtract operations.  This may be
20137 desirable in some cases where strict IEEE 754-compliant results are
20138 required: the fused multiply add/subtract instructions do not round the
20139 intermediate result, thereby producing results with @emph{more} bits of
20140 precision than specified by the IEEE standard.  Disabling fused multiply
20141 add/subtract instructions also ensures that the program output is not
20142 sensitive to the compiler's ability to combine multiply and add/subtract
20143 operations.
20145 @item -mserialize-volatile
20146 @itemx -mno-serialize-volatile
20147 @opindex mserialize-volatile
20148 @opindex mno-serialize-volatile
20149 When this option is enabled, GCC inserts @code{MEMW} instructions before
20150 @code{volatile} memory references to guarantee sequential consistency.
20151 The default is @option{-mserialize-volatile}.  Use
20152 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
20154 @item -mforce-no-pic
20155 @opindex mforce-no-pic
20156 For targets, like GNU/Linux, where all user-mode Xtensa code must be
20157 position-independent code (PIC), this option disables PIC for compiling
20158 kernel code.
20160 @item -mtext-section-literals
20161 @itemx -mno-text-section-literals
20162 @opindex mtext-section-literals
20163 @opindex mno-text-section-literals
20164 Control the treatment of literal pools.  The default is
20165 @option{-mno-text-section-literals}, which places literals in a separate
20166 section in the output file.  This allows the literal pool to be placed
20167 in a data RAM/ROM, and it also allows the linker to combine literal
20168 pools from separate object files to remove redundant literals and
20169 improve code size.  With @option{-mtext-section-literals}, the literals
20170 are interspersed in the text section in order to keep them as close as
20171 possible to their references.  This may be necessary for large assembly
20172 files.
20174 @item -mtarget-align
20175 @itemx -mno-target-align
20176 @opindex mtarget-align
20177 @opindex mno-target-align
20178 When this option is enabled, GCC instructs the assembler to
20179 automatically align instructions to reduce branch penalties at the
20180 expense of some code density.  The assembler attempts to widen density
20181 instructions to align branch targets and the instructions following call
20182 instructions.  If there are not enough preceding safe density
20183 instructions to align a target, no widening is performed.  The
20184 default is @option{-mtarget-align}.  These options do not affect the
20185 treatment of auto-aligned instructions like @code{LOOP}, which the
20186 assembler always aligns, either by widening density instructions or
20187 by inserting NOP instructions.
20189 @item -mlongcalls
20190 @itemx -mno-longcalls
20191 @opindex mlongcalls
20192 @opindex mno-longcalls
20193 When this option is enabled, GCC instructs the assembler to translate
20194 direct calls to indirect calls unless it can determine that the target
20195 of a direct call is in the range allowed by the call instruction.  This
20196 translation typically occurs for calls to functions in other source
20197 files.  Specifically, the assembler translates a direct @code{CALL}
20198 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
20199 The default is @option{-mno-longcalls}.  This option should be used in
20200 programs where the call target can potentially be out of range.  This
20201 option is implemented in the assembler, not the compiler, so the
20202 assembly code generated by GCC still shows direct call
20203 instructions---look at the disassembled object code to see the actual
20204 instructions.  Note that the assembler uses an indirect call for
20205 every cross-file call, not just those that really are out of range.
20206 @end table
20208 @node zSeries Options
20209 @subsection zSeries Options
20210 @cindex zSeries options
20212 These are listed under @xref{S/390 and zSeries Options}.
20214 @node Code Gen Options
20215 @section Options for Code Generation Conventions
20216 @cindex code generation conventions
20217 @cindex options, code generation
20218 @cindex run-time options
20220 These machine-independent options control the interface conventions
20221 used in code generation.
20223 Most of them have both positive and negative forms; the negative form
20224 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
20225 one of the forms is listed---the one that is not the default.  You
20226 can figure out the other form by either removing @samp{no-} or adding
20229 @table @gcctabopt
20230 @item -fbounds-check
20231 @opindex fbounds-check
20232 For front ends that support it, generate additional code to check that
20233 indices used to access arrays are within the declared range.  This is
20234 currently only supported by the Java and Fortran front ends, where
20235 this option defaults to true and false respectively.
20237 @item -fstack-reuse=@var{reuse-level}
20238 @opindex fstack_reuse
20239 This option controls stack space reuse for user declared local/auto variables
20240 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
20241 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
20242 local variables and temporaries, @samp{named_vars} enables the reuse only for
20243 user defined local variables with names, and @samp{none} disables stack reuse
20244 completely. The default value is @samp{all}. The option is needed when the
20245 program extends the lifetime of a scoped local variable or a compiler generated
20246 temporary beyond the end point defined by the language.  When a lifetime of
20247 a variable ends, and if the variable lives in memory, the optimizing compiler
20248 has the freedom to reuse its stack space with other temporaries or scoped
20249 local variables whose live range does not overlap with it. Legacy code extending
20250 local lifetime will likely to break with the stack reuse optimization.
20252 For example,
20254 @smallexample
20255    int *p;
20256    @{
20257      int local1;
20259      p = &local1;
20260      local1 = 10;
20261      ....
20262    @}
20263    @{
20264       int local2;
20265       local2 = 20;
20266       ...
20267    @}
20269    if (*p == 10)  // out of scope use of local1
20270      @{
20272      @}
20273 @end smallexample
20275 Another example:
20276 @smallexample
20278    struct A
20279    @{
20280        A(int k) : i(k), j(k) @{ @}
20281        int i;
20282        int j;
20283    @};
20285    A *ap;
20287    void foo(const A& ar)
20288    @{
20289       ap = &ar;
20290    @}
20292    void bar()
20293    @{
20294       foo(A(10)); // temp object's lifetime ends when foo returns
20296       @{
20297         A a(20);
20298         ....
20299       @}
20300       ap->i+= 10;  // ap references out of scope temp whose space
20301                    // is reused with a. What is the value of ap->i?
20302    @}
20304 @end smallexample
20306 The lifetime of a compiler generated temporary is well defined by the C++
20307 standard. When a lifetime of a temporary ends, and if the temporary lives
20308 in memory, the optimizing compiler has the freedom to reuse its stack
20309 space with other temporaries or scoped local variables whose live range
20310 does not overlap with it. However some of the legacy code relies on
20311 the behavior of older compilers in which temporaries' stack space is
20312 not reused, the aggressive stack reuse can lead to runtime errors. This
20313 option is used to control the temporary stack reuse optimization.
20315 @item -ftrapv
20316 @opindex ftrapv
20317 This option generates traps for signed overflow on addition, subtraction,
20318 multiplication operations.
20320 @item -fwrapv
20321 @opindex fwrapv
20322 This option instructs the compiler to assume that signed arithmetic
20323 overflow of addition, subtraction and multiplication wraps around
20324 using twos-complement representation.  This flag enables some optimizations
20325 and disables others.  This option is enabled by default for the Java
20326 front end, as required by the Java language specification.
20328 @item -fexceptions
20329 @opindex fexceptions
20330 Enable exception handling.  Generates extra code needed to propagate
20331 exceptions.  For some targets, this implies GCC generates frame
20332 unwind information for all functions, which can produce significant data
20333 size overhead, although it does not affect execution.  If you do not
20334 specify this option, GCC enables it by default for languages like
20335 C++ that normally require exception handling, and disables it for
20336 languages like C that do not normally require it.  However, you may need
20337 to enable this option when compiling C code that needs to interoperate
20338 properly with exception handlers written in C++.  You may also wish to
20339 disable this option if you are compiling older C++ programs that don't
20340 use exception handling.
20342 @item -fnon-call-exceptions
20343 @opindex fnon-call-exceptions
20344 Generate code that allows trapping instructions to throw exceptions.
20345 Note that this requires platform-specific runtime support that does
20346 not exist everywhere.  Moreover, it only allows @emph{trapping}
20347 instructions to throw exceptions, i.e.@: memory references or floating-point
20348 instructions.  It does not allow exceptions to be thrown from
20349 arbitrary signal handlers such as @code{SIGALRM}.
20351 @item -fdelete-dead-exceptions
20352 @opindex fdelete-dead-exceptions
20353 Consider that instructions that may throw exceptions but don't otherwise
20354 contribute to the execution of the program can be optimized away.
20355 This option is enabled by default for the Ada front end, as permitted by
20356 the Ada language specification.
20357 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
20359 @item -funwind-tables
20360 @opindex funwind-tables
20361 Similar to @option{-fexceptions}, except that it just generates any needed
20362 static data, but does not affect the generated code in any other way.
20363 You normally do not need to enable this option; instead, a language processor
20364 that needs this handling enables it on your behalf.
20366 @item -fasynchronous-unwind-tables
20367 @opindex fasynchronous-unwind-tables
20368 Generate unwind table in DWARF 2 format, if supported by target machine.  The
20369 table is exact at each instruction boundary, so it can be used for stack
20370 unwinding from asynchronous events (such as debugger or garbage collector).
20372 @item -fpcc-struct-return
20373 @opindex fpcc-struct-return
20374 Return ``short'' @code{struct} and @code{union} values in memory like
20375 longer ones, rather than in registers.  This convention is less
20376 efficient, but it has the advantage of allowing intercallability between
20377 GCC-compiled files and files compiled with other compilers, particularly
20378 the Portable C Compiler (pcc).
20380 The precise convention for returning structures in memory depends
20381 on the target configuration macros.
20383 Short structures and unions are those whose size and alignment match
20384 that of some integer type.
20386 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
20387 switch is not binary compatible with code compiled with the
20388 @option{-freg-struct-return} switch.
20389 Use it to conform to a non-default application binary interface.
20391 @item -freg-struct-return
20392 @opindex freg-struct-return
20393 Return @code{struct} and @code{union} values in registers when possible.
20394 This is more efficient for small structures than
20395 @option{-fpcc-struct-return}.
20397 If you specify neither @option{-fpcc-struct-return} nor
20398 @option{-freg-struct-return}, GCC defaults to whichever convention is
20399 standard for the target.  If there is no standard convention, GCC
20400 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
20401 the principal compiler.  In those cases, we can choose the standard, and
20402 we chose the more efficient register return alternative.
20404 @strong{Warning:} code compiled with the @option{-freg-struct-return}
20405 switch is not binary compatible with code compiled with the
20406 @option{-fpcc-struct-return} switch.
20407 Use it to conform to a non-default application binary interface.
20409 @item -fshort-enums
20410 @opindex fshort-enums
20411 Allocate to an @code{enum} type only as many bytes as it needs for the
20412 declared range of possible values.  Specifically, the @code{enum} type
20413 is equivalent to the smallest integer type that has enough room.
20415 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
20416 code that is not binary compatible with code generated without that switch.
20417 Use it to conform to a non-default application binary interface.
20419 @item -fshort-double
20420 @opindex fshort-double
20421 Use the same size for @code{double} as for @code{float}.
20423 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
20424 code that is not binary compatible with code generated without that switch.
20425 Use it to conform to a non-default application binary interface.
20427 @item -fshort-wchar
20428 @opindex fshort-wchar
20429 Override the underlying type for @samp{wchar_t} to be @samp{short
20430 unsigned int} instead of the default for the target.  This option is
20431 useful for building programs to run under WINE@.
20433 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
20434 code that is not binary compatible with code generated without that switch.
20435 Use it to conform to a non-default application binary interface.
20437 @item -fno-common
20438 @opindex fno-common
20439 In C code, controls the placement of uninitialized global variables.
20440 Unix C compilers have traditionally permitted multiple definitions of
20441 such variables in different compilation units by placing the variables
20442 in a common block.
20443 This is the behavior specified by @option{-fcommon}, and is the default
20444 for GCC on most targets.
20445 On the other hand, this behavior is not required by ISO C, and on some
20446 targets may carry a speed or code size penalty on variable references.
20447 The @option{-fno-common} option specifies that the compiler should place
20448 uninitialized global variables in the data section of the object file,
20449 rather than generating them as common blocks.
20450 This has the effect that if the same variable is declared
20451 (without @code{extern}) in two different compilations,
20452 you get a multiple-definition error when you link them.
20453 In this case, you must compile with @option{-fcommon} instead.
20454 Compiling with @option{-fno-common} is useful on targets for which
20455 it provides better performance, or if you wish to verify that the
20456 program will work on other systems that always treat uninitialized
20457 variable declarations this way.
20459 @item -fno-ident
20460 @opindex fno-ident
20461 Ignore the @samp{#ident} directive.
20463 @item -finhibit-size-directive
20464 @opindex finhibit-size-directive
20465 Don't output a @code{.size} assembler directive, or anything else that
20466 would cause trouble if the function is split in the middle, and the
20467 two halves are placed at locations far apart in memory.  This option is
20468 used when compiling @file{crtstuff.c}; you should not need to use it
20469 for anything else.
20471 @item -fverbose-asm
20472 @opindex fverbose-asm
20473 Put extra commentary information in the generated assembly code to
20474 make it more readable.  This option is generally only of use to those
20475 who actually need to read the generated assembly code (perhaps while
20476 debugging the compiler itself).
20478 @option{-fno-verbose-asm}, the default, causes the
20479 extra information to be omitted and is useful when comparing two assembler
20480 files.
20482 @item -frecord-gcc-switches
20483 @opindex frecord-gcc-switches
20484 This switch causes the command line used to invoke the
20485 compiler to be recorded into the object file that is being created.
20486 This switch is only implemented on some targets and the exact format
20487 of the recording is target and binary file format dependent, but it
20488 usually takes the form of a section containing ASCII text.  This
20489 switch is related to the @option{-fverbose-asm} switch, but that
20490 switch only records information in the assembler output file as
20491 comments, so it never reaches the object file.
20492 See also @option{-grecord-gcc-switches} for another
20493 way of storing compiler options into the object file.
20495 @item -fpic
20496 @opindex fpic
20497 @cindex global offset table
20498 @cindex PIC
20499 Generate position-independent code (PIC) suitable for use in a shared
20500 library, if supported for the target machine.  Such code accesses all
20501 constant addresses through a global offset table (GOT)@.  The dynamic
20502 loader resolves the GOT entries when the program starts (the dynamic
20503 loader is not part of GCC; it is part of the operating system).  If
20504 the GOT size for the linked executable exceeds a machine-specific
20505 maximum size, you get an error message from the linker indicating that
20506 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
20507 instead.  (These maximums are 8k on the SPARC and 32k
20508 on the m68k and RS/6000.  The 386 has no such limit.)
20510 Position-independent code requires special support, and therefore works
20511 only on certain machines.  For the 386, GCC supports PIC for System V
20512 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
20513 position-independent.
20515 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20516 are defined to 1.
20518 @item -fPIC
20519 @opindex fPIC
20520 If supported for the target machine, emit position-independent code,
20521 suitable for dynamic linking and avoiding any limit on the size of the
20522 global offset table.  This option makes a difference on the m68k,
20523 PowerPC and SPARC@.
20525 Position-independent code requires special support, and therefore works
20526 only on certain machines.
20528 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20529 are defined to 2.
20531 @item -fpie
20532 @itemx -fPIE
20533 @opindex fpie
20534 @opindex fPIE
20535 These options are similar to @option{-fpic} and @option{-fPIC}, but
20536 generated position independent code can be only linked into executables.
20537 Usually these options are used when @option{-pie} GCC option is
20538 used during linking.
20540 @option{-fpie} and @option{-fPIE} both define the macros
20541 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
20542 for @option{-fpie} and 2 for @option{-fPIE}.
20544 @item -fno-jump-tables
20545 @opindex fno-jump-tables
20546 Do not use jump tables for switch statements even where it would be
20547 more efficient than other code generation strategies.  This option is
20548 of use in conjunction with @option{-fpic} or @option{-fPIC} for
20549 building code that forms part of a dynamic linker and cannot
20550 reference the address of a jump table.  On some targets, jump tables
20551 do not require a GOT and this option is not needed.
20553 @item -ffixed-@var{reg}
20554 @opindex ffixed
20555 Treat the register named @var{reg} as a fixed register; generated code
20556 should never refer to it (except perhaps as a stack pointer, frame
20557 pointer or in some other fixed role).
20559 @var{reg} must be the name of a register.  The register names accepted
20560 are machine-specific and are defined in the @code{REGISTER_NAMES}
20561 macro in the machine description macro file.
20563 This flag does not have a negative form, because it specifies a
20564 three-way choice.
20566 @item -fcall-used-@var{reg}
20567 @opindex fcall-used
20568 Treat the register named @var{reg} as an allocable register that is
20569 clobbered by function calls.  It may be allocated for temporaries or
20570 variables that do not live across a call.  Functions compiled this way
20571 do not save and restore the register @var{reg}.
20573 It is an error to use this flag with the frame pointer or stack pointer.
20574 Use of this flag for other registers that have fixed pervasive roles in
20575 the machine's execution model produces disastrous results.
20577 This flag does not have a negative form, because it specifies a
20578 three-way choice.
20580 @item -fcall-saved-@var{reg}
20581 @opindex fcall-saved
20582 Treat the register named @var{reg} as an allocable register saved by
20583 functions.  It may be allocated even for temporaries or variables that
20584 live across a call.  Functions compiled this way save and restore
20585 the register @var{reg} if they use it.
20587 It is an error to use this flag with the frame pointer or stack pointer.
20588 Use of this flag for other registers that have fixed pervasive roles in
20589 the machine's execution model produces disastrous results.
20591 A different sort of disaster results from the use of this flag for
20592 a register in which function values may be returned.
20594 This flag does not have a negative form, because it specifies a
20595 three-way choice.
20597 @item -fpack-struct[=@var{n}]
20598 @opindex fpack-struct
20599 Without a value specified, pack all structure members together without
20600 holes.  When a value is specified (which must be a small power of two), pack
20601 structure members according to this value, representing the maximum
20602 alignment (that is, objects with default alignment requirements larger than
20603 this are output potentially unaligned at the next fitting location.
20605 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
20606 code that is not binary compatible with code generated without that switch.
20607 Additionally, it makes the code suboptimal.
20608 Use it to conform to a non-default application binary interface.
20610 @item -finstrument-functions
20611 @opindex finstrument-functions
20612 Generate instrumentation calls for entry and exit to functions.  Just
20613 after function entry and just before function exit, the following
20614 profiling functions are called with the address of the current
20615 function and its call site.  (On some platforms,
20616 @code{__builtin_return_address} does not work beyond the current
20617 function, so the call site information may not be available to the
20618 profiling functions otherwise.)
20620 @smallexample
20621 void __cyg_profile_func_enter (void *this_fn,
20622                                void *call_site);
20623 void __cyg_profile_func_exit  (void *this_fn,
20624                                void *call_site);
20625 @end smallexample
20627 The first argument is the address of the start of the current function,
20628 which may be looked up exactly in the symbol table.
20630 This instrumentation is also done for functions expanded inline in other
20631 functions.  The profiling calls indicate where, conceptually, the
20632 inline function is entered and exited.  This means that addressable
20633 versions of such functions must be available.  If all your uses of a
20634 function are expanded inline, this may mean an additional expansion of
20635 code size.  If you use @samp{extern inline} in your C code, an
20636 addressable version of such functions must be provided.  (This is
20637 normally the case anyway, but if you get lucky and the optimizer always
20638 expands the functions inline, you might have gotten away without
20639 providing static copies.)
20641 A function may be given the attribute @code{no_instrument_function}, in
20642 which case this instrumentation is not done.  This can be used, for
20643 example, for the profiling functions listed above, high-priority
20644 interrupt routines, and any functions from which the profiling functions
20645 cannot safely be called (perhaps signal handlers, if the profiling
20646 routines generate output or allocate memory).
20648 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
20649 @opindex finstrument-functions-exclude-file-list
20651 Set the list of functions that are excluded from instrumentation (see
20652 the description of @code{-finstrument-functions}).  If the file that
20653 contains a function definition matches with one of @var{file}, then
20654 that function is not instrumented.  The match is done on substrings:
20655 if the @var{file} parameter is a substring of the file name, it is
20656 considered to be a match.
20658 For example:
20660 @smallexample
20661 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
20662 @end smallexample
20664 @noindent
20665 excludes any inline function defined in files whose pathnames
20666 contain @code{/bits/stl} or @code{include/sys}.
20668 If, for some reason, you want to include letter @code{','} in one of
20669 @var{sym}, write @code{'\,'}. For example,
20670 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
20671 (note the single quote surrounding the option).
20673 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
20674 @opindex finstrument-functions-exclude-function-list
20676 This is similar to @code{-finstrument-functions-exclude-file-list},
20677 but this option sets the list of function names to be excluded from
20678 instrumentation.  The function name to be matched is its user-visible
20679 name, such as @code{vector<int> blah(const vector<int> &)}, not the
20680 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
20681 match is done on substrings: if the @var{sym} parameter is a substring
20682 of the function name, it is considered to be a match.  For C99 and C++
20683 extended identifiers, the function name must be given in UTF-8, not
20684 using universal character names.
20686 @item -fstack-check
20687 @opindex fstack-check
20688 Generate code to verify that you do not go beyond the boundary of the
20689 stack.  You should specify this flag if you are running in an
20690 environment with multiple threads, but you only rarely need to specify it in
20691 a single-threaded environment since stack overflow is automatically
20692 detected on nearly all systems if there is only one stack.
20694 Note that this switch does not actually cause checking to be done; the
20695 operating system or the language runtime must do that.  The switch causes
20696 generation of code to ensure that they see the stack being extended.
20698 You can additionally specify a string parameter: @code{no} means no
20699 checking, @code{generic} means force the use of old-style checking,
20700 @code{specific} means use the best checking method and is equivalent
20701 to bare @option{-fstack-check}.
20703 Old-style checking is a generic mechanism that requires no specific
20704 target support in the compiler but comes with the following drawbacks:
20706 @enumerate
20707 @item
20708 Modified allocation strategy for large objects: they are always
20709 allocated dynamically if their size exceeds a fixed threshold.
20711 @item
20712 Fixed limit on the size of the static frame of functions: when it is
20713 topped by a particular function, stack checking is not reliable and
20714 a warning is issued by the compiler.
20716 @item
20717 Inefficiency: because of both the modified allocation strategy and the
20718 generic implementation, code performance is hampered.
20719 @end enumerate
20721 Note that old-style stack checking is also the fallback method for
20722 @code{specific} if no target support has been added in the compiler.
20724 @item -fstack-limit-register=@var{reg}
20725 @itemx -fstack-limit-symbol=@var{sym}
20726 @itemx -fno-stack-limit
20727 @opindex fstack-limit-register
20728 @opindex fstack-limit-symbol
20729 @opindex fno-stack-limit
20730 Generate code to ensure that the stack does not grow beyond a certain value,
20731 either the value of a register or the address of a symbol.  If a larger
20732 stack is required, a signal is raised at run time.  For most targets,
20733 the signal is raised before the stack overruns the boundary, so
20734 it is possible to catch the signal without taking special precautions.
20736 For instance, if the stack starts at absolute address @samp{0x80000000}
20737 and grows downwards, you can use the flags
20738 @option{-fstack-limit-symbol=__stack_limit} and
20739 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
20740 of 128KB@.  Note that this may only work with the GNU linker.
20742 @item -fsplit-stack
20743 @opindex fsplit-stack
20744 Generate code to automatically split the stack before it overflows.
20745 The resulting program has a discontiguous stack which can only
20746 overflow if the program is unable to allocate any more memory.  This
20747 is most useful when running threaded programs, as it is no longer
20748 necessary to calculate a good stack size to use for each thread.  This
20749 is currently only implemented for the i386 and x86_64 back ends running
20750 GNU/Linux.
20752 When code compiled with @option{-fsplit-stack} calls code compiled
20753 without @option{-fsplit-stack}, there may not be much stack space
20754 available for the latter code to run.  If compiling all code,
20755 including library code, with @option{-fsplit-stack} is not an option,
20756 then the linker can fix up these calls so that the code compiled
20757 without @option{-fsplit-stack} always has a large stack.  Support for
20758 this is implemented in the gold linker in GNU binutils release 2.21
20759 and later.
20761 @item -fleading-underscore
20762 @opindex fleading-underscore
20763 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
20764 change the way C symbols are represented in the object file.  One use
20765 is to help link with legacy assembly code.
20767 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
20768 generate code that is not binary compatible with code generated without that
20769 switch.  Use it to conform to a non-default application binary interface.
20770 Not all targets provide complete support for this switch.
20772 @item -ftls-model=@var{model}
20773 @opindex ftls-model
20774 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
20775 The @var{model} argument should be one of @code{global-dynamic},
20776 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
20778 The default without @option{-fpic} is @code{initial-exec}; with
20779 @option{-fpic} the default is @code{global-dynamic}.
20781 @item -fvisibility=@var{default|internal|hidden|protected}
20782 @opindex fvisibility
20783 Set the default ELF image symbol visibility to the specified option---all
20784 symbols are marked with this unless overridden within the code.
20785 Using this feature can very substantially improve linking and
20786 load times of shared object libraries, produce more optimized
20787 code, provide near-perfect API export and prevent symbol clashes.
20788 It is @strong{strongly} recommended that you use this in any shared objects
20789 you distribute.
20791 Despite the nomenclature, @code{default} always means public; i.e.,
20792 available to be linked against from outside the shared object.
20793 @code{protected} and @code{internal} are pretty useless in real-world
20794 usage so the only other commonly used option is @code{hidden}.
20795 The default if @option{-fvisibility} isn't specified is
20796 @code{default}, i.e., make every
20797 symbol public---this causes the same behavior as previous versions of
20798 GCC@.
20800 A good explanation of the benefits offered by ensuring ELF
20801 symbols have the correct visibility is given by ``How To Write
20802 Shared Libraries'' by Ulrich Drepper (which can be found at
20803 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
20804 solution made possible by this option to marking things hidden when
20805 the default is public is to make the default hidden and mark things
20806 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
20807 and @code{__attribute__ ((visibility("default")))} instead of
20808 @code{__declspec(dllexport)} you get almost identical semantics with
20809 identical syntax.  This is a great boon to those working with
20810 cross-platform projects.
20812 For those adding visibility support to existing code, you may find
20813 @samp{#pragma GCC visibility} of use.  This works by you enclosing
20814 the declarations you wish to set visibility for with (for example)
20815 @samp{#pragma GCC visibility push(hidden)} and
20816 @samp{#pragma GCC visibility pop}.
20817 Bear in mind that symbol visibility should be viewed @strong{as
20818 part of the API interface contract} and thus all new code should
20819 always specify visibility when it is not the default; i.e., declarations
20820 only for use within the local DSO should @strong{always} be marked explicitly
20821 as hidden as so to avoid PLT indirection overheads---making this
20822 abundantly clear also aids readability and self-documentation of the code.
20823 Note that due to ISO C++ specification requirements, @code{operator new} and
20824 @code{operator delete} must always be of default visibility.
20826 Be aware that headers from outside your project, in particular system
20827 headers and headers from any other library you use, may not be
20828 expecting to be compiled with visibility other than the default.  You
20829 may need to explicitly say @samp{#pragma GCC visibility push(default)}
20830 before including any such headers.
20832 @samp{extern} declarations are not affected by @option{-fvisibility}, so
20833 a lot of code can be recompiled with @option{-fvisibility=hidden} with
20834 no modifications.  However, this means that calls to @code{extern}
20835 functions with no explicit visibility use the PLT, so it is more
20836 effective to use @code{__attribute ((visibility))} and/or
20837 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
20838 declarations should be treated as hidden.
20840 Note that @option{-fvisibility} does affect C++ vague linkage
20841 entities. This means that, for instance, an exception class that is
20842 be thrown between DSOs must be explicitly marked with default
20843 visibility so that the @samp{type_info} nodes are unified between
20844 the DSOs.
20846 An overview of these techniques, their benefits and how to use them
20847 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
20849 @item -fstrict-volatile-bitfields
20850 @opindex fstrict-volatile-bitfields
20851 This option should be used if accesses to volatile bit-fields (or other
20852 structure fields, although the compiler usually honors those types
20853 anyway) should use a single access of the width of the
20854 field's type, aligned to a natural alignment if possible.  For
20855 example, targets with memory-mapped peripheral registers might require
20856 all such accesses to be 16 bits wide; with this flag you can
20857 declare all peripheral bit-fields as @code{unsigned short} (assuming short
20858 is 16 bits on these targets) to force GCC to use 16-bit accesses
20859 instead of, perhaps, a more efficient 32-bit access.
20861 If this option is disabled, the compiler uses the most efficient
20862 instruction.  In the previous example, that might be a 32-bit load
20863 instruction, even though that accesses bytes that do not contain
20864 any portion of the bit-field, or memory-mapped registers unrelated to
20865 the one being updated.
20867 If the target requires strict alignment, and honoring the field
20868 type would require violating this alignment, a warning is issued.
20869 If the field has @code{packed} attribute, the access is done without
20870 honoring the field type.  If the field doesn't have @code{packed}
20871 attribute, the access is done honoring the field type.  In both cases,
20872 GCC assumes that the user knows something about the target hardware
20873 that it is unaware of.
20875 The default value of this option is determined by the application binary
20876 interface for the target processor.
20878 @item -fsync-libcalls
20879 @opindex fsync-libcalls
20880 This option controls whether any out-of-line instance of the @code{__sync}
20881 family of functions may be used to implement the C++11 @code{__atomic}
20882 family of functions.
20884 The default value of this option is enabled, thus the only useful form
20885 of the option is @option{-fno-sync-libcalls}.  This option is used in
20886 the implementation of the @file{libatomic} runtime library.
20888 @end table
20890 @c man end
20892 @node Environment Variables
20893 @section Environment Variables Affecting GCC
20894 @cindex environment variables
20896 @c man begin ENVIRONMENT
20897 This section describes several environment variables that affect how GCC
20898 operates.  Some of them work by specifying directories or prefixes to use
20899 when searching for various kinds of files.  Some are used to specify other
20900 aspects of the compilation environment.
20902 Note that you can also specify places to search using options such as
20903 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
20904 take precedence over places specified using environment variables, which
20905 in turn take precedence over those specified by the configuration of GCC@.
20906 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
20907 GNU Compiler Collection (GCC) Internals}.
20909 @table @env
20910 @item LANG
20911 @itemx LC_CTYPE
20912 @c @itemx LC_COLLATE
20913 @itemx LC_MESSAGES
20914 @c @itemx LC_MONETARY
20915 @c @itemx LC_NUMERIC
20916 @c @itemx LC_TIME
20917 @itemx LC_ALL
20918 @findex LANG
20919 @findex LC_CTYPE
20920 @c @findex LC_COLLATE
20921 @findex LC_MESSAGES
20922 @c @findex LC_MONETARY
20923 @c @findex LC_NUMERIC
20924 @c @findex LC_TIME
20925 @findex LC_ALL
20926 @cindex locale
20927 These environment variables control the way that GCC uses
20928 localization information which allows GCC to work with different
20929 national conventions.  GCC inspects the locale categories
20930 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
20931 so.  These locale categories can be set to any value supported by your
20932 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
20933 Kingdom encoded in UTF-8.
20935 The @env{LC_CTYPE} environment variable specifies character
20936 classification.  GCC uses it to determine the character boundaries in
20937 a string; this is needed for some multibyte encodings that contain quote
20938 and escape characters that are otherwise interpreted as a string
20939 end or escape.
20941 The @env{LC_MESSAGES} environment variable specifies the language to
20942 use in diagnostic messages.
20944 If the @env{LC_ALL} environment variable is set, it overrides the value
20945 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
20946 and @env{LC_MESSAGES} default to the value of the @env{LANG}
20947 environment variable.  If none of these variables are set, GCC
20948 defaults to traditional C English behavior.
20950 @item TMPDIR
20951 @findex TMPDIR
20952 If @env{TMPDIR} is set, it specifies the directory to use for temporary
20953 files.  GCC uses temporary files to hold the output of one stage of
20954 compilation which is to be used as input to the next stage: for example,
20955 the output of the preprocessor, which is the input to the compiler
20956 proper.
20958 @item GCC_COMPARE_DEBUG
20959 @findex GCC_COMPARE_DEBUG
20960 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
20961 @option{-fcompare-debug} to the compiler driver.  See the documentation
20962 of this option for more details.
20964 @item GCC_EXEC_PREFIX
20965 @findex GCC_EXEC_PREFIX
20966 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
20967 names of the subprograms executed by the compiler.  No slash is added
20968 when this prefix is combined with the name of a subprogram, but you can
20969 specify a prefix that ends with a slash if you wish.
20971 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
20972 an appropriate prefix to use based on the pathname it is invoked with.
20974 If GCC cannot find the subprogram using the specified prefix, it
20975 tries looking in the usual places for the subprogram.
20977 The default value of @env{GCC_EXEC_PREFIX} is
20978 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
20979 the installed compiler. In many cases @var{prefix} is the value
20980 of @code{prefix} when you ran the @file{configure} script.
20982 Other prefixes specified with @option{-B} take precedence over this prefix.
20984 This prefix is also used for finding files such as @file{crt0.o} that are
20985 used for linking.
20987 In addition, the prefix is used in an unusual way in finding the
20988 directories to search for header files.  For each of the standard
20989 directories whose name normally begins with @samp{/usr/local/lib/gcc}
20990 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
20991 replacing that beginning with the specified prefix to produce an
20992 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
20993 @file{foo/bar} just before it searches the standard directory 
20994 @file{/usr/local/lib/bar}.
20995 If a standard directory begins with the configured
20996 @var{prefix} then the value of @var{prefix} is replaced by
20997 @env{GCC_EXEC_PREFIX} when looking for header files.
20999 @item COMPILER_PATH
21000 @findex COMPILER_PATH
21001 The value of @env{COMPILER_PATH} is a colon-separated list of
21002 directories, much like @env{PATH}.  GCC tries the directories thus
21003 specified when searching for subprograms, if it can't find the
21004 subprograms using @env{GCC_EXEC_PREFIX}.
21006 @item LIBRARY_PATH
21007 @findex LIBRARY_PATH
21008 The value of @env{LIBRARY_PATH} is a colon-separated list of
21009 directories, much like @env{PATH}.  When configured as a native compiler,
21010 GCC tries the directories thus specified when searching for special
21011 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
21012 using GCC also uses these directories when searching for ordinary
21013 libraries for the @option{-l} option (but directories specified with
21014 @option{-L} come first).
21016 @item LANG
21017 @findex LANG
21018 @cindex locale definition
21019 This variable is used to pass locale information to the compiler.  One way in
21020 which this information is used is to determine the character set to be used
21021 when character literals, string literals and comments are parsed in C and C++.
21022 When the compiler is configured to allow multibyte characters,
21023 the following values for @env{LANG} are recognized:
21025 @table @samp
21026 @item C-JIS
21027 Recognize JIS characters.
21028 @item C-SJIS
21029 Recognize SJIS characters.
21030 @item C-EUCJP
21031 Recognize EUCJP characters.
21032 @end table
21034 If @env{LANG} is not defined, or if it has some other value, then the
21035 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
21036 recognize and translate multibyte characters.
21037 @end table
21039 @noindent
21040 Some additional environment variables affect the behavior of the
21041 preprocessor.
21043 @include cppenv.texi
21045 @c man end
21047 @node Precompiled Headers
21048 @section Using Precompiled Headers
21049 @cindex precompiled headers
21050 @cindex speed of compilation
21052 Often large projects have many header files that are included in every
21053 source file.  The time the compiler takes to process these header files
21054 over and over again can account for nearly all of the time required to
21055 build the project.  To make builds faster, GCC allows you to
21056 @dfn{precompile} a header file.
21058 To create a precompiled header file, simply compile it as you would any
21059 other file, if necessary using the @option{-x} option to make the driver
21060 treat it as a C or C++ header file.  You may want to use a
21061 tool like @command{make} to keep the precompiled header up-to-date when
21062 the headers it contains change.
21064 A precompiled header file is searched for when @code{#include} is
21065 seen in the compilation.  As it searches for the included file
21066 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
21067 compiler looks for a precompiled header in each directory just before it
21068 looks for the include file in that directory.  The name searched for is
21069 the name specified in the @code{#include} with @samp{.gch} appended.  If
21070 the precompiled header file can't be used, it is ignored.
21072 For instance, if you have @code{#include "all.h"}, and you have
21073 @file{all.h.gch} in the same directory as @file{all.h}, then the
21074 precompiled header file is used if possible, and the original
21075 header is used otherwise.
21077 Alternatively, you might decide to put the precompiled header file in a
21078 directory and use @option{-I} to ensure that directory is searched
21079 before (or instead of) the directory containing the original header.
21080 Then, if you want to check that the precompiled header file is always
21081 used, you can put a file of the same name as the original header in this
21082 directory containing an @code{#error} command.
21084 This also works with @option{-include}.  So yet another way to use
21085 precompiled headers, good for projects not designed with precompiled
21086 header files in mind, is to simply take most of the header files used by
21087 a project, include them from another header file, precompile that header
21088 file, and @option{-include} the precompiled header.  If the header files
21089 have guards against multiple inclusion, they are skipped because
21090 they've already been included (in the precompiled header).
21092 If you need to precompile the same header file for different
21093 languages, targets, or compiler options, you can instead make a
21094 @emph{directory} named like @file{all.h.gch}, and put each precompiled
21095 header in the directory, perhaps using @option{-o}.  It doesn't matter
21096 what you call the files in the directory; every precompiled header in
21097 the directory is considered.  The first precompiled header
21098 encountered in the directory that is valid for this compilation is
21099 used; they're searched in no particular order.
21101 There are many other possibilities, limited only by your imagination,
21102 good sense, and the constraints of your build system.
21104 A precompiled header file can be used only when these conditions apply:
21106 @itemize
21107 @item
21108 Only one precompiled header can be used in a particular compilation.
21110 @item
21111 A precompiled header can't be used once the first C token is seen.  You
21112 can have preprocessor directives before a precompiled header; you cannot
21113 include a precompiled header from inside another header.
21115 @item
21116 The precompiled header file must be produced for the same language as
21117 the current compilation.  You can't use a C precompiled header for a C++
21118 compilation.
21120 @item
21121 The precompiled header file must have been produced by the same compiler
21122 binary as the current compilation is using.
21124 @item
21125 Any macros defined before the precompiled header is included must
21126 either be defined in the same way as when the precompiled header was
21127 generated, or must not affect the precompiled header, which usually
21128 means that they don't appear in the precompiled header at all.
21130 The @option{-D} option is one way to define a macro before a
21131 precompiled header is included; using a @code{#define} can also do it.
21132 There are also some options that define macros implicitly, like
21133 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
21134 defined this way.
21136 @item If debugging information is output when using the precompiled
21137 header, using @option{-g} or similar, the same kind of debugging information
21138 must have been output when building the precompiled header.  However,
21139 a precompiled header built using @option{-g} can be used in a compilation
21140 when no debugging information is being output.
21142 @item The same @option{-m} options must generally be used when building
21143 and using the precompiled header.  @xref{Submodel Options},
21144 for any cases where this rule is relaxed.
21146 @item Each of the following options must be the same when building and using
21147 the precompiled header:
21149 @gccoptlist{-fexceptions}
21151 @item
21152 Some other command-line options starting with @option{-f},
21153 @option{-p}, or @option{-O} must be defined in the same way as when
21154 the precompiled header was generated.  At present, it's not clear
21155 which options are safe to change and which are not; the safest choice
21156 is to use exactly the same options when generating and using the
21157 precompiled header.  The following are known to be safe:
21159 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
21160 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
21161 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
21162 -pedantic-errors}
21164 @end itemize
21166 For all of these except the last, the compiler automatically
21167 ignores the precompiled header if the conditions aren't met.  If you
21168 find an option combination that doesn't work and doesn't cause the
21169 precompiled header to be ignored, please consider filing a bug report,
21170 see @ref{Bugs}.
21172 If you do use differing options when generating and using the
21173 precompiled header, the actual behavior is a mixture of the
21174 behavior for the options.  For instance, if you use @option{-g} to
21175 generate the precompiled header but not when using it, you may or may
21176 not get debugging information for routines in the precompiled header.