* cfgloopanal.c (get_loop_hot_path): New function.
[official-gcc.git] / gcc / doc / invoke.texi
blob73363a1a5a6c07de6333ad13a6e75b016ec1245d
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
15 2012
16 Free Software Foundation, Inc.
18 Permission is granted to copy, distribute and/or modify this document
19 under the terms of the GNU Free Documentation License, Version 1.3 or
20 any later version published by the Free Software Foundation; with the
21 Invariant Sections being ``GNU General Public License'' and ``Funding
22 Free Software'', the Front-Cover texts being (a) (see below), and with
23 the Back-Cover Texts being (b) (see below).  A copy of the license is
24 included in the gfdl(7) man page.
26 (a) The FSF's Front-Cover Text is:
28      A GNU Manual
30 (b) The FSF's Back-Cover Text is:
32      You have freedom to copy and modify this GNU Manual, like GNU
33      software.  Copies published by the Free Software Foundation raise
34      funds for GNU development.
35 @c man end
36 @c Set file name and title for the man page.
37 @setfilename gcc
38 @settitle GNU project C and C++ compiler
39 @c man begin SYNOPSIS
40 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
41     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
42     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
43     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
44     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
45     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
46     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
48 Only the most useful options are listed here; see below for the
49 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
50 @c man end
51 @c man begin SEEALSO
52 gpl(7), gfdl(7), fsf-funding(7),
53 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
54 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
55 @file{ld}, @file{binutils} and @file{gdb}.
56 @c man end
57 @c man begin BUGS
58 For instructions on reporting bugs, see
59 @w{@value{BUGURL}}.
60 @c man end
61 @c man begin AUTHOR
62 See the Info entry for @command{gcc}, or
63 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
64 for contributors to GCC@.
65 @c man end
66 @end ignore
68 @node Invoking GCC
69 @chapter GCC Command Options
70 @cindex GCC command options
71 @cindex command options
72 @cindex options, GCC command
74 @c man begin DESCRIPTION
75 When you invoke GCC, it normally does preprocessing, compilation,
76 assembly and linking.  The ``overall options'' allow you to stop this
77 process at an intermediate stage.  For example, the @option{-c} option
78 says not to run the linker.  Then the output consists of object files
79 output by the assembler.
81 Other options are passed on to one stage of processing.  Some options
82 control the preprocessor and others the compiler itself.  Yet other
83 options control the assembler and linker; most of these are not
84 documented here, since you rarely need to use any of them.
86 @cindex C compilation options
87 Most of the command-line options that you can use with GCC are useful
88 for C programs; when an option is only useful with another language
89 (usually C++), the explanation says so explicitly.  If the description
90 for a particular option does not mention a source language, you can use
91 that option with all supported languages.
93 @cindex C++ compilation options
94 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
95 options for compiling C++ programs.
97 @cindex grouping options
98 @cindex options, grouping
99 The @command{gcc} program accepts options and file names as operands.  Many
100 options have multi-letter names; therefore multiple single-letter options
101 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
102 -v}}.
104 @cindex order of options
105 @cindex options, order
106 You can mix options and other arguments.  For the most part, the order
107 you use doesn't matter.  Order does matter when you use several
108 options of the same kind; for example, if you specify @option{-L} more
109 than once, the directories are searched in the order specified.  Also,
110 the placement of the @option{-l} option is significant.
112 Many options have long names starting with @samp{-f} or with
113 @samp{-W}---for example,
114 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
115 these have both positive and negative forms; the negative form of
116 @option{-ffoo} is @option{-fno-foo}.  This manual documents
117 only one of these two forms, whichever one is not the default.
119 @c man end
121 @xref{Option Index}, for an index to GCC's options.
123 @menu
124 * Option Summary::      Brief list of all options, without explanations.
125 * Overall Options::     Controlling the kind of output:
126                         an executable, object files, assembler files,
127                         or preprocessed source.
128 * Invoking G++::        Compiling C++ programs.
129 * C Dialect Options::   Controlling the variant of C language compiled.
130 * C++ Dialect Options:: Variations on C++.
131 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
132                         and Objective-C++.
133 * Language Independent Options:: Controlling how diagnostics should be
134                         formatted.
135 * Warning Options::     How picky should the compiler be?
136 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
137 * Optimize Options::    How much optimization?
138 * Preprocessor Options:: Controlling header files and macro definitions.
139                          Also, getting dependency information for Make.
140 * Assembler Options::   Passing options to the assembler.
141 * Link Options::        Specifying libraries and so on.
142 * Directory Options::   Where to find header files and libraries.
143                         Where to find the compiler executable files.
144 * Spec Files::          How to pass switches to sub-processes.
145 * Target Options::      Running a cross-compiler, or an old version of GCC.
146 * Submodel Options::    Specifying minor hardware or convention variations,
147                         such as 68010 vs 68020.
148 * Code Gen Options::    Specifying conventions for function calls, data layout
149                         and register usage.
150 * Environment Variables:: Env vars that affect GCC.
151 * Precompiled Headers:: Compiling a header once, and using it many times.
152 @end menu
154 @c man begin OPTIONS
156 @node Option Summary
157 @section Option Summary
159 Here is a summary of all the options, grouped by type.  Explanations are
160 in the following sections.
162 @table @emph
163 @item Overall Options
164 @xref{Overall Options,,Options Controlling the Kind of Output}.
165 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
166 -pipe  -pass-exit-codes  @gol
167 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
168 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
169 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{arg} -fdump-go-spec=@var{file}}
171 @item C Language Options
172 @xref{C Dialect Options,,Options Controlling C Dialect}.
173 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
174 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
175 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
176 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
177 -trigraphs  -traditional  -traditional-cpp @gol
178 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
179 -fsigned-bitfields  -fsigned-char @gol
180 -funsigned-bitfields  -funsigned-char}
182 @item C++ Language Options
183 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
184 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
185 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
186 -fno-elide-constructors @gol
187 -fno-enforce-eh-specs @gol
188 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
189 -fno-implicit-templates @gol
190 -fno-implicit-inline-templates @gol
191 -fno-implement-inlines  -fms-extensions @gol
192 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
193 -fno-optional-diags  -fpermissive @gol
194 -fno-pretty-templates @gol
195 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
196 -ftemplate-depth=@var{n} @gol
197 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
198 -fno-default-inline  -fvisibility-inlines-hidden @gol
199 -fvisibility-ms-compat @gol
200 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
201 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
202 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
203 -Weffc++  -Wstrict-null-sentinel @gol
204 -Wno-non-template-friend  -Wold-style-cast @gol
205 -Woverloaded-virtual  -Wno-pmf-conversions @gol
206 -Wsign-promo}
208 @item Objective-C and Objective-C++ Language Options
209 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
210 Objective-C and Objective-C++ Dialects}.
211 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
212 -fgnu-runtime  -fnext-runtime @gol
213 -fno-nil-receivers @gol
214 -fobjc-abi-version=@var{n} @gol
215 -fobjc-call-cxx-cdtors @gol
216 -fobjc-direct-dispatch @gol
217 -fobjc-exceptions @gol
218 -fobjc-gc @gol
219 -fobjc-nilcheck @gol
220 -fobjc-std=objc1 @gol
221 -freplace-objc-classes @gol
222 -fzero-link @gol
223 -gen-decls @gol
224 -Wassign-intercept @gol
225 -Wno-protocol  -Wselector @gol
226 -Wstrict-selector-match @gol
227 -Wundeclared-selector}
229 @item Language Independent Options
230 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
231 @gccoptlist{-fmessage-length=@var{n}  @gol
232 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
233 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
235 @item Warning Options
236 @xref{Warning Options,,Options to Request or Suppress Warnings}.
237 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
238 -pedantic-errors @gol
239 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
240 -Wno-attributes -Wno-builtin-macro-redefined @gol
241 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
242 -Wchar-subscripts -Wclobbered  -Wcomment @gol
243 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
244 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
245 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
246 -Wno-endif-labels -Werror  -Werror=* @gol
247 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
248 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
249 -Wformat-security  -Wformat-y2k @gol
250 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
251 -Wignored-qualifiers @gol
252 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
253 -Winit-self  -Winline -Wmaybe-uninitialized @gol
254 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
255 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
256 -Wlogical-op -Wlong-long @gol
257 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
258 -Wmissing-include-dirs @gol
259 -Wno-mudflap @gol
260 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
261 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
262 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
263 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
264 -Wredundant-decls  -Wno-return-local-addr @gol
265 -Wreturn-type  -Wsequence-point  -Wshadow @gol
266 -Wsign-compare  -Wsign-conversion  -Wsizeof-pointer-memaccess @gol
267 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
268 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
269 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
270 -Wmissing-format-attribute @gol
271 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
272 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
273 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
274 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
275 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
276 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
277 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
278 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
279 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
281 @item C and Objective-C-only Warning Options
282 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
283 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
284 -Wold-style-declaration  -Wold-style-definition @gol
285 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
286 -Wdeclaration-after-statement -Wpointer-sign}
288 @item Debugging Options
289 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
290 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
291 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
292 -fdisable-ipa-@var{pass_name} @gol
293 -fdisable-rtl-@var{pass_name} @gol
294 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
295 -fdisable-tree-@var{pass_name} @gol
296 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
297 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
298 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
299 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
300 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
301 -fdump-passes @gol
302 -fdump-statistics @gol
303 -fdump-tree-all @gol
304 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
305 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
306 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
307 -fdump-tree-ch @gol
308 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-nrv -fdump-tree-vect @gol
318 -fdump-tree-sink @gol
319 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
323 -ftree-vectorizer-verbose=@var{n} @gol
324 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
325 -fdump-final-insns=@var{file} @gol
326 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
327 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
328 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
329 -fenable-@var{kind}-@var{pass} @gol
330 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
331 -fdebug-types-section -fmem-report-wpa @gol
332 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
333 -fopt-info @gol
334 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
335 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
336 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
337 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
338 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
339 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
340 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
341 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
342 -gvms  -gxcoff  -gxcoff+ @gol
343 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
344 -fdebug-prefix-map=@var{old}=@var{new} @gol
345 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
346 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
347 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
348 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
349 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
350 -print-sysroot -print-sysroot-headers-suffix @gol
351 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
353 @item Optimization Options
354 @xref{Optimize Options,,Options that Control Optimization}.
355 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
356 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
357 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
358 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
359 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
360 -fcompare-elim -fcprop-registers -fcrossjumping @gol
361 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
362 -fcx-limited-range @gol
363 -fdata-sections -fdce -fdelayed-branch @gol
364 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
365 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
366 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
367 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
368 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
369 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
370 -fif-conversion2 -findirect-inlining @gol
371 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
372 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
373 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
374 -fira-algorithm=@var{algorithm} @gol
375 -fira-region=@var{region} -fira-hoist-pressure @gol
376 -fira-loop-pressure -fno-ira-share-save-slots @gol
377 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
378 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
379 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
380 -floop-parallelize-all -flto -flto-compression-level @gol
381 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
382 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
383 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
384 -fno-default-inline @gol
385 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
386 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
387 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
388 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
389 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
390 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
391 -fprefetch-loop-arrays -fprofile-report @gol
392 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
393 -fprofile-generate=@var{path} @gol
394 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
395 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
396 -freorder-blocks-and-partition -freorder-functions @gol
397 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
398 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
399 -fsched-spec-load -fsched-spec-load-dangerous @gol
400 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
401 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
402 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
403 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
404 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
405 -fselective-scheduling -fselective-scheduling2 @gol
406 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
407 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
408 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
409 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
410 -fthread-jumps -ftracer -ftree-bit-ccp @gol
411 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
412 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
413 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
414 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
415 -ftree-loop-if-convert-stores -ftree-loop-im @gol
416 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
417 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
418 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
419 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
420 -ftree-switch-conversion -ftree-tail-merge @gol
421 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
422 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
423 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
424 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
425 -fwhole-program -fwpa -fuse-linker-plugin @gol
426 --param @var{name}=@var{value}
427 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
429 @item Preprocessor Options
430 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
431 @gccoptlist{-A@var{question}=@var{answer} @gol
432 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
433 -C  -dD  -dI  -dM  -dN @gol
434 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
435 -idirafter @var{dir} @gol
436 -include @var{file}  -imacros @var{file} @gol
437 -iprefix @var{file}  -iwithprefix @var{dir} @gol
438 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
439 -imultilib @var{dir} -isysroot @var{dir} @gol
440 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
441 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
442 -remap -trigraphs  -undef  -U@var{macro}  @gol
443 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
445 @item Assembler Option
446 @xref{Assembler Options,,Passing Options to the Assembler}.
447 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
449 @item Linker Options
450 @xref{Link Options,,Options for Linking}.
451 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
452 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
453 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
454 -shared-libgcc  -symbolic @gol
455 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
456 -u @var{symbol}}
458 @item Directory Options
459 @xref{Directory Options,,Options for Directory Search}.
460 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
461 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
462 --sysroot=@var{dir} --no-sysroot-suffix}
464 @item Machine Dependent Options
465 @xref{Submodel Options,,Hardware Models and Configurations}.
466 @c This list is ordered alphanumerically by subsection name.
467 @c Try and put the significant identifier (CPU or system) first,
468 @c so users have a clue at guessing where the ones they want will be.
470 @emph{AArch64 Options}
471 @gccoptlist{-mbig-endian  -mlittle-endian @gol
472 -mgeneral-regs-only @gol
473 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
474 -mstrict-align @gol
475 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
476 -mtls-dialect=desc  -mtls-dialect=traditional @gol
477 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
479 @emph{Adapteva Epiphany Options}
480 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
481 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
482 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
483 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
484 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
485 -msplit-vecmove-early -m1reg-@var{reg}}
487 @emph{ARM Options}
488 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
489 -mabi=@var{name} @gol
490 -mapcs-stack-check  -mno-apcs-stack-check @gol
491 -mapcs-float  -mno-apcs-float @gol
492 -mapcs-reentrant  -mno-apcs-reentrant @gol
493 -msched-prolog  -mno-sched-prolog @gol
494 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
495 -mfloat-abi=@var{name} @gol
496 -mfp16-format=@var{name}
497 -mthumb-interwork  -mno-thumb-interwork @gol
498 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
499 -mstructure-size-boundary=@var{n} @gol
500 -mabort-on-noreturn @gol
501 -mlong-calls  -mno-long-calls @gol
502 -msingle-pic-base  -mno-single-pic-base @gol
503 -mpic-register=@var{reg} @gol
504 -mnop-fun-dllimport @gol
505 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
506 -mpoke-function-name @gol
507 -mthumb  -marm @gol
508 -mtpcs-frame  -mtpcs-leaf-frame @gol
509 -mcaller-super-interworking  -mcallee-super-interworking @gol
510 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
511 -mword-relocations @gol
512 -mfix-cortex-m3-ldrd @gol
513 -munaligned-access}
515 @emph{AVR Options}
516 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
517 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
518 -mstrict-X -mtiny-stack}
520 @emph{Blackfin Options}
521 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
522 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
523 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
524 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
525 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
526 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
527 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
528 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
529 -micplb}
531 @emph{C6X Options}
532 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
533 -msim -msdata=@var{sdata-type}}
535 @emph{CRIS Options}
536 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
537 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
538 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
539 -mstack-align  -mdata-align  -mconst-align @gol
540 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
541 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
542 -mmul-bug-workaround  -mno-mul-bug-workaround}
544 @emph{CR16 Options}
545 @gccoptlist{-mmac @gol
546 -mcr16cplus -mcr16c @gol
547 -msim -mint32 -mbit-ops
548 -mdata-model=@var{model}}
550 @emph{Darwin Options}
551 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
552 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
553 -client_name  -compatibility_version  -current_version @gol
554 -dead_strip @gol
555 -dependency-file  -dylib_file  -dylinker_install_name @gol
556 -dynamic  -dynamiclib  -exported_symbols_list @gol
557 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
558 -force_flat_namespace  -headerpad_max_install_names @gol
559 -iframework @gol
560 -image_base  -init  -install_name  -keep_private_externs @gol
561 -multi_module  -multiply_defined  -multiply_defined_unused @gol
562 -noall_load   -no_dead_strip_inits_and_terms @gol
563 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
564 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
565 -private_bundle  -read_only_relocs  -sectalign @gol
566 -sectobjectsymbols  -whyload  -seg1addr @gol
567 -sectcreate  -sectobjectsymbols  -sectorder @gol
568 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
569 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
570 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
571 -single_module  -static  -sub_library  -sub_umbrella @gol
572 -twolevel_namespace  -umbrella  -undefined @gol
573 -unexported_symbols_list  -weak_reference_mismatches @gol
574 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
575 -mkernel -mone-byte-bool}
577 @emph{DEC Alpha Options}
578 @gccoptlist{-mno-fp-regs  -msoft-float @gol
579 -mieee  -mieee-with-inexact  -mieee-conformant @gol
580 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
581 -mtrap-precision=@var{mode}  -mbuild-constants @gol
582 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
583 -mbwx  -mmax  -mfix  -mcix @gol
584 -mfloat-vax  -mfloat-ieee @gol
585 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
586 -msmall-text  -mlarge-text @gol
587 -mmemory-latency=@var{time}}
589 @emph{FR30 Options}
590 @gccoptlist{-msmall-model -mno-lsim}
592 @emph{FRV Options}
593 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
594 -mhard-float  -msoft-float @gol
595 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
596 -mdouble  -mno-double @gol
597 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
598 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
599 -mlinked-fp  -mlong-calls  -malign-labels @gol
600 -mlibrary-pic  -macc-4  -macc-8 @gol
601 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
602 -moptimize-membar -mno-optimize-membar @gol
603 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
604 -mvliw-branch  -mno-vliw-branch @gol
605 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
606 -mno-nested-cond-exec  -mtomcat-stats @gol
607 -mTLS -mtls @gol
608 -mcpu=@var{cpu}}
610 @emph{GNU/Linux Options}
611 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
612 -tno-android-cc -tno-android-ld}
614 @emph{H8/300 Options}
615 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
617 @emph{HPPA Options}
618 @gccoptlist{-march=@var{architecture-type} @gol
619 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
620 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
621 -mfixed-range=@var{register-range} @gol
622 -mjump-in-delay -mlinker-opt -mlong-calls @gol
623 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
624 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
625 -mno-jump-in-delay  -mno-long-load-store @gol
626 -mno-portable-runtime  -mno-soft-float @gol
627 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
628 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
629 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
630 -munix=@var{unix-std}  -nolibdld  -static  -threads}
632 @emph{i386 and x86-64 Options}
633 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
634 -mfpmath=@var{unit} @gol
635 -masm=@var{dialect}  -mno-fancy-math-387 @gol
636 -mno-fp-ret-in-387  -msoft-float @gol
637 -mno-wide-multiply  -mrtd  -malign-double @gol
638 -mpreferred-stack-boundary=@var{num} @gol
639 -mincoming-stack-boundary=@var{num} @gol
640 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
641 -mrecip -mrecip=@var{opt} @gol
642 -mvzeroupper -mprefer-avx128 @gol
643 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
644 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
645 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
646 -mbmi2 -mrtm -mlwp -mthreads @gol
647 -mno-align-stringops  -minline-all-stringops @gol
648 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
649 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
650 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
651 -mregparm=@var{num}  -msseregparm @gol
652 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
653 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
654 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
655 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
656 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
657 -msse2avx -mfentry -m8bit-idiv @gol
658 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
660 @emph{i386 and x86-64 Windows Options}
661 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
662 -mnop-fun-dllimport -mthread @gol
663 -municode -mwin32 -mwindows -fno-set-stack-executable}
665 @emph{IA-64 Options}
666 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
667 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
668 -mconstant-gp  -mauto-pic  -mfused-madd @gol
669 -minline-float-divide-min-latency @gol
670 -minline-float-divide-max-throughput @gol
671 -mno-inline-float-divide @gol
672 -minline-int-divide-min-latency @gol
673 -minline-int-divide-max-throughput  @gol
674 -mno-inline-int-divide @gol
675 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
676 -mno-inline-sqrt @gol
677 -mdwarf2-asm -mearly-stop-bits @gol
678 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
679 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
680 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
681 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
682 -msched-spec-ldc -msched-spec-control-ldc @gol
683 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
684 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
685 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
686 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
688 @emph{LM32 Options}
689 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
690 -msign-extend-enabled -muser-enabled}
692 @emph{M32R/D Options}
693 @gccoptlist{-m32r2 -m32rx -m32r @gol
694 -mdebug @gol
695 -malign-loops -mno-align-loops @gol
696 -missue-rate=@var{number} @gol
697 -mbranch-cost=@var{number} @gol
698 -mmodel=@var{code-size-model-type} @gol
699 -msdata=@var{sdata-type} @gol
700 -mno-flush-func -mflush-func=@var{name} @gol
701 -mno-flush-trap -mflush-trap=@var{number} @gol
702 -G @var{num}}
704 @emph{M32C Options}
705 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
707 @emph{M680x0 Options}
708 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
709 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
710 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
711 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
712 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
713 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
714 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
715 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
716 -mxgot -mno-xgot}
718 @emph{MCore Options}
719 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
720 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
721 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
722 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
723 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
725 @emph{MeP Options}
726 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
727 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
728 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
729 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
730 -mtiny=@var{n}}
732 @emph{MicroBlaze Options}
733 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
734 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
735 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
736 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
737 -mxl-mode-@var{app-model}}
739 @emph{MIPS Options}
740 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
741 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
742 -mips64  -mips64r2 @gol
743 -mips16  -mno-mips16  -mflip-mips16 @gol
744 -minterlink-mips16  -mno-interlink-mips16 @gol
745 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
746 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
747 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
748 -mno-float -msingle-float  -mdouble-float  @gol
749 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
750 -mmcu -mmno-mcu @gol
751 -mfpu=@var{fpu-type} @gol
752 -msmartmips  -mno-smartmips @gol
753 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
754 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
755 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
756 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
757 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
758 -membedded-data  -mno-embedded-data @gol
759 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
760 -mcode-readable=@var{setting} @gol
761 -msplit-addresses  -mno-split-addresses @gol
762 -mexplicit-relocs  -mno-explicit-relocs @gol
763 -mcheck-zero-division  -mno-check-zero-division @gol
764 -mdivide-traps  -mdivide-breaks @gol
765 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
766 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
767 -mfix-24k -mno-fix-24k @gol
768 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
769 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
770 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
771 -mflush-func=@var{func}  -mno-flush-func @gol
772 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
773 -mfp-exceptions -mno-fp-exceptions @gol
774 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
775 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
777 @emph{MMIX Options}
778 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
779 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
780 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
781 -mno-base-addresses  -msingle-exit  -mno-single-exit}
783 @emph{MN10300 Options}
784 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
785 -mno-am33 -mam33 -mam33-2 -mam34 @gol
786 -mtune=@var{cpu-type} @gol
787 -mreturn-pointer-on-d0 @gol
788 -mno-crt0  -mrelax -mliw -msetlb}
790 @emph{Moxie Options}
791 @gccoptlist{-meb -mel -mno-crt0}
793 @emph{PDP-11 Options}
794 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
795 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
796 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
797 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
798 -mbranch-expensive  -mbranch-cheap @gol
799 -munix-asm  -mdec-asm}
801 @emph{picoChip Options}
802 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
803 -msymbol-as-address -mno-inefficient-warnings}
805 @emph{PowerPC Options}
806 See RS/6000 and PowerPC Options.
808 @emph{RL78 Options}
809 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
811 @emph{RS/6000 and PowerPC Options}
812 @gccoptlist{-mcpu=@var{cpu-type} @gol
813 -mtune=@var{cpu-type} @gol
814 -mcmodel=@var{code-model} @gol
815 -mpowerpc64 @gol
816 -maltivec  -mno-altivec @gol
817 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
818 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
819 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
820 -mfprnd  -mno-fprnd @gol
821 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
822 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
823 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
824 -malign-power  -malign-natural @gol
825 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
826 -msingle-float -mdouble-float -msimple-fpu @gol
827 -mstring  -mno-string  -mupdate  -mno-update @gol
828 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
829 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
830 -mstrict-align  -mno-strict-align  -mrelocatable @gol
831 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
832 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
833 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
834 -mprioritize-restricted-insns=@var{priority} @gol
835 -msched-costly-dep=@var{dependence_type} @gol
836 -minsert-sched-nops=@var{scheme} @gol
837 -mcall-sysv  -mcall-netbsd @gol
838 -maix-struct-return  -msvr4-struct-return @gol
839 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
840 -mblock-move-inline-limit=@var{num} @gol
841 -misel -mno-isel @gol
842 -misel=yes  -misel=no @gol
843 -mspe -mno-spe @gol
844 -mspe=yes  -mspe=no @gol
845 -mpaired @gol
846 -mgen-cell-microcode -mwarn-cell-microcode @gol
847 -mvrsave -mno-vrsave @gol
848 -mmulhw -mno-mulhw @gol
849 -mdlmzb -mno-dlmzb @gol
850 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
851 -mprototype  -mno-prototype @gol
852 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
853 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
854 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
855 -mno-recip-precision @gol
856 -mveclibabi=@var{type} -mfriz -mno-friz @gol
857 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
858 -msave-toc-indirect -mno-save-toc-indirect}
860 @emph{RX Options}
861 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
862 -mcpu=@gol
863 -mbig-endian-data -mlittle-endian-data @gol
864 -msmall-data @gol
865 -msim  -mno-sim@gol
866 -mas100-syntax -mno-as100-syntax@gol
867 -mrelax@gol
868 -mmax-constant-size=@gol
869 -mint-register=@gol
870 -mpid@gol
871 -mno-warn-multiple-fast-interrupts@gol
872 -msave-acc-in-interrupts}
874 @emph{S/390 and zSeries Options}
875 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
876 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
877 -mlong-double-64 -mlong-double-128 @gol
878 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
879 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
880 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
881 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
882 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
884 @emph{Score Options}
885 @gccoptlist{-meb -mel @gol
886 -mnhwloop @gol
887 -muls @gol
888 -mmac @gol
889 -mscore5 -mscore5u -mscore7 -mscore7d}
891 @emph{SH Options}
892 @gccoptlist{-m1  -m2  -m2e @gol
893 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
894 -m3  -m3e @gol
895 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
896 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
897 -m5-64media  -m5-64media-nofpu @gol
898 -m5-32media  -m5-32media-nofpu @gol
899 -m5-compact  -m5-compact-nofpu @gol
900 -mb  -ml  -mdalign  -mrelax @gol
901 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
902 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
903 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
904 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
905 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
906 -maccumulate-outgoing-args -minvalid-symbols @gol
907 -matomic-model=@var{atomic-model} @gol
908 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
909 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
910 -mpretend-cmove -mtas}
912 @emph{Solaris 2 Options}
913 @gccoptlist{-mimpure-text  -mno-impure-text @gol
914 -pthreads -pthread}
916 @emph{SPARC Options}
917 @gccoptlist{-mcpu=@var{cpu-type} @gol
918 -mtune=@var{cpu-type} @gol
919 -mcmodel=@var{code-model} @gol
920 -mmemory-model=@var{mem-model} @gol
921 -m32  -m64  -mapp-regs  -mno-app-regs @gol
922 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
923 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
924 -mhard-quad-float  -msoft-quad-float @gol
925 -mlittle-endian @gol
926 -mstack-bias  -mno-stack-bias @gol
927 -munaligned-doubles  -mno-unaligned-doubles @gol
928 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
929 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
930 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
931 -mfix-at697f}
933 @emph{SPU Options}
934 @gccoptlist{-mwarn-reloc -merror-reloc @gol
935 -msafe-dma -munsafe-dma @gol
936 -mbranch-hints @gol
937 -msmall-mem -mlarge-mem -mstdmain @gol
938 -mfixed-range=@var{register-range} @gol
939 -mea32 -mea64 @gol
940 -maddress-space-conversion -mno-address-space-conversion @gol
941 -mcache-size=@var{cache-size} @gol
942 -matomic-updates -mno-atomic-updates}
944 @emph{System V Options}
945 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
947 @emph{TILE-Gx Options}
948 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
950 @emph{TILEPro Options}
951 @gccoptlist{-mcpu=@var{cpu} -m32}
953 @emph{V850 Options}
954 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
955 -mprolog-function  -mno-prolog-function  -mspace @gol
956 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
957 -mapp-regs  -mno-app-regs @gol
958 -mdisable-callt  -mno-disable-callt @gol
959 -mv850e2v3 @gol
960 -mv850e2 @gol
961 -mv850e1 -mv850es @gol
962 -mv850e @gol
963 -mv850  -mbig-switch}
965 @emph{VAX Options}
966 @gccoptlist{-mg  -mgnu  -munix}
968 @emph{VMS Options}
969 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
970 -mpointer-size=@var{size}}
972 @emph{VxWorks Options}
973 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
974 -Xbind-lazy  -Xbind-now}
976 @emph{x86-64 Options}
977 See i386 and x86-64 Options.
979 @emph{Xstormy16 Options}
980 @gccoptlist{-msim}
982 @emph{Xtensa Options}
983 @gccoptlist{-mconst16 -mno-const16 @gol
984 -mfused-madd  -mno-fused-madd @gol
985 -mforce-no-pic @gol
986 -mserialize-volatile  -mno-serialize-volatile @gol
987 -mtext-section-literals  -mno-text-section-literals @gol
988 -mtarget-align  -mno-target-align @gol
989 -mlongcalls  -mno-longcalls}
991 @emph{zSeries Options}
992 See S/390 and zSeries Options.
994 @item Code Generation Options
995 @xref{Code Gen Options,,Options for Code Generation Conventions}.
996 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
997 -ffixed-@var{reg}  -fexceptions @gol
998 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
999 -fasynchronous-unwind-tables @gol
1000 -finhibit-size-directive  -finstrument-functions @gol
1001 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1002 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1003 -fno-common  -fno-ident @gol
1004 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1005 -fno-jump-tables @gol
1006 -frecord-gcc-switches @gol
1007 -freg-struct-return  -fshort-enums @gol
1008 -fshort-double  -fshort-wchar @gol
1009 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1010 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1011 -fno-stack-limit -fsplit-stack @gol
1012 -fleading-underscore  -ftls-model=@var{model} @gol
1013 -fstack-reuse=@var{reuse_level} @gol
1014 -ftrapv  -fwrapv  -fbounds-check @gol
1015 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1016 @end table
1018 @menu
1019 * Overall Options::     Controlling the kind of output:
1020                         an executable, object files, assembler files,
1021                         or preprocessed source.
1022 * C Dialect Options::   Controlling the variant of C language compiled.
1023 * C++ Dialect Options:: Variations on C++.
1024 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1025                         and Objective-C++.
1026 * Language Independent Options:: Controlling how diagnostics should be
1027                         formatted.
1028 * Warning Options::     How picky should the compiler be?
1029 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1030 * Optimize Options::    How much optimization?
1031 * Preprocessor Options:: Controlling header files and macro definitions.
1032                          Also, getting dependency information for Make.
1033 * Assembler Options::   Passing options to the assembler.
1034 * Link Options::        Specifying libraries and so on.
1035 * Directory Options::   Where to find header files and libraries.
1036                         Where to find the compiler executable files.
1037 * Spec Files::          How to pass switches to sub-processes.
1038 * Target Options::      Running a cross-compiler, or an old version of GCC.
1039 @end menu
1041 @node Overall Options
1042 @section Options Controlling the Kind of Output
1044 Compilation can involve up to four stages: preprocessing, compilation
1045 proper, assembly and linking, always in that order.  GCC is capable of
1046 preprocessing and compiling several files either into several
1047 assembler input files, or into one assembler input file; then each
1048 assembler input file produces an object file, and linking combines all
1049 the object files (those newly compiled, and those specified as input)
1050 into an executable file.
1052 @cindex file name suffix
1053 For any given input file, the file name suffix determines what kind of
1054 compilation is done:
1056 @table @gcctabopt
1057 @item @var{file}.c
1058 C source code that must be preprocessed.
1060 @item @var{file}.i
1061 C source code that should not be preprocessed.
1063 @item @var{file}.ii
1064 C++ source code that should not be preprocessed.
1066 @item @var{file}.m
1067 Objective-C source code.  Note that you must link with the @file{libobjc}
1068 library to make an Objective-C program work.
1070 @item @var{file}.mi
1071 Objective-C source code that should not be preprocessed.
1073 @item @var{file}.mm
1074 @itemx @var{file}.M
1075 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1076 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1077 to a literal capital M@.
1079 @item @var{file}.mii
1080 Objective-C++ source code that should not be preprocessed.
1082 @item @var{file}.h
1083 C, C++, Objective-C or Objective-C++ header file to be turned into a
1084 precompiled header (default), or C, C++ header file to be turned into an
1085 Ada spec (via the @option{-fdump-ada-spec} switch).
1087 @item @var{file}.cc
1088 @itemx @var{file}.cp
1089 @itemx @var{file}.cxx
1090 @itemx @var{file}.cpp
1091 @itemx @var{file}.CPP
1092 @itemx @var{file}.c++
1093 @itemx @var{file}.C
1094 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1095 the last two letters must both be literally @samp{x}.  Likewise,
1096 @samp{.C} refers to a literal capital C@.
1098 @item @var{file}.mm
1099 @itemx @var{file}.M
1100 Objective-C++ source code that must be preprocessed.
1102 @item @var{file}.mii
1103 Objective-C++ source code that should not be preprocessed.
1105 @item @var{file}.hh
1106 @itemx @var{file}.H
1107 @itemx @var{file}.hp
1108 @itemx @var{file}.hxx
1109 @itemx @var{file}.hpp
1110 @itemx @var{file}.HPP
1111 @itemx @var{file}.h++
1112 @itemx @var{file}.tcc
1113 C++ header file to be turned into a precompiled header or Ada spec.
1115 @item @var{file}.f
1116 @itemx @var{file}.for
1117 @itemx @var{file}.ftn
1118 Fixed form Fortran source code that should not be preprocessed.
1120 @item @var{file}.F
1121 @itemx @var{file}.FOR
1122 @itemx @var{file}.fpp
1123 @itemx @var{file}.FPP
1124 @itemx @var{file}.FTN
1125 Fixed form Fortran source code that must be preprocessed (with the traditional
1126 preprocessor).
1128 @item @var{file}.f90
1129 @itemx @var{file}.f95
1130 @itemx @var{file}.f03
1131 @itemx @var{file}.f08
1132 Free form Fortran source code that should not be preprocessed.
1134 @item @var{file}.F90
1135 @itemx @var{file}.F95
1136 @itemx @var{file}.F03
1137 @itemx @var{file}.F08
1138 Free form Fortran source code that must be preprocessed (with the
1139 traditional preprocessor).
1141 @item @var{file}.go
1142 Go source code.
1144 @c FIXME: Descriptions of Java file types.
1145 @c @var{file}.java
1146 @c @var{file}.class
1147 @c @var{file}.zip
1148 @c @var{file}.jar
1150 @item @var{file}.ads
1151 Ada source code file that contains a library unit declaration (a
1152 declaration of a package, subprogram, or generic, or a generic
1153 instantiation), or a library unit renaming declaration (a package,
1154 generic, or subprogram renaming declaration).  Such files are also
1155 called @dfn{specs}.
1157 @item @var{file}.adb
1158 Ada source code file containing a library unit body (a subprogram or
1159 package body).  Such files are also called @dfn{bodies}.
1161 @c GCC also knows about some suffixes for languages not yet included:
1162 @c Pascal:
1163 @c @var{file}.p
1164 @c @var{file}.pas
1165 @c Ratfor:
1166 @c @var{file}.r
1168 @item @var{file}.s
1169 Assembler code.
1171 @item @var{file}.S
1172 @itemx @var{file}.sx
1173 Assembler code that must be preprocessed.
1175 @item @var{other}
1176 An object file to be fed straight into linking.
1177 Any file name with no recognized suffix is treated this way.
1178 @end table
1180 @opindex x
1181 You can specify the input language explicitly with the @option{-x} option:
1183 @table @gcctabopt
1184 @item -x @var{language}
1185 Specify explicitly the @var{language} for the following input files
1186 (rather than letting the compiler choose a default based on the file
1187 name suffix).  This option applies to all following input files until
1188 the next @option{-x} option.  Possible values for @var{language} are:
1189 @smallexample
1190 c  c-header  cpp-output
1191 c++  c++-header  c++-cpp-output
1192 objective-c  objective-c-header  objective-c-cpp-output
1193 objective-c++ objective-c++-header objective-c++-cpp-output
1194 assembler  assembler-with-cpp
1196 f77  f77-cpp-input f95  f95-cpp-input
1198 java
1199 @end smallexample
1201 @item -x none
1202 Turn off any specification of a language, so that subsequent files are
1203 handled according to their file name suffixes (as they are if @option{-x}
1204 has not been used at all).
1206 @item -pass-exit-codes
1207 @opindex pass-exit-codes
1208 Normally the @command{gcc} program exits with the code of 1 if any
1209 phase of the compiler returns a non-success return code.  If you specify
1210 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1211 the numerically highest error produced by any phase returning an error
1212 indication.  The C, C++, and Fortran front ends return 4 if an internal
1213 compiler error is encountered.
1214 @end table
1216 If you only want some of the stages of compilation, you can use
1217 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1218 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1219 @command{gcc} is to stop.  Note that some combinations (for example,
1220 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1222 @table @gcctabopt
1223 @item -c
1224 @opindex c
1225 Compile or assemble the source files, but do not link.  The linking
1226 stage simply is not done.  The ultimate output is in the form of an
1227 object file for each source file.
1229 By default, the object file name for a source file is made by replacing
1230 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1232 Unrecognized input files, not requiring compilation or assembly, are
1233 ignored.
1235 @item -S
1236 @opindex S
1237 Stop after the stage of compilation proper; do not assemble.  The output
1238 is in the form of an assembler code file for each non-assembler input
1239 file specified.
1241 By default, the assembler file name for a source file is made by
1242 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1244 Input files that don't require compilation are ignored.
1246 @item -E
1247 @opindex E
1248 Stop after the preprocessing stage; do not run the compiler proper.  The
1249 output is in the form of preprocessed source code, which is sent to the
1250 standard output.
1252 Input files that don't require preprocessing are ignored.
1254 @cindex output file option
1255 @item -o @var{file}
1256 @opindex o
1257 Place output in file @var{file}.  This applies to whatever
1258 sort of output is being produced, whether it be an executable file,
1259 an object file, an assembler file or preprocessed C code.
1261 If @option{-o} is not specified, the default is to put an executable
1262 file in @file{a.out}, the object file for
1263 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1264 assembler file in @file{@var{source}.s}, a precompiled header file in
1265 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1266 standard output.
1268 @item -v
1269 @opindex v
1270 Print (on standard error output) the commands executed to run the stages
1271 of compilation.  Also print the version number of the compiler driver
1272 program and of the preprocessor and the compiler proper.
1274 @item -###
1275 @opindex ###
1276 Like @option{-v} except the commands are not executed and arguments
1277 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1278 This is useful for shell scripts to capture the driver-generated command lines.
1280 @item -pipe
1281 @opindex pipe
1282 Use pipes rather than temporary files for communication between the
1283 various stages of compilation.  This fails to work on some systems where
1284 the assembler is unable to read from a pipe; but the GNU assembler has
1285 no trouble.
1287 @item --help
1288 @opindex help
1289 Print (on the standard output) a description of the command-line options
1290 understood by @command{gcc}.  If the @option{-v} option is also specified
1291 then @option{--help} is also passed on to the various processes
1292 invoked by @command{gcc}, so that they can display the command-line options
1293 they accept.  If the @option{-Wextra} option has also been specified
1294 (prior to the @option{--help} option), then command-line options that
1295 have no documentation associated with them are also displayed.
1297 @item --target-help
1298 @opindex target-help
1299 Print (on the standard output) a description of target-specific command-line
1300 options for each tool.  For some targets extra target-specific
1301 information may also be printed.
1303 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1304 Print (on the standard output) a description of the command-line
1305 options understood by the compiler that fit into all specified classes
1306 and qualifiers.  These are the supported classes:
1308 @table @asis
1309 @item @samp{optimizers}
1310 Display all of the optimization options supported by the
1311 compiler.
1313 @item @samp{warnings}
1314 Display all of the options controlling warning messages
1315 produced by the compiler.
1317 @item @samp{target}
1318 Display target-specific options.  Unlike the
1319 @option{--target-help} option however, target-specific options of the
1320 linker and assembler are not displayed.  This is because those
1321 tools do not currently support the extended @option{--help=} syntax.
1323 @item @samp{params}
1324 Display the values recognized by the @option{--param}
1325 option.
1327 @item @var{language}
1328 Display the options supported for @var{language}, where
1329 @var{language} is the name of one of the languages supported in this
1330 version of GCC@.
1332 @item @samp{common}
1333 Display the options that are common to all languages.
1334 @end table
1336 These are the supported qualifiers:
1338 @table @asis
1339 @item @samp{undocumented}
1340 Display only those options that are undocumented.
1342 @item @samp{joined}
1343 Display options taking an argument that appears after an equal
1344 sign in the same continuous piece of text, such as:
1345 @samp{--help=target}.
1347 @item @samp{separate}
1348 Display options taking an argument that appears as a separate word
1349 following the original option, such as: @samp{-o output-file}.
1350 @end table
1352 Thus for example to display all the undocumented target-specific
1353 switches supported by the compiler, use:
1355 @smallexample
1356 --help=target,undocumented
1357 @end smallexample
1359 The sense of a qualifier can be inverted by prefixing it with the
1360 @samp{^} character, so for example to display all binary warning
1361 options (i.e., ones that are either on or off and that do not take an
1362 argument) that have a description, use:
1364 @smallexample
1365 --help=warnings,^joined,^undocumented
1366 @end smallexample
1368 The argument to @option{--help=} should not consist solely of inverted
1369 qualifiers.
1371 Combining several classes is possible, although this usually
1372 restricts the output so much that there is nothing to display.  One
1373 case where it does work, however, is when one of the classes is
1374 @var{target}.  For example, to display all the target-specific
1375 optimization options, use:
1377 @smallexample
1378 --help=target,optimizers
1379 @end smallexample
1381 The @option{--help=} option can be repeated on the command line.  Each
1382 successive use displays its requested class of options, skipping
1383 those that have already been displayed.
1385 If the @option{-Q} option appears on the command line before the
1386 @option{--help=} option, then the descriptive text displayed by
1387 @option{--help=} is changed.  Instead of describing the displayed
1388 options, an indication is given as to whether the option is enabled,
1389 disabled or set to a specific value (assuming that the compiler
1390 knows this at the point where the @option{--help=} option is used).
1392 Here is a truncated example from the ARM port of @command{gcc}:
1394 @smallexample
1395   % gcc -Q -mabi=2 --help=target -c
1396   The following options are target specific:
1397   -mabi=                                2
1398   -mabort-on-noreturn                   [disabled]
1399   -mapcs                                [disabled]
1400 @end smallexample
1402 The output is sensitive to the effects of previous command-line
1403 options, so for example it is possible to find out which optimizations
1404 are enabled at @option{-O2} by using:
1406 @smallexample
1407 -Q -O2 --help=optimizers
1408 @end smallexample
1410 Alternatively you can discover which binary optimizations are enabled
1411 by @option{-O3} by using:
1413 @smallexample
1414 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1415 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1416 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1417 @end smallexample
1419 @item -no-canonical-prefixes
1420 @opindex no-canonical-prefixes
1421 Do not expand any symbolic links, resolve references to @samp{/../}
1422 or @samp{/./}, or make the path absolute when generating a relative
1423 prefix.
1425 @item --version
1426 @opindex version
1427 Display the version number and copyrights of the invoked GCC@.
1429 @item -wrapper
1430 @opindex wrapper
1431 Invoke all subcommands under a wrapper program.  The name of the
1432 wrapper program and its parameters are passed as a comma separated
1433 list.
1435 @smallexample
1436 gcc -c t.c -wrapper gdb,--args
1437 @end smallexample
1439 @noindent
1440 This invokes all subprograms of @command{gcc} under
1441 @samp{gdb --args}, thus the invocation of @command{cc1} is
1442 @samp{gdb --args cc1 @dots{}}.
1444 @item -fplugin=@var{name}.so
1445 Load the plugin code in file @var{name}.so, assumed to be a
1446 shared object to be dlopen'd by the compiler.  The base name of
1447 the shared object file is used to identify the plugin for the
1448 purposes of argument parsing (See
1449 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1450 Each plugin should define the callback functions specified in the
1451 Plugins API.
1453 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1454 Define an argument called @var{key} with a value of @var{value}
1455 for the plugin called @var{name}.
1457 @item -fdump-ada-spec@r{[}-slim@r{]}
1458 For C and C++ source and include files, generate corresponding Ada
1459 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1460 GNAT User's Guide}, which provides detailed documentation on this feature.
1462 @item -fdump-go-spec=@var{file}
1463 For input files in any language, generate corresponding Go
1464 declarations in @var{file}.  This generates Go @code{const},
1465 @code{type}, @code{var}, and @code{func} declarations which may be a
1466 useful way to start writing a Go interface to code written in some
1467 other language.
1469 @include @value{srcdir}/../libiberty/at-file.texi
1470 @end table
1472 @node Invoking G++
1473 @section Compiling C++ Programs
1475 @cindex suffixes for C++ source
1476 @cindex C++ source file suffixes
1477 C++ source files conventionally use one of the suffixes @samp{.C},
1478 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1479 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1480 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1481 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1482 files with these names and compiles them as C++ programs even if you
1483 call the compiler the same way as for compiling C programs (usually
1484 with the name @command{gcc}).
1486 @findex g++
1487 @findex c++
1488 However, the use of @command{gcc} does not add the C++ library.
1489 @command{g++} is a program that calls GCC and automatically specifies linking
1490 against the C++ library.  It treats @samp{.c},
1491 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1492 files unless @option{-x} is used.  This program is also useful when
1493 precompiling a C header file with a @samp{.h} extension for use in C++
1494 compilations.  On many systems, @command{g++} is also installed with
1495 the name @command{c++}.
1497 @cindex invoking @command{g++}
1498 When you compile C++ programs, you may specify many of the same
1499 command-line options that you use for compiling programs in any
1500 language; or command-line options meaningful for C and related
1501 languages; or options that are meaningful only for C++ programs.
1502 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1503 explanations of options for languages related to C@.
1504 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1505 explanations of options that are meaningful only for C++ programs.
1507 @node C Dialect Options
1508 @section Options Controlling C Dialect
1509 @cindex dialect options
1510 @cindex language dialect options
1511 @cindex options, dialect
1513 The following options control the dialect of C (or languages derived
1514 from C, such as C++, Objective-C and Objective-C++) that the compiler
1515 accepts:
1517 @table @gcctabopt
1518 @cindex ANSI support
1519 @cindex ISO support
1520 @item -ansi
1521 @opindex ansi
1522 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1523 equivalent to @option{-std=c++98}.
1525 This turns off certain features of GCC that are incompatible with ISO
1526 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1527 such as the @code{asm} and @code{typeof} keywords, and
1528 predefined macros such as @code{unix} and @code{vax} that identify the
1529 type of system you are using.  It also enables the undesirable and
1530 rarely used ISO trigraph feature.  For the C compiler,
1531 it disables recognition of C++ style @samp{//} comments as well as
1532 the @code{inline} keyword.
1534 The alternate keywords @code{__asm__}, @code{__extension__},
1535 @code{__inline__} and @code{__typeof__} continue to work despite
1536 @option{-ansi}.  You would not want to use them in an ISO C program, of
1537 course, but it is useful to put them in header files that might be included
1538 in compilations done with @option{-ansi}.  Alternate predefined macros
1539 such as @code{__unix__} and @code{__vax__} are also available, with or
1540 without @option{-ansi}.
1542 The @option{-ansi} option does not cause non-ISO programs to be
1543 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1544 addition to @option{-ansi}.  @xref{Warning Options}.
1546 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1547 option is used.  Some header files may notice this macro and refrain
1548 from declaring certain functions or defining certain macros that the
1549 ISO standard doesn't call for; this is to avoid interfering with any
1550 programs that might use these names for other things.
1552 Functions that are normally built in but do not have semantics
1553 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1554 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1555 built-in functions provided by GCC}, for details of the functions
1556 affected.
1558 @item -std=
1559 @opindex std
1560 Determine the language standard. @xref{Standards,,Language Standards
1561 Supported by GCC}, for details of these standard versions.  This option
1562 is currently only supported when compiling C or C++.
1564 The compiler can accept several base standards, such as @samp{c90} or
1565 @samp{c++98}, and GNU dialects of those standards, such as
1566 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1567 compiler accepts all programs following that standard plus those
1568 using GNU extensions that do not contradict it.  For example,
1569 @option{-std=c90} turns off certain features of GCC that are
1570 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1571 keywords, but not other GNU extensions that do not have a meaning in
1572 ISO C90, such as omitting the middle term of a @code{?:}
1573 expression. On the other hand, when a GNU dialect of a standard is
1574 specified, all features supported by the compiler are enabled, even when
1575 those features change the meaning of the base standard.  As a result, some
1576 strict-conforming programs may be rejected.  The particular standard
1577 is used by @option{-Wpedantic} to identify which features are GNU
1578 extensions given that version of the standard. For example
1579 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1580 comments, while @option{-std=gnu99 -Wpedantic} does not.
1582 A value for this option must be provided; possible values are
1584 @table @samp
1585 @item c90
1586 @itemx c89
1587 @itemx iso9899:1990
1588 Support all ISO C90 programs (certain GNU extensions that conflict
1589 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1591 @item iso9899:199409
1592 ISO C90 as modified in amendment 1.
1594 @item c99
1595 @itemx c9x
1596 @itemx iso9899:1999
1597 @itemx iso9899:199x
1598 ISO C99.  Note that this standard is not yet fully supported; see
1599 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1600 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1602 @item c11
1603 @itemx c1x
1604 @itemx iso9899:2011
1605 ISO C11, the 2011 revision of the ISO C standard.
1606 Support is incomplete and experimental.  The name @samp{c1x} is
1607 deprecated.
1609 @item gnu90
1610 @itemx gnu89
1611 GNU dialect of ISO C90 (including some C99 features). This
1612 is the default for C code.
1614 @item gnu99
1615 @itemx gnu9x
1616 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1617 this will become the default.  The name @samp{gnu9x} is deprecated.
1619 @item gnu11
1620 @itemx gnu1x
1621 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1622 name @samp{gnu1x} is deprecated.
1624 @item c++98
1625 @itemx c++03
1626 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1627 additional defect reports. Same as @option{-ansi} for C++ code.
1629 @item gnu++98
1630 @itemx gnu++03
1631 GNU dialect of @option{-std=c++98}.  This is the default for
1632 C++ code.
1634 @item c++11
1635 @itemx c++0x
1636 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1637 experimental, and may change in incompatible ways in future releases.
1638 The name @samp{c++0x} is deprecated.
1640 @item gnu++11
1641 @itemx gnu++0x
1642 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1643 experimental, and may change in incompatible ways in future releases.
1644 The name @samp{gnu++0x} is deprecated.
1646 @item c++1y
1647 The next revision of the ISO C++ standard, tentatively planned for
1648 2017.  Support is highly experimental, and will almost certainly
1649 change in incompatible ways in future releases.
1651 @item gnu++1y
1652 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1653 and will almost certainly change in incompatible ways in future
1654 releases.
1655 @end table
1657 @item -fgnu89-inline
1658 @opindex fgnu89-inline
1659 The option @option{-fgnu89-inline} tells GCC to use the traditional
1660 GNU semantics for @code{inline} functions when in C99 mode.
1661 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1662 is accepted and ignored by GCC versions 4.1.3 up to but not including
1663 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1664 C99 mode.  Using this option is roughly equivalent to adding the
1665 @code{gnu_inline} function attribute to all inline functions
1666 (@pxref{Function Attributes}).
1668 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1669 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1670 specifies the default behavior).  This option was first supported in
1671 GCC 4.3.  This option is not supported in @option{-std=c90} or
1672 @option{-std=gnu90} mode.
1674 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1675 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1676 in effect for @code{inline} functions.  @xref{Common Predefined
1677 Macros,,,cpp,The C Preprocessor}.
1679 @item -aux-info @var{filename}
1680 @opindex aux-info
1681 Output to the given filename prototyped declarations for all functions
1682 declared and/or defined in a translation unit, including those in header
1683 files.  This option is silently ignored in any language other than C@.
1685 Besides declarations, the file indicates, in comments, the origin of
1686 each declaration (source file and line), whether the declaration was
1687 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1688 @samp{O} for old, respectively, in the first character after the line
1689 number and the colon), and whether it came from a declaration or a
1690 definition (@samp{C} or @samp{F}, respectively, in the following
1691 character).  In the case of function definitions, a K&R-style list of
1692 arguments followed by their declarations is also provided, inside
1693 comments, after the declaration.
1695 @item -fallow-parameterless-variadic-functions
1696 Accept variadic functions without named parameters.
1698 Although it is possible to define such a function, this is not very
1699 useful as it is not possible to read the arguments.  This is only
1700 supported for C as this construct is allowed by C++.
1702 @item -fno-asm
1703 @opindex fno-asm
1704 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1705 keyword, so that code can use these words as identifiers.  You can use
1706 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1707 instead.  @option{-ansi} implies @option{-fno-asm}.
1709 In C++, this switch only affects the @code{typeof} keyword, since
1710 @code{asm} and @code{inline} are standard keywords.  You may want to
1711 use the @option{-fno-gnu-keywords} flag instead, which has the same
1712 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1713 switch only affects the @code{asm} and @code{typeof} keywords, since
1714 @code{inline} is a standard keyword in ISO C99.
1716 @item -fno-builtin
1717 @itemx -fno-builtin-@var{function}
1718 @opindex fno-builtin
1719 @cindex built-in functions
1720 Don't recognize built-in functions that do not begin with
1721 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1722 functions provided by GCC}, for details of the functions affected,
1723 including those which are not built-in functions when @option{-ansi} or
1724 @option{-std} options for strict ISO C conformance are used because they
1725 do not have an ISO standard meaning.
1727 GCC normally generates special code to handle certain built-in functions
1728 more efficiently; for instance, calls to @code{alloca} may become single
1729 instructions which adjust the stack directly, and calls to @code{memcpy}
1730 may become inline copy loops.  The resulting code is often both smaller
1731 and faster, but since the function calls no longer appear as such, you
1732 cannot set a breakpoint on those calls, nor can you change the behavior
1733 of the functions by linking with a different library.  In addition,
1734 when a function is recognized as a built-in function, GCC may use
1735 information about that function to warn about problems with calls to
1736 that function, or to generate more efficient code, even if the
1737 resulting code still contains calls to that function.  For example,
1738 warnings are given with @option{-Wformat} for bad calls to
1739 @code{printf} when @code{printf} is built in and @code{strlen} is
1740 known not to modify global memory.
1742 With the @option{-fno-builtin-@var{function}} option
1743 only the built-in function @var{function} is
1744 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1745 function is named that is not built-in in this version of GCC, this
1746 option is ignored.  There is no corresponding
1747 @option{-fbuiltin-@var{function}} option; if you wish to enable
1748 built-in functions selectively when using @option{-fno-builtin} or
1749 @option{-ffreestanding}, you may define macros such as:
1751 @smallexample
1752 #define abs(n)          __builtin_abs ((n))
1753 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1754 @end smallexample
1756 @item -fhosted
1757 @opindex fhosted
1758 @cindex hosted environment
1760 Assert that compilation targets a hosted environment.  This implies
1761 @option{-fbuiltin}.  A hosted environment is one in which the
1762 entire standard library is available, and in which @code{main} has a return
1763 type of @code{int}.  Examples are nearly everything except a kernel.
1764 This is equivalent to @option{-fno-freestanding}.
1766 @item -ffreestanding
1767 @opindex ffreestanding
1768 @cindex hosted environment
1770 Assert that compilation targets a freestanding environment.  This
1771 implies @option{-fno-builtin}.  A freestanding environment
1772 is one in which the standard library may not exist, and program startup may
1773 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1774 This is equivalent to @option{-fno-hosted}.
1776 @xref{Standards,,Language Standards Supported by GCC}, for details of
1777 freestanding and hosted environments.
1779 @item -fopenmp
1780 @opindex fopenmp
1781 @cindex OpenMP parallel
1782 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1783 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1784 compiler generates parallel code according to the OpenMP Application
1785 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1786 implies @option{-pthread}, and thus is only supported on targets that
1787 have support for @option{-pthread}.
1789 @item -fgnu-tm
1790 @opindex fgnu-tm
1791 When the option @option{-fgnu-tm} is specified, the compiler
1792 generates code for the Linux variant of Intel's current Transactional
1793 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1794 an experimental feature whose interface may change in future versions
1795 of GCC, as the official specification changes.  Please note that not
1796 all architectures are supported for this feature.
1798 For more information on GCC's support for transactional memory,
1799 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1800 Transactional Memory Library}.
1802 Note that the transactional memory feature is not supported with
1803 non-call exceptions (@option{-fnon-call-exceptions}).
1805 @item -fms-extensions
1806 @opindex fms-extensions
1807 Accept some non-standard constructs used in Microsoft header files.
1809 In C++ code, this allows member names in structures to be similar
1810 to previous types declarations.
1812 @smallexample
1813 typedef int UOW;
1814 struct ABC @{
1815   UOW UOW;
1817 @end smallexample
1819 Some cases of unnamed fields in structures and unions are only
1820 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1821 fields within structs/unions}, for details.
1823 @item -fplan9-extensions
1824 Accept some non-standard constructs used in Plan 9 code.
1826 This enables @option{-fms-extensions}, permits passing pointers to
1827 structures with anonymous fields to functions that expect pointers to
1828 elements of the type of the field, and permits referring to anonymous
1829 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1830 struct/union fields within structs/unions}, for details.  This is only
1831 supported for C, not C++.
1833 @item -trigraphs
1834 @opindex trigraphs
1835 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1836 options for strict ISO C conformance) implies @option{-trigraphs}.
1838 @cindex traditional C language
1839 @cindex C language, traditional
1840 @item -traditional
1841 @itemx -traditional-cpp
1842 @opindex traditional-cpp
1843 @opindex traditional
1844 Formerly, these options caused GCC to attempt to emulate a pre-standard
1845 C compiler.  They are now only supported with the @option{-E} switch.
1846 The preprocessor continues to support a pre-standard mode.  See the GNU
1847 CPP manual for details.
1849 @item -fcond-mismatch
1850 @opindex fcond-mismatch
1851 Allow conditional expressions with mismatched types in the second and
1852 third arguments.  The value of such an expression is void.  This option
1853 is not supported for C++.
1855 @item -flax-vector-conversions
1856 @opindex flax-vector-conversions
1857 Allow implicit conversions between vectors with differing numbers of
1858 elements and/or incompatible element types.  This option should not be
1859 used for new code.
1861 @item -funsigned-char
1862 @opindex funsigned-char
1863 Let the type @code{char} be unsigned, like @code{unsigned char}.
1865 Each kind of machine has a default for what @code{char} should
1866 be.  It is either like @code{unsigned char} by default or like
1867 @code{signed char} by default.
1869 Ideally, a portable program should always use @code{signed char} or
1870 @code{unsigned char} when it depends on the signedness of an object.
1871 But many programs have been written to use plain @code{char} and
1872 expect it to be signed, or expect it to be unsigned, depending on the
1873 machines they were written for.  This option, and its inverse, let you
1874 make such a program work with the opposite default.
1876 The type @code{char} is always a distinct type from each of
1877 @code{signed char} or @code{unsigned char}, even though its behavior
1878 is always just like one of those two.
1880 @item -fsigned-char
1881 @opindex fsigned-char
1882 Let the type @code{char} be signed, like @code{signed char}.
1884 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1885 the negative form of @option{-funsigned-char}.  Likewise, the option
1886 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1888 @item -fsigned-bitfields
1889 @itemx -funsigned-bitfields
1890 @itemx -fno-signed-bitfields
1891 @itemx -fno-unsigned-bitfields
1892 @opindex fsigned-bitfields
1893 @opindex funsigned-bitfields
1894 @opindex fno-signed-bitfields
1895 @opindex fno-unsigned-bitfields
1896 These options control whether a bit-field is signed or unsigned, when the
1897 declaration does not use either @code{signed} or @code{unsigned}.  By
1898 default, such a bit-field is signed, because this is consistent: the
1899 basic integer types such as @code{int} are signed types.
1900 @end table
1902 @node C++ Dialect Options
1903 @section Options Controlling C++ Dialect
1905 @cindex compiler options, C++
1906 @cindex C++ options, command-line
1907 @cindex options, C++
1908 This section describes the command-line options that are only meaningful
1909 for C++ programs.  You can also use most of the GNU compiler options
1910 regardless of what language your program is in.  For example, you
1911 might compile a file @code{firstClass.C} like this:
1913 @smallexample
1914 g++ -g -frepo -O -c firstClass.C
1915 @end smallexample
1917 @noindent
1918 In this example, only @option{-frepo} is an option meant
1919 only for C++ programs; you can use the other options with any
1920 language supported by GCC@.
1922 Here is a list of options that are @emph{only} for compiling C++ programs:
1924 @table @gcctabopt
1926 @item -fabi-version=@var{n}
1927 @opindex fabi-version
1928 Use version @var{n} of the C++ ABI@.  The default is version 2.
1930 Version 0 refers to the version conforming most closely to
1931 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1932 will change in different versions of G++ as ABI bugs are fixed.
1934 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1936 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1938 Version 3 corrects an error in mangling a constant address as a
1939 template argument.
1941 Version 4, which first appeared in G++ 4.5, implements a standard
1942 mangling for vector types.
1944 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1945 attribute const/volatile on function pointer types, decltype of a
1946 plain decl, and use of a function parameter in the declaration of
1947 another parameter.
1949 Version 6, which first appeared in G++ 4.7, corrects the promotion
1950 behavior of C++11 scoped enums and the mangling of template argument
1951 packs, const/static_cast, prefix ++ and --, and a class scope function
1952 used as a template argument.
1954 See also @option{-Wabi}.
1956 @item -fno-access-control
1957 @opindex fno-access-control
1958 Turn off all access checking.  This switch is mainly useful for working
1959 around bugs in the access control code.
1961 @item -fcheck-new
1962 @opindex fcheck-new
1963 Check that the pointer returned by @code{operator new} is non-null
1964 before attempting to modify the storage allocated.  This check is
1965 normally unnecessary because the C++ standard specifies that
1966 @code{operator new} only returns @code{0} if it is declared
1967 @samp{throw()}, in which case the compiler always checks the
1968 return value even without this option.  In all other cases, when
1969 @code{operator new} has a non-empty exception specification, memory
1970 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1971 @samp{new (nothrow)}.
1973 @item -fconstexpr-depth=@var{n}
1974 @opindex fconstexpr-depth
1975 Set the maximum nested evaluation depth for C++11 constexpr functions
1976 to @var{n}.  A limit is needed to detect endless recursion during
1977 constant expression evaluation.  The minimum specified by the standard
1978 is 512.
1980 @item -fdeduce-init-list
1981 @opindex fdeduce-init-list
1982 Enable deduction of a template type parameter as
1983 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
1985 @smallexample
1986 template <class T> auto forward(T t) -> decltype (realfn (t))
1988   return realfn (t);
1991 void f()
1993   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1995 @end smallexample
1997 This deduction was implemented as a possible extension to the
1998 originally proposed semantics for the C++11 standard, but was not part
1999 of the final standard, so it is disabled by default.  This option is
2000 deprecated, and may be removed in a future version of G++.
2002 @item -ffriend-injection
2003 @opindex ffriend-injection
2004 Inject friend functions into the enclosing namespace, so that they are
2005 visible outside the scope of the class in which they are declared.
2006 Friend functions were documented to work this way in the old Annotated
2007 C++ Reference Manual, and versions of G++ before 4.1 always worked
2008 that way.  However, in ISO C++ a friend function that is not declared
2009 in an enclosing scope can only be found using argument dependent
2010 lookup.  This option causes friends to be injected as they were in
2011 earlier releases.
2013 This option is for compatibility, and may be removed in a future
2014 release of G++.
2016 @item -fno-elide-constructors
2017 @opindex fno-elide-constructors
2018 The C++ standard allows an implementation to omit creating a temporary
2019 that is only used to initialize another object of the same type.
2020 Specifying this option disables that optimization, and forces G++ to
2021 call the copy constructor in all cases.
2023 @item -fno-enforce-eh-specs
2024 @opindex fno-enforce-eh-specs
2025 Don't generate code to check for violation of exception specifications
2026 at run time.  This option violates the C++ standard, but may be useful
2027 for reducing code size in production builds, much like defining
2028 @samp{NDEBUG}.  This does not give user code permission to throw
2029 exceptions in violation of the exception specifications; the compiler
2030 still optimizes based on the specifications, so throwing an
2031 unexpected exception results in undefined behavior at run time.
2033 @item -ffor-scope
2034 @itemx -fno-for-scope
2035 @opindex ffor-scope
2036 @opindex fno-for-scope
2037 If @option{-ffor-scope} is specified, the scope of variables declared in
2038 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2039 as specified by the C++ standard.
2040 If @option{-fno-for-scope} is specified, the scope of variables declared in
2041 a @i{for-init-statement} extends to the end of the enclosing scope,
2042 as was the case in old versions of G++, and other (traditional)
2043 implementations of C++.
2045 If neither flag is given, the default is to follow the standard,
2046 but to allow and give a warning for old-style code that would
2047 otherwise be invalid, or have different behavior.
2049 @item -fno-gnu-keywords
2050 @opindex fno-gnu-keywords
2051 Do not recognize @code{typeof} as a keyword, so that code can use this
2052 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2053 @option{-ansi} implies @option{-fno-gnu-keywords}.
2055 @item -fno-implicit-templates
2056 @opindex fno-implicit-templates
2057 Never emit code for non-inline templates that are instantiated
2058 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2059 @xref{Template Instantiation}, for more information.
2061 @item -fno-implicit-inline-templates
2062 @opindex fno-implicit-inline-templates
2063 Don't emit code for implicit instantiations of inline templates, either.
2064 The default is to handle inlines differently so that compiles with and
2065 without optimization need the same set of explicit instantiations.
2067 @item -fno-implement-inlines
2068 @opindex fno-implement-inlines
2069 To save space, do not emit out-of-line copies of inline functions
2070 controlled by @samp{#pragma implementation}.  This causes linker
2071 errors if these functions are not inlined everywhere they are called.
2073 @item -fms-extensions
2074 @opindex fms-extensions
2075 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2076 int and getting a pointer to member function via non-standard syntax.
2078 @item -fno-nonansi-builtins
2079 @opindex fno-nonansi-builtins
2080 Disable built-in declarations of functions that are not mandated by
2081 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2082 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2084 @item -fnothrow-opt
2085 @opindex fnothrow-opt
2086 Treat a @code{throw()} exception specification as if it were a
2087 @code{noexcept} specification to reduce or eliminate the text size
2088 overhead relative to a function with no exception specification.  If
2089 the function has local variables of types with non-trivial
2090 destructors, the exception specification actually makes the
2091 function smaller because the EH cleanups for those variables can be
2092 optimized away.  The semantic effect is that an exception thrown out of
2093 a function with such an exception specification results in a call
2094 to @code{terminate} rather than @code{unexpected}.
2096 @item -fno-operator-names
2097 @opindex fno-operator-names
2098 Do not treat the operator name keywords @code{and}, @code{bitand},
2099 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2100 synonyms as keywords.
2102 @item -fno-optional-diags
2103 @opindex fno-optional-diags
2104 Disable diagnostics that the standard says a compiler does not need to
2105 issue.  Currently, the only such diagnostic issued by G++ is the one for
2106 a name having multiple meanings within a class.
2108 @item -fpermissive
2109 @opindex fpermissive
2110 Downgrade some diagnostics about nonconformant code from errors to
2111 warnings.  Thus, using @option{-fpermissive} allows some
2112 nonconforming code to compile.
2114 @item -fno-pretty-templates
2115 @opindex fno-pretty-templates
2116 When an error message refers to a specialization of a function
2117 template, the compiler normally prints the signature of the
2118 template followed by the template arguments and any typedefs or
2119 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2120 rather than @code{void f(int)}) so that it's clear which template is
2121 involved.  When an error message refers to a specialization of a class
2122 template, the compiler omits any template arguments that match
2123 the default template arguments for that template.  If either of these
2124 behaviors make it harder to understand the error message rather than
2125 easier, you can use @option{-fno-pretty-templates} to disable them.
2127 @item -frepo
2128 @opindex frepo
2129 Enable automatic template instantiation at link time.  This option also
2130 implies @option{-fno-implicit-templates}.  @xref{Template
2131 Instantiation}, for more information.
2133 @item -fno-rtti
2134 @opindex fno-rtti
2135 Disable generation of information about every class with virtual
2136 functions for use by the C++ run-time type identification features
2137 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2138 of the language, you can save some space by using this flag.  Note that
2139 exception handling uses the same information, but G++ generates it as
2140 needed. The @samp{dynamic_cast} operator can still be used for casts that
2141 do not require run-time type information, i.e.@: casts to @code{void *} or to
2142 unambiguous base classes.
2144 @item -fstats
2145 @opindex fstats
2146 Emit statistics about front-end processing at the end of the compilation.
2147 This information is generally only useful to the G++ development team.
2149 @item -fstrict-enums
2150 @opindex fstrict-enums
2151 Allow the compiler to optimize using the assumption that a value of
2152 enumerated type can only be one of the values of the enumeration (as
2153 defined in the C++ standard; basically, a value that can be
2154 represented in the minimum number of bits needed to represent all the
2155 enumerators).  This assumption may not be valid if the program uses a
2156 cast to convert an arbitrary integer value to the enumerated type.
2158 @item -ftemplate-backtrace-limit=@var{n}
2159 @opindex ftemplate-backtrace-limit
2160 Set the maximum number of template instantiation notes for a single
2161 warning or error to @var{n}.  The default value is 10.
2163 @item -ftemplate-depth=@var{n}
2164 @opindex ftemplate-depth
2165 Set the maximum instantiation depth for template classes to @var{n}.
2166 A limit on the template instantiation depth is needed to detect
2167 endless recursions during template class instantiation.  ANSI/ISO C++
2168 conforming programs must not rely on a maximum depth greater than 17
2169 (changed to 1024 in C++11).  The default value is 900, as the compiler
2170 can run out of stack space before hitting 1024 in some situations.
2172 @item -fno-threadsafe-statics
2173 @opindex fno-threadsafe-statics
2174 Do not emit the extra code to use the routines specified in the C++
2175 ABI for thread-safe initialization of local statics.  You can use this
2176 option to reduce code size slightly in code that doesn't need to be
2177 thread-safe.
2179 @item -fuse-cxa-atexit
2180 @opindex fuse-cxa-atexit
2181 Register destructors for objects with static storage duration with the
2182 @code{__cxa_atexit} function rather than the @code{atexit} function.
2183 This option is required for fully standards-compliant handling of static
2184 destructors, but only works if your C library supports
2185 @code{__cxa_atexit}.
2187 @item -fno-use-cxa-get-exception-ptr
2188 @opindex fno-use-cxa-get-exception-ptr
2189 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2190 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2191 if the runtime routine is not available.
2193 @item -fvisibility-inlines-hidden
2194 @opindex fvisibility-inlines-hidden
2195 This switch declares that the user does not attempt to compare
2196 pointers to inline functions or methods where the addresses of the two functions
2197 are taken in different shared objects.
2199 The effect of this is that GCC may, effectively, mark inline methods with
2200 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2201 appear in the export table of a DSO and do not require a PLT indirection
2202 when used within the DSO@.  Enabling this option can have a dramatic effect
2203 on load and link times of a DSO as it massively reduces the size of the
2204 dynamic export table when the library makes heavy use of templates.
2206 The behavior of this switch is not quite the same as marking the
2207 methods as hidden directly, because it does not affect static variables
2208 local to the function or cause the compiler to deduce that
2209 the function is defined in only one shared object.
2211 You may mark a method as having a visibility explicitly to negate the
2212 effect of the switch for that method.  For example, if you do want to
2213 compare pointers to a particular inline method, you might mark it as
2214 having default visibility.  Marking the enclosing class with explicit
2215 visibility has no effect.
2217 Explicitly instantiated inline methods are unaffected by this option
2218 as their linkage might otherwise cross a shared library boundary.
2219 @xref{Template Instantiation}.
2221 @item -fvisibility-ms-compat
2222 @opindex fvisibility-ms-compat
2223 This flag attempts to use visibility settings to make GCC's C++
2224 linkage model compatible with that of Microsoft Visual Studio.
2226 The flag makes these changes to GCC's linkage model:
2228 @enumerate
2229 @item
2230 It sets the default visibility to @code{hidden}, like
2231 @option{-fvisibility=hidden}.
2233 @item
2234 Types, but not their members, are not hidden by default.
2236 @item
2237 The One Definition Rule is relaxed for types without explicit
2238 visibility specifications that are defined in more than one
2239 shared object: those declarations are permitted if they are
2240 permitted when this option is not used.
2241 @end enumerate
2243 In new code it is better to use @option{-fvisibility=hidden} and
2244 export those classes that are intended to be externally visible.
2245 Unfortunately it is possible for code to rely, perhaps accidentally,
2246 on the Visual Studio behavior.
2248 Among the consequences of these changes are that static data members
2249 of the same type with the same name but defined in different shared
2250 objects are different, so changing one does not change the other;
2251 and that pointers to function members defined in different shared
2252 objects may not compare equal.  When this flag is given, it is a
2253 violation of the ODR to define types with the same name differently.
2255 @item -fno-weak
2256 @opindex fno-weak
2257 Do not use weak symbol support, even if it is provided by the linker.
2258 By default, G++ uses weak symbols if they are available.  This
2259 option exists only for testing, and should not be used by end-users;
2260 it results in inferior code and has no benefits.  This option may
2261 be removed in a future release of G++.
2263 @item -nostdinc++
2264 @opindex nostdinc++
2265 Do not search for header files in the standard directories specific to
2266 C++, but do still search the other standard directories.  (This option
2267 is used when building the C++ library.)
2268 @end table
2270 In addition, these optimization, warning, and code generation options
2271 have meanings only for C++ programs:
2273 @table @gcctabopt
2274 @item -fno-default-inline
2275 @opindex fno-default-inline
2276 Do not assume @samp{inline} for functions defined inside a class scope.
2277 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2278 functions have linkage like inline functions; they just aren't
2279 inlined by default.
2281 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2282 @opindex Wabi
2283 @opindex Wno-abi
2284 Warn when G++ generates code that is probably not compatible with the
2285 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2286 all such cases, there are probably some cases that are not warned about,
2287 even though G++ is generating incompatible code.  There may also be
2288 cases where warnings are emitted even though the code that is generated
2289 is compatible.
2291 You should rewrite your code to avoid these warnings if you are
2292 concerned about the fact that code generated by G++ may not be binary
2293 compatible with code generated by other compilers.
2295 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2297 @itemize @bullet
2299 @item
2300 A template with a non-type template parameter of reference type is
2301 mangled incorrectly:
2302 @smallexample
2303 extern int N;
2304 template <int &> struct S @{@};
2305 void n (S<N>) @{2@}
2306 @end smallexample
2308 This is fixed in @option{-fabi-version=3}.
2310 @item
2311 SIMD vector types declared using @code{__attribute ((vector_size))} are
2312 mangled in a non-standard way that does not allow for overloading of
2313 functions taking vectors of different sizes.
2315 The mangling is changed in @option{-fabi-version=4}.
2316 @end itemize
2318 The known incompatibilities in @option{-fabi-version=1} include:
2320 @itemize @bullet
2322 @item
2323 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2324 pack data into the same byte as a base class.  For example:
2326 @smallexample
2327 struct A @{ virtual void f(); int f1 : 1; @};
2328 struct B : public A @{ int f2 : 1; @};
2329 @end smallexample
2331 @noindent
2332 In this case, G++ places @code{B::f2} into the same byte
2333 as @code{A::f1}; other compilers do not.  You can avoid this problem
2334 by explicitly padding @code{A} so that its size is a multiple of the
2335 byte size on your platform; that causes G++ and other compilers to
2336 lay out @code{B} identically.
2338 @item
2339 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2340 tail padding when laying out virtual bases.  For example:
2342 @smallexample
2343 struct A @{ virtual void f(); char c1; @};
2344 struct B @{ B(); char c2; @};
2345 struct C : public A, public virtual B @{@};
2346 @end smallexample
2348 @noindent
2349 In this case, G++ does not place @code{B} into the tail-padding for
2350 @code{A}; other compilers do.  You can avoid this problem by
2351 explicitly padding @code{A} so that its size is a multiple of its
2352 alignment (ignoring virtual base classes); that causes G++ and other
2353 compilers to lay out @code{C} identically.
2355 @item
2356 Incorrect handling of bit-fields with declared widths greater than that
2357 of their underlying types, when the bit-fields appear in a union.  For
2358 example:
2360 @smallexample
2361 union U @{ int i : 4096; @};
2362 @end smallexample
2364 @noindent
2365 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2366 union too small by the number of bits in an @code{int}.
2368 @item
2369 Empty classes can be placed at incorrect offsets.  For example:
2371 @smallexample
2372 struct A @{@};
2374 struct B @{
2375   A a;
2376   virtual void f ();
2379 struct C : public B, public A @{@};
2380 @end smallexample
2382 @noindent
2383 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2384 it should be placed at offset zero.  G++ mistakenly believes that the
2385 @code{A} data member of @code{B} is already at offset zero.
2387 @item
2388 Names of template functions whose types involve @code{typename} or
2389 template template parameters can be mangled incorrectly.
2391 @smallexample
2392 template <typename Q>
2393 void f(typename Q::X) @{@}
2395 template <template <typename> class Q>
2396 void f(typename Q<int>::X) @{@}
2397 @end smallexample
2399 @noindent
2400 Instantiations of these templates may be mangled incorrectly.
2402 @end itemize
2404 It also warns about psABI-related changes.  The known psABI changes at this
2405 point include:
2407 @itemize @bullet
2409 @item
2410 For SysV/x86-64, unions with @code{long double} members are 
2411 passed in memory as specified in psABI.  For example:
2413 @smallexample
2414 union U @{
2415   long double ld;
2416   int i;
2418 @end smallexample
2420 @noindent
2421 @code{union U} is always passed in memory.
2423 @end itemize
2425 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2426 @opindex Wctor-dtor-privacy
2427 @opindex Wno-ctor-dtor-privacy
2428 Warn when a class seems unusable because all the constructors or
2429 destructors in that class are private, and it has neither friends nor
2430 public static member functions.
2432 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2433 @opindex Wdelete-non-virtual-dtor
2434 @opindex Wno-delete-non-virtual-dtor
2435 Warn when @samp{delete} is used to destroy an instance of a class that
2436 has virtual functions and non-virtual destructor. It is unsafe to delete
2437 an instance of a derived class through a pointer to a base class if the
2438 base class does not have a virtual destructor.  This warning is enabled
2439 by @option{-Wall}.
2441 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2442 @opindex Wliteral-suffix
2443 @opindex Wno-literal-suffix
2444 Warn when a string or character literal is followed by a ud-suffix which does
2445 not begin with an underscore.  As a conforming extension, GCC treats such
2446 suffixes as separate preprocessing tokens in order to maintain backwards
2447 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2448 For example:
2450 @smallexample
2451 #define __STDC_FORMAT_MACROS
2452 #include <inttypes.h>
2453 #include <stdio.h>
2455 int main() @{
2456   int64_t i64 = 123;
2457   printf("My int64: %"PRId64"\n", i64);
2459 @end smallexample
2461 In this case, @code{PRId64} is treated as a separate preprocessing token.
2463 This warning is enabled by default.
2465 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2466 @opindex Wnarrowing
2467 @opindex Wno-narrowing
2468 Warn when a narrowing conversion prohibited by C++11 occurs within
2469 @samp{@{ @}}, e.g.
2471 @smallexample
2472 int i = @{ 2.2 @}; // error: narrowing from double to int
2473 @end smallexample
2475 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2477 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2478 required by the standard.  Note that this does not affect the meaning
2479 of well-formed code; narrowing conversions are still considered
2480 ill-formed in SFINAE context.
2482 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2483 @opindex Wnoexcept
2484 @opindex Wno-noexcept
2485 Warn when a noexcept-expression evaluates to false because of a call
2486 to a function that does not have a non-throwing exception
2487 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2488 the compiler to never throw an exception.
2490 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2491 @opindex Wnon-virtual-dtor
2492 @opindex Wno-non-virtual-dtor
2493 Warn when a class has virtual functions and an accessible non-virtual
2494 destructor, in which case it is possible but unsafe to delete
2495 an instance of a derived class through a pointer to the base class.
2496 This warning is also enabled if @option{-Weffc++} is specified.
2498 @item -Wreorder @r{(C++ and Objective-C++ only)}
2499 @opindex Wreorder
2500 @opindex Wno-reorder
2501 @cindex reordering, warning
2502 @cindex warning for reordering of member initializers
2503 Warn when the order of member initializers given in the code does not
2504 match the order in which they must be executed.  For instance:
2506 @smallexample
2507 struct A @{
2508   int i;
2509   int j;
2510   A(): j (0), i (1) @{ @}
2512 @end smallexample
2514 @noindent
2515 The compiler rearranges the member initializers for @samp{i}
2516 and @samp{j} to match the declaration order of the members, emitting
2517 a warning to that effect.  This warning is enabled by @option{-Wall}.
2518 @end table
2520 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2522 @table @gcctabopt
2523 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2524 @opindex Weffc++
2525 @opindex Wno-effc++
2526 Warn about violations of the following style guidelines from Scott Meyers'
2527 @cite{Effective C++, Second Edition} book:
2529 @itemize @bullet
2530 @item
2531 Item 11:  Define a copy constructor and an assignment operator for classes
2532 with dynamically-allocated memory.
2534 @item
2535 Item 12:  Prefer initialization to assignment in constructors.
2537 @item
2538 Item 14:  Make destructors virtual in base classes.
2540 @item
2541 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2543 @item
2544 Item 23:  Don't try to return a reference when you must return an object.
2546 @end itemize
2548 Also warn about violations of the following style guidelines from
2549 Scott Meyers' @cite{More Effective C++} book:
2551 @itemize @bullet
2552 @item
2553 Item 6:  Distinguish between prefix and postfix forms of increment and
2554 decrement operators.
2556 @item
2557 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2559 @end itemize
2561 When selecting this option, be aware that the standard library
2562 headers do not obey all of these guidelines; use @samp{grep -v}
2563 to filter out those warnings.
2565 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2566 @opindex Wstrict-null-sentinel
2567 @opindex Wno-strict-null-sentinel
2568 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2569 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2570 to @code{__null}.  Although it is a null pointer constant rather than a
2571 null pointer, it is guaranteed to be of the same size as a pointer.
2572 But this use is not portable across different compilers.
2574 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2575 @opindex Wno-non-template-friend
2576 @opindex Wnon-template-friend
2577 Disable warnings when non-templatized friend functions are declared
2578 within a template.  Since the advent of explicit template specification
2579 support in G++, if the name of the friend is an unqualified-id (i.e.,
2580 @samp{friend foo(int)}), the C++ language specification demands that the
2581 friend declare or define an ordinary, nontemplate function.  (Section
2582 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2583 could be interpreted as a particular specialization of a templatized
2584 function.  Because this non-conforming behavior is no longer the default
2585 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2586 check existing code for potential trouble spots and is on by default.
2587 This new compiler behavior can be turned off with
2588 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2589 but disables the helpful warning.
2591 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2592 @opindex Wold-style-cast
2593 @opindex Wno-old-style-cast
2594 Warn if an old-style (C-style) cast to a non-void type is used within
2595 a C++ program.  The new-style casts (@samp{dynamic_cast},
2596 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2597 less vulnerable to unintended effects and much easier to search for.
2599 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2600 @opindex Woverloaded-virtual
2601 @opindex Wno-overloaded-virtual
2602 @cindex overloaded virtual function, warning
2603 @cindex warning for overloaded virtual function
2604 Warn when a function declaration hides virtual functions from a
2605 base class.  For example, in:
2607 @smallexample
2608 struct A @{
2609   virtual void f();
2612 struct B: public A @{
2613   void f(int);
2615 @end smallexample
2617 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2618 like:
2620 @smallexample
2621 B* b;
2622 b->f();
2623 @end smallexample
2625 @noindent
2626 fails to compile.
2628 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2629 @opindex Wno-pmf-conversions
2630 @opindex Wpmf-conversions
2631 Disable the diagnostic for converting a bound pointer to member function
2632 to a plain pointer.
2634 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2635 @opindex Wsign-promo
2636 @opindex Wno-sign-promo
2637 Warn when overload resolution chooses a promotion from unsigned or
2638 enumerated type to a signed type, over a conversion to an unsigned type of
2639 the same size.  Previous versions of G++ tried to preserve
2640 unsignedness, but the standard mandates the current behavior.
2642 @smallexample
2643 struct A @{
2644   operator int ();
2645   A& operator = (int);
2648 main ()
2650   A a,b;
2651   a = b;
2653 @end smallexample
2655 @noindent
2656 In this example, G++ synthesizes a default @samp{A& operator =
2657 (const A&);}, while cfront uses the user-defined @samp{operator =}.
2658 @end table
2660 @node Objective-C and Objective-C++ Dialect Options
2661 @section Options Controlling Objective-C and Objective-C++ Dialects
2663 @cindex compiler options, Objective-C and Objective-C++
2664 @cindex Objective-C and Objective-C++ options, command-line
2665 @cindex options, Objective-C and Objective-C++
2666 (NOTE: This manual does not describe the Objective-C and Objective-C++
2667 languages themselves.  @xref{Standards,,Language Standards
2668 Supported by GCC}, for references.)
2670 This section describes the command-line options that are only meaningful
2671 for Objective-C and Objective-C++ programs.  You can also use most of
2672 the language-independent GNU compiler options.
2673 For example, you might compile a file @code{some_class.m} like this:
2675 @smallexample
2676 gcc -g -fgnu-runtime -O -c some_class.m
2677 @end smallexample
2679 @noindent
2680 In this example, @option{-fgnu-runtime} is an option meant only for
2681 Objective-C and Objective-C++ programs; you can use the other options with
2682 any language supported by GCC@.
2684 Note that since Objective-C is an extension of the C language, Objective-C
2685 compilations may also use options specific to the C front-end (e.g.,
2686 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2687 C++-specific options (e.g., @option{-Wabi}).
2689 Here is a list of options that are @emph{only} for compiling Objective-C
2690 and Objective-C++ programs:
2692 @table @gcctabopt
2693 @item -fconstant-string-class=@var{class-name}
2694 @opindex fconstant-string-class
2695 Use @var{class-name} as the name of the class to instantiate for each
2696 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2697 class name is @code{NXConstantString} if the GNU runtime is being used, and
2698 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2699 @option{-fconstant-cfstrings} option, if also present, overrides the
2700 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2701 to be laid out as constant CoreFoundation strings.
2703 @item -fgnu-runtime
2704 @opindex fgnu-runtime
2705 Generate object code compatible with the standard GNU Objective-C
2706 runtime.  This is the default for most types of systems.
2708 @item -fnext-runtime
2709 @opindex fnext-runtime
2710 Generate output compatible with the NeXT runtime.  This is the default
2711 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2712 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2713 used.
2715 @item -fno-nil-receivers
2716 @opindex fno-nil-receivers
2717 Assume that all Objective-C message dispatches (@code{[receiver
2718 message:arg]}) in this translation unit ensure that the receiver is
2719 not @code{nil}.  This allows for more efficient entry points in the
2720 runtime to be used.  This option is only available in conjunction with
2721 the NeXT runtime and ABI version 0 or 1.
2723 @item -fobjc-abi-version=@var{n}
2724 @opindex fobjc-abi-version
2725 Use version @var{n} of the Objective-C ABI for the selected runtime.
2726 This option is currently supported only for the NeXT runtime.  In that
2727 case, Version 0 is the traditional (32-bit) ABI without support for
2728 properties and other Objective-C 2.0 additions.  Version 1 is the
2729 traditional (32-bit) ABI with support for properties and other
2730 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2731 nothing is specified, the default is Version 0 on 32-bit target
2732 machines, and Version 2 on 64-bit target machines.
2734 @item -fobjc-call-cxx-cdtors
2735 @opindex fobjc-call-cxx-cdtors
2736 For each Objective-C class, check if any of its instance variables is a
2737 C++ object with a non-trivial default constructor.  If so, synthesize a
2738 special @code{- (id) .cxx_construct} instance method which runs
2739 non-trivial default constructors on any such instance variables, in order,
2740 and then return @code{self}.  Similarly, check if any instance variable
2741 is a C++ object with a non-trivial destructor, and if so, synthesize a
2742 special @code{- (void) .cxx_destruct} method which runs
2743 all such default destructors, in reverse order.
2745 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2746 methods thusly generated only operate on instance variables
2747 declared in the current Objective-C class, and not those inherited
2748 from superclasses.  It is the responsibility of the Objective-C
2749 runtime to invoke all such methods in an object's inheritance
2750 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2751 by the runtime immediately after a new object instance is allocated;
2752 the @code{- (void) .cxx_destruct} methods are invoked immediately
2753 before the runtime deallocates an object instance.
2755 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2756 support for invoking the @code{- (id) .cxx_construct} and
2757 @code{- (void) .cxx_destruct} methods.
2759 @item -fobjc-direct-dispatch
2760 @opindex fobjc-direct-dispatch
2761 Allow fast jumps to the message dispatcher.  On Darwin this is
2762 accomplished via the comm page.
2764 @item -fobjc-exceptions
2765 @opindex fobjc-exceptions
2766 Enable syntactic support for structured exception handling in
2767 Objective-C, similar to what is offered by C++ and Java.  This option
2768 is required to use the Objective-C keywords @code{@@try},
2769 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2770 @code{@@synchronized}.  This option is available with both the GNU
2771 runtime and the NeXT runtime (but not available in conjunction with
2772 the NeXT runtime on Mac OS X 10.2 and earlier).
2774 @item -fobjc-gc
2775 @opindex fobjc-gc
2776 Enable garbage collection (GC) in Objective-C and Objective-C++
2777 programs.  This option is only available with the NeXT runtime; the
2778 GNU runtime has a different garbage collection implementation that
2779 does not require special compiler flags.
2781 @item -fobjc-nilcheck
2782 @opindex fobjc-nilcheck
2783 For the NeXT runtime with version 2 of the ABI, check for a nil
2784 receiver in method invocations before doing the actual method call.
2785 This is the default and can be disabled using
2786 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2787 checked for nil in this way no matter what this flag is set to.
2788 Currently this flag does nothing when the GNU runtime, or an older
2789 version of the NeXT runtime ABI, is used.
2791 @item -fobjc-std=objc1
2792 @opindex fobjc-std
2793 Conform to the language syntax of Objective-C 1.0, the language
2794 recognized by GCC 4.0.  This only affects the Objective-C additions to
2795 the C/C++ language; it does not affect conformance to C/C++ standards,
2796 which is controlled by the separate C/C++ dialect option flags.  When
2797 this option is used with the Objective-C or Objective-C++ compiler,
2798 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2799 This is useful if you need to make sure that your Objective-C code can
2800 be compiled with older versions of GCC@.
2802 @item -freplace-objc-classes
2803 @opindex freplace-objc-classes
2804 Emit a special marker instructing @command{ld(1)} not to statically link in
2805 the resulting object file, and allow @command{dyld(1)} to load it in at
2806 run time instead.  This is used in conjunction with the Fix-and-Continue
2807 debugging mode, where the object file in question may be recompiled and
2808 dynamically reloaded in the course of program execution, without the need
2809 to restart the program itself.  Currently, Fix-and-Continue functionality
2810 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2811 and later.
2813 @item -fzero-link
2814 @opindex fzero-link
2815 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2816 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2817 compile time) with static class references that get initialized at load time,
2818 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2819 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2820 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2821 for individual class implementations to be modified during program execution.
2822 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2823 regardless of command-line options.
2825 @item -gen-decls
2826 @opindex gen-decls
2827 Dump interface declarations for all classes seen in the source file to a
2828 file named @file{@var{sourcename}.decl}.
2830 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2831 @opindex Wassign-intercept
2832 @opindex Wno-assign-intercept
2833 Warn whenever an Objective-C assignment is being intercepted by the
2834 garbage collector.
2836 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2837 @opindex Wno-protocol
2838 @opindex Wprotocol
2839 If a class is declared to implement a protocol, a warning is issued for
2840 every method in the protocol that is not implemented by the class.  The
2841 default behavior is to issue a warning for every method not explicitly
2842 implemented in the class, even if a method implementation is inherited
2843 from the superclass.  If you use the @option{-Wno-protocol} option, then
2844 methods inherited from the superclass are considered to be implemented,
2845 and no warning is issued for them.
2847 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2848 @opindex Wselector
2849 @opindex Wno-selector
2850 Warn if multiple methods of different types for the same selector are
2851 found during compilation.  The check is performed on the list of methods
2852 in the final stage of compilation.  Additionally, a check is performed
2853 for each selector appearing in a @code{@@selector(@dots{})}
2854 expression, and a corresponding method for that selector has been found
2855 during compilation.  Because these checks scan the method table only at
2856 the end of compilation, these warnings are not produced if the final
2857 stage of compilation is not reached, for example because an error is
2858 found during compilation, or because the @option{-fsyntax-only} option is
2859 being used.
2861 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2862 @opindex Wstrict-selector-match
2863 @opindex Wno-strict-selector-match
2864 Warn if multiple methods with differing argument and/or return types are
2865 found for a given selector when attempting to send a message using this
2866 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2867 is off (which is the default behavior), the compiler omits such warnings
2868 if any differences found are confined to types that share the same size
2869 and alignment.
2871 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2872 @opindex Wundeclared-selector
2873 @opindex Wno-undeclared-selector
2874 Warn if a @code{@@selector(@dots{})} expression referring to an
2875 undeclared selector is found.  A selector is considered undeclared if no
2876 method with that name has been declared before the
2877 @code{@@selector(@dots{})} expression, either explicitly in an
2878 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2879 an @code{@@implementation} section.  This option always performs its
2880 checks as soon as a @code{@@selector(@dots{})} expression is found,
2881 while @option{-Wselector} only performs its checks in the final stage of
2882 compilation.  This also enforces the coding style convention
2883 that methods and selectors must be declared before being used.
2885 @item -print-objc-runtime-info
2886 @opindex print-objc-runtime-info
2887 Generate C header describing the largest structure that is passed by
2888 value, if any.
2890 @end table
2892 @node Language Independent Options
2893 @section Options to Control Diagnostic Messages Formatting
2894 @cindex options to control diagnostics formatting
2895 @cindex diagnostic messages
2896 @cindex message formatting
2898 Traditionally, diagnostic messages have been formatted irrespective of
2899 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
2900 options described below
2901 to control the formatting algorithm for diagnostic messages, 
2902 e.g.@: how many characters per line, how often source location
2903 information should be reported.  Note that some language front ends may not
2904 honor these options.
2906 @table @gcctabopt
2907 @item -fmessage-length=@var{n}
2908 @opindex fmessage-length
2909 Try to format error messages so that they fit on lines of about @var{n}
2910 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2911 the front ends supported by GCC@.  If @var{n} is zero, then no
2912 line-wrapping is done; each error message appears on a single
2913 line.
2915 @item -fdiagnostics-show-location=once
2916 @opindex fdiagnostics-show-location
2917 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2918 reporter to emit source location information @emph{once}; that is, in
2919 case the message is too long to fit on a single physical line and has to
2920 be wrapped, the source location won't be emitted (as prefix) again,
2921 over and over, in subsequent continuation lines.  This is the default
2922 behavior.
2924 @item -fdiagnostics-show-location=every-line
2925 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2926 messages reporter to emit the same source location information (as
2927 prefix) for physical lines that result from the process of breaking
2928 a message which is too long to fit on a single line.
2930 @item -fno-diagnostics-show-option
2931 @opindex fno-diagnostics-show-option
2932 @opindex fdiagnostics-show-option
2933 By default, each diagnostic emitted includes text indicating the
2934 command-line option that directly controls the diagnostic (if such an
2935 option is known to the diagnostic machinery).  Specifying the
2936 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2938 @item -fno-diagnostics-show-caret
2939 @opindex fno-diagnostics-show-caret
2940 @opindex fdiagnostics-show-caret
2941 By default, each diagnostic emitted includes the original source line
2942 and a caret '^' indicating the column.  This option suppresses this
2943 information.
2945 @end table
2947 @node Warning Options
2948 @section Options to Request or Suppress Warnings
2949 @cindex options to control warnings
2950 @cindex warning messages
2951 @cindex messages, warning
2952 @cindex suppressing warnings
2954 Warnings are diagnostic messages that report constructions that
2955 are not inherently erroneous but that are risky or suggest there
2956 may have been an error.
2958 The following language-independent options do not enable specific
2959 warnings but control the kinds of diagnostics produced by GCC@.
2961 @table @gcctabopt
2962 @cindex syntax checking
2963 @item -fsyntax-only
2964 @opindex fsyntax-only
2965 Check the code for syntax errors, but don't do anything beyond that.
2967 @item -fmax-errors=@var{n}
2968 @opindex fmax-errors
2969 Limits the maximum number of error messages to @var{n}, at which point
2970 GCC bails out rather than attempting to continue processing the source
2971 code.  If @var{n} is 0 (the default), there is no limit on the number
2972 of error messages produced.  If @option{-Wfatal-errors} is also
2973 specified, then @option{-Wfatal-errors} takes precedence over this
2974 option.
2976 @item -w
2977 @opindex w
2978 Inhibit all warning messages.
2980 @item -Werror
2981 @opindex Werror
2982 @opindex Wno-error
2983 Make all warnings into errors.
2985 @item -Werror=
2986 @opindex Werror=
2987 @opindex Wno-error=
2988 Make the specified warning into an error.  The specifier for a warning
2989 is appended; for example @option{-Werror=switch} turns the warnings
2990 controlled by @option{-Wswitch} into errors.  This switch takes a
2991 negative form, to be used to negate @option{-Werror} for specific
2992 warnings; for example @option{-Wno-error=switch} makes
2993 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2994 is in effect.
2996 The warning message for each controllable warning includes the
2997 option that controls the warning.  That option can then be used with
2998 @option{-Werror=} and @option{-Wno-error=} as described above.
2999 (Printing of the option in the warning message can be disabled using the
3000 @option{-fno-diagnostics-show-option} flag.)
3002 Note that specifying @option{-Werror=}@var{foo} automatically implies
3003 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3004 imply anything.
3006 @item -Wfatal-errors
3007 @opindex Wfatal-errors
3008 @opindex Wno-fatal-errors
3009 This option causes the compiler to abort compilation on the first error
3010 occurred rather than trying to keep going and printing further error
3011 messages.
3013 @end table
3015 You can request many specific warnings with options beginning with
3016 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3017 implicit declarations.  Each of these specific warning options also
3018 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3019 example, @option{-Wno-implicit}.  This manual lists only one of the
3020 two forms, whichever is not the default.  For further
3021 language-specific options also refer to @ref{C++ Dialect Options} and
3022 @ref{Objective-C and Objective-C++ Dialect Options}.
3024 When an unrecognized warning option is requested (e.g.,
3025 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3026 that the option is not recognized.  However, if the @option{-Wno-} form
3027 is used, the behavior is slightly different: no diagnostic is
3028 produced for @option{-Wno-unknown-warning} unless other diagnostics
3029 are being produced.  This allows the use of new @option{-Wno-} options
3030 with old compilers, but if something goes wrong, the compiler
3031 warns that an unrecognized option is present.
3033 @table @gcctabopt
3034 @item -Wpedantic
3035 @itemx -pedantic
3036 @opindex pedantic
3037 @opindex Wpedantic
3038 Issue all the warnings demanded by strict ISO C and ISO C++;
3039 reject all programs that use forbidden extensions, and some other
3040 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3041 version of the ISO C standard specified by any @option{-std} option used.
3043 Valid ISO C and ISO C++ programs should compile properly with or without
3044 this option (though a rare few require @option{-ansi} or a
3045 @option{-std} option specifying the required version of ISO C)@.  However,
3046 without this option, certain GNU extensions and traditional C and C++
3047 features are supported as well.  With this option, they are rejected.
3049 @option{-Wpedantic} does not cause warning messages for use of the
3050 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3051 warnings are also disabled in the expression that follows
3052 @code{__extension__}.  However, only system header files should use
3053 these escape routes; application programs should avoid them.
3054 @xref{Alternate Keywords}.
3056 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3057 C conformance.  They soon find that it does not do quite what they want:
3058 it finds some non-ISO practices, but not all---only those for which
3059 ISO C @emph{requires} a diagnostic, and some others for which
3060 diagnostics have been added.
3062 A feature to report any failure to conform to ISO C might be useful in
3063 some instances, but would require considerable additional work and would
3064 be quite different from @option{-Wpedantic}.  We don't have plans to
3065 support such a feature in the near future.
3067 Where the standard specified with @option{-std} represents a GNU
3068 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3069 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3070 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3071 where they are required by the base standard.  (It does not make sense
3072 for such warnings to be given only for features not in the specified GNU
3073 C dialect, since by definition the GNU dialects of C include all
3074 features the compiler supports with the given option, and there would be
3075 nothing to warn about.)
3077 @item -pedantic-errors
3078 @opindex pedantic-errors
3079 Like @option{-Wpedantic}, except that errors are produced rather than
3080 warnings.
3082 @item -Wall
3083 @opindex Wall
3084 @opindex Wno-all
3085 This enables all the warnings about constructions that some users
3086 consider questionable, and that are easy to avoid (or modify to
3087 prevent the warning), even in conjunction with macros.  This also
3088 enables some language-specific warnings described in @ref{C++ Dialect
3089 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3091 @option{-Wall} turns on the following warning flags:
3093 @gccoptlist{-Waddress   @gol
3094 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3095 -Wc++11-compat  @gol
3096 -Wchar-subscripts  @gol
3097 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3098 -Wimplicit-int @r{(C and Objective-C only)} @gol
3099 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3100 -Wcomment  @gol
3101 -Wformat   @gol
3102 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3103 -Wmaybe-uninitialized @gol
3104 -Wmissing-braces @r{(only for C/ObjC)} @gol
3105 -Wnonnull  @gol
3106 -Wparentheses  @gol
3107 -Wpointer-sign  @gol
3108 -Wreorder   @gol
3109 -Wreturn-type  @gol
3110 -Wsequence-point  @gol
3111 -Wsign-compare @r{(only in C++)}  @gol
3112 -Wstrict-aliasing  @gol
3113 -Wstrict-overflow=1  @gol
3114 -Wswitch  @gol
3115 -Wtrigraphs  @gol
3116 -Wuninitialized  @gol
3117 -Wunknown-pragmas  @gol
3118 -Wunused-function  @gol
3119 -Wunused-label     @gol
3120 -Wunused-value     @gol
3121 -Wunused-variable  @gol
3122 -Wvolatile-register-var @gol
3125 Note that some warning flags are not implied by @option{-Wall}.  Some of
3126 them warn about constructions that users generally do not consider
3127 questionable, but which occasionally you might wish to check for;
3128 others warn about constructions that are necessary or hard to avoid in
3129 some cases, and there is no simple way to modify the code to suppress
3130 the warning. Some of them are enabled by @option{-Wextra} but many of
3131 them must be enabled individually.
3133 @item -Wextra
3134 @opindex W
3135 @opindex Wextra
3136 @opindex Wno-extra
3137 This enables some extra warning flags that are not enabled by
3138 @option{-Wall}. (This option used to be called @option{-W}.  The older
3139 name is still supported, but the newer name is more descriptive.)
3141 @gccoptlist{-Wclobbered  @gol
3142 -Wempty-body  @gol
3143 -Wignored-qualifiers @gol
3144 -Wmissing-field-initializers  @gol
3145 -Wmissing-parameter-type @r{(C only)}  @gol
3146 -Wold-style-declaration @r{(C only)}  @gol
3147 -Woverride-init  @gol
3148 -Wsign-compare  @gol
3149 -Wtype-limits  @gol
3150 -Wuninitialized  @gol
3151 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3152 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3155 The option @option{-Wextra} also prints warning messages for the
3156 following cases:
3158 @itemize @bullet
3160 @item
3161 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3162 @samp{>}, or @samp{>=}.
3164 @item
3165 (C++ only) An enumerator and a non-enumerator both appear in a
3166 conditional expression.
3168 @item
3169 (C++ only) Ambiguous virtual bases.
3171 @item
3172 (C++ only) Subscripting an array that has been declared @samp{register}.
3174 @item
3175 (C++ only) Taking the address of a variable that has been declared
3176 @samp{register}.
3178 @item
3179 (C++ only) A base class is not initialized in a derived class's copy
3180 constructor.
3182 @end itemize
3184 @item -Wchar-subscripts
3185 @opindex Wchar-subscripts
3186 @opindex Wno-char-subscripts
3187 Warn if an array subscript has type @code{char}.  This is a common cause
3188 of error, as programmers often forget that this type is signed on some
3189 machines.
3190 This warning is enabled by @option{-Wall}.
3192 @item -Wcomment
3193 @opindex Wcomment
3194 @opindex Wno-comment
3195 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3196 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3197 This warning is enabled by @option{-Wall}.
3199 @item -Wno-coverage-mismatch
3200 @opindex Wno-coverage-mismatch
3201 Warn if feedback profiles do not match when using the
3202 @option{-fprofile-use} option.
3203 If a source file is changed between compiling with @option{-fprofile-gen} and
3204 with @option{-fprofile-use}, the files with the profile feedback can fail
3205 to match the source file and GCC cannot use the profile feedback
3206 information.  By default, this warning is enabled and is treated as an
3207 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3208 warning or @option{-Wno-error=coverage-mismatch} can be used to
3209 disable the error.  Disabling the error for this warning can result in
3210 poorly optimized code and is useful only in the
3211 case of very minor changes such as bug fixes to an existing code-base.
3212 Completely disabling the warning is not recommended.
3214 @item -Wno-cpp
3215 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3217 Suppress warning messages emitted by @code{#warning} directives.
3219 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3220 @opindex Wdouble-promotion
3221 @opindex Wno-double-promotion
3222 Give a warning when a value of type @code{float} is implicitly
3223 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3224 floating-point unit implement @code{float} in hardware, but emulate
3225 @code{double} in software.  On such a machine, doing computations
3226 using @code{double} values is much more expensive because of the
3227 overhead required for software emulation.
3229 It is easy to accidentally do computations with @code{double} because
3230 floating-point literals are implicitly of type @code{double}.  For
3231 example, in:
3232 @smallexample
3233 @group
3234 float area(float radius)
3236    return 3.14159 * radius * radius;
3238 @end group
3239 @end smallexample
3240 the compiler performs the entire computation with @code{double}
3241 because the floating-point literal is a @code{double}.
3243 @item -Wformat
3244 @opindex Wformat
3245 @opindex Wno-format
3246 @opindex ffreestanding
3247 @opindex fno-builtin
3248 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3249 the arguments supplied have types appropriate to the format string
3250 specified, and that the conversions specified in the format string make
3251 sense.  This includes standard functions, and others specified by format
3252 attributes (@pxref{Function Attributes}), in the @code{printf},
3253 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3254 not in the C standard) families (or other target-specific families).
3255 Which functions are checked without format attributes having been
3256 specified depends on the standard version selected, and such checks of
3257 functions without the attribute specified are disabled by
3258 @option{-ffreestanding} or @option{-fno-builtin}.
3260 The formats are checked against the format features supported by GNU
3261 libc version 2.2.  These include all ISO C90 and C99 features, as well
3262 as features from the Single Unix Specification and some BSD and GNU
3263 extensions.  Other library implementations may not support all these
3264 features; GCC does not support warning about features that go beyond a
3265 particular library's limitations.  However, if @option{-Wpedantic} is used
3266 with @option{-Wformat}, warnings are given about format features not
3267 in the selected standard version (but not for @code{strfmon} formats,
3268 since those are not in any version of the C standard).  @xref{C Dialect
3269 Options,,Options Controlling C Dialect}.
3271 Since @option{-Wformat} also checks for null format arguments for
3272 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3274 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3275 aspects of format checking, the options @option{-Wformat-y2k},
3276 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3277 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3278 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3280 @item -Wformat-y2k
3281 @opindex Wformat-y2k
3282 @opindex Wno-format-y2k
3283 If @option{-Wformat} is specified, also warn about @code{strftime}
3284 formats that may yield only a two-digit year.
3286 @item -Wno-format-contains-nul
3287 @opindex Wno-format-contains-nul
3288 @opindex Wformat-contains-nul
3289 If @option{-Wformat} is specified, do not warn about format strings that
3290 contain NUL bytes.
3292 @item -Wno-format-extra-args
3293 @opindex Wno-format-extra-args
3294 @opindex Wformat-extra-args
3295 If @option{-Wformat} is specified, do not warn about excess arguments to a
3296 @code{printf} or @code{scanf} format function.  The C standard specifies
3297 that such arguments are ignored.
3299 Where the unused arguments lie between used arguments that are
3300 specified with @samp{$} operand number specifications, normally
3301 warnings are still given, since the implementation could not know what
3302 type to pass to @code{va_arg} to skip the unused arguments.  However,
3303 in the case of @code{scanf} formats, this option suppresses the
3304 warning if the unused arguments are all pointers, since the Single
3305 Unix Specification says that such unused arguments are allowed.
3307 @item -Wno-format-zero-length
3308 @opindex Wno-format-zero-length
3309 @opindex Wformat-zero-length
3310 If @option{-Wformat} is specified, do not warn about zero-length formats.
3311 The C standard specifies that zero-length formats are allowed.
3313 @item -Wformat-nonliteral
3314 @opindex Wformat-nonliteral
3315 @opindex Wno-format-nonliteral
3316 If @option{-Wformat} is specified, also warn if the format string is not a
3317 string literal and so cannot be checked, unless the format function
3318 takes its format arguments as a @code{va_list}.
3320 @item -Wformat-security
3321 @opindex Wformat-security
3322 @opindex Wno-format-security
3323 If @option{-Wformat} is specified, also warn about uses of format
3324 functions that represent possible security problems.  At present, this
3325 warns about calls to @code{printf} and @code{scanf} functions where the
3326 format string is not a string literal and there are no format arguments,
3327 as in @code{printf (foo);}.  This may be a security hole if the format
3328 string came from untrusted input and contains @samp{%n}.  (This is
3329 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3330 in future warnings may be added to @option{-Wformat-security} that are not
3331 included in @option{-Wformat-nonliteral}.)
3333 @item -Wformat=2
3334 @opindex Wformat=2
3335 @opindex Wno-format=2
3336 Enable @option{-Wformat} plus format checks not included in
3337 @option{-Wformat}.  Currently equivalent to @option{-Wformat
3338 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3340 @item -Wnonnull
3341 @opindex Wnonnull
3342 @opindex Wno-nonnull
3343 Warn about passing a null pointer for arguments marked as
3344 requiring a non-null value by the @code{nonnull} function attribute.
3346 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3347 can be disabled with the @option{-Wno-nonnull} option.
3349 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3350 @opindex Winit-self
3351 @opindex Wno-init-self
3352 Warn about uninitialized variables that are initialized with themselves.
3353 Note this option can only be used with the @option{-Wuninitialized} option.
3355 For example, GCC warns about @code{i} being uninitialized in the
3356 following snippet only when @option{-Winit-self} has been specified:
3357 @smallexample
3358 @group
3359 int f()
3361   int i = i;
3362   return i;
3364 @end group
3365 @end smallexample
3367 This warning is enabled by @option{-Wall} in C++.
3369 @item -Wimplicit-int @r{(C and Objective-C only)}
3370 @opindex Wimplicit-int
3371 @opindex Wno-implicit-int
3372 Warn when a declaration does not specify a type.
3373 This warning is enabled by @option{-Wall}.
3375 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3376 @opindex Wimplicit-function-declaration
3377 @opindex Wno-implicit-function-declaration
3378 Give a warning whenever a function is used before being declared. In
3379 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3380 enabled by default and it is made into an error by
3381 @option{-pedantic-errors}. This warning is also enabled by
3382 @option{-Wall}.
3384 @item -Wimplicit @r{(C and Objective-C only)}
3385 @opindex Wimplicit
3386 @opindex Wno-implicit
3387 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3388 This warning is enabled by @option{-Wall}.
3390 @item -Wignored-qualifiers @r{(C and C++ only)}
3391 @opindex Wignored-qualifiers
3392 @opindex Wno-ignored-qualifiers
3393 Warn if the return type of a function has a type qualifier
3394 such as @code{const}.  For ISO C such a type qualifier has no effect,
3395 since the value returned by a function is not an lvalue.
3396 For C++, the warning is only emitted for scalar types or @code{void}.
3397 ISO C prohibits qualified @code{void} return types on function
3398 definitions, so such return types always receive a warning
3399 even without this option.
3401 This warning is also enabled by @option{-Wextra}.
3403 @item -Wmain
3404 @opindex Wmain
3405 @opindex Wno-main
3406 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3407 a function with external linkage, returning int, taking either zero
3408 arguments, two, or three arguments of appropriate types.  This warning
3409 is enabled by default in C++ and is enabled by either @option{-Wall}
3410 or @option{-Wpedantic}.
3412 @item -Wmissing-braces
3413 @opindex Wmissing-braces
3414 @opindex Wno-missing-braces
3415 Warn if an aggregate or union initializer is not fully bracketed.  In
3416 the following example, the initializer for @samp{a} is not fully
3417 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3418 enabled by @option{-Wall} in C.
3420 @smallexample
3421 int a[2][2] = @{ 0, 1, 2, 3 @};
3422 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3423 @end smallexample
3425 This warning is enabled by @option{-Wall}.
3427 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3428 @opindex Wmissing-include-dirs
3429 @opindex Wno-missing-include-dirs
3430 Warn if a user-supplied include directory does not exist.
3432 @item -Wparentheses
3433 @opindex Wparentheses
3434 @opindex Wno-parentheses
3435 Warn if parentheses are omitted in certain contexts, such
3436 as when there is an assignment in a context where a truth value
3437 is expected, or when operators are nested whose precedence people
3438 often get confused about.
3440 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3441 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3442 interpretation from that of ordinary mathematical notation.
3444 Also warn about constructions where there may be confusion to which
3445 @code{if} statement an @code{else} branch belongs.  Here is an example of
3446 such a case:
3448 @smallexample
3449 @group
3451   if (a)
3452     if (b)
3453       foo ();
3454   else
3455     bar ();
3457 @end group
3458 @end smallexample
3460 In C/C++, every @code{else} branch belongs to the innermost possible
3461 @code{if} statement, which in this example is @code{if (b)}.  This is
3462 often not what the programmer expected, as illustrated in the above
3463 example by indentation the programmer chose.  When there is the
3464 potential for this confusion, GCC issues a warning when this flag
3465 is specified.  To eliminate the warning, add explicit braces around
3466 the innermost @code{if} statement so there is no way the @code{else}
3467 can belong to the enclosing @code{if}.  The resulting code
3468 looks like this:
3470 @smallexample
3471 @group
3473   if (a)
3474     @{
3475       if (b)
3476         foo ();
3477       else
3478         bar ();
3479     @}
3481 @end group
3482 @end smallexample
3484 Also warn for dangerous uses of the GNU extension to
3485 @code{?:} with omitted middle operand. When the condition
3486 in the @code{?}: operator is a boolean expression, the omitted value is
3487 always 1.  Often programmers expect it to be a value computed
3488 inside the conditional expression instead.
3490 This warning is enabled by @option{-Wall}.
3492 @item -Wsequence-point
3493 @opindex Wsequence-point
3494 @opindex Wno-sequence-point
3495 Warn about code that may have undefined semantics because of violations
3496 of sequence point rules in the C and C++ standards.
3498 The C and C++ standards define the order in which expressions in a C/C++
3499 program are evaluated in terms of @dfn{sequence points}, which represent
3500 a partial ordering between the execution of parts of the program: those
3501 executed before the sequence point, and those executed after it.  These
3502 occur after the evaluation of a full expression (one which is not part
3503 of a larger expression), after the evaluation of the first operand of a
3504 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3505 function is called (but after the evaluation of its arguments and the
3506 expression denoting the called function), and in certain other places.
3507 Other than as expressed by the sequence point rules, the order of
3508 evaluation of subexpressions of an expression is not specified.  All
3509 these rules describe only a partial order rather than a total order,
3510 since, for example, if two functions are called within one expression
3511 with no sequence point between them, the order in which the functions
3512 are called is not specified.  However, the standards committee have
3513 ruled that function calls do not overlap.
3515 It is not specified when between sequence points modifications to the
3516 values of objects take effect.  Programs whose behavior depends on this
3517 have undefined behavior; the C and C++ standards specify that ``Between
3518 the previous and next sequence point an object shall have its stored
3519 value modified at most once by the evaluation of an expression.
3520 Furthermore, the prior value shall be read only to determine the value
3521 to be stored.''.  If a program breaks these rules, the results on any
3522 particular implementation are entirely unpredictable.
3524 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3525 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3526 diagnosed by this option, and it may give an occasional false positive
3527 result, but in general it has been found fairly effective at detecting
3528 this sort of problem in programs.
3530 The standard is worded confusingly, therefore there is some debate
3531 over the precise meaning of the sequence point rules in subtle cases.
3532 Links to discussions of the problem, including proposed formal
3533 definitions, may be found on the GCC readings page, at
3534 @uref{http://gcc.gnu.org/@/readings.html}.
3536 This warning is enabled by @option{-Wall} for C and C++.
3538 @item -Wno-return-local-addr
3539 @opindex Wno-return-local-addr
3540 @opindex Wreturn-local-addr
3541 Do not warn about returning a pointer (or in C++, a reference) to a
3542 variable that goes out of scope after the function returns.
3544 @item -Wreturn-type
3545 @opindex Wreturn-type
3546 @opindex Wno-return-type
3547 Warn whenever a function is defined with a return type that defaults
3548 to @code{int}.  Also warn about any @code{return} statement with no
3549 return value in a function whose return type is not @code{void}
3550 (falling off the end of the function body is considered returning
3551 without a value), and about a @code{return} statement with an
3552 expression in a function whose return type is @code{void}.
3554 For C++, a function without return type always produces a diagnostic
3555 message, even when @option{-Wno-return-type} is specified.  The only
3556 exceptions are @samp{main} and functions defined in system headers.
3558 This warning is enabled by @option{-Wall}.
3560 @item -Wswitch
3561 @opindex Wswitch
3562 @opindex Wno-switch
3563 Warn whenever a @code{switch} statement has an index of enumerated type
3564 and lacks a @code{case} for one or more of the named codes of that
3565 enumeration.  (The presence of a @code{default} label prevents this
3566 warning.)  @code{case} labels outside the enumeration range also
3567 provoke warnings when this option is used (even if there is a
3568 @code{default} label).
3569 This warning is enabled by @option{-Wall}.
3571 @item -Wswitch-default
3572 @opindex Wswitch-default
3573 @opindex Wno-switch-default
3574 Warn whenever a @code{switch} statement does not have a @code{default}
3575 case.
3577 @item -Wswitch-enum
3578 @opindex Wswitch-enum
3579 @opindex Wno-switch-enum
3580 Warn whenever a @code{switch} statement has an index of enumerated type
3581 and lacks a @code{case} for one or more of the named codes of that
3582 enumeration.  @code{case} labels outside the enumeration range also
3583 provoke warnings when this option is used.  The only difference
3584 between @option{-Wswitch} and this option is that this option gives a
3585 warning about an omitted enumeration code even if there is a
3586 @code{default} label.
3588 @item -Wsync-nand @r{(C and C++ only)}
3589 @opindex Wsync-nand
3590 @opindex Wno-sync-nand
3591 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3592 built-in functions are used.  These functions changed semantics in GCC 4.4.
3594 @item -Wtrigraphs
3595 @opindex Wtrigraphs
3596 @opindex Wno-trigraphs
3597 Warn if any trigraphs are encountered that might change the meaning of
3598 the program (trigraphs within comments are not warned about).
3599 This warning is enabled by @option{-Wall}.
3601 @item -Wunused-but-set-parameter
3602 @opindex Wunused-but-set-parameter
3603 @opindex Wno-unused-but-set-parameter
3604 Warn whenever a function parameter is assigned to, but otherwise unused
3605 (aside from its declaration).
3607 To suppress this warning use the @samp{unused} attribute
3608 (@pxref{Variable Attributes}).
3610 This warning is also enabled by @option{-Wunused} together with
3611 @option{-Wextra}.
3613 @item -Wunused-but-set-variable
3614 @opindex Wunused-but-set-variable
3615 @opindex Wno-unused-but-set-variable
3616 Warn whenever a local variable is assigned to, but otherwise unused
3617 (aside from its declaration).
3618 This warning is enabled by @option{-Wall}.
3620 To suppress this warning use the @samp{unused} attribute
3621 (@pxref{Variable Attributes}).
3623 This warning is also enabled by @option{-Wunused}, which is enabled
3624 by @option{-Wall}.
3626 @item -Wunused-function
3627 @opindex Wunused-function
3628 @opindex Wno-unused-function
3629 Warn whenever a static function is declared but not defined or a
3630 non-inline static function is unused.
3631 This warning is enabled by @option{-Wall}.
3633 @item -Wunused-label
3634 @opindex Wunused-label
3635 @opindex Wno-unused-label
3636 Warn whenever a label is declared but not used.
3637 This warning is enabled by @option{-Wall}.
3639 To suppress this warning use the @samp{unused} attribute
3640 (@pxref{Variable Attributes}).
3642 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3643 @opindex Wunused-local-typedefs
3644 Warn when a typedef locally defined in a function is not used.
3645 This warning is enabled by @option{-Wall}.
3647 @item -Wunused-parameter
3648 @opindex Wunused-parameter
3649 @opindex Wno-unused-parameter
3650 Warn whenever a function parameter is unused aside from its declaration.
3652 To suppress this warning use the @samp{unused} attribute
3653 (@pxref{Variable Attributes}).
3655 @item -Wno-unused-result
3656 @opindex Wunused-result
3657 @opindex Wno-unused-result
3658 Do not warn if a caller of a function marked with attribute
3659 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3660 its return value. The default is @option{-Wunused-result}.
3662 @item -Wunused-variable
3663 @opindex Wunused-variable
3664 @opindex Wno-unused-variable
3665 Warn whenever a local variable or non-constant static variable is unused
3666 aside from its declaration.
3667 This warning is enabled by @option{-Wall}.
3669 To suppress this warning use the @samp{unused} attribute
3670 (@pxref{Variable Attributes}).
3672 @item -Wunused-value
3673 @opindex Wunused-value
3674 @opindex Wno-unused-value
3675 Warn whenever a statement computes a result that is explicitly not
3676 used. To suppress this warning cast the unused expression to
3677 @samp{void}. This includes an expression-statement or the left-hand
3678 side of a comma expression that contains no side effects. For example,
3679 an expression such as @samp{x[i,j]} causes a warning, while
3680 @samp{x[(void)i,j]} does not.
3682 This warning is enabled by @option{-Wall}.
3684 @item -Wunused
3685 @opindex Wunused
3686 @opindex Wno-unused
3687 All the above @option{-Wunused} options combined.
3689 In order to get a warning about an unused function parameter, you must
3690 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3691 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3693 @item -Wuninitialized
3694 @opindex Wuninitialized
3695 @opindex Wno-uninitialized
3696 Warn if an automatic variable is used without first being initialized
3697 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3698 warn if a non-static reference or non-static @samp{const} member
3699 appears in a class without constructors.
3701 If you want to warn about code that uses the uninitialized value of the
3702 variable in its own initializer, use the @option{-Winit-self} option.
3704 These warnings occur for individual uninitialized or clobbered
3705 elements of structure, union or array variables as well as for
3706 variables that are uninitialized or clobbered as a whole.  They do
3707 not occur for variables or elements declared @code{volatile}.  Because
3708 these warnings depend on optimization, the exact variables or elements
3709 for which there are warnings depends on the precise optimization
3710 options and version of GCC used.
3712 Note that there may be no warning about a variable that is used only
3713 to compute a value that itself is never used, because such
3714 computations may be deleted by data flow analysis before the warnings
3715 are printed.
3717 @item -Wmaybe-uninitialized
3718 @opindex Wmaybe-uninitialized
3719 @opindex Wno-maybe-uninitialized
3720 For an automatic variable, if there exists a path from the function
3721 entry to a use of the variable that is initialized, but there exist
3722 some other paths for which the variable is not initialized, the compiler
3723 emits a warning if it cannot prove the uninitialized paths are not
3724 executed at run time. These warnings are made optional because GCC is
3725 not smart enough to see all the reasons why the code might be correct
3726 in spite of appearing to have an error.  Here is one example of how
3727 this can happen:
3729 @smallexample
3730 @group
3732   int x;
3733   switch (y)
3734     @{
3735     case 1: x = 1;
3736       break;
3737     case 2: x = 4;
3738       break;
3739     case 3: x = 5;
3740     @}
3741   foo (x);
3743 @end group
3744 @end smallexample
3746 @noindent
3747 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3748 always initialized, but GCC doesn't know this. To suppress the
3749 warning, you need to provide a default case with assert(0) or
3750 similar code.
3752 @cindex @code{longjmp} warnings
3753 This option also warns when a non-volatile automatic variable might be
3754 changed by a call to @code{longjmp}.  These warnings as well are possible
3755 only in optimizing compilation.
3757 The compiler sees only the calls to @code{setjmp}.  It cannot know
3758 where @code{longjmp} will be called; in fact, a signal handler could
3759 call it at any point in the code.  As a result, you may get a warning
3760 even when there is in fact no problem because @code{longjmp} cannot
3761 in fact be called at the place that would cause a problem.
3763 Some spurious warnings can be avoided if you declare all the functions
3764 you use that never return as @code{noreturn}.  @xref{Function
3765 Attributes}.
3767 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3769 @item -Wunknown-pragmas
3770 @opindex Wunknown-pragmas
3771 @opindex Wno-unknown-pragmas
3772 @cindex warning for unknown pragmas
3773 @cindex unknown pragmas, warning
3774 @cindex pragmas, warning of unknown
3775 Warn when a @code{#pragma} directive is encountered that is not understood by 
3776 GCC@.  If this command-line option is used, warnings are even issued
3777 for unknown pragmas in system header files.  This is not the case if
3778 the warnings are only enabled by the @option{-Wall} command-line option.
3780 @item -Wno-pragmas
3781 @opindex Wno-pragmas
3782 @opindex Wpragmas
3783 Do not warn about misuses of pragmas, such as incorrect parameters,
3784 invalid syntax, or conflicts between pragmas.  See also
3785 @option{-Wunknown-pragmas}.
3787 @item -Wstrict-aliasing
3788 @opindex Wstrict-aliasing
3789 @opindex Wno-strict-aliasing
3790 This option is only active when @option{-fstrict-aliasing} is active.
3791 It warns about code that might break the strict aliasing rules that the
3792 compiler is using for optimization.  The warning does not catch all
3793 cases, but does attempt to catch the more common pitfalls.  It is
3794 included in @option{-Wall}.
3795 It is equivalent to @option{-Wstrict-aliasing=3}
3797 @item -Wstrict-aliasing=n
3798 @opindex Wstrict-aliasing=n
3799 @opindex Wno-strict-aliasing=n
3800 This option is only active when @option{-fstrict-aliasing} is active.
3801 It warns about code that might break the strict aliasing rules that the
3802 compiler is using for optimization.
3803 Higher levels correspond to higher accuracy (fewer false positives).
3804 Higher levels also correspond to more effort, similar to the way @option{-O} 
3805 works.
3806 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3808 Level 1: Most aggressive, quick, least accurate.
3809 Possibly useful when higher levels
3810 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3811 false negatives.  However, it has many false positives.
3812 Warns for all pointer conversions between possibly incompatible types,
3813 even if never dereferenced.  Runs in the front end only.
3815 Level 2: Aggressive, quick, not too precise.
3816 May still have many false positives (not as many as level 1 though),
3817 and few false negatives (but possibly more than level 1).
3818 Unlike level 1, it only warns when an address is taken.  Warns about
3819 incomplete types.  Runs in the front end only.
3821 Level 3 (default for @option{-Wstrict-aliasing}):
3822 Should have very few false positives and few false
3823 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3824 Takes care of the common pun+dereference pattern in the front end:
3825 @code{*(int*)&some_float}.
3826 If optimization is enabled, it also runs in the back end, where it deals
3827 with multiple statement cases using flow-sensitive points-to information.
3828 Only warns when the converted pointer is dereferenced.
3829 Does not warn about incomplete types.
3831 @item -Wstrict-overflow
3832 @itemx -Wstrict-overflow=@var{n}
3833 @opindex Wstrict-overflow
3834 @opindex Wno-strict-overflow
3835 This option is only active when @option{-fstrict-overflow} is active.
3836 It warns about cases where the compiler optimizes based on the
3837 assumption that signed overflow does not occur.  Note that it does not
3838 warn about all cases where the code might overflow: it only warns
3839 about cases where the compiler implements some optimization.  Thus
3840 this warning depends on the optimization level.
3842 An optimization that assumes that signed overflow does not occur is
3843 perfectly safe if the values of the variables involved are such that
3844 overflow never does, in fact, occur.  Therefore this warning can
3845 easily give a false positive: a warning about code that is not
3846 actually a problem.  To help focus on important issues, several
3847 warning levels are defined.  No warnings are issued for the use of
3848 undefined signed overflow when estimating how many iterations a loop
3849 requires, in particular when determining whether a loop will be
3850 executed at all.
3852 @table @gcctabopt
3853 @item -Wstrict-overflow=1
3854 Warn about cases that are both questionable and easy to avoid.  For
3855 example,  with @option{-fstrict-overflow}, the compiler simplifies
3856 @code{x + 1 > x} to @code{1}.  This level of
3857 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3858 are not, and must be explicitly requested.
3860 @item -Wstrict-overflow=2
3861 Also warn about other cases where a comparison is simplified to a
3862 constant.  For example: @code{abs (x) >= 0}.  This can only be
3863 simplified when @option{-fstrict-overflow} is in effect, because
3864 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3865 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3866 @option{-Wstrict-overflow=2}.
3868 @item -Wstrict-overflow=3
3869 Also warn about other cases where a comparison is simplified.  For
3870 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
3872 @item -Wstrict-overflow=4
3873 Also warn about other simplifications not covered by the above cases.
3874 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
3876 @item -Wstrict-overflow=5
3877 Also warn about cases where the compiler reduces the magnitude of a
3878 constant involved in a comparison.  For example: @code{x + 2 > y} is
3879 simplified to @code{x + 1 >= y}.  This is reported only at the
3880 highest warning level because this simplification applies to many
3881 comparisons, so this warning level gives a very large number of
3882 false positives.
3883 @end table
3885 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
3886 @opindex Wsuggest-attribute=
3887 @opindex Wno-suggest-attribute=
3888 Warn for cases where adding an attribute may be beneficial. The
3889 attributes currently supported are listed below.
3891 @table @gcctabopt
3892 @item -Wsuggest-attribute=pure
3893 @itemx -Wsuggest-attribute=const
3894 @itemx -Wsuggest-attribute=noreturn
3895 @opindex Wsuggest-attribute=pure
3896 @opindex Wno-suggest-attribute=pure
3897 @opindex Wsuggest-attribute=const
3898 @opindex Wno-suggest-attribute=const
3899 @opindex Wsuggest-attribute=noreturn
3900 @opindex Wno-suggest-attribute=noreturn
3902 Warn about functions that might be candidates for attributes
3903 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3904 functions visible in other compilation units or (in the case of @code{pure} and
3905 @code{const}) if it cannot prove that the function returns normally. A function
3906 returns normally if it doesn't contain an infinite loop or return abnormally
3907 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3908 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3909 higher.  Higher optimization levels improve the accuracy of the analysis.
3911 @item -Wsuggest-attribute=format
3912 @itemx -Wmissing-format-attribute
3913 @opindex Wsuggest-attribute=format
3914 @opindex Wmissing-format-attribute
3915 @opindex Wno-suggest-attribute=format
3916 @opindex Wno-missing-format-attribute
3917 @opindex Wformat
3918 @opindex Wno-format
3920 Warn about function pointers that might be candidates for @code{format}
3921 attributes.  Note these are only possible candidates, not absolute ones.
3922 GCC guesses that function pointers with @code{format} attributes that
3923 are used in assignment, initialization, parameter passing or return
3924 statements should have a corresponding @code{format} attribute in the
3925 resulting type.  I.e.@: the left-hand side of the assignment or
3926 initialization, the type of the parameter variable, or the return type
3927 of the containing function respectively should also have a @code{format}
3928 attribute to avoid the warning.
3930 GCC also warns about function definitions that might be
3931 candidates for @code{format} attributes.  Again, these are only
3932 possible candidates.  GCC guesses that @code{format} attributes
3933 might be appropriate for any function that calls a function like
3934 @code{vprintf} or @code{vscanf}, but this might not always be the
3935 case, and some functions for which @code{format} attributes are
3936 appropriate may not be detected.
3937 @end table
3939 @item -Warray-bounds
3940 @opindex Wno-array-bounds
3941 @opindex Warray-bounds
3942 This option is only active when @option{-ftree-vrp} is active
3943 (default for @option{-O2} and above). It warns about subscripts to arrays
3944 that are always out of bounds. This warning is enabled by @option{-Wall}.
3946 @item -Wno-div-by-zero
3947 @opindex Wno-div-by-zero
3948 @opindex Wdiv-by-zero
3949 Do not warn about compile-time integer division by zero.  Floating-point
3950 division by zero is not warned about, as it can be a legitimate way of
3951 obtaining infinities and NaNs.
3953 @item -Wsystem-headers
3954 @opindex Wsystem-headers
3955 @opindex Wno-system-headers
3956 @cindex warnings from system headers
3957 @cindex system headers, warnings from
3958 Print warning messages for constructs found in system header files.
3959 Warnings from system headers are normally suppressed, on the assumption
3960 that they usually do not indicate real problems and would only make the
3961 compiler output harder to read.  Using this command-line option tells
3962 GCC to emit warnings from system headers as if they occurred in user
3963 code.  However, note that using @option{-Wall} in conjunction with this
3964 option does @emph{not} warn about unknown pragmas in system
3965 headers---for that, @option{-Wunknown-pragmas} must also be used.
3967 @item -Wtrampolines
3968 @opindex Wtrampolines
3969 @opindex Wno-trampolines
3970  Warn about trampolines generated for pointers to nested functions.
3972  A trampoline is a small piece of data or code that is created at run
3973  time on the stack when the address of a nested function is taken, and
3974  is used to call the nested function indirectly.  For some targets, it
3975  is made up of data only and thus requires no special treatment.  But,
3976  for most targets, it is made up of code and thus requires the stack
3977  to be made executable in order for the program to work properly.
3979 @item -Wfloat-equal
3980 @opindex Wfloat-equal
3981 @opindex Wno-float-equal
3982 Warn if floating-point values are used in equality comparisons.
3984 The idea behind this is that sometimes it is convenient (for the
3985 programmer) to consider floating-point values as approximations to
3986 infinitely precise real numbers.  If you are doing this, then you need
3987 to compute (by analyzing the code, or in some other way) the maximum or
3988 likely maximum error that the computation introduces, and allow for it
3989 when performing comparisons (and when producing output, but that's a
3990 different problem).  In particular, instead of testing for equality, you
3991 should check to see whether the two values have ranges that overlap; and
3992 this is done with the relational operators, so equality comparisons are
3993 probably mistaken.
3995 @item -Wtraditional @r{(C and Objective-C only)}
3996 @opindex Wtraditional
3997 @opindex Wno-traditional
3998 Warn about certain constructs that behave differently in traditional and
3999 ISO C@.  Also warn about ISO C constructs that have no traditional C
4000 equivalent, and/or problematic constructs that should be avoided.
4002 @itemize @bullet
4003 @item
4004 Macro parameters that appear within string literals in the macro body.
4005 In traditional C macro replacement takes place within string literals,
4006 but in ISO C it does not.
4008 @item
4009 In traditional C, some preprocessor directives did not exist.
4010 Traditional preprocessors only considered a line to be a directive
4011 if the @samp{#} appeared in column 1 on the line.  Therefore
4012 @option{-Wtraditional} warns about directives that traditional C
4013 understands but ignores because the @samp{#} does not appear as the
4014 first character on the line.  It also suggests you hide directives like
4015 @samp{#pragma} not understood by traditional C by indenting them.  Some
4016 traditional implementations do not recognize @samp{#elif}, so this option
4017 suggests avoiding it altogether.
4019 @item
4020 A function-like macro that appears without arguments.
4022 @item
4023 The unary plus operator.
4025 @item
4026 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4027 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4028 constants.)  Note, these suffixes appear in macros defined in the system
4029 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4030 Use of these macros in user code might normally lead to spurious
4031 warnings, however GCC's integrated preprocessor has enough context to
4032 avoid warning in these cases.
4034 @item
4035 A function declared external in one block and then used after the end of
4036 the block.
4038 @item
4039 A @code{switch} statement has an operand of type @code{long}.
4041 @item
4042 A non-@code{static} function declaration follows a @code{static} one.
4043 This construct is not accepted by some traditional C compilers.
4045 @item
4046 The ISO type of an integer constant has a different width or
4047 signedness from its traditional type.  This warning is only issued if
4048 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4049 typically represent bit patterns, are not warned about.
4051 @item
4052 Usage of ISO string concatenation is detected.
4054 @item
4055 Initialization of automatic aggregates.
4057 @item
4058 Identifier conflicts with labels.  Traditional C lacks a separate
4059 namespace for labels.
4061 @item
4062 Initialization of unions.  If the initializer is zero, the warning is
4063 omitted.  This is done under the assumption that the zero initializer in
4064 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4065 initializer warnings and relies on default initialization to zero in the
4066 traditional C case.
4068 @item
4069 Conversions by prototypes between fixed/floating-point values and vice
4070 versa.  The absence of these prototypes when compiling with traditional
4071 C causes serious problems.  This is a subset of the possible
4072 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4074 @item
4075 Use of ISO C style function definitions.  This warning intentionally is
4076 @emph{not} issued for prototype declarations or variadic functions
4077 because these ISO C features appear in your code when using
4078 libiberty's traditional C compatibility macros, @code{PARAMS} and
4079 @code{VPARAMS}.  This warning is also bypassed for nested functions
4080 because that feature is already a GCC extension and thus not relevant to
4081 traditional C compatibility.
4082 @end itemize
4084 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4085 @opindex Wtraditional-conversion
4086 @opindex Wno-traditional-conversion
4087 Warn if a prototype causes a type conversion that is different from what
4088 would happen to the same argument in the absence of a prototype.  This
4089 includes conversions of fixed point to floating and vice versa, and
4090 conversions changing the width or signedness of a fixed-point argument
4091 except when the same as the default promotion.
4093 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4094 @opindex Wdeclaration-after-statement
4095 @opindex Wno-declaration-after-statement
4096 Warn when a declaration is found after a statement in a block.  This
4097 construct, known from C++, was introduced with ISO C99 and is by default
4098 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4099 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4101 @item -Wundef
4102 @opindex Wundef
4103 @opindex Wno-undef
4104 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4106 @item -Wno-endif-labels
4107 @opindex Wno-endif-labels
4108 @opindex Wendif-labels
4109 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4111 @item -Wshadow
4112 @opindex Wshadow
4113 @opindex Wno-shadow
4114 Warn whenever a local variable or type declaration shadows another variable,
4115 parameter, type, or class member (in C++), or whenever a built-in function
4116 is shadowed. Note that in C++, the compiler warns if a local variable
4117 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4119 @item -Wlarger-than=@var{len}
4120 @opindex Wlarger-than=@var{len}
4121 @opindex Wlarger-than-@var{len}
4122 Warn whenever an object of larger than @var{len} bytes is defined.
4124 @item -Wframe-larger-than=@var{len}
4125 @opindex Wframe-larger-than
4126 Warn if the size of a function frame is larger than @var{len} bytes.
4127 The computation done to determine the stack frame size is approximate
4128 and not conservative.
4129 The actual requirements may be somewhat greater than @var{len}
4130 even if you do not get a warning.  In addition, any space allocated
4131 via @code{alloca}, variable-length arrays, or related constructs
4132 is not included by the compiler when determining
4133 whether or not to issue a warning.
4135 @item -Wno-free-nonheap-object
4136 @opindex Wno-free-nonheap-object
4137 @opindex Wfree-nonheap-object
4138 Do not warn when attempting to free an object that was not allocated
4139 on the heap.
4141 @item -Wstack-usage=@var{len}
4142 @opindex Wstack-usage
4143 Warn if the stack usage of a function might be larger than @var{len} bytes.
4144 The computation done to determine the stack usage is conservative.
4145 Any space allocated via @code{alloca}, variable-length arrays, or related
4146 constructs is included by the compiler when determining whether or not to
4147 issue a warning.
4149 The message is in keeping with the output of @option{-fstack-usage}.
4151 @itemize
4152 @item
4153 If the stack usage is fully static but exceeds the specified amount, it's:
4155 @smallexample
4156   warning: stack usage is 1120 bytes
4157 @end smallexample
4158 @item
4159 If the stack usage is (partly) dynamic but bounded, it's:
4161 @smallexample
4162   warning: stack usage might be 1648 bytes
4163 @end smallexample
4164 @item
4165 If the stack usage is (partly) dynamic and not bounded, it's:
4167 @smallexample
4168   warning: stack usage might be unbounded
4169 @end smallexample
4170 @end itemize
4172 @item -Wunsafe-loop-optimizations
4173 @opindex Wunsafe-loop-optimizations
4174 @opindex Wno-unsafe-loop-optimizations
4175 Warn if the loop cannot be optimized because the compiler cannot
4176 assume anything on the bounds of the loop indices.  With
4177 @option{-funsafe-loop-optimizations} warn if the compiler makes
4178 such assumptions.
4180 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4181 @opindex Wno-pedantic-ms-format
4182 @opindex Wpedantic-ms-format
4183 When used in combination with @option{-Wformat}
4184 and @option{-pedantic} without GNU extensions, this option
4185 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4186 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4187 which depend on the MS runtime.
4189 @item -Wpointer-arith
4190 @opindex Wpointer-arith
4191 @opindex Wno-pointer-arith
4192 Warn about anything that depends on the ``size of'' a function type or
4193 of @code{void}.  GNU C assigns these types a size of 1, for
4194 convenience in calculations with @code{void *} pointers and pointers
4195 to functions.  In C++, warn also when an arithmetic operation involves
4196 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4198 @item -Wtype-limits
4199 @opindex Wtype-limits
4200 @opindex Wno-type-limits
4201 Warn if a comparison is always true or always false due to the limited
4202 range of the data type, but do not warn for constant expressions.  For
4203 example, warn if an unsigned variable is compared against zero with
4204 @samp{<} or @samp{>=}.  This warning is also enabled by
4205 @option{-Wextra}.
4207 @item -Wbad-function-cast @r{(C and Objective-C only)}
4208 @opindex Wbad-function-cast
4209 @opindex Wno-bad-function-cast
4210 Warn whenever a function call is cast to a non-matching type.
4211 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4213 @item -Wc++-compat @r{(C and Objective-C only)}
4214 Warn about ISO C constructs that are outside of the common subset of
4215 ISO C and ISO C++, e.g.@: request for implicit conversion from
4216 @code{void *} to a pointer to non-@code{void} type.
4218 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4219 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4220 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4221 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4222 enabled by @option{-Wall}.
4224 @item -Wcast-qual
4225 @opindex Wcast-qual
4226 @opindex Wno-cast-qual
4227 Warn whenever a pointer is cast so as to remove a type qualifier from
4228 the target type.  For example, warn if a @code{const char *} is cast
4229 to an ordinary @code{char *}.
4231 Also warn when making a cast that introduces a type qualifier in an
4232 unsafe way.  For example, casting @code{char **} to @code{const char **}
4233 is unsafe, as in this example:
4235 @smallexample
4236   /* p is char ** value.  */
4237   const char **q = (const char **) p;
4238   /* Assignment of readonly string to const char * is OK.  */
4239   *q = "string";
4240   /* Now char** pointer points to read-only memory.  */
4241   **p = 'b';
4242 @end smallexample
4244 @item -Wcast-align
4245 @opindex Wcast-align
4246 @opindex Wno-cast-align
4247 Warn whenever a pointer is cast such that the required alignment of the
4248 target is increased.  For example, warn if a @code{char *} is cast to
4249 an @code{int *} on machines where integers can only be accessed at
4250 two- or four-byte boundaries.
4252 @item -Wwrite-strings
4253 @opindex Wwrite-strings
4254 @opindex Wno-write-strings
4255 When compiling C, give string constants the type @code{const
4256 char[@var{length}]} so that copying the address of one into a
4257 non-@code{const} @code{char *} pointer produces a warning.  These
4258 warnings help you find at compile time code that can try to write
4259 into a string constant, but only if you have been very careful about
4260 using @code{const} in declarations and prototypes.  Otherwise, it is
4261 just a nuisance. This is why we did not make @option{-Wall} request
4262 these warnings.
4264 When compiling C++, warn about the deprecated conversion from string
4265 literals to @code{char *}.  This warning is enabled by default for C++
4266 programs.
4268 @item -Wclobbered
4269 @opindex Wclobbered
4270 @opindex Wno-clobbered
4271 Warn for variables that might be changed by @samp{longjmp} or
4272 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4274 @item -Wconversion
4275 @opindex Wconversion
4276 @opindex Wno-conversion
4277 Warn for implicit conversions that may alter a value. This includes
4278 conversions between real and integer, like @code{abs (x)} when
4279 @code{x} is @code{double}; conversions between signed and unsigned,
4280 like @code{unsigned ui = -1}; and conversions to smaller types, like
4281 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4282 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4283 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4284 conversions between signed and unsigned integers can be disabled by
4285 using @option{-Wno-sign-conversion}.
4287 For C++, also warn for confusing overload resolution for user-defined
4288 conversions; and conversions that never use a type conversion
4289 operator: conversions to @code{void}, the same type, a base class or a
4290 reference to them. Warnings about conversions between signed and
4291 unsigned integers are disabled by default in C++ unless
4292 @option{-Wsign-conversion} is explicitly enabled.
4294 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4295 @opindex Wconversion-null
4296 @opindex Wno-conversion-null
4297 Do not warn for conversions between @code{NULL} and non-pointer
4298 types. @option{-Wconversion-null} is enabled by default.
4300 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4301 @opindex Wzero-as-null-pointer-constant
4302 @opindex Wno-zero-as-null-pointer-constant
4303 Warn when a literal '0' is used as null pointer constant.  This can
4304 be useful to facilitate the conversion to @code{nullptr} in C++11.
4306 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4307 @opindex Wuseless-cast
4308 @opindex Wno-useless-cast
4309 Warn when an expression is casted to its own type.
4311 @item -Wempty-body
4312 @opindex Wempty-body
4313 @opindex Wno-empty-body
4314 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4315 while} statement.  This warning is also enabled by @option{-Wextra}.
4317 @item -Wenum-compare
4318 @opindex Wenum-compare
4319 @opindex Wno-enum-compare
4320 Warn about a comparison between values of different enumerated types.
4321 In C++ enumeral mismatches in conditional expressions are also
4322 diagnosed and the warning is enabled by default.  In C this warning is 
4323 enabled by @option{-Wall}.
4325 @item -Wjump-misses-init @r{(C, Objective-C only)}
4326 @opindex Wjump-misses-init
4327 @opindex Wno-jump-misses-init
4328 Warn if a @code{goto} statement or a @code{switch} statement jumps
4329 forward across the initialization of a variable, or jumps backward to a
4330 label after the variable has been initialized.  This only warns about
4331 variables that are initialized when they are declared.  This warning is
4332 only supported for C and Objective-C; in C++ this sort of branch is an
4333 error in any case.
4335 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4336 can be disabled with the @option{-Wno-jump-misses-init} option.
4338 @item -Wsign-compare
4339 @opindex Wsign-compare
4340 @opindex Wno-sign-compare
4341 @cindex warning for comparison of signed and unsigned values
4342 @cindex comparison of signed and unsigned values, warning
4343 @cindex signed and unsigned values, comparison warning
4344 Warn when a comparison between signed and unsigned values could produce
4345 an incorrect result when the signed value is converted to unsigned.
4346 This warning is also enabled by @option{-Wextra}; to get the other warnings
4347 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4349 @item -Wsign-conversion
4350 @opindex Wsign-conversion
4351 @opindex Wno-sign-conversion
4352 Warn for implicit conversions that may change the sign of an integer
4353 value, like assigning a signed integer expression to an unsigned
4354 integer variable. An explicit cast silences the warning. In C, this
4355 option is enabled also by @option{-Wconversion}.
4357 @item -Wsizeof-pointer-memaccess
4358 @opindex Wsizeof-pointer-memaccess
4359 @opindex Wno-sizeof-pointer-memaccess
4360 Warn for suspicious length parameters to certain string and memory built-in
4361 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4362 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4363 but a pointer, and suggests a possible fix, or about
4364 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4365 @option{-Wall}.
4367 @item -Waddress
4368 @opindex Waddress
4369 @opindex Wno-address
4370 Warn about suspicious uses of memory addresses. These include using
4371 the address of a function in a conditional expression, such as
4372 @code{void func(void); if (func)}, and comparisons against the memory
4373 address of a string literal, such as @code{if (x == "abc")}.  Such
4374 uses typically indicate a programmer error: the address of a function
4375 always evaluates to true, so their use in a conditional usually
4376 indicate that the programmer forgot the parentheses in a function
4377 call; and comparisons against string literals result in unspecified
4378 behavior and are not portable in C, so they usually indicate that the
4379 programmer intended to use @code{strcmp}.  This warning is enabled by
4380 @option{-Wall}.
4382 @item -Wlogical-op
4383 @opindex Wlogical-op
4384 @opindex Wno-logical-op
4385 Warn about suspicious uses of logical operators in expressions.
4386 This includes using logical operators in contexts where a
4387 bit-wise operator is likely to be expected.
4389 @item -Waggregate-return
4390 @opindex Waggregate-return
4391 @opindex Wno-aggregate-return
4392 Warn if any functions that return structures or unions are defined or
4393 called.  (In languages where you can return an array, this also elicits
4394 a warning.)
4396 @item -Wno-attributes
4397 @opindex Wno-attributes
4398 @opindex Wattributes
4399 Do not warn if an unexpected @code{__attribute__} is used, such as
4400 unrecognized attributes, function attributes applied to variables,
4401 etc.  This does not stop errors for incorrect use of supported
4402 attributes.
4404 @item -Wno-builtin-macro-redefined
4405 @opindex Wno-builtin-macro-redefined
4406 @opindex Wbuiltin-macro-redefined
4407 Do not warn if certain built-in macros are redefined.  This suppresses
4408 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4409 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4411 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4412 @opindex Wstrict-prototypes
4413 @opindex Wno-strict-prototypes
4414 Warn if a function is declared or defined without specifying the
4415 argument types.  (An old-style function definition is permitted without
4416 a warning if preceded by a declaration that specifies the argument
4417 types.)
4419 @item -Wold-style-declaration @r{(C and Objective-C only)}
4420 @opindex Wold-style-declaration
4421 @opindex Wno-old-style-declaration
4422 Warn for obsolescent usages, according to the C Standard, in a
4423 declaration. For example, warn if storage-class specifiers like
4424 @code{static} are not the first things in a declaration.  This warning
4425 is also enabled by @option{-Wextra}.
4427 @item -Wold-style-definition @r{(C and Objective-C only)}
4428 @opindex Wold-style-definition
4429 @opindex Wno-old-style-definition
4430 Warn if an old-style function definition is used.  A warning is given
4431 even if there is a previous prototype.
4433 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4434 @opindex Wmissing-parameter-type
4435 @opindex Wno-missing-parameter-type
4436 A function parameter is declared without a type specifier in K&R-style
4437 functions:
4439 @smallexample
4440 void foo(bar) @{ @}
4441 @end smallexample
4443 This warning is also enabled by @option{-Wextra}.
4445 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4446 @opindex Wmissing-prototypes
4447 @opindex Wno-missing-prototypes
4448 Warn if a global function is defined without a previous prototype
4449 declaration.  This warning is issued even if the definition itself
4450 provides a prototype.  Use this option to detect global functions
4451 that do not have a matching prototype declaration in a header file.
4452 This option is not valid for C++ because all function declarations
4453 provide prototypes and a non-matching declaration will declare an
4454 overload rather than conflict with an earlier declaration.
4455 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4457 @item -Wmissing-declarations
4458 @opindex Wmissing-declarations
4459 @opindex Wno-missing-declarations
4460 Warn if a global function is defined without a previous declaration.
4461 Do so even if the definition itself provides a prototype.
4462 Use this option to detect global functions that are not declared in
4463 header files.  In C, no warnings are issued for functions with previous
4464 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4465 missing prototypes.  In C++, no warnings are issued for function templates,
4466 or for inline functions, or for functions in anonymous namespaces.
4468 @item -Wmissing-field-initializers
4469 @opindex Wmissing-field-initializers
4470 @opindex Wno-missing-field-initializers
4471 @opindex W
4472 @opindex Wextra
4473 @opindex Wno-extra
4474 Warn if a structure's initializer has some fields missing.  For
4475 example, the following code causes such a warning, because
4476 @code{x.h} is implicitly zero:
4478 @smallexample
4479 struct s @{ int f, g, h; @};
4480 struct s x = @{ 3, 4 @};
4481 @end smallexample
4483 This option does not warn about designated initializers, so the following
4484 modification does not trigger a warning:
4486 @smallexample
4487 struct s @{ int f, g, h; @};
4488 struct s x = @{ .f = 3, .g = 4 @};
4489 @end smallexample
4491 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4492 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4494 @item -Wno-multichar
4495 @opindex Wno-multichar
4496 @opindex Wmultichar
4497 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4498 Usually they indicate a typo in the user's code, as they have
4499 implementation-defined values, and should not be used in portable code.
4501 @item -Wnormalized=<none|id|nfc|nfkc>
4502 @opindex Wnormalized=
4503 @cindex NFC
4504 @cindex NFKC
4505 @cindex character set, input normalization
4506 In ISO C and ISO C++, two identifiers are different if they are
4507 different sequences of characters.  However, sometimes when characters
4508 outside the basic ASCII character set are used, you can have two
4509 different character sequences that look the same.  To avoid confusion,
4510 the ISO 10646 standard sets out some @dfn{normalization rules} which
4511 when applied ensure that two sequences that look the same are turned into
4512 the same sequence.  GCC can warn you if you are using identifiers that
4513 have not been normalized; this option controls that warning.
4515 There are four levels of warning supported by GCC@.  The default is
4516 @option{-Wnormalized=nfc}, which warns about any identifier that is
4517 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4518 recommended form for most uses.
4520 Unfortunately, there are some characters allowed in identifiers by
4521 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4522 identifiers.  That is, there's no way to use these symbols in portable
4523 ISO C or C++ and have all your identifiers in NFC@.
4524 @option{-Wnormalized=id} suppresses the warning for these characters.
4525 It is hoped that future versions of the standards involved will correct
4526 this, which is why this option is not the default.
4528 You can switch the warning off for all characters by writing
4529 @option{-Wnormalized=none}.  You should only do this if you
4530 are using some other normalization scheme (like ``D''), because
4531 otherwise you can easily create bugs that are literally impossible to see.
4533 Some characters in ISO 10646 have distinct meanings but look identical
4534 in some fonts or display methodologies, especially once formatting has
4535 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4536 LETTER N'', displays just like a regular @code{n} that has been
4537 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4538 normalization scheme to convert all these into a standard form as
4539 well, and GCC warns if your code is not in NFKC if you use
4540 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4541 about every identifier that contains the letter O because it might be
4542 confused with the digit 0, and so is not the default, but may be
4543 useful as a local coding convention if the programming environment 
4544 cannot be fixed to display these characters distinctly.
4546 @item -Wno-deprecated
4547 @opindex Wno-deprecated
4548 @opindex Wdeprecated
4549 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4551 @item -Wno-deprecated-declarations
4552 @opindex Wno-deprecated-declarations
4553 @opindex Wdeprecated-declarations
4554 Do not warn about uses of functions (@pxref{Function Attributes}),
4555 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4556 Attributes}) marked as deprecated by using the @code{deprecated}
4557 attribute.
4559 @item -Wno-overflow
4560 @opindex Wno-overflow
4561 @opindex Woverflow
4562 Do not warn about compile-time overflow in constant expressions.
4564 @item -Woverride-init @r{(C and Objective-C only)}
4565 @opindex Woverride-init
4566 @opindex Wno-override-init
4567 @opindex W
4568 @opindex Wextra
4569 @opindex Wno-extra
4570 Warn if an initialized field without side effects is overridden when
4571 using designated initializers (@pxref{Designated Inits, , Designated
4572 Initializers}).
4574 This warning is included in @option{-Wextra}.  To get other
4575 @option{-Wextra} warnings without this one, use @option{-Wextra
4576 -Wno-override-init}.
4578 @item -Wpacked
4579 @opindex Wpacked
4580 @opindex Wno-packed
4581 Warn if a structure is given the packed attribute, but the packed
4582 attribute has no effect on the layout or size of the structure.
4583 Such structures may be mis-aligned for little benefit.  For
4584 instance, in this code, the variable @code{f.x} in @code{struct bar}
4585 is misaligned even though @code{struct bar} does not itself
4586 have the packed attribute:
4588 @smallexample
4589 @group
4590 struct foo @{
4591   int x;
4592   char a, b, c, d;
4593 @} __attribute__((packed));
4594 struct bar @{
4595   char z;
4596   struct foo f;
4598 @end group
4599 @end smallexample
4601 @item -Wpacked-bitfield-compat
4602 @opindex Wpacked-bitfield-compat
4603 @opindex Wno-packed-bitfield-compat
4604 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4605 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4606 the change can lead to differences in the structure layout.  GCC
4607 informs you when the offset of such a field has changed in GCC 4.4.
4608 For example there is no longer a 4-bit padding between field @code{a}
4609 and @code{b} in this structure:
4611 @smallexample
4612 struct foo
4614   char a:4;
4615   char b:8;
4616 @} __attribute__ ((packed));
4617 @end smallexample
4619 This warning is enabled by default.  Use
4620 @option{-Wno-packed-bitfield-compat} to disable this warning.
4622 @item -Wpadded
4623 @opindex Wpadded
4624 @opindex Wno-padded
4625 Warn if padding is included in a structure, either to align an element
4626 of the structure or to align the whole structure.  Sometimes when this
4627 happens it is possible to rearrange the fields of the structure to
4628 reduce the padding and so make the structure smaller.
4630 @item -Wredundant-decls
4631 @opindex Wredundant-decls
4632 @opindex Wno-redundant-decls
4633 Warn if anything is declared more than once in the same scope, even in
4634 cases where multiple declaration is valid and changes nothing.
4636 @item -Wnested-externs @r{(C and Objective-C only)}
4637 @opindex Wnested-externs
4638 @opindex Wno-nested-externs
4639 Warn if an @code{extern} declaration is encountered within a function.
4641 @item -Wno-inherited-variadic-ctor
4642 @opindex Winherited-variadic-ctor
4643 @opindex Wno-inherited-variadic-ctor
4644 Suppress warnings about use of C++11 inheriting constructors when the
4645 base class inherited from has a C variadic constructor; the warning is
4646 on by default because the ellipsis is not inherited.
4648 @item -Winline
4649 @opindex Winline
4650 @opindex Wno-inline
4651 Warn if a function that is declared as inline cannot be inlined.
4652 Even with this option, the compiler does not warn about failures to
4653 inline functions declared in system headers.
4655 The compiler uses a variety of heuristics to determine whether or not
4656 to inline a function.  For example, the compiler takes into account
4657 the size of the function being inlined and the amount of inlining
4658 that has already been done in the current function.  Therefore,
4659 seemingly insignificant changes in the source program can cause the
4660 warnings produced by @option{-Winline} to appear or disappear.
4662 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4663 @opindex Wno-invalid-offsetof
4664 @opindex Winvalid-offsetof
4665 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4666 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4667 to a non-POD type is undefined.  In existing C++ implementations,
4668 however, @samp{offsetof} typically gives meaningful results even when
4669 applied to certain kinds of non-POD types (such as a simple
4670 @samp{struct} that fails to be a POD type only by virtue of having a
4671 constructor).  This flag is for users who are aware that they are
4672 writing nonportable code and who have deliberately chosen to ignore the
4673 warning about it.
4675 The restrictions on @samp{offsetof} may be relaxed in a future version
4676 of the C++ standard.
4678 @item -Wno-int-to-pointer-cast
4679 @opindex Wno-int-to-pointer-cast
4680 @opindex Wint-to-pointer-cast
4681 Suppress warnings from casts to pointer type of an integer of a
4682 different size. In C++, casting to a pointer type of smaller size is
4683 an error. @option{Wint-to-pointer-cast} is enabled by default.
4686 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4687 @opindex Wno-pointer-to-int-cast
4688 @opindex Wpointer-to-int-cast
4689 Suppress warnings from casts from a pointer to an integer type of a
4690 different size.
4692 @item -Winvalid-pch
4693 @opindex Winvalid-pch
4694 @opindex Wno-invalid-pch
4695 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4696 the search path but can't be used.
4698 @item -Wlong-long
4699 @opindex Wlong-long
4700 @opindex Wno-long-long
4701 Warn if @samp{long long} type is used.  This is enabled by either
4702 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4703 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4705 @item -Wvariadic-macros
4706 @opindex Wvariadic-macros
4707 @opindex Wno-variadic-macros
4708 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4709 alternate syntax when in pedantic ISO C99 mode.  This is default.
4710 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4712 @item -Wvarargs
4713 @opindex Wvarargs
4714 @opindex Wno-varargs
4715 Warn upon questionable usage of the macros used to handle variable
4716 arguments like @samp{va_start}.  This is default.  To inhibit the
4717 warning messages, use @option{-Wno-varargs}.
4719 @item -Wvector-operation-performance
4720 @opindex Wvector-operation-performance
4721 @opindex Wno-vector-operation-performance
4722 Warn if vector operation is not implemented via SIMD capabilities of the
4723 architecture.  Mainly useful for the performance tuning.
4724 Vector operation can be implemented @code{piecewise}, which means that the
4725 scalar operation is performed on every vector element; 
4726 @code{in parallel}, which means that the vector operation is implemented
4727 using scalars of wider type, which normally is more performance efficient;
4728 and @code{as a single scalar}, which means that vector fits into a
4729 scalar type.
4731 @item -Wno-virtual-move-assign
4732 @opindex Wvirtual-move-assign
4733 @opindex Wno-virtual-move-assign
4734 Suppress warnings about inheriting from a virtual base with a
4735 non-trivial C++11 move assignment operator.  This is dangerous because
4736 if the virtual base is reachable along more than one path, it will be
4737 moved multiple times, which can mean both objects end up in the
4738 moved-from state.  If the move assignment operator is written to avoid
4739 moving from a moved-from object, this warning can be disabled.
4741 @item -Wvla
4742 @opindex Wvla
4743 @opindex Wno-vla
4744 Warn if variable length array is used in the code.
4745 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4746 the variable length array.
4748 @item -Wvolatile-register-var
4749 @opindex Wvolatile-register-var
4750 @opindex Wno-volatile-register-var
4751 Warn if a register variable is declared volatile.  The volatile
4752 modifier does not inhibit all optimizations that may eliminate reads
4753 and/or writes to register variables.  This warning is enabled by
4754 @option{-Wall}.
4756 @item -Wdisabled-optimization
4757 @opindex Wdisabled-optimization
4758 @opindex Wno-disabled-optimization
4759 Warn if a requested optimization pass is disabled.  This warning does
4760 not generally indicate that there is anything wrong with your code; it
4761 merely indicates that GCC's optimizers are unable to handle the code
4762 effectively.  Often, the problem is that your code is too big or too
4763 complex; GCC refuses to optimize programs when the optimization
4764 itself is likely to take inordinate amounts of time.
4766 @item -Wpointer-sign @r{(C and Objective-C only)}
4767 @opindex Wpointer-sign
4768 @opindex Wno-pointer-sign
4769 Warn for pointer argument passing or assignment with different signedness.
4770 This option is only supported for C and Objective-C@.  It is implied by
4771 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4772 @option{-Wno-pointer-sign}.
4774 @item -Wstack-protector
4775 @opindex Wstack-protector
4776 @opindex Wno-stack-protector
4777 This option is only active when @option{-fstack-protector} is active.  It
4778 warns about functions that are not protected against stack smashing.
4780 @item -Wno-mudflap
4781 @opindex Wno-mudflap
4782 Suppress warnings about constructs that cannot be instrumented by
4783 @option{-fmudflap}.
4785 @item -Woverlength-strings
4786 @opindex Woverlength-strings
4787 @opindex Wno-overlength-strings
4788 Warn about string constants that are longer than the ``minimum
4789 maximum'' length specified in the C standard.  Modern compilers
4790 generally allow string constants that are much longer than the
4791 standard's minimum limit, but very portable programs should avoid
4792 using longer strings.
4794 The limit applies @emph{after} string constant concatenation, and does
4795 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4796 C99, it was raised to 4095.  C++98 does not specify a normative
4797 minimum maximum, so we do not diagnose overlength strings in C++@.
4799 This option is implied by @option{-Wpedantic}, and can be disabled with
4800 @option{-Wno-overlength-strings}.
4802 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4803 @opindex Wunsuffixed-float-constants
4805 Issue a warning for any floating constant that does not have
4806 a suffix.  When used together with @option{-Wsystem-headers} it
4807 warns about such constants in system header files.  This can be useful
4808 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4809 from the decimal floating-point extension to C99.
4810 @end table
4812 @node Debugging Options
4813 @section Options for Debugging Your Program or GCC
4814 @cindex options, debugging
4815 @cindex debugging information options
4817 GCC has various special options that are used for debugging
4818 either your program or GCC:
4820 @table @gcctabopt
4821 @item -g
4822 @opindex g
4823 Produce debugging information in the operating system's native format
4824 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4825 information.
4827 On most systems that use stabs format, @option{-g} enables use of extra
4828 debugging information that only GDB can use; this extra information
4829 makes debugging work better in GDB but probably makes other debuggers
4830 crash or
4831 refuse to read the program.  If you want to control for certain whether
4832 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4833 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4835 GCC allows you to use @option{-g} with
4836 @option{-O}.  The shortcuts taken by optimized code may occasionally
4837 produce surprising results: some variables you declared may not exist
4838 at all; flow of control may briefly move where you did not expect it;
4839 some statements may not be executed because they compute constant
4840 results or their values are already at hand; some statements may
4841 execute in different places because they have been moved out of loops.
4843 Nevertheless it proves possible to debug optimized output.  This makes
4844 it reasonable to use the optimizer for programs that might have bugs.
4846 The following options are useful when GCC is generated with the
4847 capability for more than one debugging format.
4849 @item -ggdb
4850 @opindex ggdb
4851 Produce debugging information for use by GDB@.  This means to use the
4852 most expressive format available (DWARF 2, stabs, or the native format
4853 if neither of those are supported), including GDB extensions if at all
4854 possible.
4856 @item -gpubnames
4857 @opindex gpubnames
4858 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
4860 @item -gstabs
4861 @opindex gstabs
4862 Produce debugging information in stabs format (if that is supported),
4863 without GDB extensions.  This is the format used by DBX on most BSD
4864 systems.  On MIPS, Alpha and System V Release 4 systems this option
4865 produces stabs debugging output that is not understood by DBX or SDB@.
4866 On System V Release 4 systems this option requires the GNU assembler.
4868 @item -feliminate-unused-debug-symbols
4869 @opindex feliminate-unused-debug-symbols
4870 Produce debugging information in stabs format (if that is supported),
4871 for only symbols that are actually used.
4873 @item -femit-class-debug-always
4874 Instead of emitting debugging information for a C++ class in only one
4875 object file, emit it in all object files using the class.  This option
4876 should be used only with debuggers that are unable to handle the way GCC
4877 normally emits debugging information for classes because using this
4878 option increases the size of debugging information by as much as a
4879 factor of two.
4881 @item -fdebug-types-section
4882 @opindex fdebug-types-section
4883 @opindex fno-debug-types-section
4884 When using DWARF Version 4 or higher, type DIEs can be put into
4885 their own @code{.debug_types} section instead of making them part of the
4886 @code{.debug_info} section.  It is more efficient to put them in a separate
4887 comdat sections since the linker can then remove duplicates.
4888 But not all DWARF consumers support @code{.debug_types} sections yet
4889 and on some objects @code{.debug_types} produces larger instead of smaller
4890 debugging information.
4892 @item -gstabs+
4893 @opindex gstabs+
4894 Produce debugging information in stabs format (if that is supported),
4895 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4896 use of these extensions is likely to make other debuggers crash or
4897 refuse to read the program.
4899 @item -gcoff
4900 @opindex gcoff
4901 Produce debugging information in COFF format (if that is supported).
4902 This is the format used by SDB on most System V systems prior to
4903 System V Release 4.
4905 @item -gxcoff
4906 @opindex gxcoff
4907 Produce debugging information in XCOFF format (if that is supported).
4908 This is the format used by the DBX debugger on IBM RS/6000 systems.
4910 @item -gxcoff+
4911 @opindex gxcoff+
4912 Produce debugging information in XCOFF format (if that is supported),
4913 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4914 use of these extensions is likely to make other debuggers crash or
4915 refuse to read the program, and may cause assemblers other than the GNU
4916 assembler (GAS) to fail with an error.
4918 @item -gdwarf-@var{version}
4919 @opindex gdwarf-@var{version}
4920 Produce debugging information in DWARF format (if that is supported).
4921 The value of @var{version} may be either 2, 3 or 4; the default version
4922 for most targets is 4.
4924 Note that with DWARF Version 2, some ports require and always
4925 use some non-conflicting DWARF 3 extensions in the unwind tables.
4927 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4928 for maximum benefit.
4930 @item -grecord-gcc-switches
4931 @opindex grecord-gcc-switches
4932 This switch causes the command-line options used to invoke the
4933 compiler that may affect code generation to be appended to the
4934 DW_AT_producer attribute in DWARF debugging information.  The options
4935 are concatenated with spaces separating them from each other and from
4936 the compiler version.  See also @option{-frecord-gcc-switches} for another
4937 way of storing compiler options into the object file.  This is the default.
4939 @item -gno-record-gcc-switches
4940 @opindex gno-record-gcc-switches
4941 Disallow appending command-line options to the DW_AT_producer attribute
4942 in DWARF debugging information.
4944 @item -gstrict-dwarf
4945 @opindex gstrict-dwarf
4946 Disallow using extensions of later DWARF standard version than selected
4947 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4948 DWARF extensions from later standard versions is allowed.
4950 @item -gno-strict-dwarf
4951 @opindex gno-strict-dwarf
4952 Allow using extensions of later DWARF standard version than selected with
4953 @option{-gdwarf-@var{version}}.
4955 @item -gvms
4956 @opindex gvms
4957 Produce debugging information in Alpha/VMS debug format (if that is
4958 supported).  This is the format used by DEBUG on Alpha/VMS systems.
4960 @item -g@var{level}
4961 @itemx -ggdb@var{level}
4962 @itemx -gstabs@var{level}
4963 @itemx -gcoff@var{level}
4964 @itemx -gxcoff@var{level}
4965 @itemx -gvms@var{level}
4966 Request debugging information and also use @var{level} to specify how
4967 much information.  The default level is 2.
4969 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4970 @option{-g}.
4972 Level 1 produces minimal information, enough for making backtraces in
4973 parts of the program that you don't plan to debug.  This includes
4974 descriptions of functions and external variables, but no information
4975 about local variables and no line numbers.
4977 Level 3 includes extra information, such as all the macro definitions
4978 present in the program.  Some debuggers support macro expansion when
4979 you use @option{-g3}.
4981 @option{-gdwarf-2} does not accept a concatenated debug level, because
4982 GCC used to support an option @option{-gdwarf} that meant to generate
4983 debug information in version 1 of the DWARF format (which is very
4984 different from version 2), and it would have been too confusing.  That
4985 debug format is long obsolete, but the option cannot be changed now.
4986 Instead use an additional @option{-g@var{level}} option to change the
4987 debug level for DWARF.
4989 @item -gtoggle
4990 @opindex gtoggle
4991 Turn off generation of debug info, if leaving out this option
4992 generates it, or turn it on at level 2 otherwise.  The position of this
4993 argument in the command line does not matter; it takes effect after all
4994 other options are processed, and it does so only once, no matter how
4995 many times it is given.  This is mainly intended to be used with
4996 @option{-fcompare-debug}.
4998 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4999 @opindex fdump-final-insns
5000 Dump the final internal representation (RTL) to @var{file}.  If the
5001 optional argument is omitted (or if @var{file} is @code{.}), the name
5002 of the dump file is determined by appending @code{.gkd} to the
5003 compilation output file name.
5005 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5006 @opindex fcompare-debug
5007 @opindex fno-compare-debug
5008 If no error occurs during compilation, run the compiler a second time,
5009 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5010 passed to the second compilation.  Dump the final internal
5011 representation in both compilations, and print an error if they differ.
5013 If the equal sign is omitted, the default @option{-gtoggle} is used.
5015 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5016 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5017 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5018 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5019 is used.
5021 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5022 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5023 of the final representation and the second compilation, preventing even
5024 @env{GCC_COMPARE_DEBUG} from taking effect.
5026 To verify full coverage during @option{-fcompare-debug} testing, set
5027 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5028 which GCC rejects as an invalid option in any actual compilation
5029 (rather than preprocessing, assembly or linking).  To get just a
5030 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5031 not overridden} will do.
5033 @item -fcompare-debug-second
5034 @opindex fcompare-debug-second
5035 This option is implicitly passed to the compiler for the second
5036 compilation requested by @option{-fcompare-debug}, along with options to
5037 silence warnings, and omitting other options that would cause
5038 side-effect compiler outputs to files or to the standard output.  Dump
5039 files and preserved temporary files are renamed so as to contain the
5040 @code{.gk} additional extension during the second compilation, to avoid
5041 overwriting those generated by the first.
5043 When this option is passed to the compiler driver, it causes the
5044 @emph{first} compilation to be skipped, which makes it useful for little
5045 other than debugging the compiler proper.
5047 @item -feliminate-dwarf2-dups
5048 @opindex feliminate-dwarf2-dups
5049 Compress DWARF 2 debugging information by eliminating duplicated
5050 information about each symbol.  This option only makes sense when
5051 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5053 @item -femit-struct-debug-baseonly
5054 Emit debug information for struct-like types
5055 only when the base name of the compilation source file
5056 matches the base name of file in which the struct is defined.
5058 This option substantially reduces the size of debugging information,
5059 but at significant potential loss in type information to the debugger.
5060 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5061 See @option{-femit-struct-debug-detailed} for more detailed control.
5063 This option works only with DWARF 2.
5065 @item -femit-struct-debug-reduced
5066 Emit debug information for struct-like types
5067 only when the base name of the compilation source file
5068 matches the base name of file in which the type is defined,
5069 unless the struct is a template or defined in a system header.
5071 This option significantly reduces the size of debugging information,
5072 with some potential loss in type information to the debugger.
5073 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5074 See @option{-femit-struct-debug-detailed} for more detailed control.
5076 This option works only with DWARF 2.
5078 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5079 Specify the struct-like types
5080 for which the compiler generates debug information.
5081 The intent is to reduce duplicate struct debug information
5082 between different object files within the same program.
5084 This option is a detailed version of
5085 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5086 which serves for most needs.
5088 A specification has the syntax@*
5089 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5091 The optional first word limits the specification to
5092 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5093 A struct type is used directly when it is the type of a variable, member.
5094 Indirect uses arise through pointers to structs.
5095 That is, when use of an incomplete struct is valid, the use is indirect.
5096 An example is
5097 @samp{struct one direct; struct two * indirect;}.
5099 The optional second word limits the specification to
5100 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5101 Generic structs are a bit complicated to explain.
5102 For C++, these are non-explicit specializations of template classes,
5103 or non-template classes within the above.
5104 Other programming languages have generics,
5105 but @option{-femit-struct-debug-detailed} does not yet implement them.
5107 The third word specifies the source files for those
5108 structs for which the compiler should emit debug information.
5109 The values @samp{none} and @samp{any} have the normal meaning.
5110 The value @samp{base} means that
5111 the base of name of the file in which the type declaration appears
5112 must match the base of the name of the main compilation file.
5113 In practice, this means that when compiling @file{foo.c}, debug information
5114 is generated for types declared in that file and @file{foo.h},
5115 but not other header files.
5116 The value @samp{sys} means those types satisfying @samp{base}
5117 or declared in system or compiler headers.
5119 You may need to experiment to determine the best settings for your application.
5121 The default is @option{-femit-struct-debug-detailed=all}.
5123 This option works only with DWARF 2.
5125 @item -fno-merge-debug-strings
5126 @opindex fmerge-debug-strings
5127 @opindex fno-merge-debug-strings
5128 Direct the linker to not merge together strings in the debugging
5129 information that are identical in different object files.  Merging is
5130 not supported by all assemblers or linkers.  Merging decreases the size
5131 of the debug information in the output file at the cost of increasing
5132 link processing time.  Merging is enabled by default.
5134 @item -fdebug-prefix-map=@var{old}=@var{new}
5135 @opindex fdebug-prefix-map
5136 When compiling files in directory @file{@var{old}}, record debugging
5137 information describing them as in @file{@var{new}} instead.
5139 @item -fno-dwarf2-cfi-asm
5140 @opindex fdwarf2-cfi-asm
5141 @opindex fno-dwarf2-cfi-asm
5142 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5143 instead of using GAS @code{.cfi_*} directives.
5145 @cindex @command{prof}
5146 @item -p
5147 @opindex p
5148 Generate extra code to write profile information suitable for the
5149 analysis program @command{prof}.  You must use this option when compiling
5150 the source files you want data about, and you must also use it when
5151 linking.
5153 @cindex @command{gprof}
5154 @item -pg
5155 @opindex pg
5156 Generate extra code to write profile information suitable for the
5157 analysis program @command{gprof}.  You must use this option when compiling
5158 the source files you want data about, and you must also use it when
5159 linking.
5161 @item -Q
5162 @opindex Q
5163 Makes the compiler print out each function name as it is compiled, and
5164 print some statistics about each pass when it finishes.
5166 @item -ftime-report
5167 @opindex ftime-report
5168 Makes the compiler print some statistics about the time consumed by each
5169 pass when it finishes.
5171 @item -fmem-report
5172 @opindex fmem-report
5173 Makes the compiler print some statistics about permanent memory
5174 allocation when it finishes.
5176 @item -fmem-report-wpa
5177 @opindex fmem-report-wpa
5178 Makes the compiler print some statistics about permanent memory
5179 allocation for the WPA phase only.
5181 @item -fpre-ipa-mem-report
5182 @opindex fpre-ipa-mem-report
5183 @item -fpost-ipa-mem-report
5184 @opindex fpost-ipa-mem-report
5185 Makes the compiler print some statistics about permanent memory
5186 allocation before or after interprocedural optimization.
5188 @item -fprofile-report
5189 @opindex fprofile-report
5190 Makes the compiler print some statistics about consistency of the
5191 (estimated) profile and effect of individual passes.
5193 @item -fstack-usage
5194 @opindex fstack-usage
5195 Makes the compiler output stack usage information for the program, on a
5196 per-function basis.  The filename for the dump is made by appending
5197 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5198 the output file, if explicitly specified and it is not an executable,
5199 otherwise it is the basename of the source file.  An entry is made up
5200 of three fields:
5202 @itemize
5203 @item
5204 The name of the function.
5205 @item
5206 A number of bytes.
5207 @item
5208 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5209 @end itemize
5211 The qualifier @code{static} means that the function manipulates the stack
5212 statically: a fixed number of bytes are allocated for the frame on function
5213 entry and released on function exit; no stack adjustments are otherwise made
5214 in the function.  The second field is this fixed number of bytes.
5216 The qualifier @code{dynamic} means that the function manipulates the stack
5217 dynamically: in addition to the static allocation described above, stack
5218 adjustments are made in the body of the function, for example to push/pop
5219 arguments around function calls.  If the qualifier @code{bounded} is also
5220 present, the amount of these adjustments is bounded at compile time and
5221 the second field is an upper bound of the total amount of stack used by
5222 the function.  If it is not present, the amount of these adjustments is
5223 not bounded at compile time and the second field only represents the
5224 bounded part.
5226 @item -fprofile-arcs
5227 @opindex fprofile-arcs
5228 Add code so that program flow @dfn{arcs} are instrumented.  During
5229 execution the program records how many times each branch and call is
5230 executed and how many times it is taken or returns.  When the compiled
5231 program exits it saves this data to a file called
5232 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5233 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5234 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5235 @var{auxname} is generated from the name of the output file, if
5236 explicitly specified and it is not the final executable, otherwise it is
5237 the basename of the source file.  In both cases any suffix is removed
5238 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5239 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5240 @xref{Cross-profiling}.
5242 @cindex @command{gcov}
5243 @item --coverage
5244 @opindex coverage
5246 This option is used to compile and link code instrumented for coverage
5247 analysis.  The option is a synonym for @option{-fprofile-arcs}
5248 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5249 linking).  See the documentation for those options for more details.
5251 @itemize
5253 @item
5254 Compile the source files with @option{-fprofile-arcs} plus optimization
5255 and code generation options.  For test coverage analysis, use the
5256 additional @option{-ftest-coverage} option.  You do not need to profile
5257 every source file in a program.
5259 @item
5260 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5261 (the latter implies the former).
5263 @item
5264 Run the program on a representative workload to generate the arc profile
5265 information.  This may be repeated any number of times.  You can run
5266 concurrent instances of your program, and provided that the file system
5267 supports locking, the data files will be correctly updated.  Also
5268 @code{fork} calls are detected and correctly handled (double counting
5269 will not happen).
5271 @item
5272 For profile-directed optimizations, compile the source files again with
5273 the same optimization and code generation options plus
5274 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5275 Control Optimization}).
5277 @item
5278 For test coverage analysis, use @command{gcov} to produce human readable
5279 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5280 @command{gcov} documentation for further information.
5282 @end itemize
5284 With @option{-fprofile-arcs}, for each function of your program GCC
5285 creates a program flow graph, then finds a spanning tree for the graph.
5286 Only arcs that are not on the spanning tree have to be instrumented: the
5287 compiler adds code to count the number of times that these arcs are
5288 executed.  When an arc is the only exit or only entrance to a block, the
5289 instrumentation code can be added to the block; otherwise, a new basic
5290 block must be created to hold the instrumentation code.
5292 @need 2000
5293 @item -ftest-coverage
5294 @opindex ftest-coverage
5295 Produce a notes file that the @command{gcov} code-coverage utility
5296 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5297 show program coverage.  Each source file's note file is called
5298 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5299 above for a description of @var{auxname} and instructions on how to
5300 generate test coverage data.  Coverage data matches the source files
5301 more closely if you do not optimize.
5303 @item -fdbg-cnt-list
5304 @opindex fdbg-cnt-list
5305 Print the name and the counter upper bound for all debug counters.
5308 @item -fdbg-cnt=@var{counter-value-list}
5309 @opindex fdbg-cnt
5310 Set the internal debug counter upper bound.  @var{counter-value-list}
5311 is a comma-separated list of @var{name}:@var{value} pairs
5312 which sets the upper bound of each debug counter @var{name} to @var{value}.
5313 All debug counters have the initial upper bound of @code{UINT_MAX};
5314 thus @code{dbg_cnt()} returns true always unless the upper bound
5315 is set by this option.
5316 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5317 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5319 @item -fenable-@var{kind}-@var{pass}
5320 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5321 @opindex fdisable-
5322 @opindex fenable-
5324 This is a set of options that are used to explicitly disable/enable
5325 optimization passes.  These options are intended for use for debugging GCC.
5326 Compiler users should use regular options for enabling/disabling
5327 passes instead.
5329 @table @gcctabopt
5331 @item -fdisable-ipa-@var{pass}
5332 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5333 statically invoked in the compiler multiple times, the pass name should be
5334 appended with a sequential number starting from 1.
5336 @item -fdisable-rtl-@var{pass}
5337 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5338 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5339 statically invoked in the compiler multiple times, the pass name should be
5340 appended with a sequential number starting from 1.  @var{range-list} is a 
5341 comma-separated list of function ranges or assembler names.  Each range is a number
5342 pair separated by a colon.  The range is inclusive in both ends.  If the range
5343 is trivial, the number pair can be simplified as a single number.  If the
5344 function's cgraph node's @var{uid} falls within one of the specified ranges,
5345 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5346 function header of a dump file, and the pass names can be dumped by using
5347 option @option{-fdump-passes}.
5349 @item -fdisable-tree-@var{pass}
5350 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5351 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5352 option arguments.
5354 @item -fenable-ipa-@var{pass}
5355 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5356 statically invoked in the compiler multiple times, the pass name should be
5357 appended with a sequential number starting from 1.
5359 @item -fenable-rtl-@var{pass}
5360 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5361 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5362 description and examples.
5364 @item -fenable-tree-@var{pass}
5365 @itemx -fenable-tree-@var{pass}=@var{range-list}
5366 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5367 of option arguments.
5369 @end table
5371 Here are some examples showing uses of these options.
5373 @smallexample
5375 # disable ccp1 for all functions
5376    -fdisable-tree-ccp1
5377 # disable complete unroll for function whose cgraph node uid is 1
5378    -fenable-tree-cunroll=1
5379 # disable gcse2 for functions at the following ranges [1,1],
5380 # [300,400], and [400,1000]
5381 # disable gcse2 for functions foo and foo2
5382    -fdisable-rtl-gcse2=foo,foo2
5383 # disable early inlining
5384    -fdisable-tree-einline
5385 # disable ipa inlining
5386    -fdisable-ipa-inline
5387 # enable tree full unroll
5388    -fenable-tree-unroll
5390 @end smallexample
5392 @item -d@var{letters}
5393 @itemx -fdump-rtl-@var{pass}
5394 @itemx -fdump-rtl-@var{pass}=@var{filename}
5395 @opindex d
5396 Says to make debugging dumps during compilation at times specified by
5397 @var{letters}.  This is used for debugging the RTL-based passes of the
5398 compiler.  The file names for most of the dumps are made by appending
5399 a pass number and a word to the @var{dumpname}, and the files are
5400 created in the directory of the output file. In case of
5401 @option{=@var{filename}} option, the dump is output on the given file
5402 instead of the pass numbered dump files. Note that the pass number is
5403 computed statically as passes get registered into the pass manager.
5404 Thus the numbering is not related to the dynamic order of execution of
5405 passes.  In particular, a pass installed by a plugin could have a
5406 number over 200 even if it executed quite early.  @var{dumpname} is
5407 generated from the name of the output file, if explicitly specified
5408 and it is not an executable, otherwise it is the basename of the
5409 source file. These switches may have different effects when
5410 @option{-E} is used for preprocessing.
5412 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5413 @option{-d} option @var{letters}.  Here are the possible
5414 letters for use in @var{pass} and @var{letters}, and their meanings:
5416 @table @gcctabopt
5418 @item -fdump-rtl-alignments
5419 @opindex fdump-rtl-alignments
5420 Dump after branch alignments have been computed.
5422 @item -fdump-rtl-asmcons
5423 @opindex fdump-rtl-asmcons
5424 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5426 @item -fdump-rtl-auto_inc_dec
5427 @opindex fdump-rtl-auto_inc_dec
5428 Dump after auto-inc-dec discovery.  This pass is only run on
5429 architectures that have auto inc or auto dec instructions.
5431 @item -fdump-rtl-barriers
5432 @opindex fdump-rtl-barriers
5433 Dump after cleaning up the barrier instructions.
5435 @item -fdump-rtl-bbpart
5436 @opindex fdump-rtl-bbpart
5437 Dump after partitioning hot and cold basic blocks.
5439 @item -fdump-rtl-bbro
5440 @opindex fdump-rtl-bbro
5441 Dump after block reordering.
5443 @item -fdump-rtl-btl1
5444 @itemx -fdump-rtl-btl2
5445 @opindex fdump-rtl-btl2
5446 @opindex fdump-rtl-btl2
5447 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5448 after the two branch
5449 target load optimization passes.
5451 @item -fdump-rtl-bypass
5452 @opindex fdump-rtl-bypass
5453 Dump after jump bypassing and control flow optimizations.
5455 @item -fdump-rtl-combine
5456 @opindex fdump-rtl-combine
5457 Dump after the RTL instruction combination pass.
5459 @item -fdump-rtl-compgotos
5460 @opindex fdump-rtl-compgotos
5461 Dump after duplicating the computed gotos.
5463 @item -fdump-rtl-ce1
5464 @itemx -fdump-rtl-ce2
5465 @itemx -fdump-rtl-ce3
5466 @opindex fdump-rtl-ce1
5467 @opindex fdump-rtl-ce2
5468 @opindex fdump-rtl-ce3
5469 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5470 @option{-fdump-rtl-ce3} enable dumping after the three
5471 if conversion passes.
5473 @item -fdump-rtl-cprop_hardreg
5474 @opindex fdump-rtl-cprop_hardreg
5475 Dump after hard register copy propagation.
5477 @item -fdump-rtl-csa
5478 @opindex fdump-rtl-csa
5479 Dump after combining stack adjustments.
5481 @item -fdump-rtl-cse1
5482 @itemx -fdump-rtl-cse2
5483 @opindex fdump-rtl-cse1
5484 @opindex fdump-rtl-cse2
5485 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5486 the two common subexpression elimination passes.
5488 @item -fdump-rtl-dce
5489 @opindex fdump-rtl-dce
5490 Dump after the standalone dead code elimination passes.
5492 @item -fdump-rtl-dbr
5493 @opindex fdump-rtl-dbr
5494 Dump after delayed branch scheduling.
5496 @item -fdump-rtl-dce1
5497 @itemx -fdump-rtl-dce2
5498 @opindex fdump-rtl-dce1
5499 @opindex fdump-rtl-dce2
5500 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5501 the two dead store elimination passes.
5503 @item -fdump-rtl-eh
5504 @opindex fdump-rtl-eh
5505 Dump after finalization of EH handling code.
5507 @item -fdump-rtl-eh_ranges
5508 @opindex fdump-rtl-eh_ranges
5509 Dump after conversion of EH handling range regions.
5511 @item -fdump-rtl-expand
5512 @opindex fdump-rtl-expand
5513 Dump after RTL generation.
5515 @item -fdump-rtl-fwprop1
5516 @itemx -fdump-rtl-fwprop2
5517 @opindex fdump-rtl-fwprop1
5518 @opindex fdump-rtl-fwprop2
5519 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5520 dumping after the two forward propagation passes.
5522 @item -fdump-rtl-gcse1
5523 @itemx -fdump-rtl-gcse2
5524 @opindex fdump-rtl-gcse1
5525 @opindex fdump-rtl-gcse2
5526 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5527 after global common subexpression elimination.
5529 @item -fdump-rtl-init-regs
5530 @opindex fdump-rtl-init-regs
5531 Dump after the initialization of the registers.
5533 @item -fdump-rtl-initvals
5534 @opindex fdump-rtl-initvals
5535 Dump after the computation of the initial value sets.
5537 @item -fdump-rtl-into_cfglayout
5538 @opindex fdump-rtl-into_cfglayout
5539 Dump after converting to cfglayout mode.
5541 @item -fdump-rtl-ira
5542 @opindex fdump-rtl-ira
5543 Dump after iterated register allocation.
5545 @item -fdump-rtl-jump
5546 @opindex fdump-rtl-jump
5547 Dump after the second jump optimization.
5549 @item -fdump-rtl-loop2
5550 @opindex fdump-rtl-loop2
5551 @option{-fdump-rtl-loop2} enables dumping after the rtl
5552 loop optimization passes.
5554 @item -fdump-rtl-mach
5555 @opindex fdump-rtl-mach
5556 Dump after performing the machine dependent reorganization pass, if that
5557 pass exists.
5559 @item -fdump-rtl-mode_sw
5560 @opindex fdump-rtl-mode_sw
5561 Dump after removing redundant mode switches.
5563 @item -fdump-rtl-rnreg
5564 @opindex fdump-rtl-rnreg
5565 Dump after register renumbering.
5567 @item -fdump-rtl-outof_cfglayout
5568 @opindex fdump-rtl-outof_cfglayout
5569 Dump after converting from cfglayout mode.
5571 @item -fdump-rtl-peephole2
5572 @opindex fdump-rtl-peephole2
5573 Dump after the peephole pass.
5575 @item -fdump-rtl-postreload
5576 @opindex fdump-rtl-postreload
5577 Dump after post-reload optimizations.
5579 @itemx -fdump-rtl-pro_and_epilogue
5580 @opindex fdump-rtl-pro_and_epilogue
5581 Dump after generating the function prologues and epilogues.
5583 @item -fdump-rtl-regmove
5584 @opindex fdump-rtl-regmove
5585 Dump after the register move pass.
5587 @item -fdump-rtl-sched1
5588 @itemx -fdump-rtl-sched2
5589 @opindex fdump-rtl-sched1
5590 @opindex fdump-rtl-sched2
5591 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5592 after the basic block scheduling passes.
5594 @item -fdump-rtl-see
5595 @opindex fdump-rtl-see
5596 Dump after sign extension elimination.
5598 @item -fdump-rtl-seqabstr
5599 @opindex fdump-rtl-seqabstr
5600 Dump after common sequence discovery.
5602 @item -fdump-rtl-shorten
5603 @opindex fdump-rtl-shorten
5604 Dump after shortening branches.
5606 @item -fdump-rtl-sibling
5607 @opindex fdump-rtl-sibling
5608 Dump after sibling call optimizations.
5610 @item -fdump-rtl-split1
5611 @itemx -fdump-rtl-split2
5612 @itemx -fdump-rtl-split3
5613 @itemx -fdump-rtl-split4
5614 @itemx -fdump-rtl-split5
5615 @opindex fdump-rtl-split1
5616 @opindex fdump-rtl-split2
5617 @opindex fdump-rtl-split3
5618 @opindex fdump-rtl-split4
5619 @opindex fdump-rtl-split5
5620 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5621 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5622 @option{-fdump-rtl-split5} enable dumping after five rounds of
5623 instruction splitting.
5625 @item -fdump-rtl-sms
5626 @opindex fdump-rtl-sms
5627 Dump after modulo scheduling.  This pass is only run on some
5628 architectures.
5630 @item -fdump-rtl-stack
5631 @opindex fdump-rtl-stack
5632 Dump after conversion from GCC's ``flat register file'' registers to the
5633 x87's stack-like registers.  This pass is only run on x86 variants.
5635 @item -fdump-rtl-subreg1
5636 @itemx -fdump-rtl-subreg2
5637 @opindex fdump-rtl-subreg1
5638 @opindex fdump-rtl-subreg2
5639 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5640 the two subreg expansion passes.
5642 @item -fdump-rtl-unshare
5643 @opindex fdump-rtl-unshare
5644 Dump after all rtl has been unshared.
5646 @item -fdump-rtl-vartrack
5647 @opindex fdump-rtl-vartrack
5648 Dump after variable tracking.
5650 @item -fdump-rtl-vregs
5651 @opindex fdump-rtl-vregs
5652 Dump after converting virtual registers to hard registers.
5654 @item -fdump-rtl-web
5655 @opindex fdump-rtl-web
5656 Dump after live range splitting.
5658 @item -fdump-rtl-regclass
5659 @itemx -fdump-rtl-subregs_of_mode_init
5660 @itemx -fdump-rtl-subregs_of_mode_finish
5661 @itemx -fdump-rtl-dfinit
5662 @itemx -fdump-rtl-dfinish
5663 @opindex fdump-rtl-regclass
5664 @opindex fdump-rtl-subregs_of_mode_init
5665 @opindex fdump-rtl-subregs_of_mode_finish
5666 @opindex fdump-rtl-dfinit
5667 @opindex fdump-rtl-dfinish
5668 These dumps are defined but always produce empty files.
5670 @item -da
5671 @itemx -fdump-rtl-all
5672 @opindex da
5673 @opindex fdump-rtl-all
5674 Produce all the dumps listed above.
5676 @item -dA
5677 @opindex dA
5678 Annotate the assembler output with miscellaneous debugging information.
5680 @item -dD
5681 @opindex dD
5682 Dump all macro definitions, at the end of preprocessing, in addition to
5683 normal output.
5685 @item -dH
5686 @opindex dH
5687 Produce a core dump whenever an error occurs.
5689 @item -dp
5690 @opindex dp
5691 Annotate the assembler output with a comment indicating which
5692 pattern and alternative is used.  The length of each instruction is
5693 also printed.
5695 @item -dP
5696 @opindex dP
5697 Dump the RTL in the assembler output as a comment before each instruction.
5698 Also turns on @option{-dp} annotation.
5700 @item -dv
5701 @opindex dv
5702 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5703 dump a representation of the control flow graph suitable for viewing with VCG
5704 to @file{@var{file}.@var{pass}.vcg}.
5706 @item -dx
5707 @opindex dx
5708 Just generate RTL for a function instead of compiling it.  Usually used
5709 with @option{-fdump-rtl-expand}.
5710 @end table
5712 @item -fdump-noaddr
5713 @opindex fdump-noaddr
5714 When doing debugging dumps, suppress address output.  This makes it more
5715 feasible to use diff on debugging dumps for compiler invocations with
5716 different compiler binaries and/or different
5717 text / bss / data / heap / stack / dso start locations.
5719 @item -fdump-unnumbered
5720 @opindex fdump-unnumbered
5721 When doing debugging dumps, suppress instruction numbers and address output.
5722 This makes it more feasible to use diff on debugging dumps for compiler
5723 invocations with different options, in particular with and without
5724 @option{-g}.
5726 @item -fdump-unnumbered-links
5727 @opindex fdump-unnumbered-links
5728 When doing debugging dumps (see @option{-d} option above), suppress
5729 instruction numbers for the links to the previous and next instructions
5730 in a sequence.
5732 @item -fdump-translation-unit @r{(C++ only)}
5733 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5734 @opindex fdump-translation-unit
5735 Dump a representation of the tree structure for the entire translation
5736 unit to a file.  The file name is made by appending @file{.tu} to the
5737 source file name, and the file is created in the same directory as the
5738 output file.  If the @samp{-@var{options}} form is used, @var{options}
5739 controls the details of the dump as described for the
5740 @option{-fdump-tree} options.
5742 @item -fdump-class-hierarchy @r{(C++ only)}
5743 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5744 @opindex fdump-class-hierarchy
5745 Dump a representation of each class's hierarchy and virtual function
5746 table layout to a file.  The file name is made by appending
5747 @file{.class} to the source file name, and the file is created in the
5748 same directory as the output file.  If the @samp{-@var{options}} form
5749 is used, @var{options} controls the details of the dump as described
5750 for the @option{-fdump-tree} options.
5752 @item -fdump-ipa-@var{switch}
5753 @opindex fdump-ipa
5754 Control the dumping at various stages of inter-procedural analysis
5755 language tree to a file.  The file name is generated by appending a
5756 switch specific suffix to the source file name, and the file is created
5757 in the same directory as the output file.  The following dumps are
5758 possible:
5760 @table @samp
5761 @item all
5762 Enables all inter-procedural analysis dumps.
5764 @item cgraph
5765 Dumps information about call-graph optimization, unused function removal,
5766 and inlining decisions.
5768 @item inline
5769 Dump after function inlining.
5771 @end table
5773 @item -fdump-passes
5774 @opindex fdump-passes
5775 Dump the list of optimization passes that are turned on and off by
5776 the current command-line options.
5778 @item -fdump-statistics-@var{option}
5779 @opindex fdump-statistics
5780 Enable and control dumping of pass statistics in a separate file.  The
5781 file name is generated by appending a suffix ending in
5782 @samp{.statistics} to the source file name, and the file is created in
5783 the same directory as the output file.  If the @samp{-@var{option}}
5784 form is used, @samp{-stats} causes counters to be summed over the
5785 whole compilation unit while @samp{-details} dumps every event as
5786 the passes generate them.  The default with no option is to sum
5787 counters for each function compiled.
5789 @item -fdump-tree-@var{switch}
5790 @itemx -fdump-tree-@var{switch}-@var{options}
5791 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
5792 @opindex fdump-tree
5793 Control the dumping at various stages of processing the intermediate
5794 language tree to a file.  The file name is generated by appending a
5795 switch-specific suffix to the source file name, and the file is
5796 created in the same directory as the output file. In case of
5797 @option{=@var{filename}} option, the dump is output on the given file
5798 instead of the auto named dump files.  If the @samp{-@var{options}}
5799 form is used, @var{options} is a list of @samp{-} separated options
5800 which control the details of the dump.  Not all options are applicable
5801 to all dumps; those that are not meaningful are ignored.  The
5802 following options are available
5804 @table @samp
5805 @item address
5806 Print the address of each node.  Usually this is not meaningful as it
5807 changes according to the environment and source file.  Its primary use
5808 is for tying up a dump file with a debug environment.
5809 @item asmname
5810 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5811 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5812 use working backward from mangled names in the assembly file.
5813 @item slim
5814 Inhibit dumping of members of a scope or body of a function merely
5815 because that scope has been reached.  Only dump such items when they
5816 are directly reachable by some other path.  When dumping pretty-printed
5817 trees, this option inhibits dumping the bodies of control structures.
5818 @item raw
5819 Print a raw representation of the tree.  By default, trees are
5820 pretty-printed into a C-like representation.
5821 @item details
5822 Enable more detailed dumps (not honored by every dump option). Also
5823 include information from the optimization passes.
5824 @item stats
5825 Enable dumping various statistics about the pass (not honored by every dump
5826 option).
5827 @item blocks
5828 Enable showing basic block boundaries (disabled in raw dumps).
5829 @item vops
5830 Enable showing virtual operands for every statement.
5831 @item lineno
5832 Enable showing line numbers for statements.
5833 @item uid
5834 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5835 @item verbose
5836 Enable showing the tree dump for each statement.
5837 @item eh
5838 Enable showing the EH region number holding each statement.
5839 @item scev
5840 Enable showing scalar evolution analysis details.
5841 @item optimized
5842 Enable showing optimization information (only available in certain
5843 passes).
5844 @item missed
5845 Enable showing missed optimization information (only available in certain
5846 passes).
5847 @item notes
5848 Enable other detailed optimization information (only available in
5849 certain passes).
5850 @item =@var{filename}
5851 Instead of an auto named dump file, output into the given file
5852 name. The file names @file{stdout} and @file{stderr} are treated
5853 specially and are considered already open standard streams. For
5854 example,
5856 @smallexample
5857 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
5858      -fdump-tree-pre=stderr file.c
5859 @end smallexample
5861 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
5862 output on to @file{stderr}. If two conflicting dump filenames are
5863 given for the same pass, then the latter option overrides the earlier
5864 one.
5866 @item all
5867 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5868 and @option{lineno}.
5870 @item optall
5871 Turn on all optimization options, i.e., @option{optimized},
5872 @option{missed}, and @option{note}.
5873 @end table
5875 The following tree dumps are possible:
5876 @table @samp
5878 @item original
5879 @opindex fdump-tree-original
5880 Dump before any tree based optimization, to @file{@var{file}.original}.
5882 @item optimized
5883 @opindex fdump-tree-optimized
5884 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5886 @item gimple
5887 @opindex fdump-tree-gimple
5888 Dump each function before and after the gimplification pass to a file.  The
5889 file name is made by appending @file{.gimple} to the source file name.
5891 @item cfg
5892 @opindex fdump-tree-cfg
5893 Dump the control flow graph of each function to a file.  The file name is
5894 made by appending @file{.cfg} to the source file name.
5896 @item vcg
5897 @opindex fdump-tree-vcg
5898 Dump the control flow graph of each function to a file in VCG format.  The
5899 file name is made by appending @file{.vcg} to the source file name.  Note
5900 that if the file contains more than one function, the generated file cannot
5901 be used directly by VCG@.  You must cut and paste each function's
5902 graph into its own separate file first.
5904 @item ch
5905 @opindex fdump-tree-ch
5906 Dump each function after copying loop headers.  The file name is made by
5907 appending @file{.ch} to the source file name.
5909 @item ssa
5910 @opindex fdump-tree-ssa
5911 Dump SSA related information to a file.  The file name is made by appending
5912 @file{.ssa} to the source file name.
5914 @item alias
5915 @opindex fdump-tree-alias
5916 Dump aliasing information for each function.  The file name is made by
5917 appending @file{.alias} to the source file name.
5919 @item ccp
5920 @opindex fdump-tree-ccp
5921 Dump each function after CCP@.  The file name is made by appending
5922 @file{.ccp} to the source file name.
5924 @item storeccp
5925 @opindex fdump-tree-storeccp
5926 Dump each function after STORE-CCP@.  The file name is made by appending
5927 @file{.storeccp} to the source file name.
5929 @item pre
5930 @opindex fdump-tree-pre
5931 Dump trees after partial redundancy elimination.  The file name is made
5932 by appending @file{.pre} to the source file name.
5934 @item fre
5935 @opindex fdump-tree-fre
5936 Dump trees after full redundancy elimination.  The file name is made
5937 by appending @file{.fre} to the source file name.
5939 @item copyprop
5940 @opindex fdump-tree-copyprop
5941 Dump trees after copy propagation.  The file name is made
5942 by appending @file{.copyprop} to the source file name.
5944 @item store_copyprop
5945 @opindex fdump-tree-store_copyprop
5946 Dump trees after store copy-propagation.  The file name is made
5947 by appending @file{.store_copyprop} to the source file name.
5949 @item dce
5950 @opindex fdump-tree-dce
5951 Dump each function after dead code elimination.  The file name is made by
5952 appending @file{.dce} to the source file name.
5954 @item mudflap
5955 @opindex fdump-tree-mudflap
5956 Dump each function after adding mudflap instrumentation.  The file name is
5957 made by appending @file{.mudflap} to the source file name.
5959 @item sra
5960 @opindex fdump-tree-sra
5961 Dump each function after performing scalar replacement of aggregates.  The
5962 file name is made by appending @file{.sra} to the source file name.
5964 @item sink
5965 @opindex fdump-tree-sink
5966 Dump each function after performing code sinking.  The file name is made
5967 by appending @file{.sink} to the source file name.
5969 @item dom
5970 @opindex fdump-tree-dom
5971 Dump each function after applying dominator tree optimizations.  The file
5972 name is made by appending @file{.dom} to the source file name.
5974 @item dse
5975 @opindex fdump-tree-dse
5976 Dump each function after applying dead store elimination.  The file
5977 name is made by appending @file{.dse} to the source file name.
5979 @item phiopt
5980 @opindex fdump-tree-phiopt
5981 Dump each function after optimizing PHI nodes into straightline code.  The file
5982 name is made by appending @file{.phiopt} to the source file name.
5984 @item forwprop
5985 @opindex fdump-tree-forwprop
5986 Dump each function after forward propagating single use variables.  The file
5987 name is made by appending @file{.forwprop} to the source file name.
5989 @item copyrename
5990 @opindex fdump-tree-copyrename
5991 Dump each function after applying the copy rename optimization.  The file
5992 name is made by appending @file{.copyrename} to the source file name.
5994 @item nrv
5995 @opindex fdump-tree-nrv
5996 Dump each function after applying the named return value optimization on
5997 generic trees.  The file name is made by appending @file{.nrv} to the source
5998 file name.
6000 @item vect
6001 @opindex fdump-tree-vect
6002 Dump each function after applying vectorization of loops.  The file name is
6003 made by appending @file{.vect} to the source file name.
6005 @item slp
6006 @opindex fdump-tree-slp
6007 Dump each function after applying vectorization of basic blocks.  The file name
6008 is made by appending @file{.slp} to the source file name.
6010 @item vrp
6011 @opindex fdump-tree-vrp
6012 Dump each function after Value Range Propagation (VRP).  The file name
6013 is made by appending @file{.vrp} to the source file name.
6015 @item all
6016 @opindex fdump-tree-all
6017 Enable all the available tree dumps with the flags provided in this option.
6018 @end table
6020 @item -fopt-info
6021 @itemx -fopt-info-@var{options}
6022 @itemx -fopt-info-@var{options}=@var{filename}
6023 @opindex fopt-info
6024 Controls optimization dumps from various optimization passes. If the
6025 @samp{-@var{options}} form is used, @var{options} is a list of
6026 @samp{-} separated options to select the dump details and
6027 optimizations.  If @var{options} is not specified, it defaults to
6028 @option{all} for details and @option{optall} for optimization
6029 groups. If the @var{filename} is not specified, it defaults to
6030 @file{stderr}. Note that the output @var{filename} will be overwritten
6031 in case of multiple translation units. If a combined output from
6032 multiple translation units is desired, @file{stderr} should be used
6033 instead.
6035 The options can be divided into two groups, 1) options describing the
6036 verbosity of the dump, and 2) options describing which optimizations
6037 should be included. The options from both the groups can be freely
6038 mixed as they are non-overlapping. However, in case of any conflicts,
6039 the latter options override the earlier options on the command
6040 line. Though multiple -fopt-info options are accepted, only one of
6041 them can have @option{=filename}. If other filenames are provided then
6042 all but the first one are ignored.
6044 The dump verbosity has the following options
6046 @table @samp
6047 @item optimized
6048 Print information when an optimization is successfully applied. It is
6049 up to a pass to decide which information is relevant. For example, the
6050 vectorizer passes print the source location of loops which got
6051 successfully vectorized.
6052 @item missed
6053 Print information about missed optimizations. Individual passes
6054 control which informations to include in the output. For example,
6056 @smallexample
6057 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6058 @end smallexample
6060 will print information about missed optimization opportunities from
6061 vectorization passes on stderr.
6062 @item note
6063 Print verbose information about optimizations, such as certain
6064 transformations, more detailed messages about decisions etc.
6065 @item all
6066 Print detailed optimization information. This includes
6067 @var{optimized}, @var{missed}, and @var{note}.
6068 @end table
6070 The second set of options describes a group of optimizations and may
6071 include one or more of the following.
6073 @table @samp
6074 @item ipa
6075 Enable dumps from all interprocedural optimizations.
6076 @item loop
6077 Enable dumps from all loop optimizations.
6078 @item inline
6079 Enable dumps from all inlining optimizations.
6080 @item vec
6081 Enable dumps from all vectorization optimizations.
6082 @end table
6084 For example,
6085 @smallexample
6086 gcc -O3 -fopt-info-missed=missed.all
6087 @end smallexample
6089 outputs missed optimization report from all the passes into
6090 @file{missed.all}.
6092 As another example,
6093 @smallexample
6094 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6095 @end smallexample
6097 will output information about missed optimizations as well as
6098 optimized locations from all the inlining passes into
6099 @file{inline.txt}.
6101 If the @var{filename} is provided, then the dumps from all the
6102 applicable optimizations are concatenated into the @file{filename}.
6103 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6104 omitted, it defaults to @option{all-optall}, which means dump all
6105 available optimization info from all the passes. In the following
6106 example, all optimization info is output on to @file{stderr}.
6108 @smallexample
6109 gcc -O3 -fopt-info
6110 @end smallexample
6112 Note that @option{-fopt-info-vec-missed} behaves the same as
6113 @option{-fopt-info-missed-vec}.
6115 As another example, consider
6117 @smallexample
6118 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6119 @end smallexample
6121 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6122 in conflict since only one output file is allowed. In this case, only
6123 the first option takes effect and the subsequent options are
6124 ignored. Thus only the @file{vec.miss} is produced which cotaints
6125 dumps from the vectorizer about missed opportunities.
6127 @item -ftree-vectorizer-verbose=@var{n}
6128 @opindex ftree-vectorizer-verbose
6129 This option is deprecated and is implemented in terms of
6130 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6131 instead, where @var{kind} is one of the valid opt-info options. It
6132 prints additional optimization information.  For @var{n}=0 no
6133 diagnostic information is reported.  If @var{n}=1 the vectorizer
6134 reports each loop that got vectorized, and the total number of loops
6135 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6136 which could not be vectorized and the reasons for those. For any
6137 higher verbosity levels all the analysis and transformation
6138 information from the vectorizer is reported.
6140 Note that the information output by @option{-ftree-vectorizer-verbose}
6141 option is sent to @file{stderr}. If the equivalent form
6142 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6143 output is sent into @var{filename} instead.
6145 @item -frandom-seed=@var{string}
6146 @opindex frandom-seed
6147 This option provides a seed that GCC uses in place of
6148 random numbers in generating certain symbol names
6149 that have to be different in every compiled file.  It is also used to
6150 place unique stamps in coverage data files and the object files that
6151 produce them.  You can use the @option{-frandom-seed} option to produce
6152 reproducibly identical object files.
6154 The @var{string} should be different for every file you compile.
6156 @item -fsched-verbose=@var{n}
6157 @opindex fsched-verbose
6158 On targets that use instruction scheduling, this option controls the
6159 amount of debugging output the scheduler prints.  This information is
6160 written to standard error, unless @option{-fdump-rtl-sched1} or
6161 @option{-fdump-rtl-sched2} is specified, in which case it is output
6162 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6163 respectively.  However for @var{n} greater than nine, the output is
6164 always printed to standard error.
6166 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6167 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6168 For @var{n} greater than one, it also output basic block probabilities,
6169 detailed ready list information and unit/insn info.  For @var{n} greater
6170 than two, it includes RTL at abort point, control-flow and regions info.
6171 And for @var{n} over four, @option{-fsched-verbose} also includes
6172 dependence info.
6174 @item -save-temps
6175 @itemx -save-temps=cwd
6176 @opindex save-temps
6177 Store the usual ``temporary'' intermediate files permanently; place them
6178 in the current directory and name them based on the source file.  Thus,
6179 compiling @file{foo.c} with @option{-c -save-temps} produces files
6180 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6181 preprocessed @file{foo.i} output file even though the compiler now
6182 normally uses an integrated preprocessor.
6184 When used in combination with the @option{-x} command-line option,
6185 @option{-save-temps} is sensible enough to avoid over writing an
6186 input source file with the same extension as an intermediate file.
6187 The corresponding intermediate file may be obtained by renaming the
6188 source file before using @option{-save-temps}.
6190 If you invoke GCC in parallel, compiling several different source
6191 files that share a common base name in different subdirectories or the
6192 same source file compiled for multiple output destinations, it is
6193 likely that the different parallel compilers will interfere with each
6194 other, and overwrite the temporary files.  For instance:
6196 @smallexample
6197 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6198 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6199 @end smallexample
6201 may result in @file{foo.i} and @file{foo.o} being written to
6202 simultaneously by both compilers.
6204 @item -save-temps=obj
6205 @opindex save-temps=obj
6206 Store the usual ``temporary'' intermediate files permanently.  If the
6207 @option{-o} option is used, the temporary files are based on the
6208 object file.  If the @option{-o} option is not used, the
6209 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6211 For example:
6213 @smallexample
6214 gcc -save-temps=obj -c foo.c
6215 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6216 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6217 @end smallexample
6219 @noindent
6220 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6221 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6222 @file{dir2/yfoobar.o}.
6224 @item -time@r{[}=@var{file}@r{]}
6225 @opindex time
6226 Report the CPU time taken by each subprocess in the compilation
6227 sequence.  For C source files, this is the compiler proper and assembler
6228 (plus the linker if linking is done).
6230 Without the specification of an output file, the output looks like this:
6232 @smallexample
6233 # cc1 0.12 0.01
6234 # as 0.00 0.01
6235 @end smallexample
6237 The first number on each line is the ``user time'', that is time spent
6238 executing the program itself.  The second number is ``system time'',
6239 time spent executing operating system routines on behalf of the program.
6240 Both numbers are in seconds.
6242 With the specification of an output file, the output is appended to the
6243 named file, and it looks like this:
6245 @smallexample
6246 0.12 0.01 cc1 @var{options}
6247 0.00 0.01 as @var{options}
6248 @end smallexample
6250 The ``user time'' and the ``system time'' are moved before the program
6251 name, and the options passed to the program are displayed, so that one
6252 can later tell what file was being compiled, and with which options.
6254 @item -fvar-tracking
6255 @opindex fvar-tracking
6256 Run variable tracking pass.  It computes where variables are stored at each
6257 position in code.  Better debugging information is then generated
6258 (if the debugging information format supports this information).
6260 It is enabled by default when compiling with optimization (@option{-Os},
6261 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6262 the debug info format supports it.
6264 @item -fvar-tracking-assignments
6265 @opindex fvar-tracking-assignments
6266 @opindex fno-var-tracking-assignments
6267 Annotate assignments to user variables early in the compilation and
6268 attempt to carry the annotations over throughout the compilation all the
6269 way to the end, in an attempt to improve debug information while
6270 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6272 It can be enabled even if var-tracking is disabled, in which case
6273 annotations are created and maintained, but discarded at the end.
6275 @item -fvar-tracking-assignments-toggle
6276 @opindex fvar-tracking-assignments-toggle
6277 @opindex fno-var-tracking-assignments-toggle
6278 Toggle @option{-fvar-tracking-assignments}, in the same way that
6279 @option{-gtoggle} toggles @option{-g}.
6281 @item -print-file-name=@var{library}
6282 @opindex print-file-name
6283 Print the full absolute name of the library file @var{library} that
6284 would be used when linking---and don't do anything else.  With this
6285 option, GCC does not compile or link anything; it just prints the
6286 file name.
6288 @item -print-multi-directory
6289 @opindex print-multi-directory
6290 Print the directory name corresponding to the multilib selected by any
6291 other switches present in the command line.  This directory is supposed
6292 to exist in @env{GCC_EXEC_PREFIX}.
6294 @item -print-multi-lib
6295 @opindex print-multi-lib
6296 Print the mapping from multilib directory names to compiler switches
6297 that enable them.  The directory name is separated from the switches by
6298 @samp{;}, and each switch starts with an @samp{@@} instead of the
6299 @samp{-}, without spaces between multiple switches.  This is supposed to
6300 ease shell processing.
6302 @item -print-multi-os-directory
6303 @opindex print-multi-os-directory
6304 Print the path to OS libraries for the selected
6305 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6306 present in the @file{lib} subdirectory and no multilibs are used, this is
6307 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6308 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6309 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6310 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6312 @item -print-prog-name=@var{program}
6313 @opindex print-prog-name
6314 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6316 @item -print-libgcc-file-name
6317 @opindex print-libgcc-file-name
6318 Same as @option{-print-file-name=libgcc.a}.
6320 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6321 but you do want to link with @file{libgcc.a}.  You can do:
6323 @smallexample
6324 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6325 @end smallexample
6327 @item -print-search-dirs
6328 @opindex print-search-dirs
6329 Print the name of the configured installation directory and a list of
6330 program and library directories @command{gcc} searches---and don't do anything else.
6332 This is useful when @command{gcc} prints the error message
6333 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6334 To resolve this you either need to put @file{cpp0} and the other compiler
6335 components where @command{gcc} expects to find them, or you can set the environment
6336 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6337 Don't forget the trailing @samp{/}.
6338 @xref{Environment Variables}.
6340 @item -print-sysroot
6341 @opindex print-sysroot
6342 Print the target sysroot directory that is used during
6343 compilation.  This is the target sysroot specified either at configure
6344 time or using the @option{--sysroot} option, possibly with an extra
6345 suffix that depends on compilation options.  If no target sysroot is
6346 specified, the option prints nothing.
6348 @item -print-sysroot-headers-suffix
6349 @opindex print-sysroot-headers-suffix
6350 Print the suffix added to the target sysroot when searching for
6351 headers, or give an error if the compiler is not configured with such
6352 a suffix---and don't do anything else.
6354 @item -dumpmachine
6355 @opindex dumpmachine
6356 Print the compiler's target machine (for example,
6357 @samp{i686-pc-linux-gnu})---and don't do anything else.
6359 @item -dumpversion
6360 @opindex dumpversion
6361 Print the compiler version (for example, @samp{3.0})---and don't do
6362 anything else.
6364 @item -dumpspecs
6365 @opindex dumpspecs
6366 Print the compiler's built-in specs---and don't do anything else.  (This
6367 is used when GCC itself is being built.)  @xref{Spec Files}.
6369 @item -fno-eliminate-unused-debug-types
6370 @opindex feliminate-unused-debug-types
6371 @opindex fno-eliminate-unused-debug-types
6372 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6373 output for types that are nowhere used in the source file being compiled.
6374 Sometimes it is useful to have GCC emit debugging
6375 information for all types declared in a compilation
6376 unit, regardless of whether or not they are actually used
6377 in that compilation unit, for example 
6378 if, in the debugger, you want to cast a value to a type that is
6379 not actually used in your program (but is declared).  More often,
6380 however, this results in a significant amount of wasted space.
6381 @end table
6383 @node Optimize Options
6384 @section Options That Control Optimization
6385 @cindex optimize options
6386 @cindex options, optimization
6388 These options control various sorts of optimizations.
6390 Without any optimization option, the compiler's goal is to reduce the
6391 cost of compilation and to make debugging produce the expected
6392 results.  Statements are independent: if you stop the program with a
6393 breakpoint between statements, you can then assign a new value to any
6394 variable or change the program counter to any other statement in the
6395 function and get exactly the results you expect from the source
6396 code.
6398 Turning on optimization flags makes the compiler attempt to improve
6399 the performance and/or code size at the expense of compilation time
6400 and possibly the ability to debug the program.
6402 The compiler performs optimization based on the knowledge it has of the
6403 program.  Compiling multiple files at once to a single output file mode allows
6404 the compiler to use information gained from all of the files when compiling
6405 each of them.
6407 Not all optimizations are controlled directly by a flag.  Only
6408 optimizations that have a flag are listed in this section.
6410 Most optimizations are only enabled if an @option{-O} level is set on
6411 the command line.  Otherwise they are disabled, even if individual
6412 optimization flags are specified.
6414 Depending on the target and how GCC was configured, a slightly different
6415 set of optimizations may be enabled at each @option{-O} level than
6416 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6417 to find out the exact set of optimizations that are enabled at each level.
6418 @xref{Overall Options}, for examples.
6420 @table @gcctabopt
6421 @item -O
6422 @itemx -O1
6423 @opindex O
6424 @opindex O1
6425 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6426 more memory for a large function.
6428 With @option{-O}, the compiler tries to reduce code size and execution
6429 time, without performing any optimizations that take a great deal of
6430 compilation time.
6432 @option{-O} turns on the following optimization flags:
6433 @gccoptlist{
6434 -fauto-inc-dec @gol
6435 -fcompare-elim @gol
6436 -fcprop-registers @gol
6437 -fdce @gol
6438 -fdefer-pop @gol
6439 -fdelayed-branch @gol
6440 -fdse @gol
6441 -fguess-branch-probability @gol
6442 -fif-conversion2 @gol
6443 -fif-conversion @gol
6444 -fipa-pure-const @gol
6445 -fipa-profile @gol
6446 -fipa-reference @gol
6447 -fmerge-constants
6448 -fsplit-wide-types @gol
6449 -ftree-bit-ccp @gol
6450 -ftree-builtin-call-dce @gol
6451 -ftree-ccp @gol
6452 -ftree-ch @gol
6453 -ftree-copyrename @gol
6454 -ftree-dce @gol
6455 -ftree-dominator-opts @gol
6456 -ftree-dse @gol
6457 -ftree-forwprop @gol
6458 -ftree-fre @gol
6459 -ftree-phiprop @gol
6460 -ftree-slsr @gol
6461 -ftree-sra @gol
6462 -ftree-pta @gol
6463 -ftree-ter @gol
6464 -funit-at-a-time}
6466 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6467 where doing so does not interfere with debugging.
6469 @item -O2
6470 @opindex O2
6471 Optimize even more.  GCC performs nearly all supported optimizations
6472 that do not involve a space-speed tradeoff.
6473 As compared to @option{-O}, this option increases both compilation time
6474 and the performance of the generated code.
6476 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6477 also turns on the following optimization flags:
6478 @gccoptlist{-fthread-jumps @gol
6479 -falign-functions  -falign-jumps @gol
6480 -falign-loops  -falign-labels @gol
6481 -fcaller-saves @gol
6482 -fcrossjumping @gol
6483 -fcse-follow-jumps  -fcse-skip-blocks @gol
6484 -fdelete-null-pointer-checks @gol
6485 -fdevirtualize @gol
6486 -fexpensive-optimizations @gol
6487 -fgcse  -fgcse-lm  @gol
6488 -fhoist-adjacent-loads @gol
6489 -finline-small-functions @gol
6490 -findirect-inlining @gol
6491 -fipa-sra @gol
6492 -foptimize-sibling-calls @gol
6493 -fpartial-inlining @gol
6494 -fpeephole2 @gol
6495 -fregmove @gol
6496 -freorder-blocks  -freorder-functions @gol
6497 -frerun-cse-after-loop  @gol
6498 -fsched-interblock  -fsched-spec @gol
6499 -fschedule-insns  -fschedule-insns2 @gol
6500 -fstrict-aliasing -fstrict-overflow @gol
6501 -ftree-switch-conversion -ftree-tail-merge @gol
6502 -ftree-pre @gol
6503 -ftree-vrp}
6505 Please note the warning under @option{-fgcse} about
6506 invoking @option{-O2} on programs that use computed gotos.
6508 @item -O3
6509 @opindex O3
6510 Optimize yet more.  @option{-O3} turns on all optimizations specified
6511 by @option{-O2} and also turns on the @option{-finline-functions},
6512 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6513 @option{-fgcse-after-reload}, @option{-ftree-vectorize},
6514 @option{-fvect-cost-model},
6515 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6517 @item -O0
6518 @opindex O0
6519 Reduce compilation time and make debugging produce the expected
6520 results.  This is the default.
6522 @item -Os
6523 @opindex Os
6524 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6525 do not typically increase code size.  It also performs further
6526 optimizations designed to reduce code size.
6528 @option{-Os} disables the following optimization flags:
6529 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6530 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6531 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6533 @item -Ofast
6534 @opindex Ofast
6535 Disregard strict standards compliance.  @option{-Ofast} enables all
6536 @option{-O3} optimizations.  It also enables optimizations that are not
6537 valid for all standard-compliant programs.
6538 It turns on @option{-ffast-math} and the Fortran-specific
6539 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6541 @item -Og
6542 @opindex Og
6543 Optimize debugging experience.  @option{-Og} enables optimizations
6544 that do not interfere with debugging. It should be the optimization
6545 level of choice for the standard edit-compile-debug cycle, offering
6546 a reasonable level of optimization while maintaining fast compilation
6547 and a good debugging experience.
6549 If you use multiple @option{-O} options, with or without level numbers,
6550 the last such option is the one that is effective.
6551 @end table
6553 Options of the form @option{-f@var{flag}} specify machine-independent
6554 flags.  Most flags have both positive and negative forms; the negative
6555 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6556 below, only one of the forms is listed---the one you typically 
6557 use.  You can figure out the other form by either removing @samp{no-}
6558 or adding it.
6560 The following options control specific optimizations.  They are either
6561 activated by @option{-O} options or are related to ones that are.  You
6562 can use the following flags in the rare cases when ``fine-tuning'' of
6563 optimizations to be performed is desired.
6565 @table @gcctabopt
6566 @item -fno-default-inline
6567 @opindex fno-default-inline
6568 Do not make member functions inline by default merely because they are
6569 defined inside the class scope (C++ only).  Otherwise, when you specify
6570 @w{@option{-O}}, member functions defined inside class scope are compiled
6571 inline by default; i.e., you don't need to add @samp{inline} in front of
6572 the member function name.
6574 @item -fno-defer-pop
6575 @opindex fno-defer-pop
6576 Always pop the arguments to each function call as soon as that function
6577 returns.  For machines that must pop arguments after a function call,
6578 the compiler normally lets arguments accumulate on the stack for several
6579 function calls and pops them all at once.
6581 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6583 @item -fforward-propagate
6584 @opindex fforward-propagate
6585 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6586 instructions and checks if the result can be simplified.  If loop unrolling
6587 is active, two passes are performed and the second is scheduled after
6588 loop unrolling.
6590 This option is enabled by default at optimization levels @option{-O},
6591 @option{-O2}, @option{-O3}, @option{-Os}.
6593 @item -ffp-contract=@var{style}
6594 @opindex ffp-contract
6595 @option{-ffp-contract=off} disables floating-point expression contraction.
6596 @option{-ffp-contract=fast} enables floating-point expression contraction
6597 such as forming of fused multiply-add operations if the target has
6598 native support for them.
6599 @option{-ffp-contract=on} enables floating-point expression contraction
6600 if allowed by the language standard.  This is currently not implemented
6601 and treated equal to @option{-ffp-contract=off}.
6603 The default is @option{-ffp-contract=fast}.
6605 @item -fomit-frame-pointer
6606 @opindex fomit-frame-pointer
6607 Don't keep the frame pointer in a register for functions that
6608 don't need one.  This avoids the instructions to save, set up and
6609 restore frame pointers; it also makes an extra register available
6610 in many functions.  @strong{It also makes debugging impossible on
6611 some machines.}
6613 On some machines, such as the VAX, this flag has no effect, because
6614 the standard calling sequence automatically handles the frame pointer
6615 and nothing is saved by pretending it doesn't exist.  The
6616 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6617 whether a target machine supports this flag.  @xref{Registers,,Register
6618 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6620 Starting with GCC version 4.6, the default setting (when not optimizing for
6621 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6622 @option{-fomit-frame-pointer}.  The default can be reverted to
6623 @option{-fno-omit-frame-pointer} by configuring GCC with the
6624 @option{--enable-frame-pointer} configure option.
6626 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6628 @item -foptimize-sibling-calls
6629 @opindex foptimize-sibling-calls
6630 Optimize sibling and tail recursive calls.
6632 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6634 @item -fno-inline
6635 @opindex fno-inline
6636 Do not expand any functions inline apart from those marked with
6637 the @code{always_inline} attribute.  This is the default when not
6638 optimizing.
6640 Single functions can be exempted from inlining by marking them
6641 with the @code{noinline} attribute.
6643 @item -finline-small-functions
6644 @opindex finline-small-functions
6645 Integrate functions into their callers when their body is smaller than expected
6646 function call code (so overall size of program gets smaller).  The compiler
6647 heuristically decides which functions are simple enough to be worth integrating
6648 in this way.  This inlining applies to all functions, even those not declared
6649 inline.
6651 Enabled at level @option{-O2}.
6653 @item -findirect-inlining
6654 @opindex findirect-inlining
6655 Inline also indirect calls that are discovered to be known at compile
6656 time thanks to previous inlining.  This option has any effect only
6657 when inlining itself is turned on by the @option{-finline-functions}
6658 or @option{-finline-small-functions} options.
6660 Enabled at level @option{-O2}.
6662 @item -finline-functions
6663 @opindex finline-functions
6664 Consider all functions for inlining, even if they are not declared inline.
6665 The compiler heuristically decides which functions are worth integrating
6666 in this way.
6668 If all calls to a given function are integrated, and the function is
6669 declared @code{static}, then the function is normally not output as
6670 assembler code in its own right.
6672 Enabled at level @option{-O3}.
6674 @item -finline-functions-called-once
6675 @opindex finline-functions-called-once
6676 Consider all @code{static} functions called once for inlining into their
6677 caller even if they are not marked @code{inline}.  If a call to a given
6678 function is integrated, then the function is not output as assembler code
6679 in its own right.
6681 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6683 @item -fearly-inlining
6684 @opindex fearly-inlining
6685 Inline functions marked by @code{always_inline} and functions whose body seems
6686 smaller than the function call overhead early before doing
6687 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6688 makes profiling significantly cheaper and usually inlining faster on programs
6689 having large chains of nested wrapper functions.
6691 Enabled by default.
6693 @item -fipa-sra
6694 @opindex fipa-sra
6695 Perform interprocedural scalar replacement of aggregates, removal of
6696 unused parameters and replacement of parameters passed by reference
6697 by parameters passed by value.
6699 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6701 @item -finline-limit=@var{n}
6702 @opindex finline-limit
6703 By default, GCC limits the size of functions that can be inlined.  This flag
6704 allows coarse control of this limit.  @var{n} is the size of functions that
6705 can be inlined in number of pseudo instructions.
6707 Inlining is actually controlled by a number of parameters, which may be
6708 specified individually by using @option{--param @var{name}=@var{value}}.
6709 The @option{-finline-limit=@var{n}} option sets some of these parameters
6710 as follows:
6712 @table @gcctabopt
6713 @item max-inline-insns-single
6714 is set to @var{n}/2.
6715 @item max-inline-insns-auto
6716 is set to @var{n}/2.
6717 @end table
6719 See below for a documentation of the individual
6720 parameters controlling inlining and for the defaults of these parameters.
6722 @emph{Note:} there may be no value to @option{-finline-limit} that results
6723 in default behavior.
6725 @emph{Note:} pseudo instruction represents, in this particular context, an
6726 abstract measurement of function's size.  In no way does it represent a count
6727 of assembly instructions and as such its exact meaning might change from one
6728 release to an another.
6730 @item -fno-keep-inline-dllexport
6731 @opindex -fno-keep-inline-dllexport
6732 This is a more fine-grained version of @option{-fkeep-inline-functions},
6733 which applies only to functions that are declared using the @code{dllexport}
6734 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6735 Functions}.)
6737 @item -fkeep-inline-functions
6738 @opindex fkeep-inline-functions
6739 In C, emit @code{static} functions that are declared @code{inline}
6740 into the object file, even if the function has been inlined into all
6741 of its callers.  This switch does not affect functions using the
6742 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6743 inline functions into the object file.
6745 @item -fkeep-static-consts
6746 @opindex fkeep-static-consts
6747 Emit variables declared @code{static const} when optimization isn't turned
6748 on, even if the variables aren't referenced.
6750 GCC enables this option by default.  If you want to force the compiler to
6751 check if a variable is referenced, regardless of whether or not
6752 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6754 @item -fmerge-constants
6755 @opindex fmerge-constants
6756 Attempt to merge identical constants (string constants and floating-point
6757 constants) across compilation units.
6759 This option is the default for optimized compilation if the assembler and
6760 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6761 behavior.
6763 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6765 @item -fmerge-all-constants
6766 @opindex fmerge-all-constants
6767 Attempt to merge identical constants and identical variables.
6769 This option implies @option{-fmerge-constants}.  In addition to
6770 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6771 arrays or initialized constant variables with integral or floating-point
6772 types.  Languages like C or C++ require each variable, including multiple
6773 instances of the same variable in recursive calls, to have distinct locations,
6774 so using this option results in non-conforming
6775 behavior.
6777 @item -fmodulo-sched
6778 @opindex fmodulo-sched
6779 Perform swing modulo scheduling immediately before the first scheduling
6780 pass.  This pass looks at innermost loops and reorders their
6781 instructions by overlapping different iterations.
6783 @item -fmodulo-sched-allow-regmoves
6784 @opindex fmodulo-sched-allow-regmoves
6785 Perform more aggressive SMS-based modulo scheduling with register moves
6786 allowed.  By setting this flag certain anti-dependences edges are
6787 deleted, which triggers the generation of reg-moves based on the
6788 life-range analysis.  This option is effective only with
6789 @option{-fmodulo-sched} enabled.
6791 @item -fno-branch-count-reg
6792 @opindex fno-branch-count-reg
6793 Do not use ``decrement and branch'' instructions on a count register,
6794 but instead generate a sequence of instructions that decrement a
6795 register, compare it against zero, then branch based upon the result.
6796 This option is only meaningful on architectures that support such
6797 instructions, which include x86, PowerPC, IA-64 and S/390.
6799 The default is @option{-fbranch-count-reg}.
6801 @item -fno-function-cse
6802 @opindex fno-function-cse
6803 Do not put function addresses in registers; make each instruction that
6804 calls a constant function contain the function's address explicitly.
6806 This option results in less efficient code, but some strange hacks
6807 that alter the assembler output may be confused by the optimizations
6808 performed when this option is not used.
6810 The default is @option{-ffunction-cse}
6812 @item -fno-zero-initialized-in-bss
6813 @opindex fno-zero-initialized-in-bss
6814 If the target supports a BSS section, GCC by default puts variables that
6815 are initialized to zero into BSS@.  This can save space in the resulting
6816 code.
6818 This option turns off this behavior because some programs explicitly
6819 rely on variables going to the data section---e.g., so that the
6820 resulting executable can find the beginning of that section and/or make
6821 assumptions based on that.
6823 The default is @option{-fzero-initialized-in-bss}.
6825 @item -fmudflap -fmudflapth -fmudflapir
6826 @opindex fmudflap
6827 @opindex fmudflapth
6828 @opindex fmudflapir
6829 @cindex bounds checking
6830 @cindex mudflap
6831 For front-ends that support it (C and C++), instrument all risky
6832 pointer/array dereferencing operations, some standard library
6833 string/heap functions, and some other associated constructs with
6834 range/validity tests.  Modules so instrumented should be immune to
6835 buffer overflows, invalid heap use, and some other classes of C/C++
6836 programming errors.  The instrumentation relies on a separate runtime
6837 library (@file{libmudflap}), which is linked into a program if
6838 @option{-fmudflap} is given at link time.  Run-time behavior of the
6839 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6840 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6841 for its options.
6843 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6844 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6845 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6846 instrumentation should ignore pointer reads.  This produces less
6847 instrumentation (and therefore faster execution) and still provides
6848 some protection against outright memory corrupting writes, but allows
6849 erroneously read data to propagate within a program.
6851 @item -fthread-jumps
6852 @opindex fthread-jumps
6853 Perform optimizations that check to see if a jump branches to a
6854 location where another comparison subsumed by the first is found.  If
6855 so, the first branch is redirected to either the destination of the
6856 second branch or a point immediately following it, depending on whether
6857 the condition is known to be true or false.
6859 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6861 @item -fsplit-wide-types
6862 @opindex fsplit-wide-types
6863 When using a type that occupies multiple registers, such as @code{long
6864 long} on a 32-bit system, split the registers apart and allocate them
6865 independently.  This normally generates better code for those types,
6866 but may make debugging more difficult.
6868 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6869 @option{-Os}.
6871 @item -fcse-follow-jumps
6872 @opindex fcse-follow-jumps
6873 In common subexpression elimination (CSE), scan through jump instructions
6874 when the target of the jump is not reached by any other path.  For
6875 example, when CSE encounters an @code{if} statement with an
6876 @code{else} clause, CSE follows the jump when the condition
6877 tested is false.
6879 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6881 @item -fcse-skip-blocks
6882 @opindex fcse-skip-blocks
6883 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6884 follow jumps that conditionally skip over blocks.  When CSE
6885 encounters a simple @code{if} statement with no else clause,
6886 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6887 body of the @code{if}.
6889 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6891 @item -frerun-cse-after-loop
6892 @opindex frerun-cse-after-loop
6893 Re-run common subexpression elimination after loop optimizations are
6894 performed.
6896 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6898 @item -fgcse
6899 @opindex fgcse
6900 Perform a global common subexpression elimination pass.
6901 This pass also performs global constant and copy propagation.
6903 @emph{Note:} When compiling a program using computed gotos, a GCC
6904 extension, you may get better run-time performance if you disable
6905 the global common subexpression elimination pass by adding
6906 @option{-fno-gcse} to the command line.
6908 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6910 @item -fgcse-lm
6911 @opindex fgcse-lm
6912 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6913 attempts to move loads that are only killed by stores into themselves.  This
6914 allows a loop containing a load/store sequence to be changed to a load outside
6915 the loop, and a copy/store within the loop.
6917 Enabled by default when @option{-fgcse} is enabled.
6919 @item -fgcse-sm
6920 @opindex fgcse-sm
6921 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6922 global common subexpression elimination.  This pass attempts to move
6923 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6924 loops containing a load/store sequence can be changed to a load before
6925 the loop and a store after the loop.
6927 Not enabled at any optimization level.
6929 @item -fgcse-las
6930 @opindex fgcse-las
6931 When @option{-fgcse-las} is enabled, the global common subexpression
6932 elimination pass eliminates redundant loads that come after stores to the
6933 same memory location (both partial and full redundancies).
6935 Not enabled at any optimization level.
6937 @item -fgcse-after-reload
6938 @opindex fgcse-after-reload
6939 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6940 pass is performed after reload.  The purpose of this pass is to clean up
6941 redundant spilling.
6943 @item -funsafe-loop-optimizations
6944 @opindex funsafe-loop-optimizations
6945 This option tells the loop optimizer to assume that loop indices do not
6946 overflow, and that loops with nontrivial exit condition are not
6947 infinite.  This enables a wider range of loop optimizations even if
6948 the loop optimizer itself cannot prove that these assumptions are valid.
6949 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
6950 if it finds this kind of loop.
6952 @item -fcrossjumping
6953 @opindex fcrossjumping
6954 Perform cross-jumping transformation.
6955 This transformation unifies equivalent code and saves code size.  The
6956 resulting code may or may not perform better than without cross-jumping.
6958 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6960 @item -fauto-inc-dec
6961 @opindex fauto-inc-dec
6962 Combine increments or decrements of addresses with memory accesses.
6963 This pass is always skipped on architectures that do not have
6964 instructions to support this.  Enabled by default at @option{-O} and
6965 higher on architectures that support this.
6967 @item -fdce
6968 @opindex fdce
6969 Perform dead code elimination (DCE) on RTL@.
6970 Enabled by default at @option{-O} and higher.
6972 @item -fdse
6973 @opindex fdse
6974 Perform dead store elimination (DSE) on RTL@.
6975 Enabled by default at @option{-O} and higher.
6977 @item -fif-conversion
6978 @opindex fif-conversion
6979 Attempt to transform conditional jumps into branch-less equivalents.  This
6980 includes use of conditional moves, min, max, set flags and abs instructions, and
6981 some tricks doable by standard arithmetics.  The use of conditional execution
6982 on chips where it is available is controlled by @code{if-conversion2}.
6984 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6986 @item -fif-conversion2
6987 @opindex fif-conversion2
6988 Use conditional execution (where available) to transform conditional jumps into
6989 branch-less equivalents.
6991 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6993 @item -fdelete-null-pointer-checks
6994 @opindex fdelete-null-pointer-checks
6995 Assume that programs cannot safely dereference null pointers, and that
6996 no code or data element resides there.  This enables simple constant
6997 folding optimizations at all optimization levels.  In addition, other
6998 optimization passes in GCC use this flag to control global dataflow
6999 analyses that eliminate useless checks for null pointers; these assume
7000 that if a pointer is checked after it has already been dereferenced,
7001 it cannot be null.
7003 Note however that in some environments this assumption is not true.
7004 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7005 for programs that depend on that behavior.
7007 Some targets, especially embedded ones, disable this option at all levels.
7008 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7009 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7010 are enabled independently at different optimization levels.
7012 @item -fdevirtualize
7013 @opindex fdevirtualize
7014 Attempt to convert calls to virtual functions to direct calls.  This
7015 is done both within a procedure and interprocedurally as part of
7016 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7017 propagation (@option{-fipa-cp}).
7018 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7020 @item -fexpensive-optimizations
7021 @opindex fexpensive-optimizations
7022 Perform a number of minor optimizations that are relatively expensive.
7024 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7026 @item -free
7027 @opindex free
7028 Attempt to remove redundant extension instructions.  This is especially
7029 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7030 registers after writing to their lower 32-bit half.
7032 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7034 @item -foptimize-register-move
7035 @itemx -fregmove
7036 @opindex foptimize-register-move
7037 @opindex fregmove
7038 Attempt to reassign register numbers in move instructions and as
7039 operands of other simple instructions in order to maximize the amount of
7040 register tying.  This is especially helpful on machines with two-operand
7041 instructions.
7043 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7044 optimization.
7046 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7048 @item -fira-algorithm=@var{algorithm}
7049 Use the specified coloring algorithm for the integrated register
7050 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7051 specifies Chow's priority coloring, or @samp{CB}, which specifies
7052 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7053 for all architectures, but for those targets that do support it, it is
7054 the default because it generates better code.
7056 @item -fira-region=@var{region}
7057 Use specified regions for the integrated register allocator.  The
7058 @var{region} argument should be one of the following:
7060 @table @samp
7062 @item all
7063 Use all loops as register allocation regions.
7064 This can give the best results for machines with a small and/or
7065 irregular register set.
7067 @item mixed
7068 Use all loops except for loops with small register pressure 
7069 as the regions.  This value usually gives
7070 the best results in most cases and for most architectures,
7071 and is enabled by default when compiling with optimization for speed
7072 (@option{-O}, @option{-O2}, @dots{}).
7074 @item one
7075 Use all functions as a single region.  
7076 This typically results in the smallest code size, and is enabled by default for
7077 @option{-Os} or @option{-O0}.
7079 @end table
7081 @item -fira-hoist-pressure
7082 @opindex fira-hoist-pressure
7083 Use IRA to evaluate register pressure in the code hoisting pass for
7084 decisions to hoist expressions.  This option usually results in smaller
7085 code, but it can slow the compiler down.
7087 This option is enabled at level @option{-Os} for all targets.
7089 @item -fira-loop-pressure
7090 @opindex fira-loop-pressure
7091 Use IRA to evaluate register pressure in loops for decisions to move
7092 loop invariants.  This option usually results in generation
7093 of faster and smaller code on machines with large register files (>= 32
7094 registers), but it can slow the compiler down.
7096 This option is enabled at level @option{-O3} for some targets.
7098 @item -fno-ira-share-save-slots
7099 @opindex fno-ira-share-save-slots
7100 Disable sharing of stack slots used for saving call-used hard
7101 registers living through a call.  Each hard register gets a
7102 separate stack slot, and as a result function stack frames are
7103 larger.
7105 @item -fno-ira-share-spill-slots
7106 @opindex fno-ira-share-spill-slots
7107 Disable sharing of stack slots allocated for pseudo-registers.  Each
7108 pseudo-register that does not get a hard register gets a separate
7109 stack slot, and as a result function stack frames are larger.
7111 @item -fira-verbose=@var{n}
7112 @opindex fira-verbose
7113 Control the verbosity of the dump file for the integrated register allocator.
7114 The default value is 5.  If the value @var{n} is greater or equal to 10,
7115 the dump output is sent to stderr using the same format as @var{n} minus 10.
7117 @item -fdelayed-branch
7118 @opindex fdelayed-branch
7119 If supported for the target machine, attempt to reorder instructions
7120 to exploit instruction slots available after delayed branch
7121 instructions.
7123 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7125 @item -fschedule-insns
7126 @opindex fschedule-insns
7127 If supported for the target machine, attempt to reorder instructions to
7128 eliminate execution stalls due to required data being unavailable.  This
7129 helps machines that have slow floating point or memory load instructions
7130 by allowing other instructions to be issued until the result of the load
7131 or floating-point instruction is required.
7133 Enabled at levels @option{-O2}, @option{-O3}.
7135 @item -fschedule-insns2
7136 @opindex fschedule-insns2
7137 Similar to @option{-fschedule-insns}, but requests an additional pass of
7138 instruction scheduling after register allocation has been done.  This is
7139 especially useful on machines with a relatively small number of
7140 registers and where memory load instructions take more than one cycle.
7142 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7144 @item -fno-sched-interblock
7145 @opindex fno-sched-interblock
7146 Don't schedule instructions across basic blocks.  This is normally
7147 enabled by default when scheduling before register allocation, i.e.@:
7148 with @option{-fschedule-insns} or at @option{-O2} or higher.
7150 @item -fno-sched-spec
7151 @opindex fno-sched-spec
7152 Don't allow speculative motion of non-load instructions.  This is normally
7153 enabled by default when scheduling before register allocation, i.e.@:
7154 with @option{-fschedule-insns} or at @option{-O2} or higher.
7156 @item -fsched-pressure
7157 @opindex fsched-pressure
7158 Enable register pressure sensitive insn scheduling before register
7159 allocation.  This only makes sense when scheduling before register
7160 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7161 @option{-O2} or higher.  Usage of this option can improve the
7162 generated code and decrease its size by preventing register pressure
7163 increase above the number of available hard registers and subsequent
7164 spills in register allocation.
7166 @item -fsched-spec-load
7167 @opindex fsched-spec-load
7168 Allow speculative motion of some load instructions.  This only makes
7169 sense when scheduling before register allocation, i.e.@: with
7170 @option{-fschedule-insns} or at @option{-O2} or higher.
7172 @item -fsched-spec-load-dangerous
7173 @opindex fsched-spec-load-dangerous
7174 Allow speculative motion of more load instructions.  This only makes
7175 sense when scheduling before register allocation, i.e.@: with
7176 @option{-fschedule-insns} or at @option{-O2} or higher.
7178 @item -fsched-stalled-insns
7179 @itemx -fsched-stalled-insns=@var{n}
7180 @opindex fsched-stalled-insns
7181 Define how many insns (if any) can be moved prematurely from the queue
7182 of stalled insns into the ready list during the second scheduling pass.
7183 @option{-fno-sched-stalled-insns} means that no insns are moved
7184 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7185 on how many queued insns can be moved prematurely.
7186 @option{-fsched-stalled-insns} without a value is equivalent to
7187 @option{-fsched-stalled-insns=1}.
7189 @item -fsched-stalled-insns-dep
7190 @itemx -fsched-stalled-insns-dep=@var{n}
7191 @opindex fsched-stalled-insns-dep
7192 Define how many insn groups (cycles) are examined for a dependency
7193 on a stalled insn that is a candidate for premature removal from the queue
7194 of stalled insns.  This has an effect only during the second scheduling pass,
7195 and only if @option{-fsched-stalled-insns} is used.
7196 @option{-fno-sched-stalled-insns-dep} is equivalent to
7197 @option{-fsched-stalled-insns-dep=0}.
7198 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7199 @option{-fsched-stalled-insns-dep=1}.
7201 @item -fsched2-use-superblocks
7202 @opindex fsched2-use-superblocks
7203 When scheduling after register allocation, use superblock scheduling.
7204 This allows motion across basic block boundaries,
7205 resulting in faster schedules.  This option is experimental, as not all machine
7206 descriptions used by GCC model the CPU closely enough to avoid unreliable
7207 results from the algorithm.
7209 This only makes sense when scheduling after register allocation, i.e.@: with
7210 @option{-fschedule-insns2} or at @option{-O2} or higher.
7212 @item -fsched-group-heuristic
7213 @opindex fsched-group-heuristic
7214 Enable the group heuristic in the scheduler.  This heuristic favors
7215 the instruction that belongs to a schedule group.  This is enabled
7216 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7217 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7219 @item -fsched-critical-path-heuristic
7220 @opindex fsched-critical-path-heuristic
7221 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7222 instructions on the critical path.  This is enabled by default when
7223 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7224 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7226 @item -fsched-spec-insn-heuristic
7227 @opindex fsched-spec-insn-heuristic
7228 Enable the speculative instruction heuristic in the scheduler.  This
7229 heuristic favors speculative instructions with greater dependency weakness.
7230 This is enabled by default when scheduling is enabled, i.e.@:
7231 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7232 or at @option{-O2} or higher.
7234 @item -fsched-rank-heuristic
7235 @opindex fsched-rank-heuristic
7236 Enable the rank heuristic in the scheduler.  This heuristic favors
7237 the instruction belonging to a basic block with greater size or frequency.
7238 This is enabled by default when scheduling is enabled, i.e.@:
7239 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7240 at @option{-O2} or higher.
7242 @item -fsched-last-insn-heuristic
7243 @opindex fsched-last-insn-heuristic
7244 Enable the last-instruction heuristic in the scheduler.  This heuristic
7245 favors the instruction that is less dependent on the last instruction
7246 scheduled.  This is enabled by default when scheduling is enabled,
7247 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7248 at @option{-O2} or higher.
7250 @item -fsched-dep-count-heuristic
7251 @opindex fsched-dep-count-heuristic
7252 Enable the dependent-count heuristic in the scheduler.  This heuristic
7253 favors the instruction that has more instructions depending on it.
7254 This is enabled by default when scheduling is enabled, i.e.@:
7255 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7256 at @option{-O2} or higher.
7258 @item -freschedule-modulo-scheduled-loops
7259 @opindex freschedule-modulo-scheduled-loops
7260 Modulo scheduling is performed before traditional scheduling.  If a loop
7261 is modulo scheduled, later scheduling passes may change its schedule.  
7262 Use this option to control that behavior.
7264 @item -fselective-scheduling
7265 @opindex fselective-scheduling
7266 Schedule instructions using selective scheduling algorithm.  Selective
7267 scheduling runs instead of the first scheduler pass.
7269 @item -fselective-scheduling2
7270 @opindex fselective-scheduling2
7271 Schedule instructions using selective scheduling algorithm.  Selective
7272 scheduling runs instead of the second scheduler pass.
7274 @item -fsel-sched-pipelining
7275 @opindex fsel-sched-pipelining
7276 Enable software pipelining of innermost loops during selective scheduling.
7277 This option has no effect unless one of @option{-fselective-scheduling} or
7278 @option{-fselective-scheduling2} is turned on.
7280 @item -fsel-sched-pipelining-outer-loops
7281 @opindex fsel-sched-pipelining-outer-loops
7282 When pipelining loops during selective scheduling, also pipeline outer loops.
7283 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7285 @item -fshrink-wrap
7286 @opindex fshrink-wrap
7287 Emit function prologues only before parts of the function that need it,
7288 rather than at the top of the function.  This flag is enabled by default at
7289 @option{-O} and higher.
7291 @item -fcaller-saves
7292 @opindex fcaller-saves
7293 Enable allocation of values to registers that are clobbered by
7294 function calls, by emitting extra instructions to save and restore the
7295 registers around such calls.  Such allocation is done only when it
7296 seems to result in better code.
7298 This option is always enabled by default on certain machines, usually
7299 those which have no call-preserved registers to use instead.
7301 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7303 @item -fcombine-stack-adjustments
7304 @opindex fcombine-stack-adjustments
7305 Tracks stack adjustments (pushes and pops) and stack memory references
7306 and then tries to find ways to combine them.
7308 Enabled by default at @option{-O1} and higher.
7310 @item -fconserve-stack
7311 @opindex fconserve-stack
7312 Attempt to minimize stack usage.  The compiler attempts to use less
7313 stack space, even if that makes the program slower.  This option
7314 implies setting the @option{large-stack-frame} parameter to 100
7315 and the @option{large-stack-frame-growth} parameter to 400.
7317 @item -ftree-reassoc
7318 @opindex ftree-reassoc
7319 Perform reassociation on trees.  This flag is enabled by default
7320 at @option{-O} and higher.
7322 @item -ftree-pre
7323 @opindex ftree-pre
7324 Perform partial redundancy elimination (PRE) on trees.  This flag is
7325 enabled by default at @option{-O2} and @option{-O3}.
7327 @item -ftree-partial-pre
7328 @opindex ftree-partial-pre
7329 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7330 enabled by default at @option{-O3}.
7332 @item -ftree-forwprop
7333 @opindex ftree-forwprop
7334 Perform forward propagation on trees.  This flag is enabled by default
7335 at @option{-O} and higher.
7337 @item -ftree-fre
7338 @opindex ftree-fre
7339 Perform full redundancy elimination (FRE) on trees.  The difference
7340 between FRE and PRE is that FRE only considers expressions
7341 that are computed on all paths leading to the redundant computation.
7342 This analysis is faster than PRE, though it exposes fewer redundancies.
7343 This flag is enabled by default at @option{-O} and higher.
7345 @item -ftree-phiprop
7346 @opindex ftree-phiprop
7347 Perform hoisting of loads from conditional pointers on trees.  This
7348 pass is enabled by default at @option{-O} and higher.
7350 @item -fhoist-adjacent-loads
7351 @opindex hoist-adjacent-loads
7352 Speculatively hoist loads from both branches of an if-then-else if the
7353 loads are from adjacent locations in the same structure and the target
7354 architecture has a conditional move instruction.  This flag is enabled
7355 by default at @option{-O2} and higher.
7357 @item -ftree-copy-prop
7358 @opindex ftree-copy-prop
7359 Perform copy propagation on trees.  This pass eliminates unnecessary
7360 copy operations.  This flag is enabled by default at @option{-O} and
7361 higher.
7363 @item -fipa-pure-const
7364 @opindex fipa-pure-const
7365 Discover which functions are pure or constant.
7366 Enabled by default at @option{-O} and higher.
7368 @item -fipa-reference
7369 @opindex fipa-reference
7370 Discover which static variables do not escape the
7371 compilation unit.
7372 Enabled by default at @option{-O} and higher.
7374 @item -fipa-pta
7375 @opindex fipa-pta
7376 Perform interprocedural pointer analysis and interprocedural modification
7377 and reference analysis.  This option can cause excessive memory and
7378 compile-time usage on large compilation units.  It is not enabled by
7379 default at any optimization level.
7381 @item -fipa-profile
7382 @opindex fipa-profile
7383 Perform interprocedural profile propagation.  The functions called only from
7384 cold functions are marked as cold. Also functions executed once (such as
7385 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7386 functions and loop less parts of functions executed once are then optimized for
7387 size.
7388 Enabled by default at @option{-O} and higher.
7390 @item -fipa-cp
7391 @opindex fipa-cp
7392 Perform interprocedural constant propagation.
7393 This optimization analyzes the program to determine when values passed
7394 to functions are constants and then optimizes accordingly.
7395 This optimization can substantially increase performance
7396 if the application has constants passed to functions.
7397 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7399 @item -fipa-cp-clone
7400 @opindex fipa-cp-clone
7401 Perform function cloning to make interprocedural constant propagation stronger.
7402 When enabled, interprocedural constant propagation performs function cloning
7403 when externally visible function can be called with constant arguments.
7404 Because this optimization can create multiple copies of functions,
7405 it may significantly increase code size
7406 (see @option{--param ipcp-unit-growth=@var{value}}).
7407 This flag is enabled by default at @option{-O3}.
7409 @item -ftree-sink
7410 @opindex ftree-sink
7411 Perform forward store motion  on trees.  This flag is
7412 enabled by default at @option{-O} and higher.
7414 @item -ftree-bit-ccp
7415 @opindex ftree-bit-ccp
7416 Perform sparse conditional bit constant propagation on trees and propagate
7417 pointer alignment information.
7418 This pass only operates on local scalar variables and is enabled by default
7419 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7421 @item -ftree-ccp
7422 @opindex ftree-ccp
7423 Perform sparse conditional constant propagation (CCP) on trees.  This
7424 pass only operates on local scalar variables and is enabled by default
7425 at @option{-O} and higher.
7427 @item -ftree-switch-conversion
7428 Perform conversion of simple initializations in a switch to
7429 initializations from a scalar array.  This flag is enabled by default
7430 at @option{-O2} and higher.
7432 @item -ftree-tail-merge
7433 Look for identical code sequences.  When found, replace one with a jump to the
7434 other.  This optimization is known as tail merging or cross jumping.  This flag
7435 is enabled by default at @option{-O2} and higher.  The compilation time
7436 in this pass can
7437 be limited using @option{max-tail-merge-comparisons} parameter and
7438 @option{max-tail-merge-iterations} parameter.
7440 @item -ftree-dce
7441 @opindex ftree-dce
7442 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7443 default at @option{-O} and higher.
7445 @item -ftree-builtin-call-dce
7446 @opindex ftree-builtin-call-dce
7447 Perform conditional dead code elimination (DCE) for calls to built-in functions
7448 that may set @code{errno} but are otherwise side-effect free.  This flag is
7449 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7450 specified.
7452 @item -ftree-dominator-opts
7453 @opindex ftree-dominator-opts
7454 Perform a variety of simple scalar cleanups (constant/copy
7455 propagation, redundancy elimination, range propagation and expression
7456 simplification) based on a dominator tree traversal.  This also
7457 performs jump threading (to reduce jumps to jumps). This flag is
7458 enabled by default at @option{-O} and higher.
7460 @item -ftree-dse
7461 @opindex ftree-dse
7462 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7463 a memory location that is later overwritten by another store without
7464 any intervening loads.  In this case the earlier store can be deleted.  This
7465 flag is enabled by default at @option{-O} and higher.
7467 @item -ftree-ch
7468 @opindex ftree-ch
7469 Perform loop header copying on trees.  This is beneficial since it increases
7470 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7471 is enabled by default at @option{-O} and higher.  It is not enabled
7472 for @option{-Os}, since it usually increases code size.
7474 @item -ftree-loop-optimize
7475 @opindex ftree-loop-optimize
7476 Perform loop optimizations on trees.  This flag is enabled by default
7477 at @option{-O} and higher.
7479 @item -ftree-loop-linear
7480 @opindex ftree-loop-linear
7481 Perform loop interchange transformations on tree.  Same as
7482 @option{-floop-interchange}.  To use this code transformation, GCC has
7483 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7484 enable the Graphite loop transformation infrastructure.
7486 @item -floop-interchange
7487 @opindex floop-interchange
7488 Perform loop interchange transformations on loops.  Interchanging two
7489 nested loops switches the inner and outer loops.  For example, given a
7490 loop like:
7491 @smallexample
7492 DO J = 1, M
7493   DO I = 1, N
7494     A(J, I) = A(J, I) * C
7495   ENDDO
7496 ENDDO
7497 @end smallexample
7498 loop interchange transforms the loop as if it were written:
7499 @smallexample
7500 DO I = 1, N
7501   DO J = 1, M
7502     A(J, I) = A(J, I) * C
7503   ENDDO
7504 ENDDO
7505 @end smallexample
7506 which can be beneficial when @code{N} is larger than the caches,
7507 because in Fortran, the elements of an array are stored in memory
7508 contiguously by column, and the original loop iterates over rows,
7509 potentially creating at each access a cache miss.  This optimization
7510 applies to all the languages supported by GCC and is not limited to
7511 Fortran.  To use this code transformation, GCC has to be configured
7512 with @option{--with-ppl} and @option{--with-cloog} to enable the
7513 Graphite loop transformation infrastructure.
7515 @item -floop-strip-mine
7516 @opindex floop-strip-mine
7517 Perform loop strip mining transformations on loops.  Strip mining
7518 splits a loop into two nested loops.  The outer loop has strides
7519 equal to the strip size and the inner loop has strides of the
7520 original loop within a strip.  The strip length can be changed
7521 using the @option{loop-block-tile-size} parameter.  For example,
7522 given a loop like:
7523 @smallexample
7524 DO I = 1, N
7525   A(I) = A(I) + C
7526 ENDDO
7527 @end smallexample
7528 loop strip mining transforms the loop as if it were written:
7529 @smallexample
7530 DO II = 1, N, 51
7531   DO I = II, min (II + 50, N)
7532     A(I) = A(I) + C
7533   ENDDO
7534 ENDDO
7535 @end smallexample
7536 This optimization applies to all the languages supported by GCC and is
7537 not limited to Fortran.  To use this code transformation, GCC has to
7538 be configured with @option{--with-ppl} and @option{--with-cloog} to
7539 enable the Graphite loop transformation infrastructure.
7541 @item -floop-block
7542 @opindex floop-block
7543 Perform loop blocking transformations on loops.  Blocking strip mines
7544 each loop in the loop nest such that the memory accesses of the
7545 element loops fit inside caches.  The strip length can be changed
7546 using the @option{loop-block-tile-size} parameter.  For example, given
7547 a loop like:
7548 @smallexample
7549 DO I = 1, N
7550   DO J = 1, M
7551     A(J, I) = B(I) + C(J)
7552   ENDDO
7553 ENDDO
7554 @end smallexample
7555 loop blocking transforms the loop as if it were written:
7556 @smallexample
7557 DO II = 1, N, 51
7558   DO JJ = 1, M, 51
7559     DO I = II, min (II + 50, N)
7560       DO J = JJ, min (JJ + 50, M)
7561         A(J, I) = B(I) + C(J)
7562       ENDDO
7563     ENDDO
7564   ENDDO
7565 ENDDO
7566 @end smallexample
7567 which can be beneficial when @code{M} is larger than the caches,
7568 because the innermost loop iterates over a smaller amount of data
7569 which can be kept in the caches.  This optimization applies to all the
7570 languages supported by GCC and is not limited to Fortran.  To use this
7571 code transformation, GCC has to be configured with @option{--with-ppl}
7572 and @option{--with-cloog} to enable the Graphite loop transformation
7573 infrastructure.
7575 @item -fgraphite-identity
7576 @opindex fgraphite-identity
7577 Enable the identity transformation for graphite.  For every SCoP we generate
7578 the polyhedral representation and transform it back to gimple.  Using
7579 @option{-fgraphite-identity} we can check the costs or benefits of the
7580 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7581 are also performed by the code generator CLooG, like index splitting and
7582 dead code elimination in loops.
7584 @item -floop-nest-optimize
7585 @opindex floop-nest-optimize
7586 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7587 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7588 structure optimized for data-locality and parallelism.  This option
7589 is experimental.
7591 @item -floop-parallelize-all
7592 @opindex floop-parallelize-all
7593 Use the Graphite data dependence analysis to identify loops that can
7594 be parallelized.  Parallelize all the loops that can be analyzed to
7595 not contain loop carried dependences without checking that it is
7596 profitable to parallelize the loops.
7598 @item -fcheck-data-deps
7599 @opindex fcheck-data-deps
7600 Compare the results of several data dependence analyzers.  This option
7601 is used for debugging the data dependence analyzers.
7603 @item -ftree-loop-if-convert
7604 Attempt to transform conditional jumps in the innermost loops to
7605 branch-less equivalents.  The intent is to remove control-flow from
7606 the innermost loops in order to improve the ability of the
7607 vectorization pass to handle these loops.  This is enabled by default
7608 if vectorization is enabled.
7610 @item -ftree-loop-if-convert-stores
7611 Attempt to also if-convert conditional jumps containing memory writes.
7612 This transformation can be unsafe for multi-threaded programs as it
7613 transforms conditional memory writes into unconditional memory writes.
7614 For example,
7615 @smallexample
7616 for (i = 0; i < N; i++)
7617   if (cond)
7618     A[i] = expr;
7619 @end smallexample
7620 is transformed to
7621 @smallexample
7622 for (i = 0; i < N; i++)
7623   A[i] = cond ? expr : A[i];
7624 @end smallexample
7625 potentially producing data races.
7627 @item -ftree-loop-distribution
7628 Perform loop distribution.  This flag can improve cache performance on
7629 big loop bodies and allow further loop optimizations, like
7630 parallelization or vectorization, to take place.  For example, the loop
7631 @smallexample
7632 DO I = 1, N
7633   A(I) = B(I) + C
7634   D(I) = E(I) * F
7635 ENDDO
7636 @end smallexample
7637 is transformed to
7638 @smallexample
7639 DO I = 1, N
7640    A(I) = B(I) + C
7641 ENDDO
7642 DO I = 1, N
7643    D(I) = E(I) * F
7644 ENDDO
7645 @end smallexample
7647 @item -ftree-loop-distribute-patterns
7648 Perform loop distribution of patterns that can be code generated with
7649 calls to a library.  This flag is enabled by default at @option{-O3}.
7651 This pass distributes the initialization loops and generates a call to
7652 memset zero.  For example, the loop
7653 @smallexample
7654 DO I = 1, N
7655   A(I) = 0
7656   B(I) = A(I) + I
7657 ENDDO
7658 @end smallexample
7659 is transformed to
7660 @smallexample
7661 DO I = 1, N
7662    A(I) = 0
7663 ENDDO
7664 DO I = 1, N
7665    B(I) = A(I) + I
7666 ENDDO
7667 @end smallexample
7668 and the initialization loop is transformed into a call to memset zero.
7670 @item -ftree-loop-im
7671 @opindex ftree-loop-im
7672 Perform loop invariant motion on trees.  This pass moves only invariants that
7673 are hard to handle at RTL level (function calls, operations that expand to
7674 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7675 operands of conditions that are invariant out of the loop, so that we can use
7676 just trivial invariantness analysis in loop unswitching.  The pass also includes
7677 store motion.
7679 @item -ftree-loop-ivcanon
7680 @opindex ftree-loop-ivcanon
7681 Create a canonical counter for number of iterations in loops for which
7682 determining number of iterations requires complicated analysis.  Later
7683 optimizations then may determine the number easily.  Useful especially
7684 in connection with unrolling.
7686 @item -fivopts
7687 @opindex fivopts
7688 Perform induction variable optimizations (strength reduction, induction
7689 variable merging and induction variable elimination) on trees.
7691 @item -ftree-parallelize-loops=n
7692 @opindex ftree-parallelize-loops
7693 Parallelize loops, i.e., split their iteration space to run in n threads.
7694 This is only possible for loops whose iterations are independent
7695 and can be arbitrarily reordered.  The optimization is only
7696 profitable on multiprocessor machines, for loops that are CPU-intensive,
7697 rather than constrained e.g.@: by memory bandwidth.  This option
7698 implies @option{-pthread}, and thus is only supported on targets
7699 that have support for @option{-pthread}.
7701 @item -ftree-pta
7702 @opindex ftree-pta
7703 Perform function-local points-to analysis on trees.  This flag is
7704 enabled by default at @option{-O} and higher.
7706 @item -ftree-sra
7707 @opindex ftree-sra
7708 Perform scalar replacement of aggregates.  This pass replaces structure
7709 references with scalars to prevent committing structures to memory too
7710 early.  This flag is enabled by default at @option{-O} and higher.
7712 @item -ftree-copyrename
7713 @opindex ftree-copyrename
7714 Perform copy renaming on trees.  This pass attempts to rename compiler
7715 temporaries to other variables at copy locations, usually resulting in
7716 variable names which more closely resemble the original variables.  This flag
7717 is enabled by default at @option{-O} and higher.
7719 @item -ftree-coalesce-inlined-vars
7720 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7721 combine small user-defined variables too, but only if they were inlined
7722 from other functions.  It is a more limited form of
7723 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7724 inlined variables, but it will keep variables of the inlined-into
7725 function apart from each other, such that they are more likely to
7726 contain the expected values in a debugging session.  This was the
7727 default in GCC versions older than 4.7.
7729 @item -ftree-coalesce-vars
7730 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7731 combine small user-defined variables too, instead of just compiler
7732 temporaries.  This may severely limit the ability to debug an optimized
7733 program compiled with @option{-fno-var-tracking-assignments}.  In the
7734 negated form, this flag prevents SSA coalescing of user variables,
7735 including inlined ones.  This option is enabled by default.
7737 @item -ftree-ter
7738 @opindex ftree-ter
7739 Perform temporary expression replacement during the SSA->normal phase.  Single
7740 use/single def temporaries are replaced at their use location with their
7741 defining expression.  This results in non-GIMPLE code, but gives the expanders
7742 much more complex trees to work on resulting in better RTL generation.  This is
7743 enabled by default at @option{-O} and higher.
7745 @item -ftree-slsr
7746 @opindex ftree-slsr
7747 Perform straight-line strength reduction on trees.  This recognizes related
7748 expressions involving multiplications and replaces them by less expensive
7749 calculations when possible.  This is enabled by default at @option{-O} and
7750 higher.
7752 @item -ftree-vectorize
7753 @opindex ftree-vectorize
7754 Perform loop vectorization on trees. This flag is enabled by default at
7755 @option{-O3}.
7757 @item -ftree-slp-vectorize
7758 @opindex ftree-slp-vectorize
7759 Perform basic block vectorization on trees. This flag is enabled by default at
7760 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7762 @item -ftree-vect-loop-version
7763 @opindex ftree-vect-loop-version
7764 Perform loop versioning when doing loop vectorization on trees.  When a loop
7765 appears to be vectorizable except that data alignment or data dependence cannot
7766 be determined at compile time, then vectorized and non-vectorized versions of
7767 the loop are generated along with run-time checks for alignment or dependence
7768 to control which version is executed.  This option is enabled by default
7769 except at level @option{-Os} where it is disabled.
7771 @item -fvect-cost-model
7772 @opindex fvect-cost-model
7773 Enable cost model for vectorization.  This option is enabled by default at
7774 @option{-O3}.
7776 @item -ftree-vrp
7777 @opindex ftree-vrp
7778 Perform Value Range Propagation on trees.  This is similar to the
7779 constant propagation pass, but instead of values, ranges of values are
7780 propagated.  This allows the optimizers to remove unnecessary range
7781 checks like array bound checks and null pointer checks.  This is
7782 enabled by default at @option{-O2} and higher.  Null pointer check
7783 elimination is only done if @option{-fdelete-null-pointer-checks} is
7784 enabled.
7786 @item -ftracer
7787 @opindex ftracer
7788 Perform tail duplication to enlarge superblock size.  This transformation
7789 simplifies the control flow of the function allowing other optimizations to do
7790 a better job.
7792 @item -funroll-loops
7793 @opindex funroll-loops
7794 Unroll loops whose number of iterations can be determined at compile
7795 time or upon entry to the loop.  @option{-funroll-loops} implies
7796 @option{-frerun-cse-after-loop}.  This option makes code larger,
7797 and may or may not make it run faster.
7799 @item -funroll-all-loops
7800 @opindex funroll-all-loops
7801 Unroll all loops, even if their number of iterations is uncertain when
7802 the loop is entered.  This usually makes programs run more slowly.
7803 @option{-funroll-all-loops} implies the same options as
7804 @option{-funroll-loops},
7806 @item -fsplit-ivs-in-unroller
7807 @opindex fsplit-ivs-in-unroller
7808 Enables expression of values of induction variables in later iterations
7809 of the unrolled loop using the value in the first iteration.  This breaks
7810 long dependency chains, thus improving efficiency of the scheduling passes.
7812 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7813 same effect.  However, that is not reliable in cases where the loop body
7814 is more complicated than a single basic block.  It also does not work at all
7815 on some architectures due to restrictions in the CSE pass.
7817 This optimization is enabled by default.
7819 @item -fvariable-expansion-in-unroller
7820 @opindex fvariable-expansion-in-unroller
7821 With this option, the compiler creates multiple copies of some
7822 local variables when unrolling a loop, which can result in superior code.
7824 @item -fpartial-inlining
7825 @opindex fpartial-inlining
7826 Inline parts of functions.  This option has any effect only
7827 when inlining itself is turned on by the @option{-finline-functions}
7828 or @option{-finline-small-functions} options.
7830 Enabled at level @option{-O2}.
7832 @item -fpredictive-commoning
7833 @opindex fpredictive-commoning
7834 Perform predictive commoning optimization, i.e., reusing computations
7835 (especially memory loads and stores) performed in previous
7836 iterations of loops.
7838 This option is enabled at level @option{-O3}.
7840 @item -fprefetch-loop-arrays
7841 @opindex fprefetch-loop-arrays
7842 If supported by the target machine, generate instructions to prefetch
7843 memory to improve the performance of loops that access large arrays.
7845 This option may generate better or worse code; results are highly
7846 dependent on the structure of loops within the source code.
7848 Disabled at level @option{-Os}.
7850 @item -fno-peephole
7851 @itemx -fno-peephole2
7852 @opindex fno-peephole
7853 @opindex fno-peephole2
7854 Disable any machine-specific peephole optimizations.  The difference
7855 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7856 are implemented in the compiler; some targets use one, some use the
7857 other, a few use both.
7859 @option{-fpeephole} is enabled by default.
7860 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7862 @item -fno-guess-branch-probability
7863 @opindex fno-guess-branch-probability
7864 Do not guess branch probabilities using heuristics.
7866 GCC uses heuristics to guess branch probabilities if they are
7867 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7868 heuristics are based on the control flow graph.  If some branch probabilities
7869 are specified by @samp{__builtin_expect}, then the heuristics are
7870 used to guess branch probabilities for the rest of the control flow graph,
7871 taking the @samp{__builtin_expect} info into account.  The interactions
7872 between the heuristics and @samp{__builtin_expect} can be complex, and in
7873 some cases, it may be useful to disable the heuristics so that the effects
7874 of @samp{__builtin_expect} are easier to understand.
7876 The default is @option{-fguess-branch-probability} at levels
7877 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7879 @item -freorder-blocks
7880 @opindex freorder-blocks
7881 Reorder basic blocks in the compiled function in order to reduce number of
7882 taken branches and improve code locality.
7884 Enabled at levels @option{-O2}, @option{-O3}.
7886 @item -freorder-blocks-and-partition
7887 @opindex freorder-blocks-and-partition
7888 In addition to reordering basic blocks in the compiled function, in order
7889 to reduce number of taken branches, partitions hot and cold basic blocks
7890 into separate sections of the assembly and .o files, to improve
7891 paging and cache locality performance.
7893 This optimization is automatically turned off in the presence of
7894 exception handling, for linkonce sections, for functions with a user-defined
7895 section attribute and on any architecture that does not support named
7896 sections.
7898 @item -freorder-functions
7899 @opindex freorder-functions
7900 Reorder functions in the object file in order to
7901 improve code locality.  This is implemented by using special
7902 subsections @code{.text.hot} for most frequently executed functions and
7903 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7904 the linker so object file format must support named sections and linker must
7905 place them in a reasonable way.
7907 Also profile feedback must be available to make this option effective.  See
7908 @option{-fprofile-arcs} for details.
7910 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7912 @item -fstrict-aliasing
7913 @opindex fstrict-aliasing
7914 Allow the compiler to assume the strictest aliasing rules applicable to
7915 the language being compiled.  For C (and C++), this activates
7916 optimizations based on the type of expressions.  In particular, an
7917 object of one type is assumed never to reside at the same address as an
7918 object of a different type, unless the types are almost the same.  For
7919 example, an @code{unsigned int} can alias an @code{int}, but not a
7920 @code{void*} or a @code{double}.  A character type may alias any other
7921 type.
7923 @anchor{Type-punning}Pay special attention to code like this:
7924 @smallexample
7925 union a_union @{
7926   int i;
7927   double d;
7930 int f() @{
7931   union a_union t;
7932   t.d = 3.0;
7933   return t.i;
7935 @end smallexample
7936 The practice of reading from a different union member than the one most
7937 recently written to (called ``type-punning'') is common.  Even with
7938 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7939 is accessed through the union type.  So, the code above works as
7940 expected.  @xref{Structures unions enumerations and bit-fields
7941 implementation}.  However, this code might not:
7942 @smallexample
7943 int f() @{
7944   union a_union t;
7945   int* ip;
7946   t.d = 3.0;
7947   ip = &t.i;
7948   return *ip;
7950 @end smallexample
7952 Similarly, access by taking the address, casting the resulting pointer
7953 and dereferencing the result has undefined behavior, even if the cast
7954 uses a union type, e.g.:
7955 @smallexample
7956 int f() @{
7957   double d = 3.0;
7958   return ((union a_union *) &d)->i;
7960 @end smallexample
7962 The @option{-fstrict-aliasing} option is enabled at levels
7963 @option{-O2}, @option{-O3}, @option{-Os}.
7965 @item -fstrict-overflow
7966 @opindex fstrict-overflow
7967 Allow the compiler to assume strict signed overflow rules, depending
7968 on the language being compiled.  For C (and C++) this means that
7969 overflow when doing arithmetic with signed numbers is undefined, which
7970 means that the compiler may assume that it does not happen.  This
7971 permits various optimizations.  For example, the compiler assumes
7972 that an expression like @code{i + 10 > i} is always true for
7973 signed @code{i}.  This assumption is only valid if signed overflow is
7974 undefined, as the expression is false if @code{i + 10} overflows when
7975 using twos complement arithmetic.  When this option is in effect any
7976 attempt to determine whether an operation on signed numbers 
7977 overflows must be written carefully to not actually involve overflow.
7979 This option also allows the compiler to assume strict pointer
7980 semantics: given a pointer to an object, if adding an offset to that
7981 pointer does not produce a pointer to the same object, the addition is
7982 undefined.  This permits the compiler to conclude that @code{p + u >
7983 p} is always true for a pointer @code{p} and unsigned integer
7984 @code{u}.  This assumption is only valid because pointer wraparound is
7985 undefined, as the expression is false if @code{p + u} overflows using
7986 twos complement arithmetic.
7988 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7989 that integer signed overflow is fully defined: it wraps.  When
7990 @option{-fwrapv} is used, there is no difference between
7991 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7992 integers.  With @option{-fwrapv} certain types of overflow are
7993 permitted.  For example, if the compiler gets an overflow when doing
7994 arithmetic on constants, the overflowed value can still be used with
7995 @option{-fwrapv}, but not otherwise.
7997 The @option{-fstrict-overflow} option is enabled at levels
7998 @option{-O2}, @option{-O3}, @option{-Os}.
8000 @item -falign-functions
8001 @itemx -falign-functions=@var{n}
8002 @opindex falign-functions
8003 Align the start of functions to the next power-of-two greater than
8004 @var{n}, skipping up to @var{n} bytes.  For instance,
8005 @option{-falign-functions=32} aligns functions to the next 32-byte
8006 boundary, but @option{-falign-functions=24} aligns to the next
8007 32-byte boundary only if this can be done by skipping 23 bytes or less.
8009 @option{-fno-align-functions} and @option{-falign-functions=1} are
8010 equivalent and mean that functions are not aligned.
8012 Some assemblers only support this flag when @var{n} is a power of two;
8013 in that case, it is rounded up.
8015 If @var{n} is not specified or is zero, use a machine-dependent default.
8017 Enabled at levels @option{-O2}, @option{-O3}.
8019 @item -falign-labels
8020 @itemx -falign-labels=@var{n}
8021 @opindex falign-labels
8022 Align all branch targets to a power-of-two boundary, skipping up to
8023 @var{n} bytes like @option{-falign-functions}.  This option can easily
8024 make code slower, because it must insert dummy operations for when the
8025 branch target is reached in the usual flow of the code.
8027 @option{-fno-align-labels} and @option{-falign-labels=1} are
8028 equivalent and mean that labels are not aligned.
8030 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8031 are greater than this value, then their values are used instead.
8033 If @var{n} is not specified or is zero, use a machine-dependent default
8034 which is very likely to be @samp{1}, meaning no alignment.
8036 Enabled at levels @option{-O2}, @option{-O3}.
8038 @item -falign-loops
8039 @itemx -falign-loops=@var{n}
8040 @opindex falign-loops
8041 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8042 like @option{-falign-functions}.  If the loops are
8043 executed many times, this makes up for any execution of the dummy
8044 operations.
8046 @option{-fno-align-loops} and @option{-falign-loops=1} are
8047 equivalent and mean that loops are not aligned.
8049 If @var{n} is not specified or is zero, use a machine-dependent default.
8051 Enabled at levels @option{-O2}, @option{-O3}.
8053 @item -falign-jumps
8054 @itemx -falign-jumps=@var{n}
8055 @opindex falign-jumps
8056 Align branch targets to a power-of-two boundary, for branch targets
8057 where the targets can only be reached by jumping, skipping up to @var{n}
8058 bytes like @option{-falign-functions}.  In this case, no dummy operations
8059 need be executed.
8061 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8062 equivalent and mean that loops are not aligned.
8064 If @var{n} is not specified or is zero, use a machine-dependent default.
8066 Enabled at levels @option{-O2}, @option{-O3}.
8068 @item -funit-at-a-time
8069 @opindex funit-at-a-time
8070 This option is left for compatibility reasons. @option{-funit-at-a-time}
8071 has no effect, while @option{-fno-unit-at-a-time} implies
8072 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8074 Enabled by default.
8076 @item -fno-toplevel-reorder
8077 @opindex fno-toplevel-reorder
8078 Do not reorder top-level functions, variables, and @code{asm}
8079 statements.  Output them in the same order that they appear in the
8080 input file.  When this option is used, unreferenced static variables
8081 are not removed.  This option is intended to support existing code
8082 that relies on a particular ordering.  For new code, it is better to
8083 use attributes.
8085 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8086 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8087 targets.
8089 @item -fweb
8090 @opindex fweb
8091 Constructs webs as commonly used for register allocation purposes and assign
8092 each web individual pseudo register.  This allows the register allocation pass
8093 to operate on pseudos directly, but also strengthens several other optimization
8094 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8095 however, make debugging impossible, since variables no longer stay in a
8096 ``home register''.
8098 Enabled by default with @option{-funroll-loops}.
8100 @item -fwhole-program
8101 @opindex fwhole-program
8102 Assume that the current compilation unit represents the whole program being
8103 compiled.  All public functions and variables with the exception of @code{main}
8104 and those merged by attribute @code{externally_visible} become static functions
8105 and in effect are optimized more aggressively by interprocedural optimizers. If @command{gold} is used as the linker plugin, @code{externally_visible} attributes are automatically added to functions (not variable yet due to a current @command{gold} issue) that are accessed outside of LTO objects according to resolution file produced by @command{gold}.  For other linkers that cannot generate resolution file, explicit @code{externally_visible} attributes are still necessary.
8106 While this option is equivalent to proper use of the @code{static} keyword for
8107 programs consisting of a single file, in combination with option
8108 @option{-flto} this flag can be used to
8109 compile many smaller scale programs since the functions and variables become
8110 local for the whole combined compilation unit, not for the single source file
8111 itself.
8113 This option implies @option{-fwhole-file} for Fortran programs.
8115 @item -flto[=@var{n}]
8116 @opindex flto
8117 This option runs the standard link-time optimizer.  When invoked
8118 with source code, it generates GIMPLE (one of GCC's internal
8119 representations) and writes it to special ELF sections in the object
8120 file.  When the object files are linked together, all the function
8121 bodies are read from these ELF sections and instantiated as if they
8122 had been part of the same translation unit.
8124 To use the link-time optimizer, @option{-flto} needs to be specified at
8125 compile time and during the final link.  For example:
8127 @smallexample
8128 gcc -c -O2 -flto foo.c
8129 gcc -c -O2 -flto bar.c
8130 gcc -o myprog -flto -O2 foo.o bar.o
8131 @end smallexample
8133 The first two invocations to GCC save a bytecode representation
8134 of GIMPLE into special ELF sections inside @file{foo.o} and
8135 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8136 @file{foo.o} and @file{bar.o}, merges the two files into a single
8137 internal image, and compiles the result as usual.  Since both
8138 @file{foo.o} and @file{bar.o} are merged into a single image, this
8139 causes all the interprocedural analyses and optimizations in GCC to
8140 work across the two files as if they were a single one.  This means,
8141 for example, that the inliner is able to inline functions in
8142 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8144 Another (simpler) way to enable link-time optimization is:
8146 @smallexample
8147 gcc -o myprog -flto -O2 foo.c bar.c
8148 @end smallexample
8150 The above generates bytecode for @file{foo.c} and @file{bar.c},
8151 merges them together into a single GIMPLE representation and optimizes
8152 them as usual to produce @file{myprog}.
8154 The only important thing to keep in mind is that to enable link-time
8155 optimizations the @option{-flto} flag needs to be passed to both the
8156 compile and the link commands.
8158 To make whole program optimization effective, it is necessary to make
8159 certain whole program assumptions.  The compiler needs to know
8160 what functions and variables can be accessed by libraries and runtime
8161 outside of the link-time optimized unit.  When supported by the linker,
8162 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8163 to the compiler about used and externally visible symbols.  When
8164 the linker plugin is not available, @option{-fwhole-program} should be
8165 used to allow the compiler to make these assumptions, which leads
8166 to more aggressive optimization decisions.
8168 Note that when a file is compiled with @option{-flto}, the generated
8169 object file is larger than a regular object file because it 
8170 contains GIMPLE bytecodes and the usual final code.  This means that
8171 object files with LTO information can be linked as normal object
8172 files; if @option{-flto} is not passed to the linker, no
8173 interprocedural optimizations are applied.
8175 Additionally, the optimization flags used to compile individual files
8176 are not necessarily related to those used at link time.  For instance,
8178 @smallexample
8179 gcc -c -O0 -flto foo.c
8180 gcc -c -O0 -flto bar.c
8181 gcc -o myprog -flto -O3 foo.o bar.o
8182 @end smallexample
8184 This produces individual object files with unoptimized assembler
8185 code, but the resulting binary @file{myprog} is optimized at
8186 @option{-O3}.  If, instead, the final binary is generated without
8187 @option{-flto}, then @file{myprog} is not optimized.
8189 When producing the final binary with @option{-flto}, GCC only
8190 applies link-time optimizations to those files that contain bytecode.
8191 Therefore, you can mix and match object files and libraries with
8192 GIMPLE bytecodes and final object code.  GCC automatically selects
8193 which files to optimize in LTO mode and which files to link without
8194 further processing.
8196 There are some code generation flags preserved by GCC when
8197 generating bytecodes, as they need to be used during the final link
8198 stage.  Currently, the following options are saved into the GIMPLE
8199 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8200 @option{-m} target flags.
8202 At link time, these options are read in and reapplied.  Note that the
8203 current implementation makes no attempt to recognize conflicting
8204 values for these options.  If different files have conflicting option
8205 values (e.g., one file is compiled with @option{-fPIC} and another
8206 isn't), the compiler simply uses the last value read from the
8207 bytecode files.  It is recommended, then, that you compile all the files
8208 participating in the same link with the same options.
8210 If LTO encounters objects with C linkage declared with incompatible
8211 types in separate translation units to be linked together (undefined
8212 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8213 issued.  The behavior is still undefined at run time.
8215 Another feature of LTO is that it is possible to apply interprocedural
8216 optimizations on files written in different languages.  This requires
8217 support in the language front end.  Currently, the C, C++ and
8218 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8219 something like this should work:
8221 @smallexample
8222 gcc -c -flto foo.c
8223 g++ -c -flto bar.cc
8224 gfortran -c -flto baz.f90
8225 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8226 @end smallexample
8228 Notice that the final link is done with @command{g++} to get the C++
8229 runtime libraries and @option{-lgfortran} is added to get the Fortran
8230 runtime libraries.  In general, when mixing languages in LTO mode, you
8231 should use the same link command options as when mixing languages in a
8232 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8233 all the compile and link commands.
8235 If object files containing GIMPLE bytecode are stored in a library archive, say
8236 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8237 are using a linker with plugin support.  To enable this feature, use
8238 the flag @option{-fuse-linker-plugin} at link time:
8240 @smallexample
8241 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8242 @end smallexample
8244 With the linker plugin enabled, the linker extracts the needed
8245 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8246 to make them part of the aggregated GIMPLE image to be optimized.
8248 If you are not using a linker with plugin support and/or do not
8249 enable the linker plugin, then the objects inside @file{libfoo.a}
8250 are extracted and linked as usual, but they do not participate
8251 in the LTO optimization process.
8253 Link-time optimizations do not require the presence of the whole program to
8254 operate.  If the program does not require any symbols to be exported, it is
8255 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8256 the interprocedural optimizers to use more aggressive assumptions which may
8257 lead to improved optimization opportunities.
8258 Use of @option{-fwhole-program} is not needed when linker plugin is
8259 active (see @option{-fuse-linker-plugin}).
8261 The current implementation of LTO makes no
8262 attempt to generate bytecode that is portable between different
8263 types of hosts.  The bytecode files are versioned and there is a
8264 strict version check, so bytecode files generated in one version of
8265 GCC will not work with an older/newer version of GCC@.
8267 Link-time optimization does not work well with generation of debugging
8268 information.  Combining @option{-flto} with
8269 @option{-g} is currently experimental and expected to produce wrong
8270 results.
8272 If you specify the optional @var{n}, the optimization and code
8273 generation done at link time is executed in parallel using @var{n}
8274 parallel jobs by utilizing an installed @command{make} program.  The
8275 environment variable @env{MAKE} may be used to override the program
8276 used.  The default value for @var{n} is 1.
8278 You can also specify @option{-flto=jobserver} to use GNU make's
8279 job server mode to determine the number of parallel jobs. This
8280 is useful when the Makefile calling GCC is already executing in parallel.
8281 You must prepend a @samp{+} to the command recipe in the parent Makefile
8282 for this to work.  This option likely only works if @env{MAKE} is
8283 GNU make.
8285 This option is disabled by default.
8287 @item -flto-partition=@var{alg}
8288 @opindex flto-partition
8289 Specify the partitioning algorithm used by the link-time optimizer.
8290 The value is either @code{1to1} to specify a partitioning mirroring
8291 the original source files or @code{balanced} to specify partitioning
8292 into equally sized chunks (whenever possible) or @code{max} to create
8293 new partition for every symbol where possible.  Specifying @code{none}
8294 as an algorithm disables partitioning and streaming completely. 
8295 The default value is @code{balanced}. While @code{1to1} can be used
8296 as an workaround for various code ordering issues, the @code{max}
8297 partitioning is intended for internal testing only.
8299 @item -flto-compression-level=@var{n}
8300 This option specifies the level of compression used for intermediate
8301 language written to LTO object files, and is only meaningful in
8302 conjunction with LTO mode (@option{-flto}).  Valid
8303 values are 0 (no compression) to 9 (maximum compression).  Values
8304 outside this range are clamped to either 0 or 9.  If the option is not
8305 given, a default balanced compression setting is used.
8307 @item -flto-report
8308 Prints a report with internal details on the workings of the link-time
8309 optimizer.  The contents of this report vary from version to version.
8310 It is meant to be useful to GCC developers when processing object
8311 files in LTO mode (via @option{-flto}).
8313 Disabled by default.
8315 @item -fuse-linker-plugin
8316 Enables the use of a linker plugin during link-time optimization.  This
8317 option relies on plugin support in the linker, which is available in gold
8318 or in GNU ld 2.21 or newer.
8320 This option enables the extraction of object files with GIMPLE bytecode out
8321 of library archives. This improves the quality of optimization by exposing
8322 more code to the link-time optimizer.  This information specifies what
8323 symbols can be accessed externally (by non-LTO object or during dynamic
8324 linking).  Resulting code quality improvements on binaries (and shared
8325 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8326 See @option{-flto} for a description of the effect of this flag and how to
8327 use it.
8329 This option is enabled by default when LTO support in GCC is enabled
8330 and GCC was configured for use with
8331 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8333 @item -ffat-lto-objects
8334 @opindex ffat-lto-objects
8335 Fat LTO objects are object files that contain both the intermediate language
8336 and the object code. This makes them usable for both LTO linking and normal
8337 linking. This option is effective only when compiling with @option{-flto}
8338 and is ignored at link time.
8340 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8341 requires the complete toolchain to be aware of LTO. It requires a linker with
8342 linker plugin support for basic functionality.  Additionally,
8343 @command{nm}, @command{ar} and @command{ranlib}
8344 need to support linker plugins to allow a full-featured build environment
8345 (capable of building static libraries etc). gcc provides the @command{gcc-ar},
8346 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8347 to these tools. With non fat LTO makefiles need to be modified to use them.
8349 The default is @option{-ffat-lto-objects} but this default is intended to
8350 change in future releases when linker plugin enabled environments become more
8351 common.
8353 @item -fcompare-elim
8354 @opindex fcompare-elim
8355 After register allocation and post-register allocation instruction splitting,
8356 identify arithmetic instructions that compute processor flags similar to a
8357 comparison operation based on that arithmetic.  If possible, eliminate the
8358 explicit comparison operation.
8360 This pass only applies to certain targets that cannot explicitly represent
8361 the comparison operation before register allocation is complete.
8363 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8365 @item -fcprop-registers
8366 @opindex fcprop-registers
8367 After register allocation and post-register allocation instruction splitting,
8368 perform a copy-propagation pass to try to reduce scheduling dependencies
8369 and occasionally eliminate the copy.
8371 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8373 @item -fprofile-correction
8374 @opindex fprofile-correction
8375 Profiles collected using an instrumented binary for multi-threaded programs may
8376 be inconsistent due to missed counter updates. When this option is specified,
8377 GCC uses heuristics to correct or smooth out such inconsistencies. By
8378 default, GCC emits an error message when an inconsistent profile is detected.
8380 @item -fprofile-dir=@var{path}
8381 @opindex fprofile-dir
8383 Set the directory to search for the profile data files in to @var{path}.
8384 This option affects only the profile data generated by
8385 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8386 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8387 and its related options.  Both absolute and relative paths can be used.
8388 By default, GCC uses the current directory as @var{path}, thus the
8389 profile data file appears in the same directory as the object file.
8391 @item -fprofile-generate
8392 @itemx -fprofile-generate=@var{path}
8393 @opindex fprofile-generate
8395 Enable options usually used for instrumenting application to produce
8396 profile useful for later recompilation with profile feedback based
8397 optimization.  You must use @option{-fprofile-generate} both when
8398 compiling and when linking your program.
8400 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8402 If @var{path} is specified, GCC looks at the @var{path} to find
8403 the profile feedback data files. See @option{-fprofile-dir}.
8405 @item -fprofile-use
8406 @itemx -fprofile-use=@var{path}
8407 @opindex fprofile-use
8408 Enable profile feedback directed optimizations, and optimizations
8409 generally profitable only with profile feedback available.
8411 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8412 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8413 @code{ftree-loop-distribute-patterns}
8415 By default, GCC emits an error message if the feedback profiles do not
8416 match the source code.  This error can be turned into a warning by using
8417 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8418 code.
8420 If @var{path} is specified, GCC looks at the @var{path} to find
8421 the profile feedback data files. See @option{-fprofile-dir}.
8422 @end table
8424 The following options control compiler behavior regarding floating-point 
8425 arithmetic.  These options trade off between speed and
8426 correctness.  All must be specifically enabled.
8428 @table @gcctabopt
8429 @item -ffloat-store
8430 @opindex ffloat-store
8431 Do not store floating-point variables in registers, and inhibit other
8432 options that might change whether a floating-point value is taken from a
8433 register or memory.
8435 @cindex floating-point precision
8436 This option prevents undesirable excess precision on machines such as
8437 the 68000 where the floating registers (of the 68881) keep more
8438 precision than a @code{double} is supposed to have.  Similarly for the
8439 x86 architecture.  For most programs, the excess precision does only
8440 good, but a few programs rely on the precise definition of IEEE floating
8441 point.  Use @option{-ffloat-store} for such programs, after modifying
8442 them to store all pertinent intermediate computations into variables.
8444 @item -fexcess-precision=@var{style}
8445 @opindex fexcess-precision
8446 This option allows further control over excess precision on machines
8447 where floating-point registers have more precision than the IEEE
8448 @code{float} and @code{double} types and the processor does not
8449 support operations rounding to those types.  By default,
8450 @option{-fexcess-precision=fast} is in effect; this means that
8451 operations are carried out in the precision of the registers and that
8452 it is unpredictable when rounding to the types specified in the source
8453 code takes place.  When compiling C, if
8454 @option{-fexcess-precision=standard} is specified then excess
8455 precision follows the rules specified in ISO C99; in particular,
8456 both casts and assignments cause values to be rounded to their
8457 semantic types (whereas @option{-ffloat-store} only affects
8458 assignments).  This option is enabled by default for C if a strict
8459 conformance option such as @option{-std=c99} is used.
8461 @opindex mfpmath
8462 @option{-fexcess-precision=standard} is not implemented for languages
8463 other than C, and has no effect if
8464 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8465 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8466 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8467 semantics apply without excess precision, and in the latter, rounding
8468 is unpredictable.
8470 @item -ffast-math
8471 @opindex ffast-math
8472 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8473 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8474 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8476 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8478 This option is not turned on by any @option{-O} option besides
8479 @option{-Ofast} since it can result in incorrect output for programs
8480 that depend on an exact implementation of IEEE or ISO rules/specifications
8481 for math functions. It may, however, yield faster code for programs
8482 that do not require the guarantees of these specifications.
8484 @item -fno-math-errno
8485 @opindex fno-math-errno
8486 Do not set @code{errno} after calling math functions that are executed
8487 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8488 IEEE exceptions for math error handling may want to use this flag
8489 for speed while maintaining IEEE arithmetic compatibility.
8491 This option is not turned on by any @option{-O} option since
8492 it can result in incorrect output for programs that depend on
8493 an exact implementation of IEEE or ISO rules/specifications for
8494 math functions. It may, however, yield faster code for programs
8495 that do not require the guarantees of these specifications.
8497 The default is @option{-fmath-errno}.
8499 On Darwin systems, the math library never sets @code{errno}.  There is
8500 therefore no reason for the compiler to consider the possibility that
8501 it might, and @option{-fno-math-errno} is the default.
8503 @item -funsafe-math-optimizations
8504 @opindex funsafe-math-optimizations
8506 Allow optimizations for floating-point arithmetic that (a) assume
8507 that arguments and results are valid and (b) may violate IEEE or
8508 ANSI standards.  When used at link-time, it may include libraries
8509 or startup files that change the default FPU control word or other
8510 similar optimizations.
8512 This option is not turned on by any @option{-O} option since
8513 it can result in incorrect output for programs that depend on
8514 an exact implementation of IEEE or ISO rules/specifications for
8515 math functions. It may, however, yield faster code for programs
8516 that do not require the guarantees of these specifications.
8517 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8518 @option{-fassociative-math} and @option{-freciprocal-math}.
8520 The default is @option{-fno-unsafe-math-optimizations}.
8522 @item -fassociative-math
8523 @opindex fassociative-math
8525 Allow re-association of operands in series of floating-point operations.
8526 This violates the ISO C and C++ language standard by possibly changing
8527 computation result.  NOTE: re-ordering may change the sign of zero as
8528 well as ignore NaNs and inhibit or create underflow or overflow (and
8529 thus cannot be used on code that relies on rounding behavior like
8530 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8531 and thus may not be used when ordered comparisons are required.
8532 This option requires that both @option{-fno-signed-zeros} and
8533 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8534 much sense with @option{-frounding-math}. For Fortran the option
8535 is automatically enabled when both @option{-fno-signed-zeros} and
8536 @option{-fno-trapping-math} are in effect.
8538 The default is @option{-fno-associative-math}.
8540 @item -freciprocal-math
8541 @opindex freciprocal-math
8543 Allow the reciprocal of a value to be used instead of dividing by
8544 the value if this enables optimizations.  For example @code{x / y}
8545 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8546 is subject to common subexpression elimination.  Note that this loses
8547 precision and increases the number of flops operating on the value.
8549 The default is @option{-fno-reciprocal-math}.
8551 @item -ffinite-math-only
8552 @opindex ffinite-math-only
8553 Allow optimizations for floating-point arithmetic that assume
8554 that arguments and results are not NaNs or +-Infs.
8556 This option is not turned on by any @option{-O} option since
8557 it can result in incorrect output for programs that depend on
8558 an exact implementation of IEEE or ISO rules/specifications for
8559 math functions. It may, however, yield faster code for programs
8560 that do not require the guarantees of these specifications.
8562 The default is @option{-fno-finite-math-only}.
8564 @item -fno-signed-zeros
8565 @opindex fno-signed-zeros
8566 Allow optimizations for floating-point arithmetic that ignore the
8567 signedness of zero.  IEEE arithmetic specifies the behavior of
8568 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8569 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8570 This option implies that the sign of a zero result isn't significant.
8572 The default is @option{-fsigned-zeros}.
8574 @item -fno-trapping-math
8575 @opindex fno-trapping-math
8576 Compile code assuming that floating-point operations cannot generate
8577 user-visible traps.  These traps include division by zero, overflow,
8578 underflow, inexact result and invalid operation.  This option requires
8579 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8580 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8582 This option should never be turned on by any @option{-O} option since
8583 it can result in incorrect output for programs that depend on
8584 an exact implementation of IEEE or ISO rules/specifications for
8585 math functions.
8587 The default is @option{-ftrapping-math}.
8589 @item -frounding-math
8590 @opindex frounding-math
8591 Disable transformations and optimizations that assume default floating-point
8592 rounding behavior.  This is round-to-zero for all floating point
8593 to integer conversions, and round-to-nearest for all other arithmetic
8594 truncations.  This option should be specified for programs that change
8595 the FP rounding mode dynamically, or that may be executed with a
8596 non-default rounding mode.  This option disables constant folding of
8597 floating-point expressions at compile time (which may be affected by
8598 rounding mode) and arithmetic transformations that are unsafe in the
8599 presence of sign-dependent rounding modes.
8601 The default is @option{-fno-rounding-math}.
8603 This option is experimental and does not currently guarantee to
8604 disable all GCC optimizations that are affected by rounding mode.
8605 Future versions of GCC may provide finer control of this setting
8606 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8607 will be used to specify the default state for @code{FENV_ACCESS}.
8609 @item -fsignaling-nans
8610 @opindex fsignaling-nans
8611 Compile code assuming that IEEE signaling NaNs may generate user-visible
8612 traps during floating-point operations.  Setting this option disables
8613 optimizations that may change the number of exceptions visible with
8614 signaling NaNs.  This option implies @option{-ftrapping-math}.
8616 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8617 be defined.
8619 The default is @option{-fno-signaling-nans}.
8621 This option is experimental and does not currently guarantee to
8622 disable all GCC optimizations that affect signaling NaN behavior.
8624 @item -fsingle-precision-constant
8625 @opindex fsingle-precision-constant
8626 Treat floating-point constants as single precision instead of
8627 implicitly converting them to double-precision constants.
8629 @item -fcx-limited-range
8630 @opindex fcx-limited-range
8631 When enabled, this option states that a range reduction step is not
8632 needed when performing complex division.  Also, there is no checking
8633 whether the result of a complex multiplication or division is @code{NaN
8634 + I*NaN}, with an attempt to rescue the situation in that case.  The
8635 default is @option{-fno-cx-limited-range}, but is enabled by
8636 @option{-ffast-math}.
8638 This option controls the default setting of the ISO C99
8639 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8640 all languages.
8642 @item -fcx-fortran-rules
8643 @opindex fcx-fortran-rules
8644 Complex multiplication and division follow Fortran rules.  Range
8645 reduction is done as part of complex division, but there is no checking
8646 whether the result of a complex multiplication or division is @code{NaN
8647 + I*NaN}, with an attempt to rescue the situation in that case.
8649 The default is @option{-fno-cx-fortran-rules}.
8651 @end table
8653 The following options control optimizations that may improve
8654 performance, but are not enabled by any @option{-O} options.  This
8655 section includes experimental options that may produce broken code.
8657 @table @gcctabopt
8658 @item -fbranch-probabilities
8659 @opindex fbranch-probabilities
8660 After running a program compiled with @option{-fprofile-arcs}
8661 (@pxref{Debugging Options,, Options for Debugging Your Program or
8662 @command{gcc}}), you can compile it a second time using
8663 @option{-fbranch-probabilities}, to improve optimizations based on
8664 the number of times each branch was taken.  When a program
8665 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8666 counts to a file called @file{@var{sourcename}.gcda} for each source
8667 file.  The information in this data file is very dependent on the
8668 structure of the generated code, so you must use the same source code
8669 and the same optimization options for both compilations.
8671 With @option{-fbranch-probabilities}, GCC puts a
8672 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8673 These can be used to improve optimization.  Currently, they are only
8674 used in one place: in @file{reorg.c}, instead of guessing which path a
8675 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8676 exactly determine which path is taken more often.
8678 @item -fprofile-values
8679 @opindex fprofile-values
8680 If combined with @option{-fprofile-arcs}, it adds code so that some
8681 data about values of expressions in the program is gathered.
8683 With @option{-fbranch-probabilities}, it reads back the data gathered
8684 from profiling values of expressions for usage in optimizations.
8686 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8688 @item -fvpt
8689 @opindex fvpt
8690 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8691 to add code to gather information about values of expressions.
8693 With @option{-fbranch-probabilities}, it reads back the data gathered
8694 and actually performs the optimizations based on them.
8695 Currently the optimizations include specialization of division operations
8696 using the knowledge about the value of the denominator.
8698 @item -frename-registers
8699 @opindex frename-registers
8700 Attempt to avoid false dependencies in scheduled code by making use
8701 of registers left over after register allocation.  This optimization
8702 most benefits processors with lots of registers.  Depending on the
8703 debug information format adopted by the target, however, it can
8704 make debugging impossible, since variables no longer stay in
8705 a ``home register''.
8707 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8709 @item -ftracer
8710 @opindex ftracer
8711 Perform tail duplication to enlarge superblock size.  This transformation
8712 simplifies the control flow of the function allowing other optimizations to do
8713 a better job.
8715 Enabled with @option{-fprofile-use}.
8717 @item -funroll-loops
8718 @opindex funroll-loops
8719 Unroll loops whose number of iterations can be determined at compile time or
8720 upon entry to the loop.  @option{-funroll-loops} implies
8721 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8722 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8723 a small constant number of iterations).  This option makes code larger, and may
8724 or may not make it run faster.
8726 Enabled with @option{-fprofile-use}.
8728 @item -funroll-all-loops
8729 @opindex funroll-all-loops
8730 Unroll all loops, even if their number of iterations is uncertain when
8731 the loop is entered.  This usually makes programs run more slowly.
8732 @option{-funroll-all-loops} implies the same options as
8733 @option{-funroll-loops}.
8735 @item -fpeel-loops
8736 @opindex fpeel-loops
8737 Peels loops for which there is enough information that they do not
8738 roll much (from profile feedback).  It also turns on complete loop peeling
8739 (i.e.@: complete removal of loops with small constant number of iterations).
8741 Enabled with @option{-fprofile-use}.
8743 @item -fmove-loop-invariants
8744 @opindex fmove-loop-invariants
8745 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8746 at level @option{-O1}
8748 @item -funswitch-loops
8749 @opindex funswitch-loops
8750 Move branches with loop invariant conditions out of the loop, with duplicates
8751 of the loop on both branches (modified according to result of the condition).
8753 @item -ffunction-sections
8754 @itemx -fdata-sections
8755 @opindex ffunction-sections
8756 @opindex fdata-sections
8757 Place each function or data item into its own section in the output
8758 file if the target supports arbitrary sections.  The name of the
8759 function or the name of the data item determines the section's name
8760 in the output file.
8762 Use these options on systems where the linker can perform optimizations
8763 to improve locality of reference in the instruction space.  Most systems
8764 using the ELF object format and SPARC processors running Solaris 2 have
8765 linkers with such optimizations.  AIX may have these optimizations in
8766 the future.
8768 Only use these options when there are significant benefits from doing
8769 so.  When you specify these options, the assembler and linker
8770 create larger object and executable files and are also slower.
8771 You cannot use @code{gprof} on all systems if you
8772 specify this option, and you may have problems with debugging if
8773 you specify both this option and @option{-g}.
8775 @item -fbranch-target-load-optimize
8776 @opindex fbranch-target-load-optimize
8777 Perform branch target register load optimization before prologue / epilogue
8778 threading.
8779 The use of target registers can typically be exposed only during reload,
8780 thus hoisting loads out of loops and doing inter-block scheduling needs
8781 a separate optimization pass.
8783 @item -fbranch-target-load-optimize2
8784 @opindex fbranch-target-load-optimize2
8785 Perform branch target register load optimization after prologue / epilogue
8786 threading.
8788 @item -fbtr-bb-exclusive
8789 @opindex fbtr-bb-exclusive
8790 When performing branch target register load optimization, don't reuse
8791 branch target registers within any basic block.
8793 @item -fstack-protector
8794 @opindex fstack-protector
8795 Emit extra code to check for buffer overflows, such as stack smashing
8796 attacks.  This is done by adding a guard variable to functions with
8797 vulnerable objects.  This includes functions that call @code{alloca}, and
8798 functions with buffers larger than 8 bytes.  The guards are initialized
8799 when a function is entered and then checked when the function exits.
8800 If a guard check fails, an error message is printed and the program exits.
8802 @item -fstack-protector-all
8803 @opindex fstack-protector-all
8804 Like @option{-fstack-protector} except that all functions are protected.
8806 @item -fsection-anchors
8807 @opindex fsection-anchors
8808 Try to reduce the number of symbolic address calculations by using
8809 shared ``anchor'' symbols to address nearby objects.  This transformation
8810 can help to reduce the number of GOT entries and GOT accesses on some
8811 targets.
8813 For example, the implementation of the following function @code{foo}:
8815 @smallexample
8816 static int a, b, c;
8817 int foo (void) @{ return a + b + c; @}
8818 @end smallexample
8820 @noindent
8821 usually calculates the addresses of all three variables, but if you
8822 compile it with @option{-fsection-anchors}, it accesses the variables
8823 from a common anchor point instead.  The effect is similar to the
8824 following pseudocode (which isn't valid C):
8826 @smallexample
8827 int foo (void)
8829   register int *xr = &x;
8830   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8832 @end smallexample
8834 Not all targets support this option.
8836 @item --param @var{name}=@var{value}
8837 @opindex param
8838 In some places, GCC uses various constants to control the amount of
8839 optimization that is done.  For example, GCC does not inline functions
8840 that contain more than a certain number of instructions.  You can
8841 control some of these constants on the command line using the
8842 @option{--param} option.
8844 The names of specific parameters, and the meaning of the values, are
8845 tied to the internals of the compiler, and are subject to change
8846 without notice in future releases.
8848 In each case, the @var{value} is an integer.  The allowable choices for
8849 @var{name} are:
8851 @table @gcctabopt
8852 @item predictable-branch-outcome
8853 When branch is predicted to be taken with probability lower than this threshold
8854 (in percent), then it is considered well predictable. The default is 10.
8856 @item max-crossjump-edges
8857 The maximum number of incoming edges to consider for cross-jumping.
8858 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8859 the number of edges incoming to each block.  Increasing values mean
8860 more aggressive optimization, making the compilation time increase with
8861 probably small improvement in executable size.
8863 @item min-crossjump-insns
8864 The minimum number of instructions that must be matched at the end
8865 of two blocks before cross-jumping is performed on them.  This
8866 value is ignored in the case where all instructions in the block being
8867 cross-jumped from are matched.  The default value is 5.
8869 @item max-grow-copy-bb-insns
8870 The maximum code size expansion factor when copying basic blocks
8871 instead of jumping.  The expansion is relative to a jump instruction.
8872 The default value is 8.
8874 @item max-goto-duplication-insns
8875 The maximum number of instructions to duplicate to a block that jumps
8876 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8877 passes, GCC factors computed gotos early in the compilation process,
8878 and unfactors them as late as possible.  Only computed jumps at the
8879 end of a basic blocks with no more than max-goto-duplication-insns are
8880 unfactored.  The default value is 8.
8882 @item max-delay-slot-insn-search
8883 The maximum number of instructions to consider when looking for an
8884 instruction to fill a delay slot.  If more than this arbitrary number of
8885 instructions are searched, the time savings from filling the delay slot
8886 are minimal, so stop searching.  Increasing values mean more
8887 aggressive optimization, making the compilation time increase with probably
8888 small improvement in execution time.
8890 @item max-delay-slot-live-search
8891 When trying to fill delay slots, the maximum number of instructions to
8892 consider when searching for a block with valid live register
8893 information.  Increasing this arbitrarily chosen value means more
8894 aggressive optimization, increasing the compilation time.  This parameter
8895 should be removed when the delay slot code is rewritten to maintain the
8896 control-flow graph.
8898 @item max-gcse-memory
8899 The approximate maximum amount of memory that can be allocated in
8900 order to perform the global common subexpression elimination
8901 optimization.  If more memory than specified is required, the
8902 optimization is not done.
8904 @item max-gcse-insertion-ratio
8905 If the ratio of expression insertions to deletions is larger than this value
8906 for any expression, then RTL PRE inserts or removes the expression and thus
8907 leaves partially redundant computations in the instruction stream.  The default value is 20.
8909 @item max-pending-list-length
8910 The maximum number of pending dependencies scheduling allows
8911 before flushing the current state and starting over.  Large functions
8912 with few branches or calls can create excessively large lists which
8913 needlessly consume memory and resources.
8915 @item max-modulo-backtrack-attempts
8916 The maximum number of backtrack attempts the scheduler should make
8917 when modulo scheduling a loop.  Larger values can exponentially increase
8918 compilation time.
8920 @item max-inline-insns-single
8921 Several parameters control the tree inliner used in GCC@.
8922 This number sets the maximum number of instructions (counted in GCC's
8923 internal representation) in a single function that the tree inliner
8924 considers for inlining.  This only affects functions declared
8925 inline and methods implemented in a class declaration (C++).
8926 The default value is 400.
8928 @item max-inline-insns-auto
8929 When you use @option{-finline-functions} (included in @option{-O3}),
8930 a lot of functions that would otherwise not be considered for inlining
8931 by the compiler are investigated.  To those functions, a different
8932 (more restrictive) limit compared to functions declared inline can
8933 be applied.
8934 The default value is 40.
8936 @item large-function-insns
8937 The limit specifying really large functions.  For functions larger than this
8938 limit after inlining, inlining is constrained by
8939 @option{--param large-function-growth}.  This parameter is useful primarily
8940 to avoid extreme compilation time caused by non-linear algorithms used by the
8941 back end.
8942 The default value is 2700.
8944 @item large-function-growth
8945 Specifies maximal growth of large function caused by inlining in percents.
8946 The default value is 100 which limits large function growth to 2.0 times
8947 the original size.
8949 @item large-unit-insns
8950 The limit specifying large translation unit.  Growth caused by inlining of
8951 units larger than this limit is limited by @option{--param inline-unit-growth}.
8952 For small units this might be too tight.
8953 For example, consider a unit consisting of function A
8954 that is inline and B that just calls A three times.  If B is small relative to
8955 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8956 large units consisting of small inlineable functions, however, the overall unit
8957 growth limit is needed to avoid exponential explosion of code size.  Thus for
8958 smaller units, the size is increased to @option{--param large-unit-insns}
8959 before applying @option{--param inline-unit-growth}.  The default is 10000.
8961 @item inline-unit-growth
8962 Specifies maximal overall growth of the compilation unit caused by inlining.
8963 The default value is 30 which limits unit growth to 1.3 times the original
8964 size.
8966 @item ipcp-unit-growth
8967 Specifies maximal overall growth of the compilation unit caused by
8968 interprocedural constant propagation.  The default value is 10 which limits
8969 unit growth to 1.1 times the original size.
8971 @item large-stack-frame
8972 The limit specifying large stack frames.  While inlining the algorithm is trying
8973 to not grow past this limit too much.  The default value is 256 bytes.
8975 @item large-stack-frame-growth
8976 Specifies maximal growth of large stack frames caused by inlining in percents.
8977 The default value is 1000 which limits large stack frame growth to 11 times
8978 the original size.
8980 @item max-inline-insns-recursive
8981 @itemx max-inline-insns-recursive-auto
8982 Specifies the maximum number of instructions an out-of-line copy of a
8983 self-recursive inline
8984 function can grow into by performing recursive inlining.
8986 For functions declared inline, @option{--param max-inline-insns-recursive} is
8987 taken into account.  For functions not declared inline, recursive inlining
8988 happens only when @option{-finline-functions} (included in @option{-O3}) is
8989 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8990 default value is 450.
8992 @item max-inline-recursive-depth
8993 @itemx max-inline-recursive-depth-auto
8994 Specifies the maximum recursion depth used for recursive inlining.
8996 For functions declared inline, @option{--param max-inline-recursive-depth} is
8997 taken into account.  For functions not declared inline, recursive inlining
8998 happens only when @option{-finline-functions} (included in @option{-O3}) is
8999 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9000 default value is 8.
9002 @item min-inline-recursive-probability
9003 Recursive inlining is profitable only for function having deep recursion
9004 in average and can hurt for function having little recursion depth by
9005 increasing the prologue size or complexity of function body to other
9006 optimizers.
9008 When profile feedback is available (see @option{-fprofile-generate}) the actual
9009 recursion depth can be guessed from probability that function recurses via a
9010 given call expression.  This parameter limits inlining only to call expressions
9011 whose probability exceeds the given threshold (in percents).
9012 The default value is 10.
9014 @item early-inlining-insns
9015 Specify growth that the early inliner can make.  In effect it increases
9016 the amount of inlining for code having a large abstraction penalty.
9017 The default value is 10.
9019 @item max-early-inliner-iterations
9020 @itemx max-early-inliner-iterations
9021 Limit of iterations of the early inliner.  This basically bounds
9022 the number of nested indirect calls the early inliner can resolve.
9023 Deeper chains are still handled by late inlining.
9025 @item comdat-sharing-probability
9026 @itemx comdat-sharing-probability
9027 Probability (in percent) that C++ inline function with comdat visibility
9028 are shared across multiple compilation units.  The default value is 20.
9030 @item min-vect-loop-bound
9031 The minimum number of iterations under which loops are not vectorized
9032 when @option{-ftree-vectorize} is used.  The number of iterations after
9033 vectorization needs to be greater than the value specified by this option
9034 to allow vectorization.  The default value is 0.
9036 @item gcse-cost-distance-ratio
9037 Scaling factor in calculation of maximum distance an expression
9038 can be moved by GCSE optimizations.  This is currently supported only in the
9039 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9040 is with simple expressions, i.e., the expressions that have cost
9041 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9042 hoisting of simple expressions.  The default value is 10.
9044 @item gcse-unrestricted-cost
9045 Cost, roughly measured as the cost of a single typical machine
9046 instruction, at which GCSE optimizations do not constrain
9047 the distance an expression can travel.  This is currently
9048 supported only in the code hoisting pass.  The lesser the cost,
9049 the more aggressive code hoisting is.  Specifying 0 
9050 allows all expressions to travel unrestricted distances.
9051 The default value is 3.
9053 @item max-hoist-depth
9054 The depth of search in the dominator tree for expressions to hoist.
9055 This is used to avoid quadratic behavior in hoisting algorithm.
9056 The value of 0 does not limit on the search, but may slow down compilation
9057 of huge functions.  The default value is 30.
9059 @item max-tail-merge-comparisons
9060 The maximum amount of similar bbs to compare a bb with.  This is used to
9061 avoid quadratic behavior in tree tail merging.  The default value is 10.
9063 @item max-tail-merge-iterations
9064 The maximum amount of iterations of the pass over the function.  This is used to
9065 limit compilation time in tree tail merging.  The default value is 2.
9067 @item max-unrolled-insns
9068 The maximum number of instructions that a loop may have to be unrolled.
9069 If a loop is unrolled, this parameter also determines how many times
9070 the loop code is unrolled.
9072 @item max-average-unrolled-insns
9073 The maximum number of instructions biased by probabilities of their execution
9074 that a loop may have to be unrolled.  If a loop is unrolled,
9075 this parameter also determines how many times the loop code is unrolled.
9077 @item max-unroll-times
9078 The maximum number of unrollings of a single loop.
9080 @item max-peeled-insns
9081 The maximum number of instructions that a loop may have to be peeled.
9082 If a loop is peeled, this parameter also determines how many times
9083 the loop code is peeled.
9085 @item max-peel-times
9086 The maximum number of peelings of a single loop.
9088 @item max-peel-branches
9089 The maximum number of branches on the hot path through the peeled sequence.
9091 @item max-completely-peeled-insns
9092 The maximum number of insns of a completely peeled loop.
9094 @item max-completely-peel-times
9095 The maximum number of iterations of a loop to be suitable for complete peeling.
9097 @item max-completely-peel-loop-nest-depth
9098 The maximum depth of a loop nest suitable for complete peeling.
9100 @item max-unswitch-insns
9101 The maximum number of insns of an unswitched loop.
9103 @item max-unswitch-level
9104 The maximum number of branches unswitched in a single loop.
9106 @item lim-expensive
9107 The minimum cost of an expensive expression in the loop invariant motion.
9109 @item iv-consider-all-candidates-bound
9110 Bound on number of candidates for induction variables, below which
9111 all candidates are considered for each use in induction variable
9112 optimizations.  If there are more candidates than this,
9113 only the most relevant ones are considered to avoid quadratic time complexity.
9115 @item iv-max-considered-uses
9116 The induction variable optimizations give up on loops that contain more
9117 induction variable uses.
9119 @item iv-always-prune-cand-set-bound
9120 If the number of candidates in the set is smaller than this value,
9121 always try to remove unnecessary ivs from the set
9122 when adding a new one.
9124 @item scev-max-expr-size
9125 Bound on size of expressions used in the scalar evolutions analyzer.
9126 Large expressions slow the analyzer.
9128 @item scev-max-expr-complexity
9129 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9130 Complex expressions slow the analyzer.
9132 @item omega-max-vars
9133 The maximum number of variables in an Omega constraint system.
9134 The default value is 128.
9136 @item omega-max-geqs
9137 The maximum number of inequalities in an Omega constraint system.
9138 The default value is 256.
9140 @item omega-max-eqs
9141 The maximum number of equalities in an Omega constraint system.
9142 The default value is 128.
9144 @item omega-max-wild-cards
9145 The maximum number of wildcard variables that the Omega solver is
9146 able to insert.  The default value is 18.
9148 @item omega-hash-table-size
9149 The size of the hash table in the Omega solver.  The default value is
9150 550.
9152 @item omega-max-keys
9153 The maximal number of keys used by the Omega solver.  The default
9154 value is 500.
9156 @item omega-eliminate-redundant-constraints
9157 When set to 1, use expensive methods to eliminate all redundant
9158 constraints.  The default value is 0.
9160 @item vect-max-version-for-alignment-checks
9161 The maximum number of run-time checks that can be performed when
9162 doing loop versioning for alignment in the vectorizer.  See option
9163 @option{-ftree-vect-loop-version} for more information.
9165 @item vect-max-version-for-alias-checks
9166 The maximum number of run-time checks that can be performed when
9167 doing loop versioning for alias in the vectorizer.  See option
9168 @option{-ftree-vect-loop-version} for more information.
9170 @item max-iterations-to-track
9171 The maximum number of iterations of a loop the brute-force algorithm
9172 for analysis of the number of iterations of the loop tries to evaluate.
9174 @item hot-bb-count-fraction
9175 Select fraction of the maximal count of repetitions of basic block in program
9176 given basic block needs to have to be considered hot.
9178 @item hot-bb-frequency-fraction
9179 Select fraction of the entry block frequency of executions of basic block in
9180 function given basic block needs to have to be considered hot.
9182 @item max-predicted-iterations
9183 The maximum number of loop iterations we predict statically.  This is useful
9184 in cases where a function contains a single loop with known bound and
9185 another loop with unknown bound.
9186 The known number of iterations is predicted correctly, while
9187 the unknown number of iterations average to roughly 10.  This means that the
9188 loop without bounds appears artificially cold relative to the other one.
9190 @item align-threshold
9192 Select fraction of the maximal frequency of executions of a basic block in
9193 a function to align the basic block.
9195 @item align-loop-iterations
9197 A loop expected to iterate at least the selected number of iterations is
9198 aligned.
9200 @item tracer-dynamic-coverage
9201 @itemx tracer-dynamic-coverage-feedback
9203 This value is used to limit superblock formation once the given percentage of
9204 executed instructions is covered.  This limits unnecessary code size
9205 expansion.
9207 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9208 feedback is available.  The real profiles (as opposed to statically estimated
9209 ones) are much less balanced allowing the threshold to be larger value.
9211 @item tracer-max-code-growth
9212 Stop tail duplication once code growth has reached given percentage.  This is
9213 a rather artificial limit, as most of the duplicates are eliminated later in
9214 cross jumping, so it may be set to much higher values than is the desired code
9215 growth.
9217 @item tracer-min-branch-ratio
9219 Stop reverse growth when the reverse probability of best edge is less than this
9220 threshold (in percent).
9222 @item tracer-min-branch-ratio
9223 @itemx tracer-min-branch-ratio-feedback
9225 Stop forward growth if the best edge has probability lower than this
9226 threshold.
9228 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9229 compilation for profile feedback and one for compilation without.  The value
9230 for compilation with profile feedback needs to be more conservative (higher) in
9231 order to make tracer effective.
9233 @item max-cse-path-length
9235 The maximum number of basic blocks on path that CSE considers.
9236 The default is 10.
9238 @item max-cse-insns
9239 The maximum number of instructions CSE processes before flushing.
9240 The default is 1000.
9242 @item ggc-min-expand
9244 GCC uses a garbage collector to manage its own memory allocation.  This
9245 parameter specifies the minimum percentage by which the garbage
9246 collector's heap should be allowed to expand between collections.
9247 Tuning this may improve compilation speed; it has no effect on code
9248 generation.
9250 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9251 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9252 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9253 GCC is not able to calculate RAM on a particular platform, the lower
9254 bound of 30% is used.  Setting this parameter and
9255 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9256 every opportunity.  This is extremely slow, but can be useful for
9257 debugging.
9259 @item ggc-min-heapsize
9261 Minimum size of the garbage collector's heap before it begins bothering
9262 to collect garbage.  The first collection occurs after the heap expands
9263 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9264 tuning this may improve compilation speed, and has no effect on code
9265 generation.
9267 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9268 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9269 with a lower bound of 4096 (four megabytes) and an upper bound of
9270 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9271 particular platform, the lower bound is used.  Setting this parameter
9272 very large effectively disables garbage collection.  Setting this
9273 parameter and @option{ggc-min-expand} to zero causes a full collection
9274 to occur at every opportunity.
9276 @item max-reload-search-insns
9277 The maximum number of instruction reload should look backward for equivalent
9278 register.  Increasing values mean more aggressive optimization, making the
9279 compilation time increase with probably slightly better performance.
9280 The default value is 100.
9282 @item max-cselib-memory-locations
9283 The maximum number of memory locations cselib should take into account.
9284 Increasing values mean more aggressive optimization, making the compilation time
9285 increase with probably slightly better performance.  The default value is 500.
9287 @item reorder-blocks-duplicate
9288 @itemx reorder-blocks-duplicate-feedback
9290 Used by the basic block reordering pass to decide whether to use unconditional
9291 branch or duplicate the code on its destination.  Code is duplicated when its
9292 estimated size is smaller than this value multiplied by the estimated size of
9293 unconditional jump in the hot spots of the program.
9295 The @option{reorder-block-duplicate-feedback} is used only when profile
9296 feedback is available.  It may be set to higher values than
9297 @option{reorder-block-duplicate} since information about the hot spots is more
9298 accurate.
9300 @item max-sched-ready-insns
9301 The maximum number of instructions ready to be issued the scheduler should
9302 consider at any given time during the first scheduling pass.  Increasing
9303 values mean more thorough searches, making the compilation time increase
9304 with probably little benefit.  The default value is 100.
9306 @item max-sched-region-blocks
9307 The maximum number of blocks in a region to be considered for
9308 interblock scheduling.  The default value is 10.
9310 @item max-pipeline-region-blocks
9311 The maximum number of blocks in a region to be considered for
9312 pipelining in the selective scheduler.  The default value is 15.
9314 @item max-sched-region-insns
9315 The maximum number of insns in a region to be considered for
9316 interblock scheduling.  The default value is 100.
9318 @item max-pipeline-region-insns
9319 The maximum number of insns in a region to be considered for
9320 pipelining in the selective scheduler.  The default value is 200.
9322 @item min-spec-prob
9323 The minimum probability (in percents) of reaching a source block
9324 for interblock speculative scheduling.  The default value is 40.
9326 @item max-sched-extend-regions-iters
9327 The maximum number of iterations through CFG to extend regions.
9328 A value of 0 (the default) disables region extensions.
9330 @item max-sched-insn-conflict-delay
9331 The maximum conflict delay for an insn to be considered for speculative motion.
9332 The default value is 3.
9334 @item sched-spec-prob-cutoff
9335 The minimal probability of speculation success (in percents), so that
9336 speculative insns are scheduled.
9337 The default value is 40.
9339 @item sched-spec-state-edge-prob-cutoff
9340 The minimum probability an edge must have for the scheduler to save its
9341 state across it.
9342 The default value is 10.
9344 @item sched-mem-true-dep-cost
9345 Minimal distance (in CPU cycles) between store and load targeting same
9346 memory locations.  The default value is 1.
9348 @item selsched-max-lookahead
9349 The maximum size of the lookahead window of selective scheduling.  It is a
9350 depth of search for available instructions.
9351 The default value is 50.
9353 @item selsched-max-sched-times
9354 The maximum number of times that an instruction is scheduled during
9355 selective scheduling.  This is the limit on the number of iterations
9356 through which the instruction may be pipelined.  The default value is 2.
9358 @item selsched-max-insns-to-rename
9359 The maximum number of best instructions in the ready list that are considered
9360 for renaming in the selective scheduler.  The default value is 2.
9362 @item sms-min-sc
9363 The minimum value of stage count that swing modulo scheduler
9364 generates.  The default value is 2.
9366 @item max-last-value-rtl
9367 The maximum size measured as number of RTLs that can be recorded in an expression
9368 in combiner for a pseudo register as last known value of that register.  The default
9369 is 10000.
9371 @item integer-share-limit
9372 Small integer constants can use a shared data structure, reducing the
9373 compiler's memory usage and increasing its speed.  This sets the maximum
9374 value of a shared integer constant.  The default value is 256.
9376 @item ssp-buffer-size
9377 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9378 protection when @option{-fstack-protection} is used.
9380 @item max-jump-thread-duplication-stmts
9381 Maximum number of statements allowed in a block that needs to be
9382 duplicated when threading jumps.
9384 @item max-fields-for-field-sensitive
9385 Maximum number of fields in a structure treated in
9386 a field sensitive manner during pointer analysis.  The default is zero
9387 for @option{-O0} and @option{-O1},
9388 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9390 @item prefetch-latency
9391 Estimate on average number of instructions that are executed before
9392 prefetch finishes.  The distance prefetched ahead is proportional
9393 to this constant.  Increasing this number may also lead to less
9394 streams being prefetched (see @option{simultaneous-prefetches}).
9396 @item simultaneous-prefetches
9397 Maximum number of prefetches that can run at the same time.
9399 @item l1-cache-line-size
9400 The size of cache line in L1 cache, in bytes.
9402 @item l1-cache-size
9403 The size of L1 cache, in kilobytes.
9405 @item l2-cache-size
9406 The size of L2 cache, in kilobytes.
9408 @item min-insn-to-prefetch-ratio
9409 The minimum ratio between the number of instructions and the
9410 number of prefetches to enable prefetching in a loop.
9412 @item prefetch-min-insn-to-mem-ratio
9413 The minimum ratio between the number of instructions and the
9414 number of memory references to enable prefetching in a loop.
9416 @item use-canonical-types
9417 Whether the compiler should use the ``canonical'' type system.  By
9418 default, this should always be 1, which uses a more efficient internal
9419 mechanism for comparing types in C++ and Objective-C++.  However, if
9420 bugs in the canonical type system are causing compilation failures,
9421 set this value to 0 to disable canonical types.
9423 @item switch-conversion-max-branch-ratio
9424 Switch initialization conversion refuses to create arrays that are
9425 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9426 branches in the switch.
9428 @item max-partial-antic-length
9429 Maximum length of the partial antic set computed during the tree
9430 partial redundancy elimination optimization (@option{-ftree-pre}) when
9431 optimizing at @option{-O3} and above.  For some sorts of source code
9432 the enhanced partial redundancy elimination optimization can run away,
9433 consuming all of the memory available on the host machine.  This
9434 parameter sets a limit on the length of the sets that are computed,
9435 which prevents the runaway behavior.  Setting a value of 0 for
9436 this parameter allows an unlimited set length.
9438 @item sccvn-max-scc-size
9439 Maximum size of a strongly connected component (SCC) during SCCVN
9440 processing.  If this limit is hit, SCCVN processing for the whole
9441 function is not done and optimizations depending on it are
9442 disabled.  The default maximum SCC size is 10000.
9444 @item sccvn-max-alias-queries-per-access
9445 Maximum number of alias-oracle queries we perform when looking for
9446 redundancies for loads and stores.  If this limit is hit the search
9447 is aborted and the load or store is not considered redundant.  The
9448 number of queries is algorithmically limited to the number of
9449 stores on all paths from the load to the function entry.
9450 The default maxmimum number of queries is 1000.
9452 @item ira-max-loops-num
9453 IRA uses regional register allocation by default.  If a function
9454 contains more loops than the number given by this parameter, only at most
9455 the given number of the most frequently-executed loops form regions
9456 for regional register allocation.  The default value of the
9457 parameter is 100.
9459 @item ira-max-conflict-table-size 
9460 Although IRA uses a sophisticated algorithm to compress the conflict
9461 table, the table can still require excessive amounts of memory for
9462 huge functions.  If the conflict table for a function could be more
9463 than the size in MB given by this parameter, the register allocator
9464 instead uses a faster, simpler, and lower-quality
9465 algorithm that does not require building a pseudo-register conflict table.  
9466 The default value of the parameter is 2000.
9468 @item ira-loop-reserved-regs
9469 IRA can be used to evaluate more accurate register pressure in loops
9470 for decisions to move loop invariants (see @option{-O3}).  The number
9471 of available registers reserved for some other purposes is given
9472 by this parameter.  The default value of the parameter is 2, which is
9473 the minimal number of registers needed by typical instructions.
9474 This value is the best found from numerous experiments.
9476 @item loop-invariant-max-bbs-in-loop
9477 Loop invariant motion can be very expensive, both in compilation time and
9478 in amount of needed compile-time memory, with very large loops.  Loops
9479 with more basic blocks than this parameter won't have loop invariant
9480 motion optimization performed on them.  The default value of the
9481 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9483 @item loop-max-datarefs-for-datadeps
9484 Building data dapendencies is expensive for very large loops.  This
9485 parameter limits the number of data references in loops that are
9486 considered for data dependence analysis.  These large loops are no
9487 handled by the optimizations using loop data dependencies.
9488 The default value is 1000.
9490 @item max-vartrack-size
9491 Sets a maximum number of hash table slots to use during variable
9492 tracking dataflow analysis of any function.  If this limit is exceeded
9493 with variable tracking at assignments enabled, analysis for that
9494 function is retried without it, after removing all debug insns from
9495 the function.  If the limit is exceeded even without debug insns, var
9496 tracking analysis is completely disabled for the function.  Setting
9497 the parameter to zero makes it unlimited.
9499 @item max-vartrack-expr-depth
9500 Sets a maximum number of recursion levels when attempting to map
9501 variable names or debug temporaries to value expressions.  This trades
9502 compilation time for more complete debug information.  If this is set too
9503 low, value expressions that are available and could be represented in
9504 debug information may end up not being used; setting this higher may
9505 enable the compiler to find more complex debug expressions, but compile
9506 time and memory use may grow.  The default is 12.
9508 @item min-nondebug-insn-uid
9509 Use uids starting at this parameter for nondebug insns.  The range below
9510 the parameter is reserved exclusively for debug insns created by
9511 @option{-fvar-tracking-assignments}, but debug insns may get
9512 (non-overlapping) uids above it if the reserved range is exhausted.
9514 @item ipa-sra-ptr-growth-factor
9515 IPA-SRA replaces a pointer to an aggregate with one or more new
9516 parameters only when their cumulative size is less or equal to
9517 @option{ipa-sra-ptr-growth-factor} times the size of the original
9518 pointer parameter.
9520 @item tm-max-aggregate-size
9521 When making copies of thread-local variables in a transaction, this
9522 parameter specifies the size in bytes after which variables are
9523 saved with the logging functions as opposed to save/restore code
9524 sequence pairs.  This option only applies when using
9525 @option{-fgnu-tm}.
9527 @item graphite-max-nb-scop-params
9528 To avoid exponential effects in the Graphite loop transforms, the
9529 number of parameters in a Static Control Part (SCoP) is bounded.  The
9530 default value is 10 parameters.  A variable whose value is unknown at
9531 compilation time and defined outside a SCoP is a parameter of the SCoP.
9533 @item graphite-max-bbs-per-function
9534 To avoid exponential effects in the detection of SCoPs, the size of
9535 the functions analyzed by Graphite is bounded.  The default value is
9536 100 basic blocks.
9538 @item loop-block-tile-size
9539 Loop blocking or strip mining transforms, enabled with
9540 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9541 loop in the loop nest by a given number of iterations.  The strip
9542 length can be changed using the @option{loop-block-tile-size}
9543 parameter.  The default value is 51 iterations.
9545 @item ipa-cp-value-list-size
9546 IPA-CP attempts to track all possible values and types passed to a function's
9547 parameter in order to propagate them and perform devirtualization.
9548 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9549 stores per one formal parameter of a function.
9551 @item lto-partitions
9552 Specify desired number of partitions produced during WHOPR compilation.
9553 The number of partitions should exceed the number of CPUs used for compilation.
9554 The default value is 32.
9556 @item lto-minpartition
9557 Size of minimal partition for WHOPR (in estimated instructions).
9558 This prevents expenses of splitting very small programs into too many
9559 partitions.
9561 @item cxx-max-namespaces-for-diagnostic-help
9562 The maximum number of namespaces to consult for suggestions when C++
9563 name lookup fails for an identifier.  The default is 1000.
9565 @item sink-frequency-threshold
9566 The maximum relative execution frequency (in percents) of the target block
9567 relative to a statement's original block to allow statement sinking of a
9568 statement.  Larger numbers result in more aggressive statement sinking.
9569 The default value is 75.  A small positive adjustment is applied for
9570 statements with memory operands as those are even more profitable so sink.
9572 @item max-stores-to-sink
9573 The maximum number of conditional stores paires that can be sunk.  Set to 0
9574 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9575 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9577 @item allow-load-data-races
9578 Allow optimizers to introduce new data races on loads.
9579 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9580 unless implicitly set by the @option{-fmemory-model=} option.
9582 @item allow-store-data-races
9583 Allow optimizers to introduce new data races on stores.
9584 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9585 unless implicitly set by the @option{-fmemory-model=} option.
9587 @item allow-packed-load-data-races
9588 Allow optimizers to introduce new data races on packed data loads.
9589 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9590 unless implicitly set by the @option{-fmemory-model=} option.
9592 @item allow-packed-store-data-races
9593 Allow optimizers to introduce new data races on packed data stores.
9594 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9595 unless implicitly set by the @option{-fmemory-model=} option.
9597 @item case-values-threshold
9598 The smallest number of different values for which it is best to use a
9599 jump-table instead of a tree of conditional branches.  If the value is
9600 0, use the default for the machine.  The default is 0.
9602 @item tree-reassoc-width
9603 Set the maximum number of instructions executed in parallel in
9604 reassociated tree. This parameter overrides target dependent
9605 heuristics used by default if has non zero value.
9607 @item sched-pressure-algorithm
9608 Choose between the two available implementations of
9609 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9610 and is the more likely to prevent instructions from being reordered.
9611 Algorithm 2 was designed to be a compromise between the relatively
9612 conservative approach taken by algorithm 1 and the rather aggressive
9613 approach taken by the default scheduler.  It relies more heavily on
9614 having a regular register file and accurate register pressure classes.
9615 See @file{haifa-sched.c} in the GCC sources for more details.
9617 The default choice depends on the target.
9619 @item max-slsr-cand-scan
9620 Set the maximum number of existing candidates that will be considered when
9621 seeking a basis for a new straight-line strength reduction candidate.
9623 @end table
9624 @end table
9626 @node Preprocessor Options
9627 @section Options Controlling the Preprocessor
9628 @cindex preprocessor options
9629 @cindex options, preprocessor
9631 These options control the C preprocessor, which is run on each C source
9632 file before actual compilation.
9634 If you use the @option{-E} option, nothing is done except preprocessing.
9635 Some of these options make sense only together with @option{-E} because
9636 they cause the preprocessor output to be unsuitable for actual
9637 compilation.
9639 @table @gcctabopt
9640 @item -Wp,@var{option}
9641 @opindex Wp
9642 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9643 and pass @var{option} directly through to the preprocessor.  If
9644 @var{option} contains commas, it is split into multiple options at the
9645 commas.  However, many options are modified, translated or interpreted
9646 by the compiler driver before being passed to the preprocessor, and
9647 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9648 interface is undocumented and subject to change, so whenever possible
9649 you should avoid using @option{-Wp} and let the driver handle the
9650 options instead.
9652 @item -Xpreprocessor @var{option}
9653 @opindex Xpreprocessor
9654 Pass @var{option} as an option to the preprocessor.  You can use this to
9655 supply system-specific preprocessor options that GCC does not 
9656 recognize.
9658 If you want to pass an option that takes an argument, you must use
9659 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9661 @item -no-integrated-cpp
9662 @opindex no-integrated-cpp
9663 Perform preprocessing as a separate pass before compilation.
9664 By default, GCC performs preprocessing as an integrated part of
9665 input tokenization and parsing.
9666 If this option is provided, the appropriate language front end
9667 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9668 and Objective-C, respectively) is instead invoked twice,
9669 once for preprocessing only and once for actual compilation
9670 of the preprocessed input.
9671 This option may be useful in conjunction with the @option{-B} or
9672 @option{-wrapper} options to specify an alternate preprocessor or
9673 perform additional processing of the program source between
9674 normal preprocessing and compilation.
9675 @end table
9677 @include cppopts.texi
9679 @node Assembler Options
9680 @section Passing Options to the Assembler
9682 @c prevent bad page break with this line
9683 You can pass options to the assembler.
9685 @table @gcctabopt
9686 @item -Wa,@var{option}
9687 @opindex Wa
9688 Pass @var{option} as an option to the assembler.  If @var{option}
9689 contains commas, it is split into multiple options at the commas.
9691 @item -Xassembler @var{option}
9692 @opindex Xassembler
9693 Pass @var{option} as an option to the assembler.  You can use this to
9694 supply system-specific assembler options that GCC does not
9695 recognize.
9697 If you want to pass an option that takes an argument, you must use
9698 @option{-Xassembler} twice, once for the option and once for the argument.
9700 @end table
9702 @node Link Options
9703 @section Options for Linking
9704 @cindex link options
9705 @cindex options, linking
9707 These options come into play when the compiler links object files into
9708 an executable output file.  They are meaningless if the compiler is
9709 not doing a link step.
9711 @table @gcctabopt
9712 @cindex file names
9713 @item @var{object-file-name}
9714 A file name that does not end in a special recognized suffix is
9715 considered to name an object file or library.  (Object files are
9716 distinguished from libraries by the linker according to the file
9717 contents.)  If linking is done, these object files are used as input
9718 to the linker.
9720 @item -c
9721 @itemx -S
9722 @itemx -E
9723 @opindex c
9724 @opindex S
9725 @opindex E
9726 If any of these options is used, then the linker is not run, and
9727 object file names should not be used as arguments.  @xref{Overall
9728 Options}.
9730 @cindex Libraries
9731 @item -l@var{library}
9732 @itemx -l @var{library}
9733 @opindex l
9734 Search the library named @var{library} when linking.  (The second
9735 alternative with the library as a separate argument is only for
9736 POSIX compliance and is not recommended.)
9738 It makes a difference where in the command you write this option; the
9739 linker searches and processes libraries and object files in the order they
9740 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9741 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9742 to functions in @samp{z}, those functions may not be loaded.
9744 The linker searches a standard list of directories for the library,
9745 which is actually a file named @file{lib@var{library}.a}.  The linker
9746 then uses this file as if it had been specified precisely by name.
9748 The directories searched include several standard system directories
9749 plus any that you specify with @option{-L}.
9751 Normally the files found this way are library files---archive files
9752 whose members are object files.  The linker handles an archive file by
9753 scanning through it for members which define symbols that have so far
9754 been referenced but not defined.  But if the file that is found is an
9755 ordinary object file, it is linked in the usual fashion.  The only
9756 difference between using an @option{-l} option and specifying a file name
9757 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9758 and searches several directories.
9760 @item -lobjc
9761 @opindex lobjc
9762 You need this special case of the @option{-l} option in order to
9763 link an Objective-C or Objective-C++ program.
9765 @item -nostartfiles
9766 @opindex nostartfiles
9767 Do not use the standard system startup files when linking.
9768 The standard system libraries are used normally, unless @option{-nostdlib}
9769 or @option{-nodefaultlibs} is used.
9771 @item -nodefaultlibs
9772 @opindex nodefaultlibs
9773 Do not use the standard system libraries when linking.
9774 Only the libraries you specify are passed to the linker, and options
9775 specifying linkage of the system libraries, such as @code{-static-libgcc}
9776 or @code{-shared-libgcc}, are ignored.  
9777 The standard startup files are used normally, unless @option{-nostartfiles}
9778 is used.  
9780 The compiler may generate calls to @code{memcmp},
9781 @code{memset}, @code{memcpy} and @code{memmove}.
9782 These entries are usually resolved by entries in
9783 libc.  These entry points should be supplied through some other
9784 mechanism when this option is specified.
9786 @item -nostdlib
9787 @opindex nostdlib
9788 Do not use the standard system startup files or libraries when linking.
9789 No startup files and only the libraries you specify are passed to
9790 the linker, and options specifying linkage of the system libraries, such as
9791 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
9793 The compiler may generate calls to @code{memcmp}, @code{memset},
9794 @code{memcpy} and @code{memmove}.
9795 These entries are usually resolved by entries in
9796 libc.  These entry points should be supplied through some other
9797 mechanism when this option is specified.
9799 @cindex @option{-lgcc}, use with @option{-nostdlib}
9800 @cindex @option{-nostdlib} and unresolved references
9801 @cindex unresolved references and @option{-nostdlib}
9802 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9803 @cindex @option{-nodefaultlibs} and unresolved references
9804 @cindex unresolved references and @option{-nodefaultlibs}
9805 One of the standard libraries bypassed by @option{-nostdlib} and
9806 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9807 which GCC uses to overcome shortcomings of particular machines, or special
9808 needs for some languages.
9809 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9810 Collection (GCC) Internals},
9811 for more discussion of @file{libgcc.a}.)
9812 In most cases, you need @file{libgcc.a} even when you want to avoid
9813 other standard libraries.  In other words, when you specify @option{-nostdlib}
9814 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9815 This ensures that you have no unresolved references to internal GCC
9816 library subroutines.
9817 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
9818 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
9819 GNU Compiler Collection (GCC) Internals}.)
9821 @item -pie
9822 @opindex pie
9823 Produce a position independent executable on targets that support it.
9824 For predictable results, you must also specify the same set of options
9825 used for compilation (@option{-fpie}, @option{-fPIE},
9826 or model suboptions) when you specify this linker option.
9828 @item -rdynamic
9829 @opindex rdynamic
9830 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9831 that support it. This instructs the linker to add all symbols, not
9832 only used ones, to the dynamic symbol table. This option is needed
9833 for some uses of @code{dlopen} or to allow obtaining backtraces
9834 from within a program.
9836 @item -s
9837 @opindex s
9838 Remove all symbol table and relocation information from the executable.
9840 @item -static
9841 @opindex static
9842 On systems that support dynamic linking, this prevents linking with the shared
9843 libraries.  On other systems, this option has no effect.
9845 @item -shared
9846 @opindex shared
9847 Produce a shared object which can then be linked with other objects to
9848 form an executable.  Not all systems support this option.  For predictable
9849 results, you must also specify the same set of options used for compilation
9850 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
9851 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
9852 needs to build supplementary stub code for constructors to work.  On
9853 multi-libbed systems, @samp{gcc -shared} must select the correct support
9854 libraries to link against.  Failing to supply the correct flags may lead
9855 to subtle defects.  Supplying them in cases where they are not necessary
9856 is innocuous.}
9858 @item -shared-libgcc
9859 @itemx -static-libgcc
9860 @opindex shared-libgcc
9861 @opindex static-libgcc
9862 On systems that provide @file{libgcc} as a shared library, these options
9863 force the use of either the shared or static version, respectively.
9864 If no shared version of @file{libgcc} was built when the compiler was
9865 configured, these options have no effect.
9867 There are several situations in which an application should use the
9868 shared @file{libgcc} instead of the static version.  The most common
9869 of these is when the application wishes to throw and catch exceptions
9870 across different shared libraries.  In that case, each of the libraries
9871 as well as the application itself should use the shared @file{libgcc}.
9873 Therefore, the G++ and GCJ drivers automatically add
9874 @option{-shared-libgcc} whenever you build a shared library or a main
9875 executable, because C++ and Java programs typically use exceptions, so
9876 this is the right thing to do.
9878 If, instead, you use the GCC driver to create shared libraries, you may
9879 find that they are not always linked with the shared @file{libgcc}.
9880 If GCC finds, at its configuration time, that you have a non-GNU linker
9881 or a GNU linker that does not support option @option{--eh-frame-hdr},
9882 it links the shared version of @file{libgcc} into shared libraries
9883 by default.  Otherwise, it takes advantage of the linker and optimizes
9884 away the linking with the shared version of @file{libgcc}, linking with
9885 the static version of libgcc by default.  This allows exceptions to
9886 propagate through such shared libraries, without incurring relocation
9887 costs at library load time.
9889 However, if a library or main executable is supposed to throw or catch
9890 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9891 for the languages used in the program, or using the option
9892 @option{-shared-libgcc}, such that it is linked with the shared
9893 @file{libgcc}.
9895 @item -static-libstdc++
9896 When the @command{g++} program is used to link a C++ program, it
9897 normally automatically links against @option{libstdc++}.  If
9898 @file{libstdc++} is available as a shared library, and the
9899 @option{-static} option is not used, then this links against the
9900 shared version of @file{libstdc++}.  That is normally fine.  However, it
9901 is sometimes useful to freeze the version of @file{libstdc++} used by
9902 the program without going all the way to a fully static link.  The
9903 @option{-static-libstdc++} option directs the @command{g++} driver to
9904 link @file{libstdc++} statically, without necessarily linking other
9905 libraries statically.
9907 @item -symbolic
9908 @opindex symbolic
9909 Bind references to global symbols when building a shared object.  Warn
9910 about any unresolved references (unless overridden by the link editor
9911 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
9912 this option.
9914 @item -T @var{script}
9915 @opindex T
9916 @cindex linker script
9917 Use @var{script} as the linker script.  This option is supported by most
9918 systems using the GNU linker.  On some targets, such as bare-board
9919 targets without an operating system, the @option{-T} option may be required
9920 when linking to avoid references to undefined symbols.
9922 @item -Xlinker @var{option}
9923 @opindex Xlinker
9924 Pass @var{option} as an option to the linker.  You can use this to
9925 supply system-specific linker options that GCC does not recognize.
9927 If you want to pass an option that takes a separate argument, you must use
9928 @option{-Xlinker} twice, once for the option and once for the argument.
9929 For example, to pass @option{-assert definitions}, you must write
9930 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9931 @option{-Xlinker "-assert definitions"}, because this passes the entire
9932 string as a single argument, which is not what the linker expects.
9934 When using the GNU linker, it is usually more convenient to pass
9935 arguments to linker options using the @option{@var{option}=@var{value}}
9936 syntax than as separate arguments.  For example, you can specify
9937 @option{-Xlinker -Map=output.map} rather than
9938 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9939 this syntax for command-line options.
9941 @item -Wl,@var{option}
9942 @opindex Wl
9943 Pass @var{option} as an option to the linker.  If @var{option} contains
9944 commas, it is split into multiple options at the commas.  You can use this
9945 syntax to pass an argument to the option.
9946 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
9947 linker.  When using the GNU linker, you can also get the same effect with
9948 @option{-Wl,-Map=output.map}.
9950 @item -u @var{symbol}
9951 @opindex u
9952 Pretend the symbol @var{symbol} is undefined, to force linking of
9953 library modules to define it.  You can use @option{-u} multiple times with
9954 different symbols to force loading of additional library modules.
9955 @end table
9957 @node Directory Options
9958 @section Options for Directory Search
9959 @cindex directory options
9960 @cindex options, directory search
9961 @cindex search path
9963 These options specify directories to search for header files, for
9964 libraries and for parts of the compiler:
9966 @table @gcctabopt
9967 @item -I@var{dir}
9968 @opindex I
9969 Add the directory @var{dir} to the head of the list of directories to be
9970 searched for header files.  This can be used to override a system header
9971 file, substituting your own version, since these directories are
9972 searched before the system header file directories.  However, you should
9973 not use this option to add directories that contain vendor-supplied
9974 system header files (use @option{-isystem} for that).  If you use more than
9975 one @option{-I} option, the directories are scanned in left-to-right
9976 order; the standard system directories come after.
9978 If a standard system include directory, or a directory specified with
9979 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9980 option is ignored.  The directory is still searched but as a
9981 system directory at its normal position in the system include chain.
9982 This is to ensure that GCC's procedure to fix buggy system headers and
9983 the ordering for the @code{include_next} directive are not inadvertently changed.
9984 If you really need to change the search order for system directories,
9985 use the @option{-nostdinc} and/or @option{-isystem} options.
9987 @item -iplugindir=@var{dir}
9988 Set the directory to search for plugins that are passed
9989 by @option{-fplugin=@var{name}} instead of
9990 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9991 to be used by the user, but only passed by the driver.
9993 @item -iquote@var{dir}
9994 @opindex iquote
9995 Add the directory @var{dir} to the head of the list of directories to
9996 be searched for header files only for the case of @samp{#include
9997 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9998 otherwise just like @option{-I}.
10000 @item -L@var{dir}
10001 @opindex L
10002 Add directory @var{dir} to the list of directories to be searched
10003 for @option{-l}.
10005 @item -B@var{prefix}
10006 @opindex B
10007 This option specifies where to find the executables, libraries,
10008 include files, and data files of the compiler itself.
10010 The compiler driver program runs one or more of the subprograms
10011 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10012 @var{prefix} as a prefix for each program it tries to run, both with and
10013 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10015 For each subprogram to be run, the compiler driver first tries the
10016 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10017 is not specified, the driver tries two standard prefixes, 
10018 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10019 those results in a file name that is found, the unmodified program
10020 name is searched for using the directories specified in your
10021 @env{PATH} environment variable.
10023 The compiler checks to see if the path provided by the @option{-B}
10024 refers to a directory, and if necessary it adds a directory
10025 separator character at the end of the path.
10027 @option{-B} prefixes that effectively specify directory names also apply
10028 to libraries in the linker, because the compiler translates these
10029 options into @option{-L} options for the linker.  They also apply to
10030 includes files in the preprocessor, because the compiler translates these
10031 options into @option{-isystem} options for the preprocessor.  In this case,
10032 the compiler appends @samp{include} to the prefix.
10034 The runtime support file @file{libgcc.a} can also be searched for using
10035 the @option{-B} prefix, if needed.  If it is not found there, the two
10036 standard prefixes above are tried, and that is all.  The file is left
10037 out of the link if it is not found by those means.
10039 Another way to specify a prefix much like the @option{-B} prefix is to use
10040 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10041 Variables}.
10043 As a special kludge, if the path provided by @option{-B} is
10044 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10045 9, then it is replaced by @file{[dir/]include}.  This is to help
10046 with boot-strapping the compiler.
10048 @item -specs=@var{file}
10049 @opindex specs
10050 Process @var{file} after the compiler reads in the standard @file{specs}
10051 file, in order to override the defaults which the @command{gcc} driver
10052 program uses when determining what switches to pass to @command{cc1},
10053 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10054 @option{-specs=@var{file}} can be specified on the command line, and they
10055 are processed in order, from left to right.
10057 @item --sysroot=@var{dir}
10058 @opindex sysroot
10059 Use @var{dir} as the logical root directory for headers and libraries.
10060 For example, if the compiler normally searches for headers in
10061 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10062 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10064 If you use both this option and the @option{-isysroot} option, then
10065 the @option{--sysroot} option applies to libraries, but the
10066 @option{-isysroot} option applies to header files.
10068 The GNU linker (beginning with version 2.16) has the necessary support
10069 for this option.  If your linker does not support this option, the
10070 header file aspect of @option{--sysroot} still works, but the
10071 library aspect does not.
10073 @item --no-sysroot-suffix
10074 @opindex no-sysroot-suffix
10075 For some targets, a suffix is added to the root directory specified
10076 with @option{--sysroot}, depending on the other options used, so that
10077 headers may for example be found in
10078 @file{@var{dir}/@var{suffix}/usr/include} instead of
10079 @file{@var{dir}/usr/include}.  This option disables the addition of
10080 such a suffix.
10082 @item -I-
10083 @opindex I-
10084 This option has been deprecated.  Please use @option{-iquote} instead for
10085 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10086 Any directories you specify with @option{-I} options before the @option{-I-}
10087 option are searched only for the case of @samp{#include "@var{file}"};
10088 they are not searched for @samp{#include <@var{file}>}.
10090 If additional directories are specified with @option{-I} options after
10091 the @option{-I-}, these directories are searched for all @samp{#include}
10092 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10093 this way.)
10095 In addition, the @option{-I-} option inhibits the use of the current
10096 directory (where the current input file came from) as the first search
10097 directory for @samp{#include "@var{file}"}.  There is no way to
10098 override this effect of @option{-I-}.  With @option{-I.} you can specify
10099 searching the directory that is current when the compiler is
10100 invoked.  That is not exactly the same as what the preprocessor does
10101 by default, but it is often satisfactory.
10103 @option{-I-} does not inhibit the use of the standard system directories
10104 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10105 independent.
10106 @end table
10108 @c man end
10110 @node Spec Files
10111 @section Specifying subprocesses and the switches to pass to them
10112 @cindex Spec Files
10114 @command{gcc} is a driver program.  It performs its job by invoking a
10115 sequence of other programs to do the work of compiling, assembling and
10116 linking.  GCC interprets its command-line parameters and uses these to
10117 deduce which programs it should invoke, and which command-line options
10118 it ought to place on their command lines.  This behavior is controlled
10119 by @dfn{spec strings}.  In most cases there is one spec string for each
10120 program that GCC can invoke, but a few programs have multiple spec
10121 strings to control their behavior.  The spec strings built into GCC can
10122 be overridden by using the @option{-specs=} command-line switch to specify
10123 a spec file.
10125 @dfn{Spec files} are plaintext files that are used to construct spec
10126 strings.  They consist of a sequence of directives separated by blank
10127 lines.  The type of directive is determined by the first non-whitespace
10128 character on the line, which can be one of the following:
10130 @table @code
10131 @item %@var{command}
10132 Issues a @var{command} to the spec file processor.  The commands that can
10133 appear here are:
10135 @table @code
10136 @item %include <@var{file}>
10137 @cindex @code{%include}
10138 Search for @var{file} and insert its text at the current point in the
10139 specs file.
10141 @item %include_noerr <@var{file}>
10142 @cindex @code{%include_noerr}
10143 Just like @samp{%include}, but do not generate an error message if the include
10144 file cannot be found.
10146 @item %rename @var{old_name} @var{new_name}
10147 @cindex @code{%rename}
10148 Rename the spec string @var{old_name} to @var{new_name}.
10150 @end table
10152 @item *[@var{spec_name}]:
10153 This tells the compiler to create, override or delete the named spec
10154 string.  All lines after this directive up to the next directive or
10155 blank line are considered to be the text for the spec string.  If this
10156 results in an empty string then the spec is deleted.  (Or, if the
10157 spec did not exist, then nothing happens.)  Otherwise, if the spec
10158 does not currently exist a new spec is created.  If the spec does
10159 exist then its contents are overridden by the text of this
10160 directive, unless the first character of that text is the @samp{+}
10161 character, in which case the text is appended to the spec.
10163 @item [@var{suffix}]:
10164 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10165 and up to the next directive or blank line are considered to make up the
10166 spec string for the indicated suffix.  When the compiler encounters an
10167 input file with the named suffix, it processes the spec string in
10168 order to work out how to compile that file.  For example:
10170 @smallexample
10171 .ZZ:
10172 z-compile -input %i
10173 @end smallexample
10175 This says that any input file whose name ends in @samp{.ZZ} should be
10176 passed to the program @samp{z-compile}, which should be invoked with the
10177 command-line switch @option{-input} and with the result of performing the
10178 @samp{%i} substitution.  (See below.)
10180 As an alternative to providing a spec string, the text following a
10181 suffix directive can be one of the following:
10183 @table @code
10184 @item @@@var{language}
10185 This says that the suffix is an alias for a known @var{language}.  This is
10186 similar to using the @option{-x} command-line switch to GCC to specify a
10187 language explicitly.  For example:
10189 @smallexample
10190 .ZZ:
10191 @@c++
10192 @end smallexample
10194 Says that .ZZ files are, in fact, C++ source files.
10196 @item #@var{name}
10197 This causes an error messages saying:
10199 @smallexample
10200 @var{name} compiler not installed on this system.
10201 @end smallexample
10202 @end table
10204 GCC already has an extensive list of suffixes built into it.
10205 This directive adds an entry to the end of the list of suffixes, but
10206 since the list is searched from the end backwards, it is effectively
10207 possible to override earlier entries using this technique.
10209 @end table
10211 GCC has the following spec strings built into it.  Spec files can
10212 override these strings or create their own.  Note that individual
10213 targets can also add their own spec strings to this list.
10215 @smallexample
10216 asm          Options to pass to the assembler
10217 asm_final    Options to pass to the assembler post-processor
10218 cpp          Options to pass to the C preprocessor
10219 cc1          Options to pass to the C compiler
10220 cc1plus      Options to pass to the C++ compiler
10221 endfile      Object files to include at the end of the link
10222 link         Options to pass to the linker
10223 lib          Libraries to include on the command line to the linker
10224 libgcc       Decides which GCC support library to pass to the linker
10225 linker       Sets the name of the linker
10226 predefines   Defines to be passed to the C preprocessor
10227 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10228              by default
10229 startfile    Object files to include at the start of the link
10230 @end smallexample
10232 Here is a small example of a spec file:
10234 @smallexample
10235 %rename lib                 old_lib
10237 *lib:
10238 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10239 @end smallexample
10241 This example renames the spec called @samp{lib} to @samp{old_lib} and
10242 then overrides the previous definition of @samp{lib} with a new one.
10243 The new definition adds in some extra command-line options before
10244 including the text of the old definition.
10246 @dfn{Spec strings} are a list of command-line options to be passed to their
10247 corresponding program.  In addition, the spec strings can contain
10248 @samp{%}-prefixed sequences to substitute variable text or to
10249 conditionally insert text into the command line.  Using these constructs
10250 it is possible to generate quite complex command lines.
10252 Here is a table of all defined @samp{%}-sequences for spec
10253 strings.  Note that spaces are not generated automatically around the
10254 results of expanding these sequences.  Therefore you can concatenate them
10255 together or combine them with constant text in a single argument.
10257 @table @code
10258 @item %%
10259 Substitute one @samp{%} into the program name or argument.
10261 @item %i
10262 Substitute the name of the input file being processed.
10264 @item %b
10265 Substitute the basename of the input file being processed.
10266 This is the substring up to (and not including) the last period
10267 and not including the directory.
10269 @item %B
10270 This is the same as @samp{%b}, but include the file suffix (text after
10271 the last period).
10273 @item %d
10274 Marks the argument containing or following the @samp{%d} as a
10275 temporary file name, so that that file is deleted if GCC exits
10276 successfully.  Unlike @samp{%g}, this contributes no text to the
10277 argument.
10279 @item %g@var{suffix}
10280 Substitute a file name that has suffix @var{suffix} and is chosen
10281 once per compilation, and mark the argument in the same way as
10282 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10283 name is now chosen in a way that is hard to predict even when previously
10284 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10285 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10286 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10287 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10288 was simply substituted with a file name chosen once per compilation,
10289 without regard to any appended suffix (which was therefore treated
10290 just like ordinary text), making such attacks more likely to succeed.
10292 @item %u@var{suffix}
10293 Like @samp{%g}, but generates a new temporary file name
10294 each time it appears instead of once per compilation.
10296 @item %U@var{suffix}
10297 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10298 new one if there is no such last file name.  In the absence of any
10299 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10300 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10301 involves the generation of two distinct file names, one
10302 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10303 simply substituted with a file name chosen for the previous @samp{%u},
10304 without regard to any appended suffix.
10306 @item %j@var{suffix}
10307 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10308 writable, and if @option{-save-temps} is not used; 
10309 otherwise, substitute the name
10310 of a temporary file, just like @samp{%u}.  This temporary file is not
10311 meant for communication between processes, but rather as a junk
10312 disposal mechanism.
10314 @item %|@var{suffix}
10315 @itemx %m@var{suffix}
10316 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10317 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10318 all.  These are the two most common ways to instruct a program that it
10319 should read from standard input or write to standard output.  If you
10320 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10321 construct: see for example @file{f/lang-specs.h}.
10323 @item %.@var{SUFFIX}
10324 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10325 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10326 terminated by the next space or %.
10328 @item %w
10329 Marks the argument containing or following the @samp{%w} as the
10330 designated output file of this compilation.  This puts the argument
10331 into the sequence of arguments that @samp{%o} substitutes.
10333 @item %o
10334 Substitutes the names of all the output files, with spaces
10335 automatically placed around them.  You should write spaces
10336 around the @samp{%o} as well or the results are undefined.
10337 @samp{%o} is for use in the specs for running the linker.
10338 Input files whose names have no recognized suffix are not compiled
10339 at all, but they are included among the output files, so they are
10340 linked.
10342 @item %O
10343 Substitutes the suffix for object files.  Note that this is
10344 handled specially when it immediately follows @samp{%g, %u, or %U},
10345 because of the need for those to form complete file names.  The
10346 handling is such that @samp{%O} is treated exactly as if it had already
10347 been substituted, except that @samp{%g, %u, and %U} do not currently
10348 support additional @var{suffix} characters following @samp{%O} as they do
10349 following, for example, @samp{.o}.
10351 @item %p
10352 Substitutes the standard macro predefinitions for the
10353 current target machine.  Use this when running @code{cpp}.
10355 @item %P
10356 Like @samp{%p}, but puts @samp{__} before and after the name of each
10357 predefined macro, except for macros that start with @samp{__} or with
10358 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10361 @item %I
10362 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10363 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10364 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10365 and @option{-imultilib} as necessary.
10367 @item %s
10368 Current argument is the name of a library or startup file of some sort.
10369 Search for that file in a standard list of directories and substitute
10370 the full name found.  The current working directory is included in the
10371 list of directories scanned.
10373 @item %T
10374 Current argument is the name of a linker script.  Search for that file
10375 in the current list of directories to scan for libraries. If the file
10376 is located insert a @option{--script} option into the command line
10377 followed by the full path name found.  If the file is not found then
10378 generate an error message.  Note: the current working directory is not
10379 searched.
10381 @item %e@var{str}
10382 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10383 Use this when inconsistent options are detected.
10385 @item %(@var{name})
10386 Substitute the contents of spec string @var{name} at this point.
10388 @item %x@{@var{option}@}
10389 Accumulate an option for @samp{%X}.
10391 @item %X
10392 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10393 spec string.
10395 @item %Y
10396 Output the accumulated assembler options specified by @option{-Wa}.
10398 @item %Z
10399 Output the accumulated preprocessor options specified by @option{-Wp}.
10401 @item %a
10402 Process the @code{asm} spec.  This is used to compute the
10403 switches to be passed to the assembler.
10405 @item %A
10406 Process the @code{asm_final} spec.  This is a spec string for
10407 passing switches to an assembler post-processor, if such a program is
10408 needed.
10410 @item %l
10411 Process the @code{link} spec.  This is the spec for computing the
10412 command line passed to the linker.  Typically it makes use of the
10413 @samp{%L %G %S %D and %E} sequences.
10415 @item %D
10416 Dump out a @option{-L} option for each directory that GCC believes might
10417 contain startup files.  If the target supports multilibs then the
10418 current multilib directory is prepended to each of these paths.
10420 @item %L
10421 Process the @code{lib} spec.  This is a spec string for deciding which
10422 libraries are included on the command line to the linker.
10424 @item %G
10425 Process the @code{libgcc} spec.  This is a spec string for deciding
10426 which GCC support library is included on the command line to the linker.
10428 @item %S
10429 Process the @code{startfile} spec.  This is a spec for deciding which
10430 object files are the first ones passed to the linker.  Typically
10431 this might be a file named @file{crt0.o}.
10433 @item %E
10434 Process the @code{endfile} spec.  This is a spec string that specifies
10435 the last object files that are passed to the linker.
10437 @item %C
10438 Process the @code{cpp} spec.  This is used to construct the arguments
10439 to be passed to the C preprocessor.
10441 @item %1
10442 Process the @code{cc1} spec.  This is used to construct the options to be
10443 passed to the actual C compiler (@samp{cc1}).
10445 @item %2
10446 Process the @code{cc1plus} spec.  This is used to construct the options to be
10447 passed to the actual C++ compiler (@samp{cc1plus}).
10449 @item %*
10450 Substitute the variable part of a matched option.  See below.
10451 Note that each comma in the substituted string is replaced by
10452 a single space.
10454 @item %<@code{S}
10455 Remove all occurrences of @code{-S} from the command line.  Note---this
10456 command is position dependent.  @samp{%} commands in the spec string
10457 before this one see @code{-S}, @samp{%} commands in the spec string
10458 after this one do not.
10460 @item %:@var{function}(@var{args})
10461 Call the named function @var{function}, passing it @var{args}.
10462 @var{args} is first processed as a nested spec string, then split
10463 into an argument vector in the usual fashion.  The function returns
10464 a string which is processed as if it had appeared literally as part
10465 of the current spec.
10467 The following built-in spec functions are provided:
10469 @table @code
10470 @item @code{getenv}
10471 The @code{getenv} spec function takes two arguments: an environment
10472 variable name and a string.  If the environment variable is not
10473 defined, a fatal error is issued.  Otherwise, the return value is the
10474 value of the environment variable concatenated with the string.  For
10475 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10477 @smallexample
10478 %:getenv(TOPDIR /include)
10479 @end smallexample
10481 expands to @file{/path/to/top/include}.
10483 @item @code{if-exists}
10484 The @code{if-exists} spec function takes one argument, an absolute
10485 pathname to a file.  If the file exists, @code{if-exists} returns the
10486 pathname.  Here is a small example of its usage:
10488 @smallexample
10489 *startfile:
10490 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10491 @end smallexample
10493 @item @code{if-exists-else}
10494 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10495 spec function, except that it takes two arguments.  The first argument is
10496 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10497 returns the pathname.  If it does not exist, it returns the second argument.
10498 This way, @code{if-exists-else} can be used to select one file or another,
10499 based on the existence of the first.  Here is a small example of its usage:
10501 @smallexample
10502 *startfile:
10503 crt0%O%s %:if-exists(crti%O%s) \
10504 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10505 @end smallexample
10507 @item @code{replace-outfile}
10508 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10509 first argument in the outfiles array and replaces it with the second argument.  Here
10510 is a small example of its usage:
10512 @smallexample
10513 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10514 @end smallexample
10516 @item @code{remove-outfile}
10517 The @code{remove-outfile} spec function takes one argument.  It looks for the
10518 first argument in the outfiles array and removes it.  Here is a small example
10519 its usage:
10521 @smallexample
10522 %:remove-outfile(-lm)
10523 @end smallexample
10525 @item @code{pass-through-libs}
10526 The @code{pass-through-libs} spec function takes any number of arguments.  It
10527 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10528 assumes are the names of linker input library archive files) and returns a
10529 result containing all the found arguments each prepended by
10530 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10531 intended to be passed to the LTO linker plugin.
10533 @smallexample
10534 %:pass-through-libs(%G %L %G)
10535 @end smallexample
10537 @item @code{print-asm-header}
10538 The @code{print-asm-header} function takes no arguments and simply
10539 prints a banner like:
10541 @smallexample
10542 Assembler options
10543 =================
10545 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10546 @end smallexample
10548 It is used to separate compiler options from assembler options
10549 in the @option{--target-help} output.
10550 @end table
10552 @item %@{@code{S}@}
10553 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10554 If that switch is not specified, this substitutes nothing.  Note that
10555 the leading dash is omitted when specifying this option, and it is
10556 automatically inserted if the substitution is performed.  Thus the spec
10557 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10558 and outputs the command-line option @option{-foo}.
10560 @item %W@{@code{S}@}
10561 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10562 deleted on failure.
10564 @item %@{@code{S}*@}
10565 Substitutes all the switches specified to GCC whose names start
10566 with @code{-S}, but which also take an argument.  This is used for
10567 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10568 GCC considers @option{-o foo} as being
10569 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10570 text, including the space.  Thus two arguments are generated.
10572 @item %@{@code{S}*&@code{T}*@}
10573 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10574 (the order of @code{S} and @code{T} in the spec is not significant).
10575 There can be any number of ampersand-separated variables; for each the
10576 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10578 @item %@{@code{S}:@code{X}@}
10579 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10581 @item %@{!@code{S}:@code{X}@}
10582 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10584 @item %@{@code{S}*:@code{X}@}
10585 Substitutes @code{X} if one or more switches whose names start with
10586 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10587 once, no matter how many such switches appeared.  However, if @code{%*}
10588 appears somewhere in @code{X}, then @code{X} is substituted once
10589 for each matching switch, with the @code{%*} replaced by the part of
10590 that switch matching the @code{*}.
10592 @item %@{.@code{S}:@code{X}@}
10593 Substitutes @code{X}, if processing a file with suffix @code{S}.
10595 @item %@{!.@code{S}:@code{X}@}
10596 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10598 @item %@{,@code{S}:@code{X}@}
10599 Substitutes @code{X}, if processing a file for language @code{S}.
10601 @item %@{!,@code{S}:@code{X}@}
10602 Substitutes @code{X}, if not processing a file for language @code{S}.
10604 @item %@{@code{S}|@code{P}:@code{X}@}
10605 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10606 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10607 @code{*} sequences as well, although they have a stronger binding than
10608 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10609 alternatives must be starred, and only the first matching alternative
10610 is substituted.
10612 For example, a spec string like this:
10614 @smallexample
10615 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10616 @end smallexample
10618 @noindent
10619 outputs the following command-line options from the following input
10620 command-line options:
10622 @smallexample
10623 fred.c        -foo -baz
10624 jim.d         -bar -boggle
10625 -d fred.c     -foo -baz -boggle
10626 -d jim.d      -bar -baz -boggle
10627 @end smallexample
10629 @item %@{S:X; T:Y; :D@}
10631 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10632 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10633 be as many clauses as you need.  This may be combined with @code{.},
10634 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10637 @end table
10639 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10640 construct may contain other nested @samp{%} constructs or spaces, or
10641 even newlines.  They are processed as usual, as described above.
10642 Trailing white space in @code{X} is ignored.  White space may also
10643 appear anywhere on the left side of the colon in these constructs,
10644 except between @code{.} or @code{*} and the corresponding word.
10646 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10647 handled specifically in these constructs.  If another value of
10648 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10649 @option{-W} switch is found later in the command line, the earlier
10650 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10651 just one letter, which passes all matching options.
10653 The character @samp{|} at the beginning of the predicate text is used to
10654 indicate that a command should be piped to the following command, but
10655 only if @option{-pipe} is specified.
10657 It is built into GCC which switches take arguments and which do not.
10658 (You might think it would be useful to generalize this to allow each
10659 compiler's spec to say which switches take arguments.  But this cannot
10660 be done in a consistent fashion.  GCC cannot even decide which input
10661 files have been specified without knowing which switches take arguments,
10662 and it must know which input files to compile in order to tell which
10663 compilers to run).
10665 GCC also knows implicitly that arguments starting in @option{-l} are to be
10666 treated as compiler output files, and passed to the linker in their
10667 proper position among the other output files.
10669 @c man begin OPTIONS
10671 @node Target Options
10672 @section Specifying Target Machine and Compiler Version
10673 @cindex target options
10674 @cindex cross compiling
10675 @cindex specifying machine version
10676 @cindex specifying compiler version and target machine
10677 @cindex compiler version, specifying
10678 @cindex target machine, specifying
10680 The usual way to run GCC is to run the executable called @command{gcc}, or
10681 @command{@var{machine}-gcc} when cross-compiling, or
10682 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10683 one that was installed last.
10685 @node Submodel Options
10686 @section Hardware Models and Configurations
10687 @cindex submodel options
10688 @cindex specifying hardware config
10689 @cindex hardware models and configurations, specifying
10690 @cindex machine dependent options
10692 Each target machine types can have its own
10693 special options, starting with @samp{-m}, to choose among various
10694 hardware models or configurations---for example, 68010 vs 68020,
10695 floating coprocessor or none.  A single installed version of the
10696 compiler can compile for any model or configuration, according to the
10697 options specified.
10699 Some configurations of the compiler also support additional special
10700 options, usually for compatibility with other compilers on the same
10701 platform.
10703 @c This list is ordered alphanumerically by subsection name.
10704 @c It should be the same order and spelling as these options are listed
10705 @c in Machine Dependent Options
10707 @menu
10708 * AArch64 Options::
10709 * Adapteva Epiphany Options::
10710 * ARM Options::
10711 * AVR Options::
10712 * Blackfin Options::
10713 * C6X Options::
10714 * CRIS Options::
10715 * CR16 Options::
10716 * Darwin Options::
10717 * DEC Alpha Options::
10718 * FR30 Options::
10719 * FRV Options::
10720 * GNU/Linux Options::
10721 * H8/300 Options::
10722 * HPPA Options::
10723 * i386 and x86-64 Options::
10724 * i386 and x86-64 Windows Options::
10725 * IA-64 Options::
10726 * LM32 Options::
10727 * M32C Options::
10728 * M32R/D Options::
10729 * M680x0 Options::
10730 * MCore Options::
10731 * MeP Options::
10732 * MicroBlaze Options::
10733 * MIPS Options::
10734 * MMIX Options::
10735 * MN10300 Options::
10736 * Moxie Options::
10737 * PDP-11 Options::
10738 * picoChip Options::
10739 * PowerPC Options::
10740 * RL78 Options::
10741 * RS/6000 and PowerPC Options::
10742 * RX Options::
10743 * S/390 and zSeries Options::
10744 * Score Options::
10745 * SH Options::
10746 * Solaris 2 Options::
10747 * SPARC Options::
10748 * SPU Options::
10749 * System V Options::
10750 * TILE-Gx Options::
10751 * TILEPro Options::
10752 * V850 Options::
10753 * VAX Options::
10754 * VMS Options::
10755 * VxWorks Options::
10756 * x86-64 Options::
10757 * Xstormy16 Options::
10758 * Xtensa Options::
10759 * zSeries Options::
10760 @end menu
10762 @node Adapteva Epiphany Options
10763 @subsection Adapteva Epiphany Options
10765 These @samp{-m} options are defined for Adapteva Epiphany:
10767 @table @gcctabopt
10768 @item -mhalf-reg-file
10769 @opindex mhalf-reg-file
10770 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
10771 That allows code to run on hardware variants that lack these registers.
10773 @item -mprefer-short-insn-regs
10774 @opindex mprefer-short-insn-regs
10775 Preferrentially allocate registers that allow short instruction generation.
10776 This can result in increased instruction count, so this may either reduce or
10777 increase overall code size.
10779 @item -mbranch-cost=@var{num}
10780 @opindex mbranch-cost
10781 Set the cost of branches to roughly @var{num} ``simple'' instructions.
10782 This cost is only a heuristic and is not guaranteed to produce
10783 consistent results across releases.
10785 @item -mcmove
10786 @opindex mcmove
10787 Enable the generation of conditional moves.
10789 @item -mnops=@var{num}
10790 @opindex mnops
10791 Emit @var{num} NOPs before every other generated instruction.
10793 @item -mno-soft-cmpsf
10794 @opindex mno-soft-cmpsf
10795 For single-precision floating-point comparisons, emit an @code{fsub} instruction
10796 and test the flags.  This is faster than a software comparison, but can
10797 get incorrect results in the presence of NaNs, or when two different small
10798 numbers are compared such that their difference is calculated as zero.
10799 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
10800 software comparisons.
10802 @item -mstack-offset=@var{num}
10803 @opindex mstack-offset
10804 Set the offset between the top of the stack and the stack pointer.
10805 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
10806 can be used by leaf functions without stack allocation.
10807 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
10808 Note also that this option changes the ABI; compiling a program with a
10809 different stack offset than the libraries have been compiled with
10810 generally does not work.
10811 This option can be useful if you want to evaluate if a different stack
10812 offset would give you better code, but to actually use a different stack
10813 offset to build working programs, it is recommended to configure the
10814 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
10816 @item -mno-round-nearest
10817 @opindex mno-round-nearest
10818 Make the scheduler assume that the rounding mode has been set to
10819 truncating.  The default is @option{-mround-nearest}.
10821 @item -mlong-calls
10822 @opindex mlong-calls
10823 If not otherwise specified by an attribute, assume all calls might be beyond
10824 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
10825 function address into a register before performing a (otherwise direct) call.
10826 This is the default.
10828 @item -mshort-calls
10829 @opindex short-calls
10830 If not otherwise specified by an attribute, assume all direct calls are
10831 in the range of the @code{b} / @code{bl} instructions, so use these instructions
10832 for direct calls.  The default is @option{-mlong-calls}.
10834 @item -msmall16
10835 @opindex msmall16
10836 Assume addresses can be loaded as 16-bit unsigned values.  This does not
10837 apply to function addresses for which @option{-mlong-calls} semantics
10838 are in effect.
10840 @item -mfp-mode=@var{mode}
10841 @opindex mfp-mode
10842 Set the prevailing mode of the floating-point unit.
10843 This determines the floating-point mode that is provided and expected
10844 at function call and return time.  Making this mode match the mode you
10845 predominantly need at function start can make your programs smaller and
10846 faster by avoiding unnecessary mode switches.
10848 @var{mode} can be set to one the following values:
10850 @table @samp
10851 @item caller
10852 Any mode at function entry is valid, and retained or restored when
10853 the function returns, and when it calls other functions.
10854 This mode is useful for compiling libraries or other compilation units
10855 you might want to incorporate into different programs with different
10856 prevailing FPU modes, and the convenience of being able to use a single
10857 object file outweighs the size and speed overhead for any extra
10858 mode switching that might be needed, compared with what would be needed
10859 with a more specific choice of prevailing FPU mode.
10861 @item truncate
10862 This is the mode used for floating-point calculations with
10863 truncating (i.e.@: round towards zero) rounding mode.  That includes
10864 conversion from floating point to integer.
10866 @item round-nearest
10867 This is the mode used for floating-point calculations with
10868 round-to-nearest-or-even rounding mode.
10870 @item int
10871 This is the mode used to perform integer calculations in the FPU, e.g.@:
10872 integer multiply, or integer multiply-and-accumulate.
10873 @end table
10875 The default is @option{-mfp-mode=caller}
10877 @item -mnosplit-lohi
10878 @itemx -mno-postinc
10879 @itemx -mno-postmodify
10880 @opindex mnosplit-lohi
10881 @opindex mno-postinc
10882 @opindex mno-postmodify
10883 Code generation tweaks that disable, respectively, splitting of 32-bit
10884 loads, generation of post-increment addresses, and generation of
10885 post-modify addresses.  The defaults are @option{msplit-lohi},
10886 @option{-mpost-inc}, and @option{-mpost-modify}.
10888 @item -mnovect-double
10889 @opindex mno-vect-double
10890 Change the preferred SIMD mode to SImode.  The default is
10891 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
10893 @item -max-vect-align=@var{num}
10894 @opindex max-vect-align
10895 The maximum alignment for SIMD vector mode types.
10896 @var{num} may be 4 or 8.  The default is 8.
10897 Note that this is an ABI change, even though many library function
10898 interfaces are unaffected if they don't use SIMD vector modes
10899 in places that affect size and/or alignment of relevant types.
10901 @item -msplit-vecmove-early
10902 @opindex msplit-vecmove-early
10903 Split vector moves into single word moves before reload.  In theory this
10904 can give better register allocation, but so far the reverse seems to be
10905 generally the case.
10907 @item -m1reg-@var{reg}
10908 @opindex m1reg-
10909 Specify a register to hold the constant @minus{}1, which makes loading small negative
10910 constants and certain bitmasks faster.
10911 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
10912 which specify use of that register as a fixed register,
10913 and @samp{none}, which means that no register is used for this
10914 purpose.  The default is @option{-m1reg-none}.
10916 @end table
10918 @node AArch64 Options
10919 @subsection AArch64 Options
10920 @cindex AArch64 Options
10922 These options are defined for AArch64 implementations:
10924 @table @gcctabopt
10926 @item -mbig-endian
10927 @opindex mbig-endian
10928 Generate big-endian code.  This is the default when GCC is configured for an
10929 @samp{aarch64_be-*-*} target.
10931 @item -mgeneral-regs-only
10932 @opindex mgeneral-regs-only
10933 Generate code which uses only the general registers.
10935 @item -mlittle-endian
10936 @opindex mlittle-endian
10937 Generate little-endian code.  This is the default when GCC is configured for an
10938 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
10940 @item -mcmodel=tiny
10941 @opindex mcmodel=tiny
10942 Generate code for the tiny code model.  The program and its statically defined
10943 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
10944 be statically or dynamically linked.  This model is not fully implemented and
10945 mostly treated as @samp{small}.
10947 @item -mcmodel=small
10948 @opindex mcmodel=small
10949 Generate code for the small code model.  The program and its statically defined
10950 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
10951 be statically or dynamically linked.  This is the default code model.
10953 @item -mcmodel=large
10954 @opindex mcmodel=large
10955 Generate code for the large code model.  This makes no assumptions about
10956 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
10957 statically linked only.
10959 @item -mstrict-align
10960 @opindex mstrict-align
10961 Do not assume that unaligned memory references will be handled by the system.
10963 @item -momit-leaf-frame-pointer
10964 @itemx -mno-omit-leaf-frame-pointer
10965 @opindex momit-leaf-frame-pointer
10966 @opindex mno-omit-leaf-frame-pointer
10967 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
10968 default.
10970 @item -mtls-dialect=desc
10971 @opindex mtls-dialect=desc
10972 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
10973 of TLS variables.  This is the default.
10975 @item -mtls-dialect=traditional
10976 @opindex mtls-dialect=traditional
10977 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
10978 of TLS variables.
10980 @item -march=@var{name}
10981 @opindex march
10982 Specify the name of the target architecture, optionally suffixed by one or
10983 more feature modifiers.  This option has the form
10984 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
10985 only value for @var{arch} is @samp{armv8-a}.  The possible values for
10986 @var{feature} are documented in the sub-section below.
10988 Where conflicting feature modifiers are specified, the right-most feature is
10989 used.
10991 GCC uses this name to determine what kind of instructions it can emit when
10992 generating assembly code.  This option can be used in conjunction with or
10993 instead of the @option{-mcpu=} option.
10995 @item -mcpu=@var{name}
10996 @opindex mcpu
10997 Specify the name of the target processor, optionally suffixed by one or more
10998 feature modifiers.  This option has the form
10999 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11000 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
11001 possible values for @var{feature} are documented in the sub-section
11002 below.
11004 Where conflicting feature modifiers are specified, the right-most feature is
11005 used.
11007 GCC uses this name to determine what kind of instructions it can emit when
11008 generating assembly code.
11010 @item -mtune=@var{name}
11011 @opindex mtune
11012 Specify the name of the processor to tune the performance for.  The code will
11013 be tuned as if the target processor were of the type specified in this option,
11014 but still using instructions compatible with the target processor specified
11015 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
11016 modifiers.
11018 @end table
11020 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11021 @cindex @option{-march} feature modifiers
11022 @cindex @option{-mcpu} feature modifiers
11023 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11024 the following:
11026 @table @samp
11027 @item crypto
11028 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11029 @item fp
11030 Enable floating-point instructions.
11031 @item simd
11032 Enable Advanced SIMD instructions.  This implies floating-point instructions
11033 are enabled.  This is the default for all current possible values for options
11034 @option{-march} and @option{-mcpu=}.
11035 @end table
11037 @node ARM Options
11038 @subsection ARM Options
11039 @cindex ARM options
11041 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11042 architectures:
11044 @table @gcctabopt
11045 @item -mabi=@var{name}
11046 @opindex mabi
11047 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11048 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11050 @item -mapcs-frame
11051 @opindex mapcs-frame
11052 Generate a stack frame that is compliant with the ARM Procedure Call
11053 Standard for all functions, even if this is not strictly necessary for
11054 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11055 with this option causes the stack frames not to be generated for
11056 leaf functions.  The default is @option{-mno-apcs-frame}.
11058 @item -mapcs
11059 @opindex mapcs
11060 This is a synonym for @option{-mapcs-frame}.
11062 @ignore
11063 @c not currently implemented
11064 @item -mapcs-stack-check
11065 @opindex mapcs-stack-check
11066 Generate code to check the amount of stack space available upon entry to
11067 every function (that actually uses some stack space).  If there is
11068 insufficient space available then either the function
11069 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11070 called, depending upon the amount of stack space required.  The runtime
11071 system is required to provide these functions.  The default is
11072 @option{-mno-apcs-stack-check}, since this produces smaller code.
11074 @c not currently implemented
11075 @item -mapcs-float
11076 @opindex mapcs-float
11077 Pass floating-point arguments using the floating-point registers.  This is
11078 one of the variants of the APCS@.  This option is recommended if the
11079 target hardware has a floating-point unit or if a lot of floating-point
11080 arithmetic is going to be performed by the code.  The default is
11081 @option{-mno-apcs-float}, since the size of integer-only code is 
11082 slightly increased if @option{-mapcs-float} is used.
11084 @c not currently implemented
11085 @item -mapcs-reentrant
11086 @opindex mapcs-reentrant
11087 Generate reentrant, position-independent code.  The default is
11088 @option{-mno-apcs-reentrant}.
11089 @end ignore
11091 @item -mthumb-interwork
11092 @opindex mthumb-interwork
11093 Generate code that supports calling between the ARM and Thumb
11094 instruction sets.  Without this option, on pre-v5 architectures, the
11095 two instruction sets cannot be reliably used inside one program.  The
11096 default is @option{-mno-thumb-interwork}, since slightly larger code
11097 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11098 configurations this option is meaningless.
11100 @item -mno-sched-prolog
11101 @opindex mno-sched-prolog
11102 Prevent the reordering of instructions in the function prologue, or the
11103 merging of those instruction with the instructions in the function's
11104 body.  This means that all functions start with a recognizable set
11105 of instructions (or in fact one of a choice from a small set of
11106 different function prologues), and this information can be used to
11107 locate the start of functions inside an executable piece of code.  The
11108 default is @option{-msched-prolog}.
11110 @item -mfloat-abi=@var{name}
11111 @opindex mfloat-abi
11112 Specifies which floating-point ABI to use.  Permissible values
11113 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11115 Specifying @samp{soft} causes GCC to generate output containing
11116 library calls for floating-point operations.
11117 @samp{softfp} allows the generation of code using hardware floating-point
11118 instructions, but still uses the soft-float calling conventions.
11119 @samp{hard} allows generation of floating-point instructions
11120 and uses FPU-specific calling conventions.
11122 The default depends on the specific target configuration.  Note that
11123 the hard-float and soft-float ABIs are not link-compatible; you must
11124 compile your entire program with the same ABI, and link with a
11125 compatible set of libraries.
11127 @item -mlittle-endian
11128 @opindex mlittle-endian
11129 Generate code for a processor running in little-endian mode.  This is
11130 the default for all standard configurations.
11132 @item -mbig-endian
11133 @opindex mbig-endian
11134 Generate code for a processor running in big-endian mode; the default is
11135 to compile code for a little-endian processor.
11137 @item -mwords-little-endian
11138 @opindex mwords-little-endian
11139 This option only applies when generating code for big-endian processors.
11140 Generate code for a little-endian word order but a big-endian byte
11141 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11142 option should only be used if you require compatibility with code for
11143 big-endian ARM processors generated by versions of the compiler prior to
11144 2.8.  This option is now deprecated.
11146 @item -mcpu=@var{name}
11147 @opindex mcpu
11148 This specifies the name of the target ARM processor.  GCC uses this name
11149 to determine what kind of instructions it can emit when generating
11150 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
11151 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
11152 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
11153 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
11154 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
11155 @samp{arm720},
11156 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
11157 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
11158 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
11159 @samp{strongarm1110},
11160 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
11161 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
11162 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
11163 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
11164 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
11165 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
11166 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
11167 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
11168 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
11169 @samp{cortex-m4}, @samp{cortex-m3},
11170 @samp{cortex-m1},
11171 @samp{cortex-m0},
11172 @samp{cortex-m0plus},
11173 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
11174 @samp{fa526}, @samp{fa626},
11175 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
11178 @option{-mcpu=generic-@var{arch}} is also permissible, and is
11179 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
11180 See @option{-mtune} for more information.
11182 @option{-mcpu=native} causes the compiler to auto-detect the CPU
11183 of the build computer.  At present, this feature is only supported on
11184 Linux, and not all architectures are recognized.  If the auto-detect is
11185 unsuccessful the option has no effect.
11187 @item -mtune=@var{name}
11188 @opindex mtune
11189 This option is very similar to the @option{-mcpu=} option, except that
11190 instead of specifying the actual target processor type, and hence
11191 restricting which instructions can be used, it specifies that GCC should
11192 tune the performance of the code as if the target were of the type
11193 specified in this option, but still choosing the instructions it
11194 generates based on the CPU specified by a @option{-mcpu=} option.
11195 For some ARM implementations better performance can be obtained by using
11196 this option.
11198 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
11199 performance for a blend of processors within architecture @var{arch}.
11200 The aim is to generate code that run well on the current most popular
11201 processors, balancing between optimizations that benefit some CPUs in the
11202 range, and avoiding performance pitfalls of other CPUs.  The effects of
11203 this option may change in future GCC versions as CPU models come and go.
11205 @option{-mtune=native} causes the compiler to auto-detect the CPU
11206 of the build computer.  At present, this feature is only supported on
11207 Linux, and not all architectures are recognized.  If the auto-detect is
11208 unsuccessful the option has no effect.
11210 @item -march=@var{name}
11211 @opindex march
11212 This specifies the name of the target ARM architecture.  GCC uses this
11213 name to determine what kind of instructions it can emit when generating
11214 assembly code.  This option can be used in conjunction with or instead
11215 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
11216 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
11217 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
11218 @samp{armv6}, @samp{armv6j},
11219 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
11220 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
11221 @samp{armv8-a},
11222 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
11224 @option{-march=native} causes the compiler to auto-detect the architecture
11225 of the build computer.  At present, this feature is only supported on
11226 Linux, and not all architectures are recognized.  If the auto-detect is
11227 unsuccessful the option has no effect.
11229 @item -mfpu=@var{name}
11230 @opindex mfpu
11231 This specifies what floating-point hardware (or hardware emulation) is
11232 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
11233 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
11234 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
11235 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
11236 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
11238 If @option{-msoft-float} is specified this specifies the format of
11239 floating-point values.
11241 If the selected floating-point hardware includes the NEON extension
11242 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
11243 operations are not generated by GCC's auto-vectorization pass unless
11244 @option{-funsafe-math-optimizations} is also specified.  This is
11245 because NEON hardware does not fully implement the IEEE 754 standard for
11246 floating-point arithmetic (in particular denormal values are treated as
11247 zero), so the use of NEON instructions may lead to a loss of precision.
11249 @item -mfp16-format=@var{name}
11250 @opindex mfp16-format
11251 Specify the format of the @code{__fp16} half-precision floating-point type.
11252 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
11253 the default is @samp{none}, in which case the @code{__fp16} type is not
11254 defined.  @xref{Half-Precision}, for more information.
11256 @item -mstructure-size-boundary=@var{n}
11257 @opindex mstructure-size-boundary
11258 The sizes of all structures and unions are rounded up to a multiple
11259 of the number of bits set by this option.  Permissible values are 8, 32
11260 and 64.  The default value varies for different toolchains.  For the COFF
11261 targeted toolchain the default value is 8.  A value of 64 is only allowed
11262 if the underlying ABI supports it.
11264 Specifying a larger number can produce faster, more efficient code, but
11265 can also increase the size of the program.  Different values are potentially
11266 incompatible.  Code compiled with one value cannot necessarily expect to
11267 work with code or libraries compiled with another value, if they exchange
11268 information using structures or unions.
11270 @item -mabort-on-noreturn
11271 @opindex mabort-on-noreturn
11272 Generate a call to the function @code{abort} at the end of a
11273 @code{noreturn} function.  It is executed if the function tries to
11274 return.
11276 @item -mlong-calls
11277 @itemx -mno-long-calls
11278 @opindex mlong-calls
11279 @opindex mno-long-calls
11280 Tells the compiler to perform function calls by first loading the
11281 address of the function into a register and then performing a subroutine
11282 call on this register.  This switch is needed if the target function
11283 lies outside of the 64-megabyte addressing range of the offset-based
11284 version of subroutine call instruction.
11286 Even if this switch is enabled, not all function calls are turned
11287 into long calls.  The heuristic is that static functions, functions
11288 that have the @samp{short-call} attribute, functions that are inside
11289 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
11290 definitions have already been compiled within the current compilation
11291 unit are not turned into long calls.  The exceptions to this rule are
11292 that weak function definitions, functions with the @samp{long-call}
11293 attribute or the @samp{section} attribute, and functions that are within
11294 the scope of a @samp{#pragma long_calls} directive are always
11295 turned into long calls.
11297 This feature is not enabled by default.  Specifying
11298 @option{-mno-long-calls} restores the default behavior, as does
11299 placing the function calls within the scope of a @samp{#pragma
11300 long_calls_off} directive.  Note these switches have no effect on how
11301 the compiler generates code to handle function calls via function
11302 pointers.
11304 @item -msingle-pic-base
11305 @opindex msingle-pic-base
11306 Treat the register used for PIC addressing as read-only, rather than
11307 loading it in the prologue for each function.  The runtime system is
11308 responsible for initializing this register with an appropriate value
11309 before execution begins.
11311 @item -mpic-register=@var{reg}
11312 @opindex mpic-register
11313 Specify the register to be used for PIC addressing.  The default is R10
11314 unless stack-checking is enabled, when R9 is used.
11316 @item -mcirrus-fix-invalid-insns
11317 @opindex mcirrus-fix-invalid-insns
11318 @opindex mno-cirrus-fix-invalid-insns
11319 Insert NOPs into the instruction stream to in order to work around
11320 problems with invalid Maverick instruction combinations.  This option
11321 is only valid if the @option{-mcpu=ep9312} option has been used to
11322 enable generation of instructions for the Cirrus Maverick floating-point
11323 co-processor.  This option is not enabled by default, since the
11324 problem is only present in older Maverick implementations.  The default
11325 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
11326 switch.
11328 @item -mpoke-function-name
11329 @opindex mpoke-function-name
11330 Write the name of each function into the text section, directly
11331 preceding the function prologue.  The generated code is similar to this:
11333 @smallexample
11334      t0
11335          .ascii "arm_poke_function_name", 0
11336          .align
11337      t1
11338          .word 0xff000000 + (t1 - t0)
11339      arm_poke_function_name
11340          mov     ip, sp
11341          stmfd   sp!, @{fp, ip, lr, pc@}
11342          sub     fp, ip, #4
11343 @end smallexample
11345 When performing a stack backtrace, code can inspect the value of
11346 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11347 location @code{pc - 12} and the top 8 bits are set, then we know that
11348 there is a function name embedded immediately preceding this location
11349 and has length @code{((pc[-3]) & 0xff000000)}.
11351 @item -mthumb
11352 @itemx -marm
11353 @opindex marm
11354 @opindex mthumb
11356 Select between generating code that executes in ARM and Thumb
11357 states.  The default for most configurations is to generate code
11358 that executes in ARM state, but the default can be changed by
11359 configuring GCC with the @option{--with-mode=}@var{state}
11360 configure option.
11362 @item -mtpcs-frame
11363 @opindex mtpcs-frame
11364 Generate a stack frame that is compliant with the Thumb Procedure Call
11365 Standard for all non-leaf functions.  (A leaf function is one that does
11366 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11368 @item -mtpcs-leaf-frame
11369 @opindex mtpcs-leaf-frame
11370 Generate a stack frame that is compliant with the Thumb Procedure Call
11371 Standard for all leaf functions.  (A leaf function is one that does
11372 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11374 @item -mcallee-super-interworking
11375 @opindex mcallee-super-interworking
11376 Gives all externally visible functions in the file being compiled an ARM
11377 instruction set header which switches to Thumb mode before executing the
11378 rest of the function.  This allows these functions to be called from
11379 non-interworking code.  This option is not valid in AAPCS configurations
11380 because interworking is enabled by default.
11382 @item -mcaller-super-interworking
11383 @opindex mcaller-super-interworking
11384 Allows calls via function pointers (including virtual functions) to
11385 execute correctly regardless of whether the target code has been
11386 compiled for interworking or not.  There is a small overhead in the cost
11387 of executing a function pointer if this option is enabled.  This option
11388 is not valid in AAPCS configurations because interworking is enabled
11389 by default.
11391 @item -mtp=@var{name}
11392 @opindex mtp
11393 Specify the access model for the thread local storage pointer.  The valid
11394 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11395 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11396 (supported in the arm6k architecture), and @option{auto}, which uses the
11397 best available method for the selected processor.  The default setting is
11398 @option{auto}.
11400 @item -mtls-dialect=@var{dialect}
11401 @opindex mtls-dialect
11402 Specify the dialect to use for accessing thread local storage.  Two
11403 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11404 @samp{gnu} dialect selects the original GNU scheme for supporting
11405 local and global dynamic TLS models.  The @samp{gnu2} dialect
11406 selects the GNU descriptor scheme, which provides better performance
11407 for shared libraries.  The GNU descriptor scheme is compatible with
11408 the original scheme, but does require new assembler, linker and
11409 library support.  Initial and local exec TLS models are unaffected by
11410 this option and always use the original scheme.
11412 @item -mword-relocations
11413 @opindex mword-relocations
11414 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11415 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11416 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11417 is specified.
11419 @item -mfix-cortex-m3-ldrd
11420 @opindex mfix-cortex-m3-ldrd
11421 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11422 with overlapping destination and base registers are used.  This option avoids
11423 generating these instructions.  This option is enabled by default when
11424 @option{-mcpu=cortex-m3} is specified.
11426 @item -munaligned-access
11427 @itemx -mno-unaligned-access
11428 @opindex munaligned-access
11429 @opindex mno-unaligned-access
11430 Enables (or disables) reading and writing of 16- and 32- bit values
11431 from addresses that are not 16- or 32- bit aligned.  By default
11432 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11433 architectures, and enabled for all other architectures.  If unaligned
11434 access is not enabled then words in packed data structures will be
11435 accessed a byte at a time.
11437 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11438 generated object file to either true or false, depending upon the
11439 setting of this option.  If unaligned access is enabled then the
11440 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11441 defined.
11443 @end table
11445 @node AVR Options
11446 @subsection AVR Options
11447 @cindex AVR Options
11449 These options are defined for AVR implementations:
11451 @table @gcctabopt
11452 @item -mmcu=@var{mcu}
11453 @opindex mmcu
11454 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11456 The default for this option is@tie{}@code{avr2}.
11458 GCC supports the following AVR devices and ISAs:
11460 @include avr-mmcu.texi
11462 @item -maccumulate-args
11463 @opindex maccumulate-args
11464 Accumulate outgoing function arguments and acquire/release the needed
11465 stack space for outgoing function arguments once in function
11466 prologue/epilogue.  Without this option, outgoing arguments are pushed
11467 before calling a function and popped afterwards.
11469 Popping the arguments after the function call can be expensive on
11470 AVR so that accumulating the stack space might lead to smaller
11471 executables because arguments need not to be removed from the
11472 stack after such a function call.
11474 This option can lead to reduced code size for functions that perform
11475 several calls to functions that get their arguments on the stack like
11476 calls to printf-like functions.
11478 @item -mbranch-cost=@var{cost}
11479 @opindex mbranch-cost
11480 Set the branch costs for conditional branch instructions to
11481 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11482 integers. The default branch cost is 0.
11484 @item -mcall-prologues
11485 @opindex mcall-prologues
11486 Functions prologues/epilogues are expanded as calls to appropriate
11487 subroutines.  Code size is smaller.
11489 @item -mint8
11490 @opindex mint8
11491 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11492 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11493 and @code{long long} is 4 bytes.  Please note that this option does not
11494 conform to the C standards, but it results in smaller code
11495 size.
11497 @item -mno-interrupts
11498 @opindex mno-interrupts
11499 Generated code is not compatible with hardware interrupts.
11500 Code size is smaller.
11502 @item -mrelax
11503 @opindex mrelax
11504 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11505 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11506 Setting @code{-mrelax} just adds the @code{--relax} option to the
11507 linker command line when the linker is called.
11509 Jump relaxing is performed by the linker because jump offsets are not
11510 known before code is located. Therefore, the assembler code generated by the
11511 compiler is the same, but the instructions in the executable may
11512 differ from instructions in the assembler code.
11514 Relaxing must be turned on if linker stubs are needed, see the
11515 section on @code{EIND} and linker stubs below.
11517 @item -msp8
11518 @opindex msp8
11519 Treat the stack pointer register as an 8-bit register,
11520 i.e.@: assume the high byte of the stack pointer is zero.
11521 In general, you don't need to set this option by hand.
11523 This option is used internally by the compiler to select and
11524 build multilibs for architectures @code{avr2} and @code{avr25}.
11525 These architectures mix devices with and without @code{SPH}.
11526 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11527 the compiler driver will add or remove this option from the compiler
11528 proper's command line, because the compiler then knows if the device
11529 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11530 register or not.
11532 @item -mstrict-X
11533 @opindex mstrict-X
11534 Use address register @code{X} in a way proposed by the hardware.  This means
11535 that @code{X} is only used in indirect, post-increment or
11536 pre-decrement addressing.
11538 Without this option, the @code{X} register may be used in the same way
11539 as @code{Y} or @code{Z} which then is emulated by additional
11540 instructions.  
11541 For example, loading a value with @code{X+const} addressing with a
11542 small non-negative @code{const < 64} to a register @var{Rn} is
11543 performed as
11545 @example
11546 adiw r26, const   ; X += const
11547 ld   @var{Rn}, X        ; @var{Rn} = *X
11548 sbiw r26, const   ; X -= const
11549 @end example
11551 @item -mtiny-stack
11552 @opindex mtiny-stack
11553 Only change the lower 8@tie{}bits of the stack pointer.
11554 @end table
11556 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11557 @cindex @code{EIND}
11558 Pointers in the implementation are 16@tie{}bits wide.
11559 The address of a function or label is represented as word address so
11560 that indirect jumps and calls can target any code address in the
11561 range of 64@tie{}Ki words.
11563 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11564 bytes of program memory space, there is a special function register called
11565 @code{EIND} that serves as most significant part of the target address
11566 when @code{EICALL} or @code{EIJMP} instructions are used.
11568 Indirect jumps and calls on these devices are handled as follows by
11569 the compiler and are subject to some limitations:
11571 @itemize @bullet
11573 @item
11574 The compiler never sets @code{EIND}.
11576 @item
11577 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11578 instructions or might read @code{EIND} directly in order to emulate an
11579 indirect call/jump by means of a @code{RET} instruction.
11581 @item
11582 The compiler assumes that @code{EIND} never changes during the startup
11583 code or during the application. In particular, @code{EIND} is not
11584 saved/restored in function or interrupt service routine
11585 prologue/epilogue.
11587 @item
11588 For indirect calls to functions and computed goto, the linker
11589 generates @emph{stubs}. Stubs are jump pads sometimes also called
11590 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11591 The stub contains a direct jump to the desired address.
11593 @item
11594 Linker relaxation must be turned on so that the linker will generate
11595 the stubs correctly an all situaltion. See the compiler option
11596 @code{-mrelax} and the linler option @code{--relax}.
11597 There are corner cases where the linker is supposed to generate stubs
11598 but aborts without relaxation and without a helpful error message.
11600 @item
11601 The default linker script is arranged for code with @code{EIND = 0}.
11602 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11603 linker script has to be used in order to place the sections whose
11604 name start with @code{.trampolines} into the segment where @code{EIND}
11605 points to.
11607 @item
11608 The startup code from libgcc never sets @code{EIND}.
11609 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11610 For the impact of AVR-LibC on @code{EIND}, see the
11611 @w{@uref{http://nongnu.org/avr-libc/user-manual,AVR-LibC user manual}}.
11613 @item
11614 It is legitimate for user-specific startup code to set up @code{EIND}
11615 early, for example by means of initialization code located in
11616 section @code{.init3}. Such code runs prior to general startup code
11617 that initializes RAM and calls constructors, but after the bit
11618 of startup code from AVR-LibC that sets @code{EIND} to the segment
11619 where the vector table is located.
11620 @example
11621 #include <avr/io.h>
11623 static void
11624 __attribute__((section(".init3"),naked,used,no_instrument_function))
11625 init3_set_eind (void)
11627   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11628                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11630 @end example
11632 @noindent
11633 The @code{__trampolines_start} symbol is defined in the linker script.
11635 @item
11636 Stubs are generated automatically by the linker if
11637 the following two conditions are met:
11638 @itemize @minus
11640 @item The address of a label is taken by means of the @code{gs} modifier
11641 (short for @emph{generate stubs}) like so:
11642 @example
11643 LDI r24, lo8(gs(@var{func}))
11644 LDI r25, hi8(gs(@var{func}))
11645 @end example
11646 @item The final location of that label is in a code segment
11647 @emph{outside} the segment where the stubs are located.
11648 @end itemize
11650 @item
11651 The compiler emits such @code{gs} modifiers for code labels in the
11652 following situations:
11653 @itemize @minus
11654 @item Taking address of a function or code label.
11655 @item Computed goto.
11656 @item If prologue-save function is used, see @option{-mcall-prologues}
11657 command-line option.
11658 @item Switch/case dispatch tables. If you do not want such dispatch
11659 tables you can specify the @option{-fno-jump-tables} command-line option.
11660 @item C and C++ constructors/destructors called during startup/shutdown.
11661 @item If the tools hit a @code{gs()} modifier explained above.
11662 @end itemize
11664 @item
11665 Jumping to non-symbolic addresses like so is @emph{not} supported:
11667 @example
11668 int main (void)
11670     /* Call function at word address 0x2 */
11671     return ((int(*)(void)) 0x2)();
11673 @end example
11675 Instead, a stub has to be set up, i.e.@: the function has to be called
11676 through a symbol (@code{func_4} in the example):
11678 @example
11679 int main (void)
11681     extern int func_4 (void);
11683     /* Call function at byte address 0x4 */
11684     return func_4();
11686 @end example
11688 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11689 Alternatively, @code{func_4} can be defined in the linker script.
11690 @end itemize
11692 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11693 @cindex @code{RAMPD}
11694 @cindex @code{RAMPX}
11695 @cindex @code{RAMPY}
11696 @cindex @code{RAMPZ}
11697 Some AVR devices support memories larger than the 64@tie{}KiB range
11698 that can be accessed with 16-bit pointers.  To access memory locations
11699 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11700 register is used as high part of the address:
11701 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11702 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11703 register, respectively, to get a wide address. Similarly,
11704 @code{RAMPD} is used together with direct addressing.
11706 @itemize
11707 @item
11708 The startup code initializes the @code{RAMP} special function
11709 registers with zero.
11711 @item
11712 If a @ref{AVR Named Address Spaces,named address space} other than
11713 generic or @code{__flash} is used, then @code{RAMPZ} is set
11714 as needed before the operation.
11716 @item
11717 If the device supports RAM larger than 64@tie{KiB} and the compiler
11718 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11719 is reset to zero after the operation.
11721 @item
11722 If the device comes with a specific @code{RAMP} register, the ISR
11723 prologue/epilogue saves/restores that SFR and initializes it with
11724 zero in case the ISR code might (implicitly) use it.
11726 @item
11727 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
11728 If you use inline assembler to read from locations outside the
11729 16-bit address range and change one of the @code{RAMP} registers,
11730 you must reset it to zero after the access.
11732 @end itemize
11734 @subsubsection AVR Built-in Macros
11736 GCC defines several built-in macros so that the user code can test
11737 for the presence or absence of features.  Almost any of the following
11738 built-in macros are deduced from device capabilities and thus
11739 triggered by the @code{-mmcu=} command-line option.
11741 For even more AVR-specific built-in macros see
11742 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
11744 @table @code
11746 @item __AVR_ARCH__
11747 Build-in macro that resolves to a decimal number that identifies the
11748 architecture and depends on the @code{-mmcu=@var{mcu}} option.
11749 Possible values are:
11751 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
11752 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
11753 @code{105}, @code{106}, @code{107}
11755 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
11756 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
11757 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
11758 @code{avrxmega6}, @code{avrxmega7}, respectively.
11759 If @var{mcu} specifies a device, this built-in macro is set
11760 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
11761 defined to @code{4}.
11763 @item __AVR_@var{Device}__
11764 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
11765 the device's name. For example, @code{-mmcu=atmega8} defines the
11766 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
11767 @code{__AVR_ATtiny261A__}, etc.
11769 The built-in macros' names follow
11770 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
11771 the device name as from the AVR user manual. The difference between
11772 @var{Device} in the built-in macro and @var{device} in
11773 @code{-mmcu=@var{device}} is that the latter is always lowercase.
11775 If @var{device} is not a device but only a core architecture like
11776 @code{avr51}, this macro will not be defined.
11778 @item __AVR_HAVE_ELPM__
11779 The device has the the @code{ELPM} instruction.
11781 @item __AVR_HAVE_ELPMX__
11782 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
11783 R@var{n},Z+} instructions.
11785 @item __AVR_HAVE_MOVW__
11786 The device has the @code{MOVW} instruction to perform 16-bit
11787 register-register moves.
11789 @item __AVR_HAVE_LPMX__
11790 The device has the @code{LPM R@var{n},Z} and
11791 @code{LPM R@var{n},Z+} instructions.
11793 @item __AVR_HAVE_MUL__
11794 The device has a hardware multiplier. 
11796 @item __AVR_HAVE_JMP_CALL__
11797 The device has the @code{JMP} and @code{CALL} instructions.
11798 This is the case for devices with at least 16@tie{}KiB of program
11799 memory.
11801 @item __AVR_HAVE_EIJMP_EICALL__
11802 @itemx __AVR_3_BYTE_PC__
11803 The device has the @code{EIJMP} and @code{EICALL} instructions.
11804 This is the case for devices with more than 128@tie{}KiB of program memory.
11805 This also means that the program counter
11806 (PC) is 3@tie{}bytes wide.
11808 @item __AVR_2_BYTE_PC__
11809 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
11810 with up to 128@tie{}KiB of program memory.
11812 @item __AVR_HAVE_8BIT_SP__
11813 @itemx __AVR_HAVE_16BIT_SP__
11814 The stack pointer (SP) register is treated as 8-bit respectively
11815 16-bit register by the compiler.
11816 The definition of these macros is affected by @code{-mtiny-stack}.
11818 @item __AVR_HAVE_SPH__
11819 @itemx __AVR_SP8__
11820 The device has the SPH (high part of stack pointer) special function
11821 register or has an 8-bit stack pointer, respectively.
11822 The definition of these macros is affected by @code{-mmcu=} and
11823 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
11824 by @code{-msp8}.
11826 @item __AVR_HAVE_RAMPD__
11827 @itemx __AVR_HAVE_RAMPX__
11828 @itemx __AVR_HAVE_RAMPY__
11829 @itemx __AVR_HAVE_RAMPZ__
11830 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
11831 @code{RAMPZ} special function register, respectively.
11833 @item __NO_INTERRUPTS__
11834 This macro reflects the @code{-mno-interrupts} command line option.
11836 @item __AVR_ERRATA_SKIP__
11837 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
11838 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
11839 instructions because of a hardware erratum.  Skip instructions are
11840 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
11841 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
11842 set.
11844 @item __AVR_SFR_OFFSET__=@var{offset}
11845 Instructions that can address I/O special function registers directly
11846 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
11847 address as if addressed by an instruction to access RAM like @code{LD}
11848 or @code{STS}. This offset depends on the device architecture and has
11849 to be subtracted from the RAM address in order to get the
11850 respective I/O@tie{}address.
11852 @item __WITH_AVRLIBC__
11853 The compiler is configured to be used together with AVR-Libc.
11854 See the @code{--with-avrlibc} configure option.
11856 @end table
11858 @node Blackfin Options
11859 @subsection Blackfin Options
11860 @cindex Blackfin Options
11862 @table @gcctabopt
11863 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
11864 @opindex mcpu=
11865 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
11866 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
11867 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
11868 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
11869 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
11870 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
11871 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
11872 @samp{bf561}, @samp{bf592}.
11874 The optional @var{sirevision} specifies the silicon revision of the target
11875 Blackfin processor.  Any workarounds available for the targeted silicon revision
11876 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
11877 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
11878 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
11879 hexadecimal digits representing the major and minor numbers in the silicon
11880 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
11881 is not defined.  If @var{sirevision} is @samp{any}, the
11882 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
11883 If this optional @var{sirevision} is not used, GCC assumes the latest known
11884 silicon revision of the targeted Blackfin processor.
11886 GCC defines a preprocessor macro for the specified @var{cpu}.
11887 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
11888 provided by libgloss to be linked in if @option{-msim} is not given.
11890 Without this option, @samp{bf532} is used as the processor by default.
11892 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
11893 only the preprocessor macro is defined.
11895 @item -msim
11896 @opindex msim
11897 Specifies that the program will be run on the simulator.  This causes
11898 the simulator BSP provided by libgloss to be linked in.  This option
11899 has effect only for @samp{bfin-elf} toolchain.
11900 Certain other options, such as @option{-mid-shared-library} and
11901 @option{-mfdpic}, imply @option{-msim}.
11903 @item -momit-leaf-frame-pointer
11904 @opindex momit-leaf-frame-pointer
11905 Don't keep the frame pointer in a register for leaf functions.  This
11906 avoids the instructions to save, set up and restore frame pointers and
11907 makes an extra register available in leaf functions.  The option
11908 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
11909 which might make debugging harder.
11911 @item -mspecld-anomaly
11912 @opindex mspecld-anomaly
11913 When enabled, the compiler ensures that the generated code does not
11914 contain speculative loads after jump instructions. If this option is used,
11915 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
11917 @item -mno-specld-anomaly
11918 @opindex mno-specld-anomaly
11919 Don't generate extra code to prevent speculative loads from occurring.
11921 @item -mcsync-anomaly
11922 @opindex mcsync-anomaly
11923 When enabled, the compiler ensures that the generated code does not
11924 contain CSYNC or SSYNC instructions too soon after conditional branches.
11925 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
11927 @item -mno-csync-anomaly
11928 @opindex mno-csync-anomaly
11929 Don't generate extra code to prevent CSYNC or SSYNC instructions from
11930 occurring too soon after a conditional branch.
11932 @item -mlow-64k
11933 @opindex mlow-64k
11934 When enabled, the compiler is free to take advantage of the knowledge that
11935 the entire program fits into the low 64k of memory.
11937 @item -mno-low-64k
11938 @opindex mno-low-64k
11939 Assume that the program is arbitrarily large.  This is the default.
11941 @item -mstack-check-l1
11942 @opindex mstack-check-l1
11943 Do stack checking using information placed into L1 scratchpad memory by the
11944 uClinux kernel.
11946 @item -mid-shared-library
11947 @opindex mid-shared-library
11948 Generate code that supports shared libraries via the library ID method.
11949 This allows for execute in place and shared libraries in an environment
11950 without virtual memory management.  This option implies @option{-fPIC}.
11951 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11953 @item -mno-id-shared-library
11954 @opindex mno-id-shared-library
11955 Generate code that doesn't assume ID-based shared libraries are being used.
11956 This is the default.
11958 @item -mleaf-id-shared-library
11959 @opindex mleaf-id-shared-library
11960 Generate code that supports shared libraries via the library ID method,
11961 but assumes that this library or executable won't link against any other
11962 ID shared libraries.  That allows the compiler to use faster code for jumps
11963 and calls.
11965 @item -mno-leaf-id-shared-library
11966 @opindex mno-leaf-id-shared-library
11967 Do not assume that the code being compiled won't link against any ID shared
11968 libraries.  Slower code is generated for jump and call insns.
11970 @item -mshared-library-id=n
11971 @opindex mshared-library-id
11972 Specifies the identification number of the ID-based shared library being
11973 compiled.  Specifying a value of 0 generates more compact code; specifying
11974 other values forces the allocation of that number to the current
11975 library but is no more space- or time-efficient than omitting this option.
11977 @item -msep-data
11978 @opindex msep-data
11979 Generate code that allows the data segment to be located in a different
11980 area of memory from the text segment.  This allows for execute in place in
11981 an environment without virtual memory management by eliminating relocations
11982 against the text section.
11984 @item -mno-sep-data
11985 @opindex mno-sep-data
11986 Generate code that assumes that the data segment follows the text segment.
11987 This is the default.
11989 @item -mlong-calls
11990 @itemx -mno-long-calls
11991 @opindex mlong-calls
11992 @opindex mno-long-calls
11993 Tells the compiler to perform function calls by first loading the
11994 address of the function into a register and then performing a subroutine
11995 call on this register.  This switch is needed if the target function
11996 lies outside of the 24-bit addressing range of the offset-based
11997 version of subroutine call instruction.
11999 This feature is not enabled by default.  Specifying
12000 @option{-mno-long-calls} restores the default behavior.  Note these
12001 switches have no effect on how the compiler generates code to handle
12002 function calls via function pointers.
12004 @item -mfast-fp
12005 @opindex mfast-fp
12006 Link with the fast floating-point library. This library relaxes some of
12007 the IEEE floating-point standard's rules for checking inputs against
12008 Not-a-Number (NAN), in the interest of performance.
12010 @item -minline-plt
12011 @opindex minline-plt
12012 Enable inlining of PLT entries in function calls to functions that are
12013 not known to bind locally.  It has no effect without @option{-mfdpic}.
12015 @item -mmulticore
12016 @opindex mmulticore
12017 Build a standalone application for multicore Blackfin processors. 
12018 This option causes proper start files and link scripts supporting 
12019 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12020 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12022 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12023 selects the one-application-per-core programming model.  Without
12024 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12025 programming model is used. In this model, the main function of Core B
12026 should be named as @code{coreb_main}.
12028 If this option is not used, the single-core application programming
12029 model is used.
12031 @item -mcorea
12032 @opindex mcorea
12033 Build a standalone application for Core A of BF561 when using
12034 the one-application-per-core programming model. Proper start files
12035 and link scripts are used to support Core A, and the macro
12036 @code{__BFIN_COREA} is defined.
12037 This option can only be used in conjunction with @option{-mmulticore}.
12039 @item -mcoreb
12040 @opindex mcoreb
12041 Build a standalone application for Core B of BF561 when using
12042 the one-application-per-core programming model. Proper start files
12043 and link scripts are used to support Core B, and the macro
12044 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12045 should be used instead of @code{main}. 
12046 This option can only be used in conjunction with @option{-mmulticore}.
12048 @item -msdram
12049 @opindex msdram
12050 Build a standalone application for SDRAM. Proper start files and
12051 link scripts are used to put the application into SDRAM, and the macro
12052 @code{__BFIN_SDRAM} is defined.
12053 The loader should initialize SDRAM before loading the application.
12055 @item -micplb
12056 @opindex micplb
12057 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12058 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12059 are enabled; for standalone applications the default is off.
12060 @end table
12062 @node C6X Options
12063 @subsection C6X Options
12064 @cindex C6X Options
12066 @table @gcctabopt
12067 @item -march=@var{name}
12068 @opindex march
12069 This specifies the name of the target architecture.  GCC uses this
12070 name to determine what kind of instructions it can emit when generating
12071 assembly code.  Permissible names are: @samp{c62x},
12072 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12074 @item -mbig-endian
12075 @opindex mbig-endian
12076 Generate code for a big-endian target.
12078 @item -mlittle-endian
12079 @opindex mlittle-endian
12080 Generate code for a little-endian target.  This is the default.
12082 @item -msim
12083 @opindex msim
12084 Choose startup files and linker script suitable for the simulator.
12086 @item -msdata=default
12087 @opindex msdata=default
12088 Put small global and static data in the @samp{.neardata} section,
12089 which is pointed to by register @code{B14}.  Put small uninitialized
12090 global and static data in the @samp{.bss} section, which is adjacent
12091 to the @samp{.neardata} section.  Put small read-only data into the
12092 @samp{.rodata} section.  The corresponding sections used for large
12093 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12095 @item -msdata=all
12096 @opindex msdata=all
12097 Put all data, not just small objects, into the sections reserved for
12098 small data, and use addressing relative to the @code{B14} register to
12099 access them.
12101 @item -msdata=none
12102 @opindex msdata=none
12103 Make no use of the sections reserved for small data, and use absolute
12104 addresses to access all data.  Put all initialized global and static
12105 data in the @samp{.fardata} section, and all uninitialized data in the
12106 @samp{.far} section.  Put all constant data into the @samp{.const}
12107 section.
12108 @end table
12110 @node CRIS Options
12111 @subsection CRIS Options
12112 @cindex CRIS Options
12114 These options are defined specifically for the CRIS ports.
12116 @table @gcctabopt
12117 @item -march=@var{architecture-type}
12118 @itemx -mcpu=@var{architecture-type}
12119 @opindex march
12120 @opindex mcpu
12121 Generate code for the specified architecture.  The choices for
12122 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12123 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12124 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12125 @samp{v10}.
12127 @item -mtune=@var{architecture-type}
12128 @opindex mtune
12129 Tune to @var{architecture-type} everything applicable about the generated
12130 code, except for the ABI and the set of available instructions.  The
12131 choices for @var{architecture-type} are the same as for
12132 @option{-march=@var{architecture-type}}.
12134 @item -mmax-stack-frame=@var{n}
12135 @opindex mmax-stack-frame
12136 Warn when the stack frame of a function exceeds @var{n} bytes.
12138 @item -metrax4
12139 @itemx -metrax100
12140 @opindex metrax4
12141 @opindex metrax100
12142 The options @option{-metrax4} and @option{-metrax100} are synonyms for
12143 @option{-march=v3} and @option{-march=v8} respectively.
12145 @item -mmul-bug-workaround
12146 @itemx -mno-mul-bug-workaround
12147 @opindex mmul-bug-workaround
12148 @opindex mno-mul-bug-workaround
12149 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
12150 models where it applies.  This option is active by default.
12152 @item -mpdebug
12153 @opindex mpdebug
12154 Enable CRIS-specific verbose debug-related information in the assembly
12155 code.  This option also has the effect of turning off the @samp{#NO_APP}
12156 formatted-code indicator to the assembler at the beginning of the
12157 assembly file.
12159 @item -mcc-init
12160 @opindex mcc-init
12161 Do not use condition-code results from previous instruction; always emit
12162 compare and test instructions before use of condition codes.
12164 @item -mno-side-effects
12165 @opindex mno-side-effects
12166 Do not emit instructions with side effects in addressing modes other than
12167 post-increment.
12169 @item -mstack-align
12170 @itemx -mno-stack-align
12171 @itemx -mdata-align
12172 @itemx -mno-data-align
12173 @itemx -mconst-align
12174 @itemx -mno-const-align
12175 @opindex mstack-align
12176 @opindex mno-stack-align
12177 @opindex mdata-align
12178 @opindex mno-data-align
12179 @opindex mconst-align
12180 @opindex mno-const-align
12181 These options (@samp{no-} options) arrange (eliminate arrangements) for the
12182 stack frame, individual data and constants to be aligned for the maximum
12183 single data access size for the chosen CPU model.  The default is to
12184 arrange for 32-bit alignment.  ABI details such as structure layout are
12185 not affected by these options.
12187 @item -m32-bit
12188 @itemx -m16-bit
12189 @itemx -m8-bit
12190 @opindex m32-bit
12191 @opindex m16-bit
12192 @opindex m8-bit
12193 Similar to the stack- data- and const-align options above, these options
12194 arrange for stack frame, writable data and constants to all be 32-bit,
12195 16-bit or 8-bit aligned.  The default is 32-bit alignment.
12197 @item -mno-prologue-epilogue
12198 @itemx -mprologue-epilogue
12199 @opindex mno-prologue-epilogue
12200 @opindex mprologue-epilogue
12201 With @option{-mno-prologue-epilogue}, the normal function prologue and
12202 epilogue which set up the stack frame are omitted and no return
12203 instructions or return sequences are generated in the code.  Use this
12204 option only together with visual inspection of the compiled code: no
12205 warnings or errors are generated when call-saved registers must be saved,
12206 or storage for local variables needs to be allocated.
12208 @item -mno-gotplt
12209 @itemx -mgotplt
12210 @opindex mno-gotplt
12211 @opindex mgotplt
12212 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
12213 instruction sequences that load addresses for functions from the PLT part
12214 of the GOT rather than (traditional on other architectures) calls to the
12215 PLT@.  The default is @option{-mgotplt}.
12217 @item -melf
12218 @opindex melf
12219 Legacy no-op option only recognized with the cris-axis-elf and
12220 cris-axis-linux-gnu targets.
12222 @item -mlinux
12223 @opindex mlinux
12224 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
12226 @item -sim
12227 @opindex sim
12228 This option, recognized for the cris-axis-elf, arranges
12229 to link with input-output functions from a simulator library.  Code,
12230 initialized data and zero-initialized data are allocated consecutively.
12232 @item -sim2
12233 @opindex sim2
12234 Like @option{-sim}, but pass linker options to locate initialized data at
12235 0x40000000 and zero-initialized data at 0x80000000.
12236 @end table
12238 @node CR16 Options
12239 @subsection CR16 Options
12240 @cindex CR16 Options
12242 These options are defined specifically for the CR16 ports.
12244 @table @gcctabopt
12246 @item -mmac
12247 @opindex mmac
12248 Enable the use of multiply-accumulate instructions. Disabled by default.
12250 @item -mcr16cplus
12251 @itemx -mcr16c
12252 @opindex mcr16cplus
12253 @opindex mcr16c
12254 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
12255 is default.
12257 @item -msim
12258 @opindex msim
12259 Links the library libsim.a which is in compatible with simulator. Applicable
12260 to ELF compiler only.
12262 @item -mint32
12263 @opindex mint32
12264 Choose integer type as 32-bit wide.
12266 @item -mbit-ops
12267 @opindex mbit-ops
12268 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
12270 @item -mdata-model=@var{model}
12271 @opindex mdata-model
12272 Choose a data model. The choices for @var{model} are @samp{near},
12273 @samp{far} or @samp{medium}. @samp{medium} is default.
12274 However, @samp{far} is not valid with @option{-mcr16c}, as the
12275 CR16C architecture does not support the far data model.
12276 @end table
12278 @node Darwin Options
12279 @subsection Darwin Options
12280 @cindex Darwin options
12282 These options are defined for all architectures running the Darwin operating
12283 system.
12285 FSF GCC on Darwin does not create ``fat'' object files; it creates
12286 an object file for the single architecture that GCC was built to
12287 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
12288 @option{-arch} options are used; it does so by running the compiler or
12289 linker multiple times and joining the results together with
12290 @file{lipo}.
12292 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
12293 @samp{i686}) is determined by the flags that specify the ISA
12294 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
12295 @option{-force_cpusubtype_ALL} option can be used to override this.
12297 The Darwin tools vary in their behavior when presented with an ISA
12298 mismatch.  The assembler, @file{as}, only permits instructions to
12299 be used that are valid for the subtype of the file it is generating,
12300 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
12301 The linker for shared libraries, @file{/usr/bin/libtool}, fails
12302 and prints an error if asked to create a shared library with a less
12303 restrictive subtype than its input files (for instance, trying to put
12304 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
12305 for executables, @command{ld}, quietly gives the executable the most
12306 restrictive subtype of any of its input files.
12308 @table @gcctabopt
12309 @item -F@var{dir}
12310 @opindex F
12311 Add the framework directory @var{dir} to the head of the list of
12312 directories to be searched for header files.  These directories are
12313 interleaved with those specified by @option{-I} options and are
12314 scanned in a left-to-right order.
12316 A framework directory is a directory with frameworks in it.  A
12317 framework is a directory with a @file{Headers} and/or
12318 @file{PrivateHeaders} directory contained directly in it that ends
12319 in @file{.framework}.  The name of a framework is the name of this
12320 directory excluding the @file{.framework}.  Headers associated with
12321 the framework are found in one of those two directories, with
12322 @file{Headers} being searched first.  A subframework is a framework
12323 directory that is in a framework's @file{Frameworks} directory.
12324 Includes of subframework headers can only appear in a header of a
12325 framework that contains the subframework, or in a sibling subframework
12326 header.  Two subframeworks are siblings if they occur in the same
12327 framework.  A subframework should not have the same name as a
12328 framework; a warning is issued if this is violated.  Currently a
12329 subframework cannot have subframeworks; in the future, the mechanism
12330 may be extended to support this.  The standard frameworks can be found
12331 in @file{/System/Library/Frameworks} and
12332 @file{/Library/Frameworks}.  An example include looks like
12333 @code{#include <Framework/header.h>}, where @file{Framework} denotes
12334 the name of the framework and @file{header.h} is found in the
12335 @file{PrivateHeaders} or @file{Headers} directory.
12337 @item -iframework@var{dir}
12338 @opindex iframework
12339 Like @option{-F} except the directory is a treated as a system
12340 directory.  The main difference between this @option{-iframework} and
12341 @option{-F} is that with @option{-iframework} the compiler does not
12342 warn about constructs contained within header files found via
12343 @var{dir}.  This option is valid only for the C family of languages.
12345 @item -gused
12346 @opindex gused
12347 Emit debugging information for symbols that are used.  For stabs
12348 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12349 This is by default ON@.
12351 @item -gfull
12352 @opindex gfull
12353 Emit debugging information for all symbols and types.
12355 @item -mmacosx-version-min=@var{version}
12356 The earliest version of MacOS X that this executable will run on
12357 is @var{version}.  Typical values of @var{version} include @code{10.1},
12358 @code{10.2}, and @code{10.3.9}.
12360 If the compiler was built to use the system's headers by default,
12361 then the default for this option is the system version on which the
12362 compiler is running, otherwise the default is to make choices that
12363 are compatible with as many systems and code bases as possible.
12365 @item -mkernel
12366 @opindex mkernel
12367 Enable kernel development mode.  The @option{-mkernel} option sets
12368 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12369 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12370 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12371 applicable.  This mode also sets @option{-mno-altivec},
12372 @option{-msoft-float}, @option{-fno-builtin} and
12373 @option{-mlong-branch} for PowerPC targets.
12375 @item -mone-byte-bool
12376 @opindex mone-byte-bool
12377 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12378 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12379 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12380 option has no effect on x86.
12382 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12383 to generate code that is not binary compatible with code generated
12384 without that switch.  Using this switch may require recompiling all
12385 other modules in a program, including system libraries.  Use this
12386 switch to conform to a non-default data model.
12388 @item -mfix-and-continue
12389 @itemx -ffix-and-continue
12390 @itemx -findirect-data
12391 @opindex mfix-and-continue
12392 @opindex ffix-and-continue
12393 @opindex findirect-data
12394 Generate code suitable for fast turnaround development, such as to
12395 allow GDB to dynamically load @code{.o} files into already-running
12396 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12397 are provided for backwards compatibility.
12399 @item -all_load
12400 @opindex all_load
12401 Loads all members of static archive libraries.
12402 See man ld(1) for more information.
12404 @item -arch_errors_fatal
12405 @opindex arch_errors_fatal
12406 Cause the errors having to do with files that have the wrong architecture
12407 to be fatal.
12409 @item -bind_at_load
12410 @opindex bind_at_load
12411 Causes the output file to be marked such that the dynamic linker will
12412 bind all undefined references when the file is loaded or launched.
12414 @item -bundle
12415 @opindex bundle
12416 Produce a Mach-o bundle format file.
12417 See man ld(1) for more information.
12419 @item -bundle_loader @var{executable}
12420 @opindex bundle_loader
12421 This option specifies the @var{executable} that will load the build
12422 output file being linked.  See man ld(1) for more information.
12424 @item -dynamiclib
12425 @opindex dynamiclib
12426 When passed this option, GCC produces a dynamic library instead of
12427 an executable when linking, using the Darwin @file{libtool} command.
12429 @item -force_cpusubtype_ALL
12430 @opindex force_cpusubtype_ALL
12431 This causes GCC's output file to have the @var{ALL} subtype, instead of
12432 one controlled by the @option{-mcpu} or @option{-march} option.
12434 @item -allowable_client  @var{client_name}
12435 @itemx -client_name
12436 @itemx -compatibility_version
12437 @itemx -current_version
12438 @itemx -dead_strip
12439 @itemx -dependency-file
12440 @itemx -dylib_file
12441 @itemx -dylinker_install_name
12442 @itemx -dynamic
12443 @itemx -exported_symbols_list
12444 @itemx -filelist
12445 @need 800
12446 @itemx -flat_namespace
12447 @itemx -force_flat_namespace
12448 @itemx -headerpad_max_install_names
12449 @itemx -image_base
12450 @itemx -init
12451 @itemx -install_name
12452 @itemx -keep_private_externs
12453 @itemx -multi_module
12454 @itemx -multiply_defined
12455 @itemx -multiply_defined_unused
12456 @need 800
12457 @itemx -noall_load
12458 @itemx -no_dead_strip_inits_and_terms
12459 @itemx -nofixprebinding
12460 @itemx -nomultidefs
12461 @itemx -noprebind
12462 @itemx -noseglinkedit
12463 @itemx -pagezero_size
12464 @itemx -prebind
12465 @itemx -prebind_all_twolevel_modules
12466 @itemx -private_bundle
12467 @need 800
12468 @itemx -read_only_relocs
12469 @itemx -sectalign
12470 @itemx -sectobjectsymbols
12471 @itemx -whyload
12472 @itemx -seg1addr
12473 @itemx -sectcreate
12474 @itemx -sectobjectsymbols
12475 @itemx -sectorder
12476 @itemx -segaddr
12477 @itemx -segs_read_only_addr
12478 @need 800
12479 @itemx -segs_read_write_addr
12480 @itemx -seg_addr_table
12481 @itemx -seg_addr_table_filename
12482 @itemx -seglinkedit
12483 @itemx -segprot
12484 @itemx -segs_read_only_addr
12485 @itemx -segs_read_write_addr
12486 @itemx -single_module
12487 @itemx -static
12488 @itemx -sub_library
12489 @need 800
12490 @itemx -sub_umbrella
12491 @itemx -twolevel_namespace
12492 @itemx -umbrella
12493 @itemx -undefined
12494 @itemx -unexported_symbols_list
12495 @itemx -weak_reference_mismatches
12496 @itemx -whatsloaded
12497 @opindex allowable_client
12498 @opindex client_name
12499 @opindex compatibility_version
12500 @opindex current_version
12501 @opindex dead_strip
12502 @opindex dependency-file
12503 @opindex dylib_file
12504 @opindex dylinker_install_name
12505 @opindex dynamic
12506 @opindex exported_symbols_list
12507 @opindex filelist
12508 @opindex flat_namespace
12509 @opindex force_flat_namespace
12510 @opindex headerpad_max_install_names
12511 @opindex image_base
12512 @opindex init
12513 @opindex install_name
12514 @opindex keep_private_externs
12515 @opindex multi_module
12516 @opindex multiply_defined
12517 @opindex multiply_defined_unused
12518 @opindex noall_load
12519 @opindex no_dead_strip_inits_and_terms
12520 @opindex nofixprebinding
12521 @opindex nomultidefs
12522 @opindex noprebind
12523 @opindex noseglinkedit
12524 @opindex pagezero_size
12525 @opindex prebind
12526 @opindex prebind_all_twolevel_modules
12527 @opindex private_bundle
12528 @opindex read_only_relocs
12529 @opindex sectalign
12530 @opindex sectobjectsymbols
12531 @opindex whyload
12532 @opindex seg1addr
12533 @opindex sectcreate
12534 @opindex sectobjectsymbols
12535 @opindex sectorder
12536 @opindex segaddr
12537 @opindex segs_read_only_addr
12538 @opindex segs_read_write_addr
12539 @opindex seg_addr_table
12540 @opindex seg_addr_table_filename
12541 @opindex seglinkedit
12542 @opindex segprot
12543 @opindex segs_read_only_addr
12544 @opindex segs_read_write_addr
12545 @opindex single_module
12546 @opindex static
12547 @opindex sub_library
12548 @opindex sub_umbrella
12549 @opindex twolevel_namespace
12550 @opindex umbrella
12551 @opindex undefined
12552 @opindex unexported_symbols_list
12553 @opindex weak_reference_mismatches
12554 @opindex whatsloaded
12555 These options are passed to the Darwin linker.  The Darwin linker man page
12556 describes them in detail.
12557 @end table
12559 @node DEC Alpha Options
12560 @subsection DEC Alpha Options
12562 These @samp{-m} options are defined for the DEC Alpha implementations:
12564 @table @gcctabopt
12565 @item -mno-soft-float
12566 @itemx -msoft-float
12567 @opindex mno-soft-float
12568 @opindex msoft-float
12569 Use (do not use) the hardware floating-point instructions for
12570 floating-point operations.  When @option{-msoft-float} is specified,
12571 functions in @file{libgcc.a} are used to perform floating-point
12572 operations.  Unless they are replaced by routines that emulate the
12573 floating-point operations, or compiled in such a way as to call such
12574 emulations routines, these routines issue floating-point
12575 operations.   If you are compiling for an Alpha without floating-point
12576 operations, you must ensure that the library is built so as not to call
12577 them.
12579 Note that Alpha implementations without floating-point operations are
12580 required to have floating-point registers.
12582 @item -mfp-reg
12583 @itemx -mno-fp-regs
12584 @opindex mfp-reg
12585 @opindex mno-fp-regs
12586 Generate code that uses (does not use) the floating-point register set.
12587 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12588 register set is not used, floating-point operands are passed in integer
12589 registers as if they were integers and floating-point results are passed
12590 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12591 so any function with a floating-point argument or return value called by code
12592 compiled with @option{-mno-fp-regs} must also be compiled with that
12593 option.
12595 A typical use of this option is building a kernel that does not use,
12596 and hence need not save and restore, any floating-point registers.
12598 @item -mieee
12599 @opindex mieee
12600 The Alpha architecture implements floating-point hardware optimized for
12601 maximum performance.  It is mostly compliant with the IEEE floating-point
12602 standard.  However, for full compliance, software assistance is
12603 required.  This option generates code fully IEEE-compliant code
12604 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12605 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12606 defined during compilation.  The resulting code is less efficient but is
12607 able to correctly support denormalized numbers and exceptional IEEE
12608 values such as not-a-number and plus/minus infinity.  Other Alpha
12609 compilers call this option @option{-ieee_with_no_inexact}.
12611 @item -mieee-with-inexact
12612 @opindex mieee-with-inexact
12613 This is like @option{-mieee} except the generated code also maintains
12614 the IEEE @var{inexact-flag}.  Turning on this option causes the
12615 generated code to implement fully-compliant IEEE math.  In addition to
12616 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12617 macro.  On some Alpha implementations the resulting code may execute
12618 significantly slower than the code generated by default.  Since there is
12619 very little code that depends on the @var{inexact-flag}, you should
12620 normally not specify this option.  Other Alpha compilers call this
12621 option @option{-ieee_with_inexact}.
12623 @item -mfp-trap-mode=@var{trap-mode}
12624 @opindex mfp-trap-mode
12625 This option controls what floating-point related traps are enabled.
12626 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12627 The trap mode can be set to one of four values:
12629 @table @samp
12630 @item n
12631 This is the default (normal) setting.  The only traps that are enabled
12632 are the ones that cannot be disabled in software (e.g., division by zero
12633 trap).
12635 @item u
12636 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12637 as well.
12639 @item su
12640 Like @samp{u}, but the instructions are marked to be safe for software
12641 completion (see Alpha architecture manual for details).
12643 @item sui
12644 Like @samp{su}, but inexact traps are enabled as well.
12645 @end table
12647 @item -mfp-rounding-mode=@var{rounding-mode}
12648 @opindex mfp-rounding-mode
12649 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12650 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12653 @table @samp
12654 @item n
12655 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12656 the nearest machine number or towards the even machine number in case
12657 of a tie.
12659 @item m
12660 Round towards minus infinity.
12662 @item c
12663 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12665 @item d
12666 Dynamic rounding mode.  A field in the floating-point control register
12667 (@var{fpcr}, see Alpha architecture reference manual) controls the
12668 rounding mode in effect.  The C library initializes this register for
12669 rounding towards plus infinity.  Thus, unless your program modifies the
12670 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12671 @end table
12673 @item -mtrap-precision=@var{trap-precision}
12674 @opindex mtrap-precision
12675 In the Alpha architecture, floating-point traps are imprecise.  This
12676 means without software assistance it is impossible to recover from a
12677 floating trap and program execution normally needs to be terminated.
12678 GCC can generate code that can assist operating system trap handlers
12679 in determining the exact location that caused a floating-point trap.
12680 Depending on the requirements of an application, different levels of
12681 precisions can be selected:
12683 @table @samp
12684 @item p
12685 Program precision.  This option is the default and means a trap handler
12686 can only identify which program caused a floating-point exception.
12688 @item f
12689 Function precision.  The trap handler can determine the function that
12690 caused a floating-point exception.
12692 @item i
12693 Instruction precision.  The trap handler can determine the exact
12694 instruction that caused a floating-point exception.
12695 @end table
12697 Other Alpha compilers provide the equivalent options called
12698 @option{-scope_safe} and @option{-resumption_safe}.
12700 @item -mieee-conformant
12701 @opindex mieee-conformant
12702 This option marks the generated code as IEEE conformant.  You must not
12703 use this option unless you also specify @option{-mtrap-precision=i} and either
12704 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12705 is to emit the line @samp{.eflag 48} in the function prologue of the
12706 generated assembly file.
12708 @item -mbuild-constants
12709 @opindex mbuild-constants
12710 Normally GCC examines a 32- or 64-bit integer constant to
12711 see if it can construct it from smaller constants in two or three
12712 instructions.  If it cannot, it outputs the constant as a literal and
12713 generates code to load it from the data segment at run time.
12715 Use this option to require GCC to construct @emph{all} integer constants
12716 using code, even if it takes more instructions (the maximum is six).
12718 You typically use this option to build a shared library dynamic
12719 loader.  Itself a shared library, it must relocate itself in memory
12720 before it can find the variables and constants in its own data segment.
12722 @item -mbwx
12723 @itemx -mno-bwx
12724 @itemx -mcix
12725 @itemx -mno-cix
12726 @itemx -mfix
12727 @itemx -mno-fix
12728 @itemx -mmax
12729 @itemx -mno-max
12730 @opindex mbwx
12731 @opindex mno-bwx
12732 @opindex mcix
12733 @opindex mno-cix
12734 @opindex mfix
12735 @opindex mno-fix
12736 @opindex mmax
12737 @opindex mno-max
12738 Indicate whether GCC should generate code to use the optional BWX,
12739 CIX, FIX and MAX instruction sets.  The default is to use the instruction
12740 sets supported by the CPU type specified via @option{-mcpu=} option or that
12741 of the CPU on which GCC was built if none is specified.
12743 @item -mfloat-vax
12744 @itemx -mfloat-ieee
12745 @opindex mfloat-vax
12746 @opindex mfloat-ieee
12747 Generate code that uses (does not use) VAX F and G floating-point
12748 arithmetic instead of IEEE single and double precision.
12750 @item -mexplicit-relocs
12751 @itemx -mno-explicit-relocs
12752 @opindex mexplicit-relocs
12753 @opindex mno-explicit-relocs
12754 Older Alpha assemblers provided no way to generate symbol relocations
12755 except via assembler macros.  Use of these macros does not allow
12756 optimal instruction scheduling.  GNU binutils as of version 2.12
12757 supports a new syntax that allows the compiler to explicitly mark
12758 which relocations should apply to which instructions.  This option
12759 is mostly useful for debugging, as GCC detects the capabilities of
12760 the assembler when it is built and sets the default accordingly.
12762 @item -msmall-data
12763 @itemx -mlarge-data
12764 @opindex msmall-data
12765 @opindex mlarge-data
12766 When @option{-mexplicit-relocs} is in effect, static data is
12767 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
12768 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
12769 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
12770 16-bit relocations off of the @code{$gp} register.  This limits the
12771 size of the small data area to 64KB, but allows the variables to be
12772 directly accessed via a single instruction.
12774 The default is @option{-mlarge-data}.  With this option the data area
12775 is limited to just below 2GB@.  Programs that require more than 2GB of
12776 data must use @code{malloc} or @code{mmap} to allocate the data in the
12777 heap instead of in the program's data segment.
12779 When generating code for shared libraries, @option{-fpic} implies
12780 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
12782 @item -msmall-text
12783 @itemx -mlarge-text
12784 @opindex msmall-text
12785 @opindex mlarge-text
12786 When @option{-msmall-text} is used, the compiler assumes that the
12787 code of the entire program (or shared library) fits in 4MB, and is
12788 thus reachable with a branch instruction.  When @option{-msmall-data}
12789 is used, the compiler can assume that all local symbols share the
12790 same @code{$gp} value, and thus reduce the number of instructions
12791 required for a function call from 4 to 1.
12793 The default is @option{-mlarge-text}.
12795 @item -mcpu=@var{cpu_type}
12796 @opindex mcpu
12797 Set the instruction set and instruction scheduling parameters for
12798 machine type @var{cpu_type}.  You can specify either the @samp{EV}
12799 style name or the corresponding chip number.  GCC supports scheduling
12800 parameters for the EV4, EV5 and EV6 family of processors and
12801 chooses the default values for the instruction set from the processor
12802 you specify.  If you do not specify a processor type, GCC defaults
12803 to the processor on which the compiler was built.
12805 Supported values for @var{cpu_type} are
12807 @table @samp
12808 @item ev4
12809 @itemx ev45
12810 @itemx 21064
12811 Schedules as an EV4 and has no instruction set extensions.
12813 @item ev5
12814 @itemx 21164
12815 Schedules as an EV5 and has no instruction set extensions.
12817 @item ev56
12818 @itemx 21164a
12819 Schedules as an EV5 and supports the BWX extension.
12821 @item pca56
12822 @itemx 21164pc
12823 @itemx 21164PC
12824 Schedules as an EV5 and supports the BWX and MAX extensions.
12826 @item ev6
12827 @itemx 21264
12828 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
12830 @item ev67
12831 @itemx 21264a
12832 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
12833 @end table
12835 Native toolchains also support the value @samp{native},
12836 which selects the best architecture option for the host processor.
12837 @option{-mcpu=native} has no effect if GCC does not recognize
12838 the processor.
12840 @item -mtune=@var{cpu_type}
12841 @opindex mtune
12842 Set only the instruction scheduling parameters for machine type
12843 @var{cpu_type}.  The instruction set is not changed.
12845 Native toolchains also support the value @samp{native},
12846 which selects the best architecture option for the host processor.
12847 @option{-mtune=native} has no effect if GCC does not recognize
12848 the processor.
12850 @item -mmemory-latency=@var{time}
12851 @opindex mmemory-latency
12852 Sets the latency the scheduler should assume for typical memory
12853 references as seen by the application.  This number is highly
12854 dependent on the memory access patterns used by the application
12855 and the size of the external cache on the machine.
12857 Valid options for @var{time} are
12859 @table @samp
12860 @item @var{number}
12861 A decimal number representing clock cycles.
12863 @item L1
12864 @itemx L2
12865 @itemx L3
12866 @itemx main
12867 The compiler contains estimates of the number of clock cycles for
12868 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
12869 (also called Dcache, Scache, and Bcache), as well as to main memory.
12870 Note that L3 is only valid for EV5.
12872 @end table
12873 @end table
12875 @node FR30 Options
12876 @subsection FR30 Options
12877 @cindex FR30 Options
12879 These options are defined specifically for the FR30 port.
12881 @table @gcctabopt
12883 @item -msmall-model
12884 @opindex msmall-model
12885 Use the small address space model.  This can produce smaller code, but
12886 it does assume that all symbolic values and addresses fit into a
12887 20-bit range.
12889 @item -mno-lsim
12890 @opindex mno-lsim
12891 Assume that runtime support has been provided and so there is no need
12892 to include the simulator library (@file{libsim.a}) on the linker
12893 command line.
12895 @end table
12897 @node FRV Options
12898 @subsection FRV Options
12899 @cindex FRV Options
12901 @table @gcctabopt
12902 @item -mgpr-32
12903 @opindex mgpr-32
12905 Only use the first 32 general-purpose registers.
12907 @item -mgpr-64
12908 @opindex mgpr-64
12910 Use all 64 general-purpose registers.
12912 @item -mfpr-32
12913 @opindex mfpr-32
12915 Use only the first 32 floating-point registers.
12917 @item -mfpr-64
12918 @opindex mfpr-64
12920 Use all 64 floating-point registers.
12922 @item -mhard-float
12923 @opindex mhard-float
12925 Use hardware instructions for floating-point operations.
12927 @item -msoft-float
12928 @opindex msoft-float
12930 Use library routines for floating-point operations.
12932 @item -malloc-cc
12933 @opindex malloc-cc
12935 Dynamically allocate condition code registers.
12937 @item -mfixed-cc
12938 @opindex mfixed-cc
12940 Do not try to dynamically allocate condition code registers, only
12941 use @code{icc0} and @code{fcc0}.
12943 @item -mdword
12944 @opindex mdword
12946 Change ABI to use double word insns.
12948 @item -mno-dword
12949 @opindex mno-dword
12951 Do not use double word instructions.
12953 @item -mdouble
12954 @opindex mdouble
12956 Use floating-point double instructions.
12958 @item -mno-double
12959 @opindex mno-double
12961 Do not use floating-point double instructions.
12963 @item -mmedia
12964 @opindex mmedia
12966 Use media instructions.
12968 @item -mno-media
12969 @opindex mno-media
12971 Do not use media instructions.
12973 @item -mmuladd
12974 @opindex mmuladd
12976 Use multiply and add/subtract instructions.
12978 @item -mno-muladd
12979 @opindex mno-muladd
12981 Do not use multiply and add/subtract instructions.
12983 @item -mfdpic
12984 @opindex mfdpic
12986 Select the FDPIC ABI, which uses function descriptors to represent
12987 pointers to functions.  Without any PIC/PIE-related options, it
12988 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
12989 assumes GOT entries and small data are within a 12-bit range from the
12990 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
12991 are computed with 32 bits.
12992 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12994 @item -minline-plt
12995 @opindex minline-plt
12997 Enable inlining of PLT entries in function calls to functions that are
12998 not known to bind locally.  It has no effect without @option{-mfdpic}.
12999 It's enabled by default if optimizing for speed and compiling for
13000 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13001 optimization option such as @option{-O3} or above is present in the
13002 command line.
13004 @item -mTLS
13005 @opindex mTLS
13007 Assume a large TLS segment when generating thread-local code.
13009 @item -mtls
13010 @opindex mtls
13012 Do not assume a large TLS segment when generating thread-local code.
13014 @item -mgprel-ro
13015 @opindex mgprel-ro
13017 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13018 that is known to be in read-only sections.  It's enabled by default,
13019 except for @option{-fpic} or @option{-fpie}: even though it may help
13020 make the global offset table smaller, it trades 1 instruction for 4.
13021 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13022 one of which may be shared by multiple symbols, and it avoids the need
13023 for a GOT entry for the referenced symbol, so it's more likely to be a
13024 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13026 @item -multilib-library-pic
13027 @opindex multilib-library-pic
13029 Link with the (library, not FD) pic libraries.  It's implied by
13030 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13031 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13032 it explicitly.
13034 @item -mlinked-fp
13035 @opindex mlinked-fp
13037 Follow the EABI requirement of always creating a frame pointer whenever
13038 a stack frame is allocated.  This option is enabled by default and can
13039 be disabled with @option{-mno-linked-fp}.
13041 @item -mlong-calls
13042 @opindex mlong-calls
13044 Use indirect addressing to call functions outside the current
13045 compilation unit.  This allows the functions to be placed anywhere
13046 within the 32-bit address space.
13048 @item -malign-labels
13049 @opindex malign-labels
13051 Try to align labels to an 8-byte boundary by inserting NOPs into the
13052 previous packet.  This option only has an effect when VLIW packing
13053 is enabled.  It doesn't create new packets; it merely adds NOPs to
13054 existing ones.
13056 @item -mlibrary-pic
13057 @opindex mlibrary-pic
13059 Generate position-independent EABI code.
13061 @item -macc-4
13062 @opindex macc-4
13064 Use only the first four media accumulator registers.
13066 @item -macc-8
13067 @opindex macc-8
13069 Use all eight media accumulator registers.
13071 @item -mpack
13072 @opindex mpack
13074 Pack VLIW instructions.
13076 @item -mno-pack
13077 @opindex mno-pack
13079 Do not pack VLIW instructions.
13081 @item -mno-eflags
13082 @opindex mno-eflags
13084 Do not mark ABI switches in e_flags.
13086 @item -mcond-move
13087 @opindex mcond-move
13089 Enable the use of conditional-move instructions (default).
13091 This switch is mainly for debugging the compiler and will likely be removed
13092 in a future version.
13094 @item -mno-cond-move
13095 @opindex mno-cond-move
13097 Disable the use of conditional-move instructions.
13099 This switch is mainly for debugging the compiler and will likely be removed
13100 in a future version.
13102 @item -mscc
13103 @opindex mscc
13105 Enable the use of conditional set instructions (default).
13107 This switch is mainly for debugging the compiler and will likely be removed
13108 in a future version.
13110 @item -mno-scc
13111 @opindex mno-scc
13113 Disable the use of conditional set instructions.
13115 This switch is mainly for debugging the compiler and will likely be removed
13116 in a future version.
13118 @item -mcond-exec
13119 @opindex mcond-exec
13121 Enable the use of conditional execution (default).
13123 This switch is mainly for debugging the compiler and will likely be removed
13124 in a future version.
13126 @item -mno-cond-exec
13127 @opindex mno-cond-exec
13129 Disable the use of conditional execution.
13131 This switch is mainly for debugging the compiler and will likely be removed
13132 in a future version.
13134 @item -mvliw-branch
13135 @opindex mvliw-branch
13137 Run a pass to pack branches into VLIW instructions (default).
13139 This switch is mainly for debugging the compiler and will likely be removed
13140 in a future version.
13142 @item -mno-vliw-branch
13143 @opindex mno-vliw-branch
13145 Do not run a pass to pack branches into VLIW instructions.
13147 This switch is mainly for debugging the compiler and will likely be removed
13148 in a future version.
13150 @item -mmulti-cond-exec
13151 @opindex mmulti-cond-exec
13153 Enable optimization of @code{&&} and @code{||} in conditional execution
13154 (default).
13156 This switch is mainly for debugging the compiler and will likely be removed
13157 in a future version.
13159 @item -mno-multi-cond-exec
13160 @opindex mno-multi-cond-exec
13162 Disable optimization of @code{&&} and @code{||} in conditional execution.
13164 This switch is mainly for debugging the compiler and will likely be removed
13165 in a future version.
13167 @item -mnested-cond-exec
13168 @opindex mnested-cond-exec
13170 Enable nested conditional execution optimizations (default).
13172 This switch is mainly for debugging the compiler and will likely be removed
13173 in a future version.
13175 @item -mno-nested-cond-exec
13176 @opindex mno-nested-cond-exec
13178 Disable nested conditional execution optimizations.
13180 This switch is mainly for debugging the compiler and will likely be removed
13181 in a future version.
13183 @item -moptimize-membar
13184 @opindex moptimize-membar
13186 This switch removes redundant @code{membar} instructions from the
13187 compiler-generated code.  It is enabled by default.
13189 @item -mno-optimize-membar
13190 @opindex mno-optimize-membar
13192 This switch disables the automatic removal of redundant @code{membar}
13193 instructions from the generated code.
13195 @item -mtomcat-stats
13196 @opindex mtomcat-stats
13198 Cause gas to print out tomcat statistics.
13200 @item -mcpu=@var{cpu}
13201 @opindex mcpu
13203 Select the processor type for which to generate code.  Possible values are
13204 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
13205 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
13207 @end table
13209 @node GNU/Linux Options
13210 @subsection GNU/Linux Options
13212 These @samp{-m} options are defined for GNU/Linux targets:
13214 @table @gcctabopt
13215 @item -mglibc
13216 @opindex mglibc
13217 Use the GNU C library.  This is the default except
13218 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
13220 @item -muclibc
13221 @opindex muclibc
13222 Use uClibc C library.  This is the default on
13223 @samp{*-*-linux-*uclibc*} targets.
13225 @item -mbionic
13226 @opindex mbionic
13227 Use Bionic C library.  This is the default on
13228 @samp{*-*-linux-*android*} targets.
13230 @item -mandroid
13231 @opindex mandroid
13232 Compile code compatible with Android platform.  This is the default on
13233 @samp{*-*-linux-*android*} targets.
13235 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
13236 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
13237 this option makes the GCC driver pass Android-specific options to the linker.
13238 Finally, this option causes the preprocessor macro @code{__ANDROID__}
13239 to be defined.
13241 @item -tno-android-cc
13242 @opindex tno-android-cc
13243 Disable compilation effects of @option{-mandroid}, i.e., do not enable
13244 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
13245 @option{-fno-rtti} by default.
13247 @item -tno-android-ld
13248 @opindex tno-android-ld
13249 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
13250 linking options to the linker.
13252 @end table
13254 @node H8/300 Options
13255 @subsection H8/300 Options
13257 These @samp{-m} options are defined for the H8/300 implementations:
13259 @table @gcctabopt
13260 @item -mrelax
13261 @opindex mrelax
13262 Shorten some address references at link time, when possible; uses the
13263 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
13264 ld, Using ld}, for a fuller description.
13266 @item -mh
13267 @opindex mh
13268 Generate code for the H8/300H@.
13270 @item -ms
13271 @opindex ms
13272 Generate code for the H8S@.
13274 @item -mn
13275 @opindex mn
13276 Generate code for the H8S and H8/300H in the normal mode.  This switch
13277 must be used either with @option{-mh} or @option{-ms}.
13279 @item -ms2600
13280 @opindex ms2600
13281 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
13283 @item -mexr
13284 @opindex mexr
13285 Extended registers are stored on stack before execution of function
13286 with monitor attribute. Default option is @option{-mexr}.
13287 This option is valid only for H8S targets.
13289 @item -mno-exr
13290 @opindex mno-exr
13291 Extended registers are not stored on stack before execution of function 
13292 with monitor attribute. Default option is @option{-mno-exr}. 
13293 This option is valid only for H8S targets.
13295 @item -mint32
13296 @opindex mint32
13297 Make @code{int} data 32 bits by default.
13299 @item -malign-300
13300 @opindex malign-300
13301 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
13302 The default for the H8/300H and H8S is to align longs and floats on
13303 4-byte boundaries.
13304 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
13305 This option has no effect on the H8/300.
13306 @end table
13308 @node HPPA Options
13309 @subsection HPPA Options
13310 @cindex HPPA Options
13312 These @samp{-m} options are defined for the HPPA family of computers:
13314 @table @gcctabopt
13315 @item -march=@var{architecture-type}
13316 @opindex march
13317 Generate code for the specified architecture.  The choices for
13318 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
13319 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
13320 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
13321 architecture option for your machine.  Code compiled for lower numbered
13322 architectures runs on higher numbered architectures, but not the
13323 other way around.
13325 @item -mpa-risc-1-0
13326 @itemx -mpa-risc-1-1
13327 @itemx -mpa-risc-2-0
13328 @opindex mpa-risc-1-0
13329 @opindex mpa-risc-1-1
13330 @opindex mpa-risc-2-0
13331 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
13333 @item -mbig-switch
13334 @opindex mbig-switch
13335 Generate code suitable for big switch tables.  Use this option only if
13336 the assembler/linker complain about out-of-range branches within a switch
13337 table.
13339 @item -mjump-in-delay
13340 @opindex mjump-in-delay
13341 Fill delay slots of function calls with unconditional jump instructions
13342 by modifying the return pointer for the function call to be the target
13343 of the conditional jump.
13345 @item -mdisable-fpregs
13346 @opindex mdisable-fpregs
13347 Prevent floating-point registers from being used in any manner.  This is
13348 necessary for compiling kernels that perform lazy context switching of
13349 floating-point registers.  If you use this option and attempt to perform
13350 floating-point operations, the compiler aborts.
13352 @item -mdisable-indexing
13353 @opindex mdisable-indexing
13354 Prevent the compiler from using indexing address modes.  This avoids some
13355 rather obscure problems when compiling MIG generated code under MACH@.
13357 @item -mno-space-regs
13358 @opindex mno-space-regs
13359 Generate code that assumes the target has no space registers.  This allows
13360 GCC to generate faster indirect calls and use unscaled index address modes.
13362 Such code is suitable for level 0 PA systems and kernels.
13364 @item -mfast-indirect-calls
13365 @opindex mfast-indirect-calls
13366 Generate code that assumes calls never cross space boundaries.  This
13367 allows GCC to emit code that performs faster indirect calls.
13369 This option does not work in the presence of shared libraries or nested
13370 functions.
13372 @item -mfixed-range=@var{register-range}
13373 @opindex mfixed-range
13374 Generate code treating the given register range as fixed registers.
13375 A fixed register is one that the register allocator cannot use.  This is
13376 useful when compiling kernel code.  A register range is specified as
13377 two registers separated by a dash.  Multiple register ranges can be
13378 specified separated by a comma.
13380 @item -mlong-load-store
13381 @opindex mlong-load-store
13382 Generate 3-instruction load and store sequences as sometimes required by
13383 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13384 the HP compilers.
13386 @item -mportable-runtime
13387 @opindex mportable-runtime
13388 Use the portable calling conventions proposed by HP for ELF systems.
13390 @item -mgas
13391 @opindex mgas
13392 Enable the use of assembler directives only GAS understands.
13394 @item -mschedule=@var{cpu-type}
13395 @opindex mschedule
13396 Schedule code according to the constraints for the machine type
13397 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13398 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13399 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13400 proper scheduling option for your machine.  The default scheduling is
13401 @samp{8000}.
13403 @item -mlinker-opt
13404 @opindex mlinker-opt
13405 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13406 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13407 linkers in which they give bogus error messages when linking some programs.
13409 @item -msoft-float
13410 @opindex msoft-float
13411 Generate output containing library calls for floating point.
13412 @strong{Warning:} the requisite libraries are not available for all HPPA
13413 targets.  Normally the facilities of the machine's usual C compiler are
13414 used, but this cannot be done directly in cross-compilation.  You must make
13415 your own arrangements to provide suitable library functions for
13416 cross-compilation.
13418 @option{-msoft-float} changes the calling convention in the output file;
13419 therefore, it is only useful if you compile @emph{all} of a program with
13420 this option.  In particular, you need to compile @file{libgcc.a}, the
13421 library that comes with GCC, with @option{-msoft-float} in order for
13422 this to work.
13424 @item -msio
13425 @opindex msio
13426 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13427 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13428 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13429 options are available under HP-UX and HI-UX@.
13431 @item -mgnu-ld
13432 @opindex mgnu-ld
13433 Use options specific to GNU @command{ld}.
13434 This passes @option{-shared} to @command{ld} when
13435 building a shared library.  It is the default when GCC is configured,
13436 explicitly or implicitly, with the GNU linker.  This option does not
13437 affect which @command{ld} is called; it only changes what parameters
13438 are passed to that @command{ld}.
13439 The @command{ld} that is called is determined by the
13440 @option{--with-ld} configure option, GCC's program search path, and
13441 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13442 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13443 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13445 @item -mhp-ld
13446 @opindex mhp-ld
13447 Use options specific to HP @command{ld}.
13448 This passes @option{-b} to @command{ld} when building
13449 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13450 links.  It is the default when GCC is configured, explicitly or
13451 implicitly, with the HP linker.  This option does not affect
13452 which @command{ld} is called; it only changes what parameters are passed to that
13453 @command{ld}.
13454 The @command{ld} that is called is determined by the @option{--with-ld}
13455 configure option, GCC's program search path, and finally by the user's
13456 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13457 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13458 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13460 @item -mlong-calls
13461 @opindex mno-long-calls
13462 Generate code that uses long call sequences.  This ensures that a call
13463 is always able to reach linker generated stubs.  The default is to generate
13464 long calls only when the distance from the call site to the beginning
13465 of the function or translation unit, as the case may be, exceeds a
13466 predefined limit set by the branch type being used.  The limits for
13467 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13468 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13469 240,000 bytes.
13471 Distances are measured from the beginning of functions when using the
13472 @option{-ffunction-sections} option, or when using the @option{-mgas}
13473 and @option{-mno-portable-runtime} options together under HP-UX with
13474 the SOM linker.
13476 It is normally not desirable to use this option as it degrades
13477 performance.  However, it may be useful in large applications,
13478 particularly when partial linking is used to build the application.
13480 The types of long calls used depends on the capabilities of the
13481 assembler and linker, and the type of code being generated.  The
13482 impact on systems that support long absolute calls, and long pic
13483 symbol-difference or pc-relative calls should be relatively small.
13484 However, an indirect call is used on 32-bit ELF systems in pic code
13485 and it is quite long.
13487 @item -munix=@var{unix-std}
13488 @opindex march
13489 Generate compiler predefines and select a startfile for the specified
13490 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13491 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13492 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13493 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13494 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13495 and later.
13497 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13498 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13499 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13500 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13501 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13502 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13504 It is @emph{important} to note that this option changes the interfaces
13505 for various library routines.  It also affects the operational behavior
13506 of the C library.  Thus, @emph{extreme} care is needed in using this
13507 option.
13509 Library code that is intended to operate with more than one UNIX
13510 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13511 as appropriate.  Most GNU software doesn't provide this capability.
13513 @item -nolibdld
13514 @opindex nolibdld
13515 Suppress the generation of link options to search libdld.sl when the
13516 @option{-static} option is specified on HP-UX 10 and later.
13518 @item -static
13519 @opindex static
13520 The HP-UX implementation of setlocale in libc has a dependency on
13521 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13522 when the @option{-static} option is specified, special link options
13523 are needed to resolve this dependency.
13525 On HP-UX 10 and later, the GCC driver adds the necessary options to
13526 link with libdld.sl when the @option{-static} option is specified.
13527 This causes the resulting binary to be dynamic.  On the 64-bit port,
13528 the linkers generate dynamic binaries by default in any case.  The
13529 @option{-nolibdld} option can be used to prevent the GCC driver from
13530 adding these link options.
13532 @item -threads
13533 @opindex threads
13534 Add support for multithreading with the @dfn{dce thread} library
13535 under HP-UX@.  This option sets flags for both the preprocessor and
13536 linker.
13537 @end table
13539 @node i386 and x86-64 Options
13540 @subsection Intel 386 and AMD x86-64 Options
13541 @cindex i386 Options
13542 @cindex x86-64 Options
13543 @cindex Intel 386 Options
13544 @cindex AMD x86-64 Options
13546 These @samp{-m} options are defined for the i386 and x86-64 family of
13547 computers:
13549 @table @gcctabopt
13551 @item -march=@var{cpu-type}
13552 @opindex march
13553 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13554 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13555 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13556 to generate code that may not run at all on processors other than the one
13557 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13558 @option{-mtune=@var{cpu-type}}.
13560 The choices for @var{cpu-type} are:
13562 @table @samp
13563 @item native
13564 This selects the CPU to generate code for at compilation time by determining
13565 the processor type of the compiling machine.  Using @option{-march=native}
13566 enables all instruction subsets supported by the local machine (hence
13567 the result might not run on different machines).  Using @option{-mtune=native}
13568 produces code optimized for the local machine under the constraints
13569 of the selected instruction set.  
13571 @item i386
13572 Original Intel i386 CPU@.
13574 @item i486
13575 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13577 @item i586
13578 @itemx pentium
13579 Intel Pentium CPU with no MMX support.
13581 @item pentium-mmx
13582 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13584 @item pentiumpro
13585 Intel Pentium Pro CPU@.
13587 @item i686
13588 When used with @option{-march}, the Pentium Pro
13589 instruction set is used, so the code runs on all i686 family chips.
13590 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13592 @item pentium2
13593 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13594 support.
13596 @item pentium3
13597 @itemx pentium3m
13598 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13599 set support.
13601 @item pentium-m
13602 Intel Pentium M; low-power version of Intel Pentium III CPU
13603 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13605 @item pentium4
13606 @itemx pentium4m
13607 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13609 @item prescott
13610 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13611 set support.
13613 @item nocona
13614 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13615 SSE2 and SSE3 instruction set support.
13617 @item core2
13618 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13619 instruction set support.
13621 @item corei7
13622 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13623 and SSE4.2 instruction set support.
13625 @item corei7-avx
13626 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13627 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13629 @item core-avx-i
13630 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13631 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13632 set support.
13634 @item atom
13635 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13636 instruction set support.
13638 @item k6
13639 AMD K6 CPU with MMX instruction set support.
13641 @item k6-2
13642 @itemx k6-3
13643 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13645 @item athlon
13646 @itemx athlon-tbird
13647 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13648 support.
13650 @item athlon-4
13651 @itemx athlon-xp
13652 @itemx athlon-mp
13653 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13654 instruction set support.
13656 @item k8
13657 @itemx opteron
13658 @itemx athlon64
13659 @itemx athlon-fx
13660 Processors based on the AMD K8 core with x86-64 instruction set support,
13661 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13662 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13663 instruction set extensions.)
13665 @item k8-sse3
13666 @itemx opteron-sse3
13667 @itemx athlon64-sse3
13668 Improved versions of AMD K8 cores with SSE3 instruction set support.
13670 @item amdfam10
13671 @itemx barcelona
13672 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13673 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13674 instruction set extensions.)
13676 @item bdver1
13677 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13678 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13679 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13680 @item bdver2
13681 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13682 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13683 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13684 extensions.)
13686 @item btver1
13687 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13688 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13689 instruction set extensions.)
13691 @item btver2
13692 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
13693 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
13694 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
13696 @item winchip-c6
13697 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13698 set support.
13700 @item winchip2
13701 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13702 instruction set support.
13704 @item c3
13705 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13706 implemented for this chip.)
13708 @item c3-2
13709 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13710 (No scheduling is
13711 implemented for this chip.)
13713 @item geode
13714 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
13715 @end table
13717 @item -mtune=@var{cpu-type}
13718 @opindex mtune
13719 Tune to @var{cpu-type} everything applicable about the generated code, except
13720 for the ABI and the set of available instructions.  
13721 While picking a specific @var{cpu-type} schedules things appropriately
13722 for that particular chip, the compiler does not generate any code that
13723 cannot run on the default machine type unless you use a
13724 @option{-march=@var{cpu-type}} option.
13725 For example, if GCC is configured for i686-pc-linux-gnu
13726 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
13727 but still runs on i686 machines.
13729 The choices for @var{cpu-type} are the same as for @option{-march}.
13730 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
13732 @table @samp
13733 @item generic
13734 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
13735 If you know the CPU on which your code will run, then you should use
13736 the corresponding @option{-mtune} or @option{-march} option instead of
13737 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
13738 of your application will have, then you should use this option.
13740 As new processors are deployed in the marketplace, the behavior of this
13741 option will change.  Therefore, if you upgrade to a newer version of
13742 GCC, code generation controlled by this option will change to reflect
13743 the processors
13744 that are most common at the time that version of GCC is released.
13746 There is no @option{-march=generic} option because @option{-march}
13747 indicates the instruction set the compiler can use, and there is no
13748 generic instruction set applicable to all processors.  In contrast,
13749 @option{-mtune} indicates the processor (or, in this case, collection of
13750 processors) for which the code is optimized.
13751 @end table
13753 @item -mcpu=@var{cpu-type}
13754 @opindex mcpu
13755 A deprecated synonym for @option{-mtune}.
13757 @item -mfpmath=@var{unit}
13758 @opindex mfpmath
13759 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
13760 for @var{unit} are:
13762 @table @samp
13763 @item 387
13764 Use the standard 387 floating-point coprocessor present on the majority of chips and
13765 emulated otherwise.  Code compiled with this option runs almost everywhere.
13766 The temporary results are computed in 80-bit precision instead of the precision
13767 specified by the type, resulting in slightly different results compared to most
13768 of other chips.  See @option{-ffloat-store} for more detailed description.
13770 This is the default choice for i386 compiler.
13772 @item sse
13773 Use scalar floating-point instructions present in the SSE instruction set.
13774 This instruction set is supported by Pentium III and newer chips,
13775 and in the AMD line
13776 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
13777 instruction set supports only single-precision arithmetic, thus the double and
13778 extended-precision arithmetic are still done using 387.  A later version, present
13779 only in Pentium 4 and AMD x86-64 chips, supports double-precision
13780 arithmetic too.
13782 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
13783 or @option{-msse2} switches to enable SSE extensions and make this option
13784 effective.  For the x86-64 compiler, these extensions are enabled by default.
13786 The resulting code should be considerably faster in the majority of cases and avoid
13787 the numerical instability problems of 387 code, but may break some existing
13788 code that expects temporaries to be 80 bits.
13790 This is the default choice for the x86-64 compiler.
13792 @item sse,387
13793 @itemx sse+387
13794 @itemx both
13795 Attempt to utilize both instruction sets at once.  This effectively doubles the
13796 amount of available registers, and on chips with separate execution units for
13797 387 and SSE the execution resources too.  Use this option with care, as it is
13798 still experimental, because the GCC register allocator does not model separate
13799 functional units well, resulting in unstable performance.
13800 @end table
13802 @item -masm=@var{dialect}
13803 @opindex masm=@var{dialect}
13804 Output assembly instructions using selected @var{dialect}.  Supported
13805 choices are @samp{intel} or @samp{att} (the default).  Darwin does
13806 not support @samp{intel}.
13808 @item -mieee-fp
13809 @itemx -mno-ieee-fp
13810 @opindex mieee-fp
13811 @opindex mno-ieee-fp
13812 Control whether or not the compiler uses IEEE floating-point
13813 comparisons.  These correctly handle the case where the result of a
13814 comparison is unordered.
13816 @item -msoft-float
13817 @opindex msoft-float
13818 Generate output containing library calls for floating point.
13820 @strong{Warning:} the requisite libraries are not part of GCC@.
13821 Normally the facilities of the machine's usual C compiler are used, but
13822 this can't be done directly in cross-compilation.  You must make your
13823 own arrangements to provide suitable library functions for
13824 cross-compilation.
13826 On machines where a function returns floating-point results in the 80387
13827 register stack, some floating-point opcodes may be emitted even if
13828 @option{-msoft-float} is used.
13830 @item -mno-fp-ret-in-387
13831 @opindex mno-fp-ret-in-387
13832 Do not use the FPU registers for return values of functions.
13834 The usual calling convention has functions return values of types
13835 @code{float} and @code{double} in an FPU register, even if there
13836 is no FPU@.  The idea is that the operating system should emulate
13837 an FPU@.
13839 The option @option{-mno-fp-ret-in-387} causes such values to be returned
13840 in ordinary CPU registers instead.
13842 @item -mno-fancy-math-387
13843 @opindex mno-fancy-math-387
13844 Some 387 emulators do not support the @code{sin}, @code{cos} and
13845 @code{sqrt} instructions for the 387.  Specify this option to avoid
13846 generating those instructions.  This option is the default on FreeBSD,
13847 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
13848 indicates that the target CPU always has an FPU and so the
13849 instruction does not need emulation.  These
13850 instructions are not generated unless you also use the
13851 @option{-funsafe-math-optimizations} switch.
13853 @item -malign-double
13854 @itemx -mno-align-double
13855 @opindex malign-double
13856 @opindex mno-align-double
13857 Control whether GCC aligns @code{double}, @code{long double}, and
13858 @code{long long} variables on a two-word boundary or a one-word
13859 boundary.  Aligning @code{double} variables on a two-word boundary
13860 produces code that runs somewhat faster on a Pentium at the
13861 expense of more memory.
13863 On x86-64, @option{-malign-double} is enabled by default.
13865 @strong{Warning:} if you use the @option{-malign-double} switch,
13866 structures containing the above types are aligned differently than
13867 the published application binary interface specifications for the 386
13868 and are not binary compatible with structures in code compiled
13869 without that switch.
13871 @item -m96bit-long-double
13872 @itemx -m128bit-long-double
13873 @opindex m96bit-long-double
13874 @opindex m128bit-long-double
13875 These switches control the size of @code{long double} type.  The i386
13876 application binary interface specifies the size to be 96 bits,
13877 so @option{-m96bit-long-double} is the default in 32-bit mode.
13879 Modern architectures (Pentium and newer) prefer @code{long double}
13880 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
13881 conforming to the ABI, this is not possible.  So specifying
13882 @option{-m128bit-long-double} aligns @code{long double}
13883 to a 16-byte boundary by padding the @code{long double} with an additional
13884 32-bit zero.
13886 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
13887 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
13889 Notice that neither of these options enable any extra precision over the x87
13890 standard of 80 bits for a @code{long double}.
13892 @strong{Warning:} if you override the default value for your target ABI, this
13893 changes the size of 
13894 structures and arrays containing @code{long double} variables,
13895 as well as modifying the function calling convention for functions taking
13896 @code{long double}.  Hence they are not binary-compatible
13897 with code compiled without that switch.
13899 @item -mlong-double-64
13900 @itemx -mlong-double-80
13901 @opindex mlong-double-64
13902 @opindex mlong-double-80
13903 These switches control the size of @code{long double} type. A size
13904 of 64 bits makes the @code{long double} type equivalent to the @code{double}
13905 type. This is the default for Bionic C library.
13907 @strong{Warning:} if you override the default value for your target ABI, this
13908 changes the size of
13909 structures and arrays containing @code{long double} variables,
13910 as well as modifying the function calling convention for functions taking
13911 @code{long double}.  Hence they are not binary-compatible
13912 with code compiled without that switch.
13914 @item -mlarge-data-threshold=@var{threshold}
13915 @opindex mlarge-data-threshold
13916 When @option{-mcmodel=medium} is specified, data objects larger than
13917 @var{threshold} are placed in the large data section.  This value must be the
13918 same across all objects linked into the binary, and defaults to 65535.
13920 @item -mrtd
13921 @opindex mrtd
13922 Use a different function-calling convention, in which functions that
13923 take a fixed number of arguments return with the @code{ret @var{num}}
13924 instruction, which pops their arguments while returning.  This saves one
13925 instruction in the caller since there is no need to pop the arguments
13926 there.
13928 You can specify that an individual function is called with this calling
13929 sequence with the function attribute @samp{stdcall}.  You can also
13930 override the @option{-mrtd} option by using the function attribute
13931 @samp{cdecl}.  @xref{Function Attributes}.
13933 @strong{Warning:} this calling convention is incompatible with the one
13934 normally used on Unix, so you cannot use it if you need to call
13935 libraries compiled with the Unix compiler.
13937 Also, you must provide function prototypes for all functions that
13938 take variable numbers of arguments (including @code{printf});
13939 otherwise incorrect code is generated for calls to those
13940 functions.
13942 In addition, seriously incorrect code results if you call a
13943 function with too many arguments.  (Normally, extra arguments are
13944 harmlessly ignored.)
13946 @item -mregparm=@var{num}
13947 @opindex mregparm
13948 Control how many registers are used to pass integer arguments.  By
13949 default, no registers are used to pass arguments, and at most 3
13950 registers can be used.  You can control this behavior for a specific
13951 function by using the function attribute @samp{regparm}.
13952 @xref{Function Attributes}.
13954 @strong{Warning:} if you use this switch, and
13955 @var{num} is nonzero, then you must build all modules with the same
13956 value, including any libraries.  This includes the system libraries and
13957 startup modules.
13959 @item -msseregparm
13960 @opindex msseregparm
13961 Use SSE register passing conventions for float and double arguments
13962 and return values.  You can control this behavior for a specific
13963 function by using the function attribute @samp{sseregparm}.
13964 @xref{Function Attributes}.
13966 @strong{Warning:} if you use this switch then you must build all
13967 modules with the same value, including any libraries.  This includes
13968 the system libraries and startup modules.
13970 @item -mvect8-ret-in-mem
13971 @opindex mvect8-ret-in-mem
13972 Return 8-byte vectors in memory instead of MMX registers.  This is the
13973 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
13974 Studio compilers until version 12.  Later compiler versions (starting
13975 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
13976 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
13977 you need to remain compatible with existing code produced by those
13978 previous compiler versions or older versions of GCC@.
13980 @item -mpc32
13981 @itemx -mpc64
13982 @itemx -mpc80
13983 @opindex mpc32
13984 @opindex mpc64
13985 @opindex mpc80
13987 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
13988 is specified, the significands of results of floating-point operations are
13989 rounded to 24 bits (single precision); @option{-mpc64} rounds the
13990 significands of results of floating-point operations to 53 bits (double
13991 precision) and @option{-mpc80} rounds the significands of results of
13992 floating-point operations to 64 bits (extended double precision), which is
13993 the default.  When this option is used, floating-point operations in higher
13994 precisions are not available to the programmer without setting the FPU
13995 control word explicitly.
13997 Setting the rounding of floating-point operations to less than the default
13998 80 bits can speed some programs by 2% or more.  Note that some mathematical
13999 libraries assume that extended-precision (80-bit) floating-point operations
14000 are enabled by default; routines in such libraries could suffer significant
14001 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14002 when this option is used to set the precision to less than extended precision.
14004 @item -mstackrealign
14005 @opindex mstackrealign
14006 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14007 option generates an alternate prologue and epilogue that realigns the
14008 run-time stack if necessary.  This supports mixing legacy codes that keep
14009 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14010 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14011 applicable to individual functions.
14013 @item -mpreferred-stack-boundary=@var{num}
14014 @opindex mpreferred-stack-boundary
14015 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14016 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14017 the default is 4 (16 bytes or 128 bits).
14019 @strong{Warning:} When generating code for the x86-64 architecture with
14020 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14021 used to keep the stack boundary aligned to 8 byte boundary.  Since
14022 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14023 intended to be used in controlled environment where stack space is
14024 important limitation.  This option will lead to wrong code when functions
14025 compiled with 16 byte stack alignment (such as functions from a standard
14026 library) are called with misaligned stack.  In this case, SSE
14027 instructions may lead to misaligned memory access traps.  In addition,
14028 variable arguments will be handled incorrectly for 16 byte aligned
14029 objects (including x87 long double and __int128), leading to wrong
14030 results.  You must build all modules with
14031 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14032 includes the system libraries and startup modules.
14034 @item -mincoming-stack-boundary=@var{num}
14035 @opindex mincoming-stack-boundary
14036 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14037 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14038 the one specified by @option{-mpreferred-stack-boundary} is used.
14040 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14041 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14042 suffer significant run time performance penalties.  On Pentium III, the
14043 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14044 properly if it is not 16-byte aligned.
14046 To ensure proper alignment of this values on the stack, the stack boundary
14047 must be as aligned as that required by any value stored on the stack.
14048 Further, every function must be generated such that it keeps the stack
14049 aligned.  Thus calling a function compiled with a higher preferred
14050 stack boundary from a function compiled with a lower preferred stack
14051 boundary most likely misaligns the stack.  It is recommended that
14052 libraries that use callbacks always use the default setting.
14054 This extra alignment does consume extra stack space, and generally
14055 increases code size.  Code that is sensitive to stack space usage, such
14056 as embedded systems and operating system kernels, may want to reduce the
14057 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14059 @item -mmmx
14060 @itemx -mno-mmx
14061 @itemx -msse
14062 @itemx -mno-sse
14063 @itemx -msse2
14064 @itemx -mno-sse2
14065 @itemx -msse3
14066 @itemx -mno-sse3
14067 @itemx -mssse3
14068 @itemx -mno-ssse3
14069 @itemx -msse4.1
14070 @need 800
14071 @itemx -mno-sse4.1
14072 @itemx -msse4.2
14073 @itemx -mno-sse4.2
14074 @itemx -msse4
14075 @itemx -mno-sse4
14076 @itemx -mavx
14077 @itemx -mno-avx
14078 @itemx -mavx2
14079 @itemx -mno-avx2
14080 @itemx -maes
14081 @itemx -mno-aes
14082 @itemx -mpclmul
14083 @need 800
14084 @itemx -mno-pclmul
14085 @itemx -mfsgsbase
14086 @itemx -mno-fsgsbase
14087 @itemx -mrdrnd
14088 @itemx -mno-rdrnd
14089 @itemx -mf16c
14090 @itemx -mno-f16c
14091 @itemx -mfma
14092 @itemx -mno-fma
14093 @itemx -msse4a
14094 @itemx -mno-sse4a
14095 @itemx -mfma4
14096 @need 800
14097 @itemx -mno-fma4
14098 @itemx -mxop
14099 @itemx -mno-xop
14100 @itemx -mlwp
14101 @itemx -mno-lwp
14102 @itemx -m3dnow
14103 @itemx -mno-3dnow
14104 @itemx -mpopcnt
14105 @itemx -mno-popcnt
14106 @itemx -mabm
14107 @itemx -mno-abm
14108 @itemx -mbmi
14109 @itemx -mbmi2
14110 @itemx -mno-bmi
14111 @itemx -mno-bmi2
14112 @itemx -mlzcnt
14113 @itemx -mno-lzcnt
14114 @itemx -mrtm
14115 @itemx -mtbm
14116 @itemx -mno-tbm
14117 @opindex mmmx
14118 @opindex mno-mmx
14119 @opindex msse
14120 @opindex mno-sse
14121 @opindex m3dnow
14122 @opindex mno-3dnow
14123 These switches enable or disable the use of instructions in the MMX, SSE,
14124 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
14125 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT, RTM or 3DNow!@:
14126 extended instruction sets.
14127 These extensions are also available as built-in functions: see
14128 @ref{X86 Built-in Functions}, for details of the functions enabled and
14129 disabled by these switches.
14131 To generate SSE/SSE2 instructions automatically from floating-point
14132 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
14134 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
14135 generates new AVX instructions or AVX equivalence for all SSEx instructions
14136 when needed.
14138 These options enable GCC to use these extended instructions in
14139 generated code, even without @option{-mfpmath=sse}.  Applications that
14140 perform run-time CPU detection must compile separate files for each
14141 supported architecture, using the appropriate flags.  In particular,
14142 the file containing the CPU detection code should be compiled without
14143 these options.
14145 @item -mcld
14146 @opindex mcld
14147 This option instructs GCC to emit a @code{cld} instruction in the prologue
14148 of functions that use string instructions.  String instructions depend on
14149 the DF flag to select between autoincrement or autodecrement mode.  While the
14150 ABI specifies the DF flag to be cleared on function entry, some operating
14151 systems violate this specification by not clearing the DF flag in their
14152 exception dispatchers.  The exception handler can be invoked with the DF flag
14153 set, which leads to wrong direction mode when string instructions are used.
14154 This option can be enabled by default on 32-bit x86 targets by configuring
14155 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
14156 instructions can be suppressed with the @option{-mno-cld} compiler option
14157 in this case.
14159 @item -mvzeroupper
14160 @opindex mvzeroupper
14161 This option instructs GCC to emit a @code{vzeroupper} instruction
14162 before a transfer of control flow out of the function to minimize
14163 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
14164 intrinsics.
14166 @item -mprefer-avx128
14167 @opindex mprefer-avx128
14168 This option instructs GCC to use 128-bit AVX instructions instead of
14169 256-bit AVX instructions in the auto-vectorizer.
14171 @item -mcx16
14172 @opindex mcx16
14173 This option enables GCC to generate @code{CMPXCHG16B} instructions.
14174 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
14175 (or oword) data types.  
14176 This is useful for high-resolution counters that can be updated
14177 by multiple processors (or cores).  This instruction is generated as part of
14178 atomic built-in functions: see @ref{__sync Builtins} or
14179 @ref{__atomic Builtins} for details.
14181 @item -msahf
14182 @opindex msahf
14183 This option enables generation of @code{SAHF} instructions in 64-bit code.
14184 Early Intel Pentium 4 CPUs with Intel 64 support,
14185 prior to the introduction of Pentium 4 G1 step in December 2005,
14186 lacked the @code{LAHF} and @code{SAHF} instructions
14187 which were supported by AMD64.
14188 These are load and store instructions, respectively, for certain status flags.
14189 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
14190 @code{drem}, and @code{remainder} built-in functions;
14191 see @ref{Other Builtins} for details.
14193 @item -mmovbe
14194 @opindex mmovbe
14195 This option enables use of the @code{movbe} instruction to implement
14196 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
14198 @item -mcrc32
14199 @opindex mcrc32
14200 This option enables built-in functions @code{__builtin_ia32_crc32qi},
14201 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
14202 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
14204 @item -mrecip
14205 @opindex mrecip
14206 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
14207 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
14208 with an additional Newton-Raphson step
14209 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
14210 (and their vectorized
14211 variants) for single-precision floating-point arguments.  These instructions
14212 are generated only when @option{-funsafe-math-optimizations} is enabled
14213 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
14214 Note that while the throughput of the sequence is higher than the throughput
14215 of the non-reciprocal instruction, the precision of the sequence can be
14216 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
14218 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
14219 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
14220 combination), and doesn't need @option{-mrecip}.
14222 Also note that GCC emits the above sequence with additional Newton-Raphson step
14223 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
14224 already with @option{-ffast-math} (or the above option combination), and
14225 doesn't need @option{-mrecip}.
14227 @item -mrecip=@var{opt}
14228 @opindex mrecip=opt
14229 This option controls which reciprocal estimate instructions
14230 may be used.  @var{opt} is a comma-separated list of options, which may
14231 be preceded by a @samp{!} to invert the option:
14233 @table @samp
14234 @item all
14235 Enable all estimate instructions.
14237 @item default
14238 Enable the default instructions, equivalent to @option{-mrecip}.
14240 @item none
14241 Disable all estimate instructions, equivalent to @option{-mno-recip}.
14243 @item div
14244 Enable the approximation for scalar division.
14246 @item vec-div
14247 Enable the approximation for vectorized division.
14249 @item sqrt
14250 Enable the approximation for scalar square root.
14252 @item vec-sqrt
14253 Enable the approximation for vectorized square root.
14254 @end table
14256 So, for example, @option{-mrecip=all,!sqrt} enables
14257 all of the reciprocal approximations, except for square root.
14259 @item -mveclibabi=@var{type}
14260 @opindex mveclibabi
14261 Specifies the ABI type to use for vectorizing intrinsics using an
14262 external library.  Supported values for @var{type} are @samp{svml} 
14263 for the Intel short
14264 vector math library and @samp{acml} for the AMD math core library.
14265 To use this option, both @option{-ftree-vectorize} and
14266 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
14267 ABI-compatible library must be specified at link time.
14269 GCC currently emits calls to @code{vmldExp2},
14270 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
14271 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
14272 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
14273 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
14274 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
14275 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
14276 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
14277 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
14278 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
14279 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
14280 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
14281 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
14282 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
14283 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
14284 when @option{-mveclibabi=acml} is used.  
14286 @item -mabi=@var{name}
14287 @opindex mabi
14288 Generate code for the specified calling convention.  Permissible values
14289 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
14290 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
14291 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
14292 You can control this behavior for a specific function by
14293 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
14294 @xref{Function Attributes}.
14296 @item -mtls-dialect=@var{type}
14297 @opindex mtls-dialect
14298 Generate code to access thread-local storage using the @samp{gnu} or
14299 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
14300 @samp{gnu2} is more efficient, but it may add compile- and run-time
14301 requirements that cannot be satisfied on all systems.
14303 @item -mpush-args
14304 @itemx -mno-push-args
14305 @opindex mpush-args
14306 @opindex mno-push-args
14307 Use PUSH operations to store outgoing parameters.  This method is shorter
14308 and usually equally fast as method using SUB/MOV operations and is enabled
14309 by default.  In some cases disabling it may improve performance because of
14310 improved scheduling and reduced dependencies.
14312 @item -maccumulate-outgoing-args
14313 @opindex maccumulate-outgoing-args
14314 If enabled, the maximum amount of space required for outgoing arguments is
14315 computed in the function prologue.  This is faster on most modern CPUs
14316 because of reduced dependencies, improved scheduling and reduced stack usage
14317 when the preferred stack boundary is not equal to 2.  The drawback is a notable
14318 increase in code size.  This switch implies @option{-mno-push-args}.
14320 @item -mthreads
14321 @opindex mthreads
14322 Support thread-safe exception handling on MinGW.  Programs that rely
14323 on thread-safe exception handling must compile and link all code with the
14324 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
14325 @code{-D_MT}; when linking, it links in a special thread helper library
14326 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
14328 @item -mno-align-stringops
14329 @opindex mno-align-stringops
14330 Do not align the destination of inlined string operations.  This switch reduces
14331 code size and improves performance in case the destination is already aligned,
14332 but GCC doesn't know about it.
14334 @item -minline-all-stringops
14335 @opindex minline-all-stringops
14336 By default GCC inlines string operations only when the destination is 
14337 known to be aligned to least a 4-byte boundary.  
14338 This enables more inlining and increases code
14339 size, but may improve performance of code that depends on fast
14340 @code{memcpy}, @code{strlen},
14341 and @code{memset} for short lengths.
14343 @item -minline-stringops-dynamically
14344 @opindex minline-stringops-dynamically
14345 For string operations of unknown size, use run-time checks with
14346 inline code for small blocks and a library call for large blocks.
14348 @item -mstringop-strategy=@var{alg}
14349 @opindex mstringop-strategy=@var{alg}
14350 Override the internal decision heuristic for the particular algorithm to use
14351 for inlining string operations.  The allowed values for @var{alg} are:
14353 @table @samp
14354 @item rep_byte
14355 @itemx rep_4byte
14356 @itemx rep_8byte
14357 Expand using i386 @code{rep} prefix of the specified size.
14359 @item byte_loop
14360 @itemx loop
14361 @itemx unrolled_loop
14362 Expand into an inline loop.
14364 @item libcall
14365 Always use a library call.
14366 @end table
14368 @item -momit-leaf-frame-pointer
14369 @opindex momit-leaf-frame-pointer
14370 Don't keep the frame pointer in a register for leaf functions.  This
14371 avoids the instructions to save, set up, and restore frame pointers and
14372 makes an extra register available in leaf functions.  The option
14373 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14374 which might make debugging harder.
14376 @item -mtls-direct-seg-refs
14377 @itemx -mno-tls-direct-seg-refs
14378 @opindex mtls-direct-seg-refs
14379 Controls whether TLS variables may be accessed with offsets from the
14380 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14381 or whether the thread base pointer must be added.  Whether or not this
14382 is valid depends on the operating system, and whether it maps the
14383 segment to cover the entire TLS area.
14385 For systems that use the GNU C Library, the default is on.
14387 @item -msse2avx
14388 @itemx -mno-sse2avx
14389 @opindex msse2avx
14390 Specify that the assembler should encode SSE instructions with VEX
14391 prefix.  The option @option{-mavx} turns this on by default.
14393 @item -mfentry
14394 @itemx -mno-fentry
14395 @opindex mfentry
14396 If profiling is active (@option{-pg}), put the profiling
14397 counter call before the prologue.
14398 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14399 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14401 @item -m8bit-idiv
14402 @itemx -mno-8bit-idiv
14403 @opindex 8bit-idiv
14404 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14405 much faster than 32-bit/64-bit integer divide.  This option generates a
14406 run-time check.  If both dividend and divisor are within range of 0
14407 to 255, 8-bit unsigned integer divide is used instead of
14408 32-bit/64-bit integer divide.
14410 @item -mavx256-split-unaligned-load
14411 @itemx -mavx256-split-unaligned-store
14412 @opindex avx256-split-unaligned-load
14413 @opindex avx256-split-unaligned-store
14414 Split 32-byte AVX unaligned load and store.
14416 @end table
14418 These @samp{-m} switches are supported in addition to the above
14419 on x86-64 processors in 64-bit environments.
14421 @table @gcctabopt
14422 @item -m32
14423 @itemx -m64
14424 @itemx -mx32
14425 @opindex m32
14426 @opindex m64
14427 @opindex mx32
14428 Generate code for a 32-bit or 64-bit environment.
14429 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14430 to 32 bits, and
14431 generates code that runs on any i386 system.
14433 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14434 types to 64 bits, and generates code for the x86-64 architecture.
14435 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14436 and @option{-mdynamic-no-pic} options.
14438 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14439 to 32 bits, and
14440 generates code for the x86-64 architecture.
14442 @item -mno-red-zone
14443 @opindex mno-red-zone
14444 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14445 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14446 stack pointer that is not modified by signal or interrupt handlers
14447 and therefore can be used for temporary data without adjusting the stack
14448 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14450 @item -mcmodel=small
14451 @opindex mcmodel=small
14452 Generate code for the small code model: the program and its symbols must
14453 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14454 Programs can be statically or dynamically linked.  This is the default
14455 code model.
14457 @item -mcmodel=kernel
14458 @opindex mcmodel=kernel
14459 Generate code for the kernel code model.  The kernel runs in the
14460 negative 2 GB of the address space.
14461 This model has to be used for Linux kernel code.
14463 @item -mcmodel=medium
14464 @opindex mcmodel=medium
14465 Generate code for the medium model: the program is linked in the lower 2
14466 GB of the address space.  Small symbols are also placed there.  Symbols
14467 with sizes larger than @option{-mlarge-data-threshold} are put into
14468 large data or BSS sections and can be located above 2GB.  Programs can
14469 be statically or dynamically linked.
14471 @item -mcmodel=large
14472 @opindex mcmodel=large
14473 Generate code for the large model.  This model makes no assumptions
14474 about addresses and sizes of sections.
14476 @item -maddress-mode=long
14477 @opindex maddress-mode=long
14478 Generate code for long address mode.  This is only supported for 64-bit
14479 and x32 environments.  It is the default address mode for 64-bit
14480 environments.
14482 @item -maddress-mode=short
14483 @opindex maddress-mode=short
14484 Generate code for short address mode.  This is only supported for 32-bit
14485 and x32 environments.  It is the default address mode for 32-bit and
14486 x32 environments.
14487 @end table
14489 @node i386 and x86-64 Windows Options
14490 @subsection i386 and x86-64 Windows Options
14491 @cindex i386 and x86-64 Windows Options
14493 These additional options are available for Microsoft Windows targets:
14495 @table @gcctabopt
14496 @item -mconsole
14497 @opindex mconsole
14498 This option
14499 specifies that a console application is to be generated, by
14500 instructing the linker to set the PE header subsystem type
14501 required for console applications.
14502 This option is available for Cygwin and MinGW targets and is
14503 enabled by default on those targets.
14505 @item -mdll
14506 @opindex mdll
14507 This option is available for Cygwin and MinGW targets.  It
14508 specifies that a DLL---a dynamic link library---is to be
14509 generated, enabling the selection of the required runtime
14510 startup object and entry point.
14512 @item -mnop-fun-dllimport
14513 @opindex mnop-fun-dllimport
14514 This option is available for Cygwin and MinGW targets.  It
14515 specifies that the @code{dllimport} attribute should be ignored.
14517 @item -mthread
14518 @opindex mthread
14519 This option is available for MinGW targets. It specifies
14520 that MinGW-specific thread support is to be used.
14522 @item -municode
14523 @opindex municode
14524 This option is available for MinGW-w64 targets.  It causes
14525 the @code{UNICODE} preprocessor macro to be predefined, and
14526 chooses Unicode-capable runtime startup code.
14528 @item -mwin32
14529 @opindex mwin32
14530 This option is available for Cygwin and MinGW targets.  It
14531 specifies that the typical Microsoft Windows predefined macros are to
14532 be set in the pre-processor, but does not influence the choice
14533 of runtime library/startup code.
14535 @item -mwindows
14536 @opindex mwindows
14537 This option is available for Cygwin and MinGW targets.  It
14538 specifies that a GUI application is to be generated by
14539 instructing the linker to set the PE header subsystem type
14540 appropriately.
14542 @item -fno-set-stack-executable
14543 @opindex fno-set-stack-executable
14544 This option is available for MinGW targets. It specifies that
14545 the executable flag for the stack used by nested functions isn't
14546 set. This is necessary for binaries running in kernel mode of
14547 Microsoft Windows, as there the User32 API, which is used to set executable
14548 privileges, isn't available.
14550 @item -fwritable-relocated-rdata
14551 @opindex fno-writable-relocated-rdata
14552 This option is available for MinGW and Cygwin targets.  It specifies
14553 that relocated-data in read-only section is put into .data
14554 section.  This is a necessary for older runtimes not supporting
14555 modification of .rdata sections for pseudo-relocation.
14557 @item -mpe-aligned-commons
14558 @opindex mpe-aligned-commons
14559 This option is available for Cygwin and MinGW targets.  It
14560 specifies that the GNU extension to the PE file format that
14561 permits the correct alignment of COMMON variables should be
14562 used when generating code.  It is enabled by default if
14563 GCC detects that the target assembler found during configuration
14564 supports the feature.
14565 @end table
14567 See also under @ref{i386 and x86-64 Options} for standard options.
14569 @node IA-64 Options
14570 @subsection IA-64 Options
14571 @cindex IA-64 Options
14573 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14575 @table @gcctabopt
14576 @item -mbig-endian
14577 @opindex mbig-endian
14578 Generate code for a big-endian target.  This is the default for HP-UX@.
14580 @item -mlittle-endian
14581 @opindex mlittle-endian
14582 Generate code for a little-endian target.  This is the default for AIX5
14583 and GNU/Linux.
14585 @item -mgnu-as
14586 @itemx -mno-gnu-as
14587 @opindex mgnu-as
14588 @opindex mno-gnu-as
14589 Generate (or don't) code for the GNU assembler.  This is the default.
14590 @c Also, this is the default if the configure option @option{--with-gnu-as}
14591 @c is used.
14593 @item -mgnu-ld
14594 @itemx -mno-gnu-ld
14595 @opindex mgnu-ld
14596 @opindex mno-gnu-ld
14597 Generate (or don't) code for the GNU linker.  This is the default.
14598 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14599 @c is used.
14601 @item -mno-pic
14602 @opindex mno-pic
14603 Generate code that does not use a global pointer register.  The result
14604 is not position independent code, and violates the IA-64 ABI@.
14606 @item -mvolatile-asm-stop
14607 @itemx -mno-volatile-asm-stop
14608 @opindex mvolatile-asm-stop
14609 @opindex mno-volatile-asm-stop
14610 Generate (or don't) a stop bit immediately before and after volatile asm
14611 statements.
14613 @item -mregister-names
14614 @itemx -mno-register-names
14615 @opindex mregister-names
14616 @opindex mno-register-names
14617 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14618 the stacked registers.  This may make assembler output more readable.
14620 @item -mno-sdata
14621 @itemx -msdata
14622 @opindex mno-sdata
14623 @opindex msdata
14624 Disable (or enable) optimizations that use the small data section.  This may
14625 be useful for working around optimizer bugs.
14627 @item -mconstant-gp
14628 @opindex mconstant-gp
14629 Generate code that uses a single constant global pointer value.  This is
14630 useful when compiling kernel code.
14632 @item -mauto-pic
14633 @opindex mauto-pic
14634 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14635 This is useful when compiling firmware code.
14637 @item -minline-float-divide-min-latency
14638 @opindex minline-float-divide-min-latency
14639 Generate code for inline divides of floating-point values
14640 using the minimum latency algorithm.
14642 @item -minline-float-divide-max-throughput
14643 @opindex minline-float-divide-max-throughput
14644 Generate code for inline divides of floating-point values
14645 using the maximum throughput algorithm.
14647 @item -mno-inline-float-divide
14648 @opindex mno-inline-float-divide
14649 Do not generate inline code for divides of floating-point values.
14651 @item -minline-int-divide-min-latency
14652 @opindex minline-int-divide-min-latency
14653 Generate code for inline divides of integer values
14654 using the minimum latency algorithm.
14656 @item -minline-int-divide-max-throughput
14657 @opindex minline-int-divide-max-throughput
14658 Generate code for inline divides of integer values
14659 using the maximum throughput algorithm.
14661 @item -mno-inline-int-divide
14662 @opindex mno-inline-int-divide
14663 Do not generate inline code for divides of integer values.
14665 @item -minline-sqrt-min-latency
14666 @opindex minline-sqrt-min-latency
14667 Generate code for inline square roots
14668 using the minimum latency algorithm.
14670 @item -minline-sqrt-max-throughput
14671 @opindex minline-sqrt-max-throughput
14672 Generate code for inline square roots
14673 using the maximum throughput algorithm.
14675 @item -mno-inline-sqrt
14676 @opindex mno-inline-sqrt
14677 Do not generate inline code for @code{sqrt}.
14679 @item -mfused-madd
14680 @itemx -mno-fused-madd
14681 @opindex mfused-madd
14682 @opindex mno-fused-madd
14683 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14684 instructions.  The default is to use these instructions.
14686 @item -mno-dwarf2-asm
14687 @itemx -mdwarf2-asm
14688 @opindex mno-dwarf2-asm
14689 @opindex mdwarf2-asm
14690 Don't (or do) generate assembler code for the DWARF 2 line number debugging
14691 info.  This may be useful when not using the GNU assembler.
14693 @item -mearly-stop-bits
14694 @itemx -mno-early-stop-bits
14695 @opindex mearly-stop-bits
14696 @opindex mno-early-stop-bits
14697 Allow stop bits to be placed earlier than immediately preceding the
14698 instruction that triggered the stop bit.  This can improve instruction
14699 scheduling, but does not always do so.
14701 @item -mfixed-range=@var{register-range}
14702 @opindex mfixed-range
14703 Generate code treating the given register range as fixed registers.
14704 A fixed register is one that the register allocator cannot use.  This is
14705 useful when compiling kernel code.  A register range is specified as
14706 two registers separated by a dash.  Multiple register ranges can be
14707 specified separated by a comma.
14709 @item -mtls-size=@var{tls-size}
14710 @opindex mtls-size
14711 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
14714 @item -mtune=@var{cpu-type}
14715 @opindex mtune
14716 Tune the instruction scheduling for a particular CPU, Valid values are
14717 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
14718 and @samp{mckinley}.
14720 @item -milp32
14721 @itemx -mlp64
14722 @opindex milp32
14723 @opindex mlp64
14724 Generate code for a 32-bit or 64-bit environment.
14725 The 32-bit environment sets int, long and pointer to 32 bits.
14726 The 64-bit environment sets int to 32 bits and long and pointer
14727 to 64 bits.  These are HP-UX specific flags.
14729 @item -mno-sched-br-data-spec
14730 @itemx -msched-br-data-spec
14731 @opindex mno-sched-br-data-spec
14732 @opindex msched-br-data-spec
14733 (Dis/En)able data speculative scheduling before reload.
14734 This results in generation of @code{ld.a} instructions and
14735 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14736 The default is 'disable'.
14738 @item -msched-ar-data-spec
14739 @itemx -mno-sched-ar-data-spec
14740 @opindex msched-ar-data-spec
14741 @opindex mno-sched-ar-data-spec
14742 (En/Dis)able data speculative scheduling after reload.
14743 This results in generation of @code{ld.a} instructions and
14744 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14745 The default is 'enable'.
14747 @item -mno-sched-control-spec
14748 @itemx -msched-control-spec
14749 @opindex mno-sched-control-spec
14750 @opindex msched-control-spec
14751 (Dis/En)able control speculative scheduling.  This feature is
14752 available only during region scheduling (i.e.@: before reload).
14753 This results in generation of the @code{ld.s} instructions and
14754 the corresponding check instructions @code{chk.s}.
14755 The default is 'disable'.
14757 @item -msched-br-in-data-spec
14758 @itemx -mno-sched-br-in-data-spec
14759 @opindex msched-br-in-data-spec
14760 @opindex mno-sched-br-in-data-spec
14761 (En/Dis)able speculative scheduling of the instructions that
14762 are dependent on the data speculative loads before reload.
14763 This is effective only with @option{-msched-br-data-spec} enabled.
14764 The default is 'enable'.
14766 @item -msched-ar-in-data-spec
14767 @itemx -mno-sched-ar-in-data-spec
14768 @opindex msched-ar-in-data-spec
14769 @opindex mno-sched-ar-in-data-spec
14770 (En/Dis)able speculative scheduling of the instructions that
14771 are dependent on the data speculative loads after reload.
14772 This is effective only with @option{-msched-ar-data-spec} enabled.
14773 The default is 'enable'.
14775 @item -msched-in-control-spec
14776 @itemx -mno-sched-in-control-spec
14777 @opindex msched-in-control-spec
14778 @opindex mno-sched-in-control-spec
14779 (En/Dis)able speculative scheduling of the instructions that
14780 are dependent on the control speculative loads.
14781 This is effective only with @option{-msched-control-spec} enabled.
14782 The default is 'enable'.
14784 @item -mno-sched-prefer-non-data-spec-insns
14785 @itemx -msched-prefer-non-data-spec-insns
14786 @opindex mno-sched-prefer-non-data-spec-insns
14787 @opindex msched-prefer-non-data-spec-insns
14788 If enabled, data-speculative instructions are chosen for schedule
14789 only if there are no other choices at the moment.  This makes
14790 the use of the data speculation much more conservative.
14791 The default is 'disable'.
14793 @item -mno-sched-prefer-non-control-spec-insns
14794 @itemx -msched-prefer-non-control-spec-insns
14795 @opindex mno-sched-prefer-non-control-spec-insns
14796 @opindex msched-prefer-non-control-spec-insns
14797 If enabled, control-speculative instructions are chosen for schedule
14798 only if there are no other choices at the moment.  This makes
14799 the use of the control speculation much more conservative.
14800 The default is 'disable'.
14802 @item -mno-sched-count-spec-in-critical-path
14803 @itemx -msched-count-spec-in-critical-path
14804 @opindex mno-sched-count-spec-in-critical-path
14805 @opindex msched-count-spec-in-critical-path
14806 If enabled, speculative dependencies are considered during
14807 computation of the instructions priorities.  This makes the use of the
14808 speculation a bit more conservative.
14809 The default is 'disable'.
14811 @item -msched-spec-ldc
14812 @opindex msched-spec-ldc
14813 Use a simple data speculation check.  This option is on by default.
14815 @item -msched-control-spec-ldc
14816 @opindex msched-spec-ldc
14817 Use a simple check for control speculation.  This option is on by default.
14819 @item -msched-stop-bits-after-every-cycle
14820 @opindex msched-stop-bits-after-every-cycle
14821 Place a stop bit after every cycle when scheduling.  This option is on
14822 by default.
14824 @item -msched-fp-mem-deps-zero-cost
14825 @opindex msched-fp-mem-deps-zero-cost
14826 Assume that floating-point stores and loads are not likely to cause a conflict
14827 when placed into the same instruction group.  This option is disabled by
14828 default.
14830 @item -msel-sched-dont-check-control-spec
14831 @opindex msel-sched-dont-check-control-spec
14832 Generate checks for control speculation in selective scheduling.
14833 This flag is disabled by default.
14835 @item -msched-max-memory-insns=@var{max-insns}
14836 @opindex msched-max-memory-insns
14837 Limit on the number of memory insns per instruction group, giving lower
14838 priority to subsequent memory insns attempting to schedule in the same
14839 instruction group. Frequently useful to prevent cache bank conflicts.
14840 The default value is 1.
14842 @item -msched-max-memory-insns-hard-limit
14843 @opindex msched-max-memory-insns-hard-limit
14844 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
14845 disallowing more than that number in an instruction group.
14846 Otherwise, the limit is ``soft'', meaning that non-memory operations
14847 are preferred when the limit is reached, but memory operations may still
14848 be scheduled.
14850 @end table
14852 @node LM32 Options
14853 @subsection LM32 Options
14854 @cindex LM32 options
14856 These @option{-m} options are defined for the LatticeMico32 architecture:
14858 @table @gcctabopt
14859 @item -mbarrel-shift-enabled
14860 @opindex mbarrel-shift-enabled
14861 Enable barrel-shift instructions.
14863 @item -mdivide-enabled
14864 @opindex mdivide-enabled
14865 Enable divide and modulus instructions.
14867 @item -mmultiply-enabled
14868 @opindex multiply-enabled
14869 Enable multiply instructions.
14871 @item -msign-extend-enabled
14872 @opindex msign-extend-enabled
14873 Enable sign extend instructions.
14875 @item -muser-enabled
14876 @opindex muser-enabled
14877 Enable user-defined instructions.
14879 @end table
14881 @node M32C Options
14882 @subsection M32C Options
14883 @cindex M32C options
14885 @table @gcctabopt
14886 @item -mcpu=@var{name}
14887 @opindex mcpu=
14888 Select the CPU for which code is generated.  @var{name} may be one of
14889 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
14890 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
14891 the M32C/80 series.
14893 @item -msim
14894 @opindex msim
14895 Specifies that the program will be run on the simulator.  This causes
14896 an alternate runtime library to be linked in which supports, for
14897 example, file I/O@.  You must not use this option when generating
14898 programs that will run on real hardware; you must provide your own
14899 runtime library for whatever I/O functions are needed.
14901 @item -memregs=@var{number}
14902 @opindex memregs=
14903 Specifies the number of memory-based pseudo-registers GCC uses
14904 during code generation.  These pseudo-registers are used like real
14905 registers, so there is a tradeoff between GCC's ability to fit the
14906 code into available registers, and the performance penalty of using
14907 memory instead of registers.  Note that all modules in a program must
14908 be compiled with the same value for this option.  Because of that, you
14909 must not use this option with GCC's default runtime libraries.
14911 @end table
14913 @node M32R/D Options
14914 @subsection M32R/D Options
14915 @cindex M32R/D options
14917 These @option{-m} options are defined for Renesas M32R/D architectures:
14919 @table @gcctabopt
14920 @item -m32r2
14921 @opindex m32r2
14922 Generate code for the M32R/2@.
14924 @item -m32rx
14925 @opindex m32rx
14926 Generate code for the M32R/X@.
14928 @item -m32r
14929 @opindex m32r
14930 Generate code for the M32R@.  This is the default.
14932 @item -mmodel=small
14933 @opindex mmodel=small
14934 Assume all objects live in the lower 16MB of memory (so that their addresses
14935 can be loaded with the @code{ld24} instruction), and assume all subroutines
14936 are reachable with the @code{bl} instruction.
14937 This is the default.
14939 The addressability of a particular object can be set with the
14940 @code{model} attribute.
14942 @item -mmodel=medium
14943 @opindex mmodel=medium
14944 Assume objects may be anywhere in the 32-bit address space (the compiler
14945 generates @code{seth/add3} instructions to load their addresses), and
14946 assume all subroutines are reachable with the @code{bl} instruction.
14948 @item -mmodel=large
14949 @opindex mmodel=large
14950 Assume objects may be anywhere in the 32-bit address space (the compiler
14951 generates @code{seth/add3} instructions to load their addresses), and
14952 assume subroutines may not be reachable with the @code{bl} instruction
14953 (the compiler generates the much slower @code{seth/add3/jl}
14954 instruction sequence).
14956 @item -msdata=none
14957 @opindex msdata=none
14958 Disable use of the small data area.  Variables are put into
14959 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
14960 @code{section} attribute has been specified).
14961 This is the default.
14963 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
14964 Objects may be explicitly put in the small data area with the
14965 @code{section} attribute using one of these sections.
14967 @item -msdata=sdata
14968 @opindex msdata=sdata
14969 Put small global and static data in the small data area, but do not
14970 generate special code to reference them.
14972 @item -msdata=use
14973 @opindex msdata=use
14974 Put small global and static data in the small data area, and generate
14975 special instructions to reference them.
14977 @item -G @var{num}
14978 @opindex G
14979 @cindex smaller data references
14980 Put global and static objects less than or equal to @var{num} bytes
14981 into the small data or BSS sections instead of the normal data or BSS
14982 sections.  The default value of @var{num} is 8.
14983 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
14984 for this option to have any effect.
14986 All modules should be compiled with the same @option{-G @var{num}} value.
14987 Compiling with different values of @var{num} may or may not work; if it
14988 doesn't the linker gives an error message---incorrect code is not
14989 generated.
14991 @item -mdebug
14992 @opindex mdebug
14993 Makes the M32R-specific code in the compiler display some statistics
14994 that might help in debugging programs.
14996 @item -malign-loops
14997 @opindex malign-loops
14998 Align all loops to a 32-byte boundary.
15000 @item -mno-align-loops
15001 @opindex mno-align-loops
15002 Do not enforce a 32-byte alignment for loops.  This is the default.
15004 @item -missue-rate=@var{number}
15005 @opindex missue-rate=@var{number}
15006 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15007 or 2.
15009 @item -mbranch-cost=@var{number}
15010 @opindex mbranch-cost=@var{number}
15011 @var{number} can only be 1 or 2.  If it is 1 then branches are
15012 preferred over conditional code, if it is 2, then the opposite applies.
15014 @item -mflush-trap=@var{number}
15015 @opindex mflush-trap=@var{number}
15016 Specifies the trap number to use to flush the cache.  The default is
15017 12.  Valid numbers are between 0 and 15 inclusive.
15019 @item -mno-flush-trap
15020 @opindex mno-flush-trap
15021 Specifies that the cache cannot be flushed by using a trap.
15023 @item -mflush-func=@var{name}
15024 @opindex mflush-func=@var{name}
15025 Specifies the name of the operating system function to call to flush
15026 the cache.  The default is @emph{_flush_cache}, but a function call
15027 is only used if a trap is not available.
15029 @item -mno-flush-func
15030 @opindex mno-flush-func
15031 Indicates that there is no OS function for flushing the cache.
15033 @end table
15035 @node M680x0 Options
15036 @subsection M680x0 Options
15037 @cindex M680x0 options
15039 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15040 The default settings depend on which architecture was selected when
15041 the compiler was configured; the defaults for the most common choices
15042 are given below.
15044 @table @gcctabopt
15045 @item -march=@var{arch}
15046 @opindex march
15047 Generate code for a specific M680x0 or ColdFire instruction set
15048 architecture.  Permissible values of @var{arch} for M680x0
15049 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15050 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15051 architectures are selected according to Freescale's ISA classification
15052 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15053 @samp{isab} and @samp{isac}.
15055 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15056 code for a ColdFire target.  The @var{arch} in this macro is one of the
15057 @option{-march} arguments given above.
15059 When used together, @option{-march} and @option{-mtune} select code
15060 that runs on a family of similar processors but that is optimized
15061 for a particular microarchitecture.
15063 @item -mcpu=@var{cpu}
15064 @opindex mcpu
15065 Generate code for a specific M680x0 or ColdFire processor.
15066 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15067 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15068 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15069 below, which also classifies the CPUs into families:
15071 @multitable @columnfractions 0.20 0.80
15072 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15073 @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}
15074 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
15075 @item @samp{5206e} @tab @samp{5206e}
15076 @item @samp{5208} @tab @samp{5207} @samp{5208}
15077 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
15078 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
15079 @item @samp{5216} @tab @samp{5214} @samp{5216}
15080 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
15081 @item @samp{5225} @tab @samp{5224} @samp{5225}
15082 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
15083 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
15084 @item @samp{5249} @tab @samp{5249}
15085 @item @samp{5250} @tab @samp{5250}
15086 @item @samp{5271} @tab @samp{5270} @samp{5271}
15087 @item @samp{5272} @tab @samp{5272}
15088 @item @samp{5275} @tab @samp{5274} @samp{5275}
15089 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
15090 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
15091 @item @samp{5307} @tab @samp{5307}
15092 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
15093 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
15094 @item @samp{5407} @tab @samp{5407}
15095 @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}
15096 @end multitable
15098 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
15099 @var{arch} is compatible with @var{cpu}.  Other combinations of
15100 @option{-mcpu} and @option{-march} are rejected.
15102 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
15103 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
15104 where the value of @var{family} is given by the table above.
15106 @item -mtune=@var{tune}
15107 @opindex mtune
15108 Tune the code for a particular microarchitecture within the
15109 constraints set by @option{-march} and @option{-mcpu}.
15110 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
15111 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
15112 and @samp{cpu32}.  The ColdFire microarchitectures
15113 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
15115 You can also use @option{-mtune=68020-40} for code that needs
15116 to run relatively well on 68020, 68030 and 68040 targets.
15117 @option{-mtune=68020-60} is similar but includes 68060 targets
15118 as well.  These two options select the same tuning decisions as
15119 @option{-m68020-40} and @option{-m68020-60} respectively.
15121 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
15122 when tuning for 680x0 architecture @var{arch}.  It also defines
15123 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
15124 option is used.  If GCC is tuning for a range of architectures,
15125 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
15126 it defines the macros for every architecture in the range.
15128 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
15129 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
15130 of the arguments given above.
15132 @item -m68000
15133 @itemx -mc68000
15134 @opindex m68000
15135 @opindex mc68000
15136 Generate output for a 68000.  This is the default
15137 when the compiler is configured for 68000-based systems.
15138 It is equivalent to @option{-march=68000}.
15140 Use this option for microcontrollers with a 68000 or EC000 core,
15141 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15143 @item -m68010
15144 @opindex m68010
15145 Generate output for a 68010.  This is the default
15146 when the compiler is configured for 68010-based systems.
15147 It is equivalent to @option{-march=68010}.
15149 @item -m68020
15150 @itemx -mc68020
15151 @opindex m68020
15152 @opindex mc68020
15153 Generate output for a 68020.  This is the default
15154 when the compiler is configured for 68020-based systems.
15155 It is equivalent to @option{-march=68020}.
15157 @item -m68030
15158 @opindex m68030
15159 Generate output for a 68030.  This is the default when the compiler is
15160 configured for 68030-based systems.  It is equivalent to
15161 @option{-march=68030}.
15163 @item -m68040
15164 @opindex m68040
15165 Generate output for a 68040.  This is the default when the compiler is
15166 configured for 68040-based systems.  It is equivalent to
15167 @option{-march=68040}.
15169 This option inhibits the use of 68881/68882 instructions that have to be
15170 emulated by software on the 68040.  Use this option if your 68040 does not
15171 have code to emulate those instructions.
15173 @item -m68060
15174 @opindex m68060
15175 Generate output for a 68060.  This is the default when the compiler is
15176 configured for 68060-based systems.  It is equivalent to
15177 @option{-march=68060}.
15179 This option inhibits the use of 68020 and 68881/68882 instructions that
15180 have to be emulated by software on the 68060.  Use this option if your 68060
15181 does not have code to emulate those instructions.
15183 @item -mcpu32
15184 @opindex mcpu32
15185 Generate output for a CPU32.  This is the default
15186 when the compiler is configured for CPU32-based systems.
15187 It is equivalent to @option{-march=cpu32}.
15189 Use this option for microcontrollers with a
15190 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
15191 68336, 68340, 68341, 68349 and 68360.
15193 @item -m5200
15194 @opindex m5200
15195 Generate output for a 520X ColdFire CPU@.  This is the default
15196 when the compiler is configured for 520X-based systems.
15197 It is equivalent to @option{-mcpu=5206}, and is now deprecated
15198 in favor of that option.
15200 Use this option for microcontroller with a 5200 core, including
15201 the MCF5202, MCF5203, MCF5204 and MCF5206.
15203 @item -m5206e
15204 @opindex m5206e
15205 Generate output for a 5206e ColdFire CPU@.  The option is now
15206 deprecated in favor of the equivalent @option{-mcpu=5206e}.
15208 @item -m528x
15209 @opindex m528x
15210 Generate output for a member of the ColdFire 528X family.
15211 The option is now deprecated in favor of the equivalent
15212 @option{-mcpu=528x}.
15214 @item -m5307
15215 @opindex m5307
15216 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
15217 in favor of the equivalent @option{-mcpu=5307}.
15219 @item -m5407
15220 @opindex m5407
15221 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
15222 in favor of the equivalent @option{-mcpu=5407}.
15224 @item -mcfv4e
15225 @opindex mcfv4e
15226 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
15227 This includes use of hardware floating-point instructions.
15228 The option is equivalent to @option{-mcpu=547x}, and is now
15229 deprecated in favor of that option.
15231 @item -m68020-40
15232 @opindex m68020-40
15233 Generate output for a 68040, without using any of the new instructions.
15234 This results in code that can run relatively efficiently on either a
15235 68020/68881 or a 68030 or a 68040.  The generated code does use the
15236 68881 instructions that are emulated on the 68040.
15238 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
15240 @item -m68020-60
15241 @opindex m68020-60
15242 Generate output for a 68060, without using any of the new instructions.
15243 This results in code that can run relatively efficiently on either a
15244 68020/68881 or a 68030 or a 68040.  The generated code does use the
15245 68881 instructions that are emulated on the 68060.
15247 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
15249 @item -mhard-float
15250 @itemx -m68881
15251 @opindex mhard-float
15252 @opindex m68881
15253 Generate floating-point instructions.  This is the default for 68020
15254 and above, and for ColdFire devices that have an FPU@.  It defines the
15255 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
15256 on ColdFire targets.
15258 @item -msoft-float
15259 @opindex msoft-float
15260 Do not generate floating-point instructions; use library calls instead.
15261 This is the default for 68000, 68010, and 68832 targets.  It is also
15262 the default for ColdFire devices that have no FPU.
15264 @item -mdiv
15265 @itemx -mno-div
15266 @opindex mdiv
15267 @opindex mno-div
15268 Generate (do not generate) ColdFire hardware divide and remainder
15269 instructions.  If @option{-march} is used without @option{-mcpu},
15270 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
15271 architectures.  Otherwise, the default is taken from the target CPU
15272 (either the default CPU, or the one specified by @option{-mcpu}).  For
15273 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
15274 @option{-mcpu=5206e}.
15276 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
15278 @item -mshort
15279 @opindex mshort
15280 Consider type @code{int} to be 16 bits wide, like @code{short int}.
15281 Additionally, parameters passed on the stack are also aligned to a
15282 16-bit boundary even on targets whose API mandates promotion to 32-bit.
15284 @item -mno-short
15285 @opindex mno-short
15286 Do not consider type @code{int} to be 16 bits wide.  This is the default.
15288 @item -mnobitfield
15289 @itemx -mno-bitfield
15290 @opindex mnobitfield
15291 @opindex mno-bitfield
15292 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
15293 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
15295 @item -mbitfield
15296 @opindex mbitfield
15297 Do use the bit-field instructions.  The @option{-m68020} option implies
15298 @option{-mbitfield}.  This is the default if you use a configuration
15299 designed for a 68020.
15301 @item -mrtd
15302 @opindex mrtd
15303 Use a different function-calling convention, in which functions
15304 that take a fixed number of arguments return with the @code{rtd}
15305 instruction, which pops their arguments while returning.  This
15306 saves one instruction in the caller since there is no need to pop
15307 the arguments there.
15309 This calling convention is incompatible with the one normally
15310 used on Unix, so you cannot use it if you need to call libraries
15311 compiled with the Unix compiler.
15313 Also, you must provide function prototypes for all functions that
15314 take variable numbers of arguments (including @code{printf});
15315 otherwise incorrect code is generated for calls to those
15316 functions.
15318 In addition, seriously incorrect code results if you call a
15319 function with too many arguments.  (Normally, extra arguments are
15320 harmlessly ignored.)
15322 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
15323 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15325 @item -mno-rtd
15326 @opindex mno-rtd
15327 Do not use the calling conventions selected by @option{-mrtd}.
15328 This is the default.
15330 @item -malign-int
15331 @itemx -mno-align-int
15332 @opindex malign-int
15333 @opindex mno-align-int
15334 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
15335 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
15336 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
15337 Aligning variables on 32-bit boundaries produces code that runs somewhat
15338 faster on processors with 32-bit busses at the expense of more memory.
15340 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
15341 aligns structures containing the above types differently than
15342 most published application binary interface specifications for the m68k.
15344 @item -mpcrel
15345 @opindex mpcrel
15346 Use the pc-relative addressing mode of the 68000 directly, instead of
15347 using a global offset table.  At present, this option implies @option{-fpic},
15348 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
15349 not presently supported with @option{-mpcrel}, though this could be supported for
15350 68020 and higher processors.
15352 @item -mno-strict-align
15353 @itemx -mstrict-align
15354 @opindex mno-strict-align
15355 @opindex mstrict-align
15356 Do not (do) assume that unaligned memory references are handled by
15357 the system.
15359 @item -msep-data
15360 Generate code that allows the data segment to be located in a different
15361 area of memory from the text segment.  This allows for execute-in-place in
15362 an environment without virtual memory management.  This option implies
15363 @option{-fPIC}.
15365 @item -mno-sep-data
15366 Generate code that assumes that the data segment follows the text segment.
15367 This is the default.
15369 @item -mid-shared-library
15370 Generate code that supports shared libraries via the library ID method.
15371 This allows for execute-in-place and shared libraries in an environment
15372 without virtual memory management.  This option implies @option{-fPIC}.
15374 @item -mno-id-shared-library
15375 Generate code that doesn't assume ID-based shared libraries are being used.
15376 This is the default.
15378 @item -mshared-library-id=n
15379 Specifies the identification number of the ID-based shared library being
15380 compiled.  Specifying a value of 0 generates more compact code; specifying
15381 other values forces the allocation of that number to the current
15382 library, but is no more space- or time-efficient than omitting this option.
15384 @item -mxgot
15385 @itemx -mno-xgot
15386 @opindex mxgot
15387 @opindex mno-xgot
15388 When generating position-independent code for ColdFire, generate code
15389 that works if the GOT has more than 8192 entries.  This code is
15390 larger and slower than code generated without this option.  On M680x0
15391 processors, this option is not needed; @option{-fPIC} suffices.
15393 GCC normally uses a single instruction to load values from the GOT@.
15394 While this is relatively efficient, it only works if the GOT
15395 is smaller than about 64k.  Anything larger causes the linker
15396 to report an error such as:
15398 @cindex relocation truncated to fit (ColdFire)
15399 @smallexample
15400 relocation truncated to fit: R_68K_GOT16O foobar
15401 @end smallexample
15403 If this happens, you should recompile your code with @option{-mxgot}.
15404 It should then work with very large GOTs.  However, code generated with
15405 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15406 the value of a global symbol.
15408 Note that some linkers, including newer versions of the GNU linker,
15409 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15410 you should only need to use @option{-mxgot} when compiling a single
15411 object file that accesses more than 8192 GOT entries.  Very few do.
15413 These options have no effect unless GCC is generating
15414 position-independent code.
15416 @end table
15418 @node MCore Options
15419 @subsection MCore Options
15420 @cindex MCore options
15422 These are the @samp{-m} options defined for the Motorola M*Core
15423 processors.
15425 @table @gcctabopt
15427 @item -mhardlit
15428 @itemx -mno-hardlit
15429 @opindex mhardlit
15430 @opindex mno-hardlit
15431 Inline constants into the code stream if it can be done in two
15432 instructions or less.
15434 @item -mdiv
15435 @itemx -mno-div
15436 @opindex mdiv
15437 @opindex mno-div
15438 Use the divide instruction.  (Enabled by default).
15440 @item -mrelax-immediate
15441 @itemx -mno-relax-immediate
15442 @opindex mrelax-immediate
15443 @opindex mno-relax-immediate
15444 Allow arbitrary-sized immediates in bit operations.
15446 @item -mwide-bitfields
15447 @itemx -mno-wide-bitfields
15448 @opindex mwide-bitfields
15449 @opindex mno-wide-bitfields
15450 Always treat bit-fields as @code{int}-sized.
15452 @item -m4byte-functions
15453 @itemx -mno-4byte-functions
15454 @opindex m4byte-functions
15455 @opindex mno-4byte-functions
15456 Force all functions to be aligned to a 4-byte boundary.
15458 @item -mcallgraph-data
15459 @itemx -mno-callgraph-data
15460 @opindex mcallgraph-data
15461 @opindex mno-callgraph-data
15462 Emit callgraph information.
15464 @item -mslow-bytes
15465 @itemx -mno-slow-bytes
15466 @opindex mslow-bytes
15467 @opindex mno-slow-bytes
15468 Prefer word access when reading byte quantities.
15470 @item -mlittle-endian
15471 @itemx -mbig-endian
15472 @opindex mlittle-endian
15473 @opindex mbig-endian
15474 Generate code for a little-endian target.
15476 @item -m210
15477 @itemx -m340
15478 @opindex m210
15479 @opindex m340
15480 Generate code for the 210 processor.
15482 @item -mno-lsim
15483 @opindex mno-lsim
15484 Assume that runtime support has been provided and so omit the
15485 simulator library (@file{libsim.a)} from the linker command line.
15487 @item -mstack-increment=@var{size}
15488 @opindex mstack-increment
15489 Set the maximum amount for a single stack increment operation.  Large
15490 values can increase the speed of programs that contain functions
15491 that need a large amount of stack space, but they can also trigger a
15492 segmentation fault if the stack is extended too much.  The default
15493 value is 0x1000.
15495 @end table
15497 @node MeP Options
15498 @subsection MeP Options
15499 @cindex MeP options
15501 @table @gcctabopt
15503 @item -mabsdiff
15504 @opindex mabsdiff
15505 Enables the @code{abs} instruction, which is the absolute difference
15506 between two registers.
15508 @item -mall-opts
15509 @opindex mall-opts
15510 Enables all the optional instructions---average, multiply, divide, bit
15511 operations, leading zero, absolute difference, min/max, clip, and
15512 saturation.
15515 @item -maverage
15516 @opindex maverage
15517 Enables the @code{ave} instruction, which computes the average of two
15518 registers.
15520 @item -mbased=@var{n}
15521 @opindex mbased=
15522 Variables of size @var{n} bytes or smaller are placed in the
15523 @code{.based} section by default.  Based variables use the @code{$tp}
15524 register as a base register, and there is a 128-byte limit to the
15525 @code{.based} section.
15527 @item -mbitops
15528 @opindex mbitops
15529 Enables the bit operation instructions---bit test (@code{btstm}), set
15530 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15531 test-and-set (@code{tas}).
15533 @item -mc=@var{name}
15534 @opindex mc=
15535 Selects which section constant data is placed in.  @var{name} may
15536 be @code{tiny}, @code{near}, or @code{far}.
15538 @item -mclip
15539 @opindex mclip
15540 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15541 useful unless you also provide @code{-mminmax}.
15543 @item -mconfig=@var{name}
15544 @opindex mconfig=
15545 Selects one of the built-in core configurations.  Each MeP chip has
15546 one or more modules in it; each module has a core CPU and a variety of
15547 coprocessors, optional instructions, and peripherals.  The
15548 @code{MeP-Integrator} tool, not part of GCC, provides these
15549 configurations through this option; using this option is the same as
15550 using all the corresponding command-line options.  The default
15551 configuration is @code{default}.
15553 @item -mcop
15554 @opindex mcop
15555 Enables the coprocessor instructions.  By default, this is a 32-bit
15556 coprocessor.  Note that the coprocessor is normally enabled via the
15557 @code{-mconfig=} option.
15559 @item -mcop32
15560 @opindex mcop32
15561 Enables the 32-bit coprocessor's instructions.
15563 @item -mcop64
15564 @opindex mcop64
15565 Enables the 64-bit coprocessor's instructions.
15567 @item -mivc2
15568 @opindex mivc2
15569 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15571 @item -mdc
15572 @opindex mdc
15573 Causes constant variables to be placed in the @code{.near} section.
15575 @item -mdiv
15576 @opindex mdiv
15577 Enables the @code{div} and @code{divu} instructions.
15579 @item -meb
15580 @opindex meb
15581 Generate big-endian code.
15583 @item -mel
15584 @opindex mel
15585 Generate little-endian code.
15587 @item -mio-volatile
15588 @opindex mio-volatile
15589 Tells the compiler that any variable marked with the @code{io}
15590 attribute is to be considered volatile.
15592 @item -ml
15593 @opindex ml
15594 Causes variables to be assigned to the @code{.far} section by default.
15596 @item -mleadz
15597 @opindex mleadz
15598 Enables the @code{leadz} (leading zero) instruction.
15600 @item -mm
15601 @opindex mm
15602 Causes variables to be assigned to the @code{.near} section by default.
15604 @item -mminmax
15605 @opindex mminmax
15606 Enables the @code{min} and @code{max} instructions.
15608 @item -mmult
15609 @opindex mmult
15610 Enables the multiplication and multiply-accumulate instructions.
15612 @item -mno-opts
15613 @opindex mno-opts
15614 Disables all the optional instructions enabled by @code{-mall-opts}.
15616 @item -mrepeat
15617 @opindex mrepeat
15618 Enables the @code{repeat} and @code{erepeat} instructions, used for
15619 low-overhead looping.
15621 @item -ms
15622 @opindex ms
15623 Causes all variables to default to the @code{.tiny} section.  Note
15624 that there is a 65536-byte limit to this section.  Accesses to these
15625 variables use the @code{%gp} base register.
15627 @item -msatur
15628 @opindex msatur
15629 Enables the saturation instructions.  Note that the compiler does not
15630 currently generate these itself, but this option is included for
15631 compatibility with other tools, like @code{as}.
15633 @item -msdram
15634 @opindex msdram
15635 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15637 @item -msim
15638 @opindex msim
15639 Link the simulator runtime libraries.
15641 @item -msimnovec
15642 @opindex msimnovec
15643 Link the simulator runtime libraries, excluding built-in support
15644 for reset and exception vectors and tables.
15646 @item -mtf
15647 @opindex mtf
15648 Causes all functions to default to the @code{.far} section.  Without
15649 this option, functions default to the @code{.near} section.
15651 @item -mtiny=@var{n}
15652 @opindex mtiny=
15653 Variables that are @var{n} bytes or smaller are allocated to the
15654 @code{.tiny} section.  These variables use the @code{$gp} base
15655 register.  The default for this option is 4, but note that there's a
15656 65536-byte limit to the @code{.tiny} section.
15658 @end table
15660 @node MicroBlaze Options
15661 @subsection MicroBlaze Options
15662 @cindex MicroBlaze Options
15664 @table @gcctabopt
15666 @item -msoft-float
15667 @opindex msoft-float
15668 Use software emulation for floating point (default).
15670 @item -mhard-float
15671 @opindex mhard-float
15672 Use hardware floating-point instructions.
15674 @item -mmemcpy
15675 @opindex mmemcpy
15676 Do not optimize block moves, use @code{memcpy}.
15678 @item -mno-clearbss
15679 @opindex mno-clearbss
15680 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15682 @item -mcpu=@var{cpu-type}
15683 @opindex mcpu=
15684 Use features of, and schedule code for, the given CPU.
15685 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15686 where @var{X} is a major version, @var{YY} is the minor version, and
15687 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
15688 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
15690 @item -mxl-soft-mul
15691 @opindex mxl-soft-mul
15692 Use software multiply emulation (default).
15694 @item -mxl-soft-div
15695 @opindex mxl-soft-div
15696 Use software emulation for divides (default).
15698 @item -mxl-barrel-shift
15699 @opindex mxl-barrel-shift
15700 Use the hardware barrel shifter.
15702 @item -mxl-pattern-compare
15703 @opindex mxl-pattern-compare
15704 Use pattern compare instructions.
15706 @item -msmall-divides
15707 @opindex msmall-divides
15708 Use table lookup optimization for small signed integer divisions.
15710 @item -mxl-stack-check
15711 @opindex mxl-stack-check
15712 This option is deprecated.  Use @option{-fstack-check} instead.
15714 @item -mxl-gp-opt
15715 @opindex mxl-gp-opt
15716 Use GP-relative @code{.sdata}/@code{.sbss} sections.
15718 @item -mxl-multiply-high
15719 @opindex mxl-multiply-high
15720 Use multiply high instructions for high part of 32x32 multiply.
15722 @item -mxl-float-convert
15723 @opindex mxl-float-convert
15724 Use hardware floating-point conversion instructions.
15726 @item -mxl-float-sqrt
15727 @opindex mxl-float-sqrt
15728 Use hardware floating-point square root instruction.
15730 @item -mxl-mode-@var{app-model}
15731 Select application model @var{app-model}.  Valid models are
15732 @table @samp
15733 @item executable
15734 normal executable (default), uses startup code @file{crt0.o}.
15736 @item xmdstub
15737 for use with Xilinx Microprocessor Debugger (XMD) based
15738 software intrusive debug agent called xmdstub. This uses startup file
15739 @file{crt1.o} and sets the start address of the program to 0x800.
15741 @item bootstrap
15742 for applications that are loaded using a bootloader.
15743 This model uses startup file @file{crt2.o} which does not contain a processor
15744 reset vector handler. This is suitable for transferring control on a
15745 processor reset to the bootloader rather than the application.
15747 @item novectors
15748 for applications that do not require any of the
15749 MicroBlaze vectors. This option may be useful for applications running
15750 within a monitoring application. This model uses @file{crt3.o} as a startup file.
15751 @end table
15753 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
15754 @option{-mxl-mode-@var{app-model}}.
15756 @end table
15758 @node MIPS Options
15759 @subsection MIPS Options
15760 @cindex MIPS options
15762 @table @gcctabopt
15764 @item -EB
15765 @opindex EB
15766 Generate big-endian code.
15768 @item -EL
15769 @opindex EL
15770 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
15771 configurations.
15773 @item -march=@var{arch}
15774 @opindex march
15775 Generate code that runs on @var{arch}, which can be the name of a
15776 generic MIPS ISA, or the name of a particular processor.
15777 The ISA names are:
15778 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
15779 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
15780 The processor names are:
15781 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
15782 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
15783 @samp{5kc}, @samp{5kf},
15784 @samp{20kc},
15785 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
15786 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
15787 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
15788 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
15789 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
15790 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
15791 @samp{m4k},
15792 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
15793 @samp{orion},
15794 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
15795 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
15796 @samp{rm7000}, @samp{rm9000},
15797 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
15798 @samp{sb1},
15799 @samp{sr71000},
15800 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
15801 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
15802 @samp{xlr} and @samp{xlp}.
15803 The special value @samp{from-abi} selects the
15804 most compatible architecture for the selected ABI (that is,
15805 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
15807 The native Linux/GNU toolchain also supports the value @samp{native},
15808 which selects the best architecture option for the host processor.
15809 @option{-march=native} has no effect if GCC does not recognize
15810 the processor.
15812 In processor names, a final @samp{000} can be abbreviated as @samp{k}
15813 (for example, @option{-march=r2k}).  Prefixes are optional, and
15814 @samp{vr} may be written @samp{r}.
15816 Names of the form @samp{@var{n}f2_1} refer to processors with
15817 FPUs clocked at half the rate of the core, names of the form
15818 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
15819 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
15820 processors with FPUs clocked a ratio of 3:2 with respect to the core.
15821 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
15822 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
15823 accepted as synonyms for @samp{@var{n}f1_1}.
15825 GCC defines two macros based on the value of this option.  The first
15826 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
15827 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
15828 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
15829 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
15830 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
15832 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
15833 above.  In other words, it has the full prefix and does not
15834 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
15835 the macro names the resolved architecture (either @samp{"mips1"} or
15836 @samp{"mips3"}).  It names the default architecture when no
15837 @option{-march} option is given.
15839 @item -mtune=@var{arch}
15840 @opindex mtune
15841 Optimize for @var{arch}.  Among other things, this option controls
15842 the way instructions are scheduled, and the perceived cost of arithmetic
15843 operations.  The list of @var{arch} values is the same as for
15844 @option{-march}.
15846 When this option is not used, GCC optimizes for the processor
15847 specified by @option{-march}.  By using @option{-march} and
15848 @option{-mtune} together, it is possible to generate code that
15849 runs on a family of processors, but optimize the code for one
15850 particular member of that family.
15852 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
15853 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
15854 @option{-march} ones described above.
15856 @item -mips1
15857 @opindex mips1
15858 Equivalent to @option{-march=mips1}.
15860 @item -mips2
15861 @opindex mips2
15862 Equivalent to @option{-march=mips2}.
15864 @item -mips3
15865 @opindex mips3
15866 Equivalent to @option{-march=mips3}.
15868 @item -mips4
15869 @opindex mips4
15870 Equivalent to @option{-march=mips4}.
15872 @item -mips32
15873 @opindex mips32
15874 Equivalent to @option{-march=mips32}.
15876 @item -mips32r2
15877 @opindex mips32r2
15878 Equivalent to @option{-march=mips32r2}.
15880 @item -mips64
15881 @opindex mips64
15882 Equivalent to @option{-march=mips64}.
15884 @item -mips64r2
15885 @opindex mips64r2
15886 Equivalent to @option{-march=mips64r2}.
15888 @item -mips16
15889 @itemx -mno-mips16
15890 @opindex mips16
15891 @opindex mno-mips16
15892 Generate (do not generate) MIPS16 code.  If GCC is targeting a
15893 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
15895 MIPS16 code generation can also be controlled on a per-function basis
15896 by means of @code{mips16} and @code{nomips16} attributes.
15897 @xref{Function Attributes}, for more information.
15899 @item -mflip-mips16
15900 @opindex mflip-mips16
15901 Generate MIPS16 code on alternating functions.  This option is provided
15902 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
15903 not intended for ordinary use in compiling user code.
15905 @item -minterlink-mips16
15906 @itemx -mno-interlink-mips16
15907 @opindex minterlink-mips16
15908 @opindex mno-interlink-mips16
15909 Require (do not require) that non-MIPS16 code be link-compatible with
15910 MIPS16 code.
15912 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
15913 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
15914 therefore disables direct jumps unless GCC knows that the target of the
15915 jump is not MIPS16.
15917 @item -mabi=32
15918 @itemx -mabi=o64
15919 @itemx -mabi=n32
15920 @itemx -mabi=64
15921 @itemx -mabi=eabi
15922 @opindex mabi=32
15923 @opindex mabi=o64
15924 @opindex mabi=n32
15925 @opindex mabi=64
15926 @opindex mabi=eabi
15927 Generate code for the given ABI@.
15929 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
15930 generates 64-bit code when you select a 64-bit architecture, but you
15931 can use @option{-mgp32} to get 32-bit code instead.
15933 For information about the O64 ABI, see
15934 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
15936 GCC supports a variant of the o32 ABI in which floating-point registers
15937 are 64 rather than 32 bits wide.  You can select this combination with
15938 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
15939 and @code{mfhc1} instructions and is therefore only supported for
15940 MIPS32R2 processors.
15942 The register assignments for arguments and return values remain the
15943 same, but each scalar value is passed in a single 64-bit register
15944 rather than a pair of 32-bit registers.  For example, scalar
15945 floating-point values are returned in @samp{$f0} only, not a
15946 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
15947 remains the same, but all 64 bits are saved.
15949 @item -mabicalls
15950 @itemx -mno-abicalls
15951 @opindex mabicalls
15952 @opindex mno-abicalls
15953 Generate (do not generate) code that is suitable for SVR4-style
15954 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
15955 systems.
15957 @item -mshared
15958 @itemx -mno-shared
15959 Generate (do not generate) code that is fully position-independent,
15960 and that can therefore be linked into shared libraries.  This option
15961 only affects @option{-mabicalls}.
15963 All @option{-mabicalls} code has traditionally been position-independent,
15964 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
15965 as an extension, the GNU toolchain allows executables to use absolute
15966 accesses for locally-binding symbols.  It can also use shorter GP
15967 initialization sequences and generate direct calls to locally-defined
15968 functions.  This mode is selected by @option{-mno-shared}.
15970 @option{-mno-shared} depends on binutils 2.16 or higher and generates
15971 objects that can only be linked by the GNU linker.  However, the option
15972 does not affect the ABI of the final executable; it only affects the ABI
15973 of relocatable objects.  Using @option{-mno-shared} generally makes
15974 executables both smaller and quicker.
15976 @option{-mshared} is the default.
15978 @item -mplt
15979 @itemx -mno-plt
15980 @opindex mplt
15981 @opindex mno-plt
15982 Assume (do not assume) that the static and dynamic linkers
15983 support PLTs and copy relocations.  This option only affects
15984 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
15985 has no effect without @option{-msym32}.
15987 You can make @option{-mplt} the default by configuring
15988 GCC with @option{--with-mips-plt}.  The default is
15989 @option{-mno-plt} otherwise.
15991 @item -mxgot
15992 @itemx -mno-xgot
15993 @opindex mxgot
15994 @opindex mno-xgot
15995 Lift (do not lift) the usual restrictions on the size of the global
15996 offset table.
15998 GCC normally uses a single instruction to load values from the GOT@.
15999 While this is relatively efficient, it only works if the GOT
16000 is smaller than about 64k.  Anything larger causes the linker
16001 to report an error such as:
16003 @cindex relocation truncated to fit (MIPS)
16004 @smallexample
16005 relocation truncated to fit: R_MIPS_GOT16 foobar
16006 @end smallexample
16008 If this happens, you should recompile your code with @option{-mxgot}.
16009 This works with very large GOTs, although the code is also
16010 less efficient, since it takes three instructions to fetch the
16011 value of a global symbol.
16013 Note that some linkers can create multiple GOTs.  If you have such a
16014 linker, you should only need to use @option{-mxgot} when a single object
16015 file accesses more than 64k's worth of GOT entries.  Very few do.
16017 These options have no effect unless GCC is generating position
16018 independent code.
16020 @item -mgp32
16021 @opindex mgp32
16022 Assume that general-purpose registers are 32 bits wide.
16024 @item -mgp64
16025 @opindex mgp64
16026 Assume that general-purpose registers are 64 bits wide.
16028 @item -mfp32
16029 @opindex mfp32
16030 Assume that floating-point registers are 32 bits wide.
16032 @item -mfp64
16033 @opindex mfp64
16034 Assume that floating-point registers are 64 bits wide.
16036 @item -mhard-float
16037 @opindex mhard-float
16038 Use floating-point coprocessor instructions.
16040 @item -msoft-float
16041 @opindex msoft-float
16042 Do not use floating-point coprocessor instructions.  Implement
16043 floating-point calculations using library calls instead.
16045 @item -mno-float
16046 @opindex mno-float
16047 Equivalent to @option{-msoft-float}, but additionally asserts that the
16048 program being compiled does not perform any floating-point operations.
16049 This option is presently supported only by some bare-metal MIPS
16050 configurations, where it may select a special set of libraries
16051 that lack all floating-point support (including, for example, the
16052 floating-point @code{printf} formats).  
16053 If code compiled with @code{-mno-float} accidentally contains
16054 floating-point operations, it is likely to suffer a link-time
16055 or run-time failure.
16057 @item -msingle-float
16058 @opindex msingle-float
16059 Assume that the floating-point coprocessor only supports single-precision
16060 operations.
16062 @item -mdouble-float
16063 @opindex mdouble-float
16064 Assume that the floating-point coprocessor supports double-precision
16065 operations.  This is the default.
16067 @item -mllsc
16068 @itemx -mno-llsc
16069 @opindex mllsc
16070 @opindex mno-llsc
16071 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
16072 implement atomic memory built-in functions.  When neither option is
16073 specified, GCC uses the instructions if the target architecture
16074 supports them.
16076 @option{-mllsc} is useful if the runtime environment can emulate the
16077 instructions and @option{-mno-llsc} can be useful when compiling for
16078 nonstandard ISAs.  You can make either option the default by
16079 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
16080 respectively.  @option{--with-llsc} is the default for some
16081 configurations; see the installation documentation for details.
16083 @item -mdsp
16084 @itemx -mno-dsp
16085 @opindex mdsp
16086 @opindex mno-dsp
16087 Use (do not use) revision 1 of the MIPS DSP ASE@.
16088 @xref{MIPS DSP Built-in Functions}.  This option defines the
16089 preprocessor macro @samp{__mips_dsp}.  It also defines
16090 @samp{__mips_dsp_rev} to 1.
16092 @item -mdspr2
16093 @itemx -mno-dspr2
16094 @opindex mdspr2
16095 @opindex mno-dspr2
16096 Use (do not use) revision 2 of the MIPS DSP ASE@.
16097 @xref{MIPS DSP Built-in Functions}.  This option defines the
16098 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
16099 It also defines @samp{__mips_dsp_rev} to 2.
16101 @item -msmartmips
16102 @itemx -mno-smartmips
16103 @opindex msmartmips
16104 @opindex mno-smartmips
16105 Use (do not use) the MIPS SmartMIPS ASE.
16107 @item -mpaired-single
16108 @itemx -mno-paired-single
16109 @opindex mpaired-single
16110 @opindex mno-paired-single
16111 Use (do not use) paired-single floating-point instructions.
16112 @xref{MIPS Paired-Single Support}.  This option requires
16113 hardware floating-point support to be enabled.
16115 @item -mdmx
16116 @itemx -mno-mdmx
16117 @opindex mdmx
16118 @opindex mno-mdmx
16119 Use (do not use) MIPS Digital Media Extension instructions.
16120 This option can only be used when generating 64-bit code and requires
16121 hardware floating-point support to be enabled.
16123 @item -mips3d
16124 @itemx -mno-mips3d
16125 @opindex mips3d
16126 @opindex mno-mips3d
16127 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
16128 The option @option{-mips3d} implies @option{-mpaired-single}.
16130 @item -mmt
16131 @itemx -mno-mt
16132 @opindex mmt
16133 @opindex mno-mt
16134 Use (do not use) MT Multithreading instructions.
16136 @item -mmcu
16137 @itemx -mno-mcu
16138 @opindex mmcu
16139 @opindex mno-mcu
16140 Use (do not use) the MIPS MCU ASE instructions.
16142 @item -mlong64
16143 @opindex mlong64
16144 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
16145 an explanation of the default and the way that the pointer size is
16146 determined.
16148 @item -mlong32
16149 @opindex mlong32
16150 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
16152 The default size of @code{int}s, @code{long}s and pointers depends on
16153 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
16154 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
16155 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
16156 or the same size as integer registers, whichever is smaller.
16158 @item -msym32
16159 @itemx -mno-sym32
16160 @opindex msym32
16161 @opindex mno-sym32
16162 Assume (do not assume) that all symbols have 32-bit values, regardless
16163 of the selected ABI@.  This option is useful in combination with
16164 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
16165 to generate shorter and faster references to symbolic addresses.
16167 @item -G @var{num}
16168 @opindex G
16169 Put definitions of externally-visible data in a small data section
16170 if that data is no bigger than @var{num} bytes.  GCC can then generate
16171 more efficient accesses to the data; see @option{-mgpopt} for details.
16173 The default @option{-G} option depends on the configuration.
16175 @item -mlocal-sdata
16176 @itemx -mno-local-sdata
16177 @opindex mlocal-sdata
16178 @opindex mno-local-sdata
16179 Extend (do not extend) the @option{-G} behavior to local data too,
16180 such as to static variables in C@.  @option{-mlocal-sdata} is the
16181 default for all configurations.
16183 If the linker complains that an application is using too much small data,
16184 you might want to try rebuilding the less performance-critical parts with
16185 @option{-mno-local-sdata}.  You might also want to build large
16186 libraries with @option{-mno-local-sdata}, so that the libraries leave
16187 more room for the main program.
16189 @item -mextern-sdata
16190 @itemx -mno-extern-sdata
16191 @opindex mextern-sdata
16192 @opindex mno-extern-sdata
16193 Assume (do not assume) that externally-defined data is in
16194 a small data section if the size of that data is within the @option{-G} limit.
16195 @option{-mextern-sdata} is the default for all configurations.
16197 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
16198 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
16199 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
16200 is placed in a small data section.  If @var{Var} is defined by another
16201 module, you must either compile that module with a high-enough
16202 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
16203 definition.  If @var{Var} is common, you must link the application
16204 with a high-enough @option{-G} setting.
16206 The easiest way of satisfying these restrictions is to compile
16207 and link every module with the same @option{-G} option.  However,
16208 you may wish to build a library that supports several different
16209 small data limits.  You can do this by compiling the library with
16210 the highest supported @option{-G} setting and additionally using
16211 @option{-mno-extern-sdata} to stop the library from making assumptions
16212 about externally-defined data.
16214 @item -mgpopt
16215 @itemx -mno-gpopt
16216 @opindex mgpopt
16217 @opindex mno-gpopt
16218 Use (do not use) GP-relative accesses for symbols that are known to be
16219 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
16220 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
16221 configurations.
16223 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
16224 might not hold the value of @code{_gp}.  For example, if the code is
16225 part of a library that might be used in a boot monitor, programs that
16226 call boot monitor routines pass an unknown value in @code{$gp}.
16227 (In such situations, the boot monitor itself is usually compiled
16228 with @option{-G0}.)
16230 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
16231 @option{-mno-extern-sdata}.
16233 @item -membedded-data
16234 @itemx -mno-embedded-data
16235 @opindex membedded-data
16236 @opindex mno-embedded-data
16237 Allocate variables to the read-only data section first if possible, then
16238 next in the small data section if possible, otherwise in data.  This gives
16239 slightly slower code than the default, but reduces the amount of RAM required
16240 when executing, and thus may be preferred for some embedded systems.
16242 @item -muninit-const-in-rodata
16243 @itemx -mno-uninit-const-in-rodata
16244 @opindex muninit-const-in-rodata
16245 @opindex mno-uninit-const-in-rodata
16246 Put uninitialized @code{const} variables in the read-only data section.
16247 This option is only meaningful in conjunction with @option{-membedded-data}.
16249 @item -mcode-readable=@var{setting}
16250 @opindex mcode-readable
16251 Specify whether GCC may generate code that reads from executable sections.
16252 There are three possible settings:
16254 @table @gcctabopt
16255 @item -mcode-readable=yes
16256 Instructions may freely access executable sections.  This is the
16257 default setting.
16259 @item -mcode-readable=pcrel
16260 MIPS16 PC-relative load instructions can access executable sections,
16261 but other instructions must not do so.  This option is useful on 4KSc
16262 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
16263 It is also useful on processors that can be configured to have a dual
16264 instruction/data SRAM interface and that, like the M4K, automatically
16265 redirect PC-relative loads to the instruction RAM.
16267 @item -mcode-readable=no
16268 Instructions must not access executable sections.  This option can be
16269 useful on targets that are configured to have a dual instruction/data
16270 SRAM interface but that (unlike the M4K) do not automatically redirect
16271 PC-relative loads to the instruction RAM.
16272 @end table
16274 @item -msplit-addresses
16275 @itemx -mno-split-addresses
16276 @opindex msplit-addresses
16277 @opindex mno-split-addresses
16278 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
16279 relocation operators.  This option has been superseded by
16280 @option{-mexplicit-relocs} but is retained for backwards compatibility.
16282 @item -mexplicit-relocs
16283 @itemx -mno-explicit-relocs
16284 @opindex mexplicit-relocs
16285 @opindex mno-explicit-relocs
16286 Use (do not use) assembler relocation operators when dealing with symbolic
16287 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
16288 is to use assembler macros instead.
16290 @option{-mexplicit-relocs} is the default if GCC was configured
16291 to use an assembler that supports relocation operators.
16293 @item -mcheck-zero-division
16294 @itemx -mno-check-zero-division
16295 @opindex mcheck-zero-division
16296 @opindex mno-check-zero-division
16297 Trap (do not trap) on integer division by zero.
16299 The default is @option{-mcheck-zero-division}.
16301 @item -mdivide-traps
16302 @itemx -mdivide-breaks
16303 @opindex mdivide-traps
16304 @opindex mdivide-breaks
16305 MIPS systems check for division by zero by generating either a
16306 conditional trap or a break instruction.  Using traps results in
16307 smaller code, but is only supported on MIPS II and later.  Also, some
16308 versions of the Linux kernel have a bug that prevents trap from
16309 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
16310 allow conditional traps on architectures that support them and
16311 @option{-mdivide-breaks} to force the use of breaks.
16313 The default is usually @option{-mdivide-traps}, but this can be
16314 overridden at configure time using @option{--with-divide=breaks}.
16315 Divide-by-zero checks can be completely disabled using
16316 @option{-mno-check-zero-division}.
16318 @item -mmemcpy
16319 @itemx -mno-memcpy
16320 @opindex mmemcpy
16321 @opindex mno-memcpy
16322 Force (do not force) the use of @code{memcpy()} for non-trivial block
16323 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
16324 most constant-sized copies.
16326 @item -mlong-calls
16327 @itemx -mno-long-calls
16328 @opindex mlong-calls
16329 @opindex mno-long-calls
16330 Disable (do not disable) use of the @code{jal} instruction.  Calling
16331 functions using @code{jal} is more efficient but requires the caller
16332 and callee to be in the same 256 megabyte segment.
16334 This option has no effect on abicalls code.  The default is
16335 @option{-mno-long-calls}.
16337 @item -mmad
16338 @itemx -mno-mad
16339 @opindex mmad
16340 @opindex mno-mad
16341 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
16342 instructions, as provided by the R4650 ISA@.
16344 @item -mfused-madd
16345 @itemx -mno-fused-madd
16346 @opindex mfused-madd
16347 @opindex mno-fused-madd
16348 Enable (disable) use of the floating-point multiply-accumulate
16349 instructions, when they are available.  The default is
16350 @option{-mfused-madd}.
16352 When multiply-accumulate instructions are used, the intermediate
16353 product is calculated to infinite precision and is not subject to
16354 the FCSR Flush to Zero bit.  This may be undesirable in some
16355 circumstances.
16357 @item -nocpp
16358 @opindex nocpp
16359 Tell the MIPS assembler to not run its preprocessor over user
16360 assembler files (with a @samp{.s} suffix) when assembling them.
16362 @item -mfix-24k
16363 @item -mno-fix-24k
16364 @opindex mfix-24k
16365 @opindex mno-fix-24k
16366 Work around the 24K E48 (lost data on stores during refill) errata.
16367 The workarounds are implemented by the assembler rather than by GCC@.
16369 @item -mfix-r4000
16370 @itemx -mno-fix-r4000
16371 @opindex mfix-r4000
16372 @opindex mno-fix-r4000
16373 Work around certain R4000 CPU errata:
16374 @itemize @minus
16375 @item
16376 A double-word or a variable shift may give an incorrect result if executed
16377 immediately after starting an integer division.
16378 @item
16379 A double-word or a variable shift may give an incorrect result if executed
16380 while an integer multiplication is in progress.
16381 @item
16382 An integer division may give an incorrect result if started in a delay slot
16383 of a taken branch or a jump.
16384 @end itemize
16386 @item -mfix-r4400
16387 @itemx -mno-fix-r4400
16388 @opindex mfix-r4400
16389 @opindex mno-fix-r4400
16390 Work around certain R4400 CPU errata:
16391 @itemize @minus
16392 @item
16393 A double-word or a variable shift may give an incorrect result if executed
16394 immediately after starting an integer division.
16395 @end itemize
16397 @item -mfix-r10000
16398 @itemx -mno-fix-r10000
16399 @opindex mfix-r10000
16400 @opindex mno-fix-r10000
16401 Work around certain R10000 errata:
16402 @itemize @minus
16403 @item
16404 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16405 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16406 @end itemize
16408 This option can only be used if the target architecture supports
16409 branch-likely instructions.  @option{-mfix-r10000} is the default when
16410 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16411 otherwise.
16413 @item -mfix-vr4120
16414 @itemx -mno-fix-vr4120
16415 @opindex mfix-vr4120
16416 Work around certain VR4120 errata:
16417 @itemize @minus
16418 @item
16419 @code{dmultu} does not always produce the correct result.
16420 @item
16421 @code{div} and @code{ddiv} do not always produce the correct result if one
16422 of the operands is negative.
16423 @end itemize
16424 The workarounds for the division errata rely on special functions in
16425 @file{libgcc.a}.  At present, these functions are only provided by
16426 the @code{mips64vr*-elf} configurations.
16428 Other VR4120 errata require a NOP to be inserted between certain pairs of
16429 instructions.  These errata are handled by the assembler, not by GCC itself.
16431 @item -mfix-vr4130
16432 @opindex mfix-vr4130
16433 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16434 workarounds are implemented by the assembler rather than by GCC,
16435 although GCC avoids using @code{mflo} and @code{mfhi} if the
16436 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16437 instructions are available instead.
16439 @item -mfix-sb1
16440 @itemx -mno-fix-sb1
16441 @opindex mfix-sb1
16442 Work around certain SB-1 CPU core errata.
16443 (This flag currently works around the SB-1 revision 2
16444 ``F1'' and ``F2'' floating-point errata.)
16446 @item -mr10k-cache-barrier=@var{setting}
16447 @opindex mr10k-cache-barrier
16448 Specify whether GCC should insert cache barriers to avoid the
16449 side-effects of speculation on R10K processors.
16451 In common with many processors, the R10K tries to predict the outcome
16452 of a conditional branch and speculatively executes instructions from
16453 the ``taken'' branch.  It later aborts these instructions if the
16454 predicted outcome is wrong.  However, on the R10K, even aborted
16455 instructions can have side effects.
16457 This problem only affects kernel stores and, depending on the system,
16458 kernel loads.  As an example, a speculatively-executed store may load
16459 the target memory into cache and mark the cache line as dirty, even if
16460 the store itself is later aborted.  If a DMA operation writes to the
16461 same area of memory before the ``dirty'' line is flushed, the cached
16462 data overwrites the DMA-ed data.  See the R10K processor manual
16463 for a full description, including other potential problems.
16465 One workaround is to insert cache barrier instructions before every memory
16466 access that might be speculatively executed and that might have side
16467 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16468 controls GCC's implementation of this workaround.  It assumes that
16469 aborted accesses to any byte in the following regions does not have
16470 side effects:
16472 @enumerate
16473 @item
16474 the memory occupied by the current function's stack frame;
16476 @item
16477 the memory occupied by an incoming stack argument;
16479 @item
16480 the memory occupied by an object with a link-time-constant address.
16481 @end enumerate
16483 It is the kernel's responsibility to ensure that speculative
16484 accesses to these regions are indeed safe.
16486 If the input program contains a function declaration such as:
16488 @smallexample
16489 void foo (void);
16490 @end smallexample
16492 then the implementation of @code{foo} must allow @code{j foo} and
16493 @code{jal foo} to be executed speculatively.  GCC honors this
16494 restriction for functions it compiles itself.  It expects non-GCC
16495 functions (such as hand-written assembly code) to do the same.
16497 The option has three forms:
16499 @table @gcctabopt
16500 @item -mr10k-cache-barrier=load-store
16501 Insert a cache barrier before a load or store that might be
16502 speculatively executed and that might have side effects even
16503 if aborted.
16505 @item -mr10k-cache-barrier=store
16506 Insert a cache barrier before a store that might be speculatively
16507 executed and that might have side effects even if aborted.
16509 @item -mr10k-cache-barrier=none
16510 Disable the insertion of cache barriers.  This is the default setting.
16511 @end table
16513 @item -mflush-func=@var{func}
16514 @itemx -mno-flush-func
16515 @opindex mflush-func
16516 Specifies the function to call to flush the I and D caches, or to not
16517 call any such function.  If called, the function must take the same
16518 arguments as the common @code{_flush_func()}, that is, the address of the
16519 memory range for which the cache is being flushed, the size of the
16520 memory range, and the number 3 (to flush both caches).  The default
16521 depends on the target GCC was configured for, but commonly is either
16522 @samp{_flush_func} or @samp{__cpu_flush}.
16524 @item mbranch-cost=@var{num}
16525 @opindex mbranch-cost
16526 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16527 This cost is only a heuristic and is not guaranteed to produce
16528 consistent results across releases.  A zero cost redundantly selects
16529 the default, which is based on the @option{-mtune} setting.
16531 @item -mbranch-likely
16532 @itemx -mno-branch-likely
16533 @opindex mbranch-likely
16534 @opindex mno-branch-likely
16535 Enable or disable use of Branch Likely instructions, regardless of the
16536 default for the selected architecture.  By default, Branch Likely
16537 instructions may be generated if they are supported by the selected
16538 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16539 and processors that implement those architectures; for those, Branch
16540 Likely instructions are not be generated by default because the MIPS32
16541 and MIPS64 architectures specifically deprecate their use.
16543 @item -mfp-exceptions
16544 @itemx -mno-fp-exceptions
16545 @opindex mfp-exceptions
16546 Specifies whether FP exceptions are enabled.  This affects how
16547 FP instructions are scheduled for some processors.
16548 The default is that FP exceptions are
16549 enabled.
16551 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16552 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16553 FP pipe.
16555 @item -mvr4130-align
16556 @itemx -mno-vr4130-align
16557 @opindex mvr4130-align
16558 The VR4130 pipeline is two-way superscalar, but can only issue two
16559 instructions together if the first one is 8-byte aligned.  When this
16560 option is enabled, GCC aligns pairs of instructions that it
16561 thinks should execute in parallel.
16563 This option only has an effect when optimizing for the VR4130.
16564 It normally makes code faster, but at the expense of making it bigger.
16565 It is enabled by default at optimization level @option{-O3}.
16567 @item -msynci
16568 @itemx -mno-synci
16569 @opindex msynci
16570 Enable (disable) generation of @code{synci} instructions on
16571 architectures that support it.  The @code{synci} instructions (if
16572 enabled) are generated when @code{__builtin___clear_cache()} is
16573 compiled.
16575 This option defaults to @code{-mno-synci}, but the default can be
16576 overridden by configuring with @code{--with-synci}.
16578 When compiling code for single processor systems, it is generally safe
16579 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16580 does not invalidate the instruction caches on all cores and may lead
16581 to undefined behavior.
16583 @item -mrelax-pic-calls
16584 @itemx -mno-relax-pic-calls
16585 @opindex mrelax-pic-calls
16586 Try to turn PIC calls that are normally dispatched via register
16587 @code{$25} into direct calls.  This is only possible if the linker can
16588 resolve the destination at link-time and if the destination is within
16589 range for a direct call.
16591 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16592 an assembler and a linker that support the @code{.reloc} assembly
16593 directive and @code{-mexplicit-relocs} is in effect.  With
16594 @code{-mno-explicit-relocs}, this optimization can be performed by the
16595 assembler and the linker alone without help from the compiler.
16597 @item -mmcount-ra-address
16598 @itemx -mno-mcount-ra-address
16599 @opindex mmcount-ra-address
16600 @opindex mno-mcount-ra-address
16601 Emit (do not emit) code that allows @code{_mcount} to modify the
16602 calling function's return address.  When enabled, this option extends
16603 the usual @code{_mcount} interface with a new @var{ra-address}
16604 parameter, which has type @code{intptr_t *} and is passed in register
16605 @code{$12}.  @code{_mcount} can then modify the return address by
16606 doing both of the following:
16607 @itemize
16608 @item
16609 Returning the new address in register @code{$31}.
16610 @item
16611 Storing the new address in @code{*@var{ra-address}},
16612 if @var{ra-address} is nonnull.
16613 @end itemize
16615 The default is @option{-mno-mcount-ra-address}.
16617 @end table
16619 @node MMIX Options
16620 @subsection MMIX Options
16621 @cindex MMIX Options
16623 These options are defined for the MMIX:
16625 @table @gcctabopt
16626 @item -mlibfuncs
16627 @itemx -mno-libfuncs
16628 @opindex mlibfuncs
16629 @opindex mno-libfuncs
16630 Specify that intrinsic library functions are being compiled, passing all
16631 values in registers, no matter the size.
16633 @item -mepsilon
16634 @itemx -mno-epsilon
16635 @opindex mepsilon
16636 @opindex mno-epsilon
16637 Generate floating-point comparison instructions that compare with respect
16638 to the @code{rE} epsilon register.
16640 @item -mabi=mmixware
16641 @itemx -mabi=gnu
16642 @opindex mabi=mmixware
16643 @opindex mabi=gnu
16644 Generate code that passes function parameters and return values that (in
16645 the called function) are seen as registers @code{$0} and up, as opposed to
16646 the GNU ABI which uses global registers @code{$231} and up.
16648 @item -mzero-extend
16649 @itemx -mno-zero-extend
16650 @opindex mzero-extend
16651 @opindex mno-zero-extend
16652 When reading data from memory in sizes shorter than 64 bits, use (do not
16653 use) zero-extending load instructions by default, rather than
16654 sign-extending ones.
16656 @item -mknuthdiv
16657 @itemx -mno-knuthdiv
16658 @opindex mknuthdiv
16659 @opindex mno-knuthdiv
16660 Make the result of a division yielding a remainder have the same sign as
16661 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
16662 remainder follows the sign of the dividend.  Both methods are
16663 arithmetically valid, the latter being almost exclusively used.
16665 @item -mtoplevel-symbols
16666 @itemx -mno-toplevel-symbols
16667 @opindex mtoplevel-symbols
16668 @opindex mno-toplevel-symbols
16669 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
16670 code can be used with the @code{PREFIX} assembly directive.
16672 @item -melf
16673 @opindex melf
16674 Generate an executable in the ELF format, rather than the default
16675 @samp{mmo} format used by the @command{mmix} simulator.
16677 @item -mbranch-predict
16678 @itemx -mno-branch-predict
16679 @opindex mbranch-predict
16680 @opindex mno-branch-predict
16681 Use (do not use) the probable-branch instructions, when static branch
16682 prediction indicates a probable branch.
16684 @item -mbase-addresses
16685 @itemx -mno-base-addresses
16686 @opindex mbase-addresses
16687 @opindex mno-base-addresses
16688 Generate (do not generate) code that uses @emph{base addresses}.  Using a
16689 base address automatically generates a request (handled by the assembler
16690 and the linker) for a constant to be set up in a global register.  The
16691 register is used for one or more base address requests within the range 0
16692 to 255 from the value held in the register.  The generally leads to short
16693 and fast code, but the number of different data items that can be
16694 addressed is limited.  This means that a program that uses lots of static
16695 data may require @option{-mno-base-addresses}.
16697 @item -msingle-exit
16698 @itemx -mno-single-exit
16699 @opindex msingle-exit
16700 @opindex mno-single-exit
16701 Force (do not force) generated code to have a single exit point in each
16702 function.
16703 @end table
16705 @node MN10300 Options
16706 @subsection MN10300 Options
16707 @cindex MN10300 options
16709 These @option{-m} options are defined for Matsushita MN10300 architectures:
16711 @table @gcctabopt
16712 @item -mmult-bug
16713 @opindex mmult-bug
16714 Generate code to avoid bugs in the multiply instructions for the MN10300
16715 processors.  This is the default.
16717 @item -mno-mult-bug
16718 @opindex mno-mult-bug
16719 Do not generate code to avoid bugs in the multiply instructions for the
16720 MN10300 processors.
16722 @item -mam33
16723 @opindex mam33
16724 Generate code using features specific to the AM33 processor.
16726 @item -mno-am33
16727 @opindex mno-am33
16728 Do not generate code using features specific to the AM33 processor.  This
16729 is the default.
16731 @item -mam33-2
16732 @opindex mam33-2
16733 Generate code using features specific to the AM33/2.0 processor.
16735 @item -mam34
16736 @opindex mam34
16737 Generate code using features specific to the AM34 processor.
16739 @item -mtune=@var{cpu-type}
16740 @opindex mtune
16741 Use the timing characteristics of the indicated CPU type when
16742 scheduling instructions.  This does not change the targeted processor
16743 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
16744 @samp{am33-2} or @samp{am34}.
16746 @item -mreturn-pointer-on-d0
16747 @opindex mreturn-pointer-on-d0
16748 When generating a function that returns a pointer, return the pointer
16749 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
16750 only in @code{a0}, and attempts to call such functions without a prototype
16751 result in errors.  Note that this option is on by default; use
16752 @option{-mno-return-pointer-on-d0} to disable it.
16754 @item -mno-crt0
16755 @opindex mno-crt0
16756 Do not link in the C run-time initialization object file.
16758 @item -mrelax
16759 @opindex mrelax
16760 Indicate to the linker that it should perform a relaxation optimization pass
16761 to shorten branches, calls and absolute memory addresses.  This option only
16762 has an effect when used on the command line for the final link step.
16764 This option makes symbolic debugging impossible.
16766 @item -mliw
16767 @opindex mliw
16768 Allow the compiler to generate @emph{Long Instruction Word}
16769 instructions if the target is the @samp{AM33} or later.  This is the
16770 default.  This option defines the preprocessor macro @samp{__LIW__}.
16772 @item -mnoliw
16773 @opindex mnoliw
16774 Do not allow the compiler to generate @emph{Long Instruction Word}
16775 instructions.  This option defines the preprocessor macro
16776 @samp{__NO_LIW__}.
16778 @item -msetlb
16779 @opindex msetlb
16780 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
16781 instructions if the target is the @samp{AM33} or later.  This is the
16782 default.  This option defines the preprocessor macro @samp{__SETLB__}.
16784 @item -mnosetlb
16785 @opindex mnosetlb
16786 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
16787 instructions.  This option defines the preprocessor macro
16788 @samp{__NO_SETLB__}.
16790 @end table
16792 @node Moxie Options
16793 @subsection Moxie Options
16794 @cindex Moxie Options
16796 @table @gcctabopt
16798 @item -meb
16799 @opindex meb
16800 Generate big-endian code.  This is the default for @samp{moxie-*-*}
16801 configurations.
16803 @item -mel
16804 @opindex mel
16805 Generate little-endian code.
16807 @item -mno-crt0
16808 @opindex mno-crt0
16809 Do not link in the C run-time initialization object file.
16811 @end table
16813 @node PDP-11 Options
16814 @subsection PDP-11 Options
16815 @cindex PDP-11 Options
16817 These options are defined for the PDP-11:
16819 @table @gcctabopt
16820 @item -mfpu
16821 @opindex mfpu
16822 Use hardware FPP floating point.  This is the default.  (FIS floating
16823 point on the PDP-11/40 is not supported.)
16825 @item -msoft-float
16826 @opindex msoft-float
16827 Do not use hardware floating point.
16829 @item -mac0
16830 @opindex mac0
16831 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
16833 @item -mno-ac0
16834 @opindex mno-ac0
16835 Return floating-point results in memory.  This is the default.
16837 @item -m40
16838 @opindex m40
16839 Generate code for a PDP-11/40.
16841 @item -m45
16842 @opindex m45
16843 Generate code for a PDP-11/45.  This is the default.
16845 @item -m10
16846 @opindex m10
16847 Generate code for a PDP-11/10.
16849 @item -mbcopy-builtin
16850 @opindex mbcopy-builtin
16851 Use inline @code{movmemhi} patterns for copying memory.  This is the
16852 default.
16854 @item -mbcopy
16855 @opindex mbcopy
16856 Do not use inline @code{movmemhi} patterns for copying memory.
16858 @item -mint16
16859 @itemx -mno-int32
16860 @opindex mint16
16861 @opindex mno-int32
16862 Use 16-bit @code{int}.  This is the default.
16864 @item -mint32
16865 @itemx -mno-int16
16866 @opindex mint32
16867 @opindex mno-int16
16868 Use 32-bit @code{int}.
16870 @item -mfloat64
16871 @itemx -mno-float32
16872 @opindex mfloat64
16873 @opindex mno-float32
16874 Use 64-bit @code{float}.  This is the default.
16876 @item -mfloat32
16877 @itemx -mno-float64
16878 @opindex mfloat32
16879 @opindex mno-float64
16880 Use 32-bit @code{float}.
16882 @item -mabshi
16883 @opindex mabshi
16884 Use @code{abshi2} pattern.  This is the default.
16886 @item -mno-abshi
16887 @opindex mno-abshi
16888 Do not use @code{abshi2} pattern.
16890 @item -mbranch-expensive
16891 @opindex mbranch-expensive
16892 Pretend that branches are expensive.  This is for experimenting with
16893 code generation only.
16895 @item -mbranch-cheap
16896 @opindex mbranch-cheap
16897 Do not pretend that branches are expensive.  This is the default.
16899 @item -munix-asm
16900 @opindex munix-asm
16901 Use Unix assembler syntax.  This is the default when configured for
16902 @samp{pdp11-*-bsd}.
16904 @item -mdec-asm
16905 @opindex mdec-asm
16906 Use DEC assembler syntax.  This is the default when configured for any
16907 PDP-11 target other than @samp{pdp11-*-bsd}.
16908 @end table
16910 @node picoChip Options
16911 @subsection picoChip Options
16912 @cindex picoChip options
16914 These @samp{-m} options are defined for picoChip implementations:
16916 @table @gcctabopt
16918 @item -mae=@var{ae_type}
16919 @opindex mcpu
16920 Set the instruction set, register set, and instruction scheduling
16921 parameters for array element type @var{ae_type}.  Supported values
16922 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
16924 @option{-mae=ANY} selects a completely generic AE type.  Code
16925 generated with this option runs on any of the other AE types.  The
16926 code is not as efficient as it would be if compiled for a specific
16927 AE type, and some types of operation (e.g., multiplication) do not
16928 work properly on all types of AE.
16930 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
16931 for compiled code, and is the default.
16933 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
16934 option may suffer from poor performance of byte (char) manipulation,
16935 since the DSP AE does not provide hardware support for byte load/stores.
16937 @item -msymbol-as-address
16938 Enable the compiler to directly use a symbol name as an address in a
16939 load/store instruction, without first loading it into a
16940 register.  Typically, the use of this option generates larger
16941 programs, which run faster than when the option isn't used.  However, the
16942 results vary from program to program, so it is left as a user option,
16943 rather than being permanently enabled.
16945 @item -mno-inefficient-warnings
16946 Disables warnings about the generation of inefficient code.  These
16947 warnings can be generated, for example, when compiling code that
16948 performs byte-level memory operations on the MAC AE type.  The MAC AE has
16949 no hardware support for byte-level memory operations, so all byte
16950 load/stores must be synthesized from word load/store operations.  This is
16951 inefficient and a warning is generated to indicate
16952 that you should rewrite the code to avoid byte operations, or to target
16953 an AE type that has the necessary hardware support.  This option disables
16954 these warnings.
16956 @end table
16958 @node PowerPC Options
16959 @subsection PowerPC Options
16960 @cindex PowerPC options
16962 These are listed under @xref{RS/6000 and PowerPC Options}.
16964 @node RL78 Options
16965 @subsection RL78 Options
16966 @cindex RL78 Options
16968 @table @gcctabopt
16970 @item -msim
16971 @opindex msim
16972 Links in additional target libraries to support operation within a
16973 simulator.
16975 @item -mmul=none
16976 @itemx -mmul=g13
16977 @itemx -mmul=rl78
16978 @opindex mmul
16979 Specifies the type of hardware multiplication support to be used.  The
16980 default is @code{none}, which uses software multiplication functions.
16981 The @code{g13} option is for the hardware multiply/divide peripheral
16982 only on the RL78/G13 targets.  The @code{rl78} option is for the
16983 standard hardware multiplication defined in the RL78 software manual.
16985 @end table
16987 @node RS/6000 and PowerPC Options
16988 @subsection IBM RS/6000 and PowerPC Options
16989 @cindex RS/6000 and PowerPC Options
16990 @cindex IBM RS/6000 and PowerPC Options
16992 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
16993 @table @gcctabopt
16994 @item -mpowerpc-gpopt
16995 @itemx -mno-powerpc-gpopt
16996 @itemx -mpowerpc-gfxopt
16997 @itemx -mno-powerpc-gfxopt
16998 @need 800
16999 @itemx -mpowerpc64
17000 @itemx -mno-powerpc64
17001 @itemx -mmfcrf
17002 @itemx -mno-mfcrf
17003 @itemx -mpopcntb
17004 @itemx -mno-popcntb
17005 @itemx -mpopcntd
17006 @itemx -mno-popcntd
17007 @itemx -mfprnd
17008 @itemx -mno-fprnd
17009 @need 800
17010 @itemx -mcmpb
17011 @itemx -mno-cmpb
17012 @itemx -mmfpgpr
17013 @itemx -mno-mfpgpr
17014 @itemx -mhard-dfp
17015 @itemx -mno-hard-dfp
17016 @opindex mpowerpc-gpopt
17017 @opindex mno-powerpc-gpopt
17018 @opindex mpowerpc-gfxopt
17019 @opindex mno-powerpc-gfxopt
17020 @opindex mpowerpc64
17021 @opindex mno-powerpc64
17022 @opindex mmfcrf
17023 @opindex mno-mfcrf
17024 @opindex mpopcntb
17025 @opindex mno-popcntb
17026 @opindex mpopcntd
17027 @opindex mno-popcntd
17028 @opindex mfprnd
17029 @opindex mno-fprnd
17030 @opindex mcmpb
17031 @opindex mno-cmpb
17032 @opindex mmfpgpr
17033 @opindex mno-mfpgpr
17034 @opindex mhard-dfp
17035 @opindex mno-hard-dfp
17036 You use these options to specify which instructions are available on the
17037 processor you are using.  The default value of these options is
17038 determined when configuring GCC@.  Specifying the
17039 @option{-mcpu=@var{cpu_type}} overrides the specification of these
17040 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
17041 rather than the options listed above.
17043 Specifying @option{-mpowerpc-gpopt} allows
17044 GCC to use the optional PowerPC architecture instructions in the
17045 General Purpose group, including floating-point square root.  Specifying
17046 @option{-mpowerpc-gfxopt} allows GCC to
17047 use the optional PowerPC architecture instructions in the Graphics
17048 group, including floating-point select.
17050 The @option{-mmfcrf} option allows GCC to generate the move from
17051 condition register field instruction implemented on the POWER4
17052 processor and other processors that support the PowerPC V2.01
17053 architecture.
17054 The @option{-mpopcntb} option allows GCC to generate the popcount and
17055 double-precision FP reciprocal estimate instruction implemented on the
17056 POWER5 processor and other processors that support the PowerPC V2.02
17057 architecture.
17058 The @option{-mpopcntd} option allows GCC to generate the popcount
17059 instruction implemented on the POWER7 processor and other processors
17060 that support the PowerPC V2.06 architecture.
17061 The @option{-mfprnd} option allows GCC to generate the FP round to
17062 integer instructions implemented on the POWER5+ processor and other
17063 processors that support the PowerPC V2.03 architecture.
17064 The @option{-mcmpb} option allows GCC to generate the compare bytes
17065 instruction implemented on the POWER6 processor and other processors
17066 that support the PowerPC V2.05 architecture.
17067 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
17068 general-purpose register instructions implemented on the POWER6X
17069 processor and other processors that support the extended PowerPC V2.05
17070 architecture.
17071 The @option{-mhard-dfp} option allows GCC to generate the decimal
17072 floating-point instructions implemented on some POWER processors.
17074 The @option{-mpowerpc64} option allows GCC to generate the additional
17075 64-bit instructions that are found in the full PowerPC64 architecture
17076 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
17077 @option{-mno-powerpc64}.
17079 @item -mcpu=@var{cpu_type}
17080 @opindex mcpu
17081 Set architecture type, register usage, and
17082 instruction scheduling parameters for machine type @var{cpu_type}.
17083 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
17084 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
17085 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
17086 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
17087 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
17088 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
17089 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
17090 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
17091 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
17092 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{powerpc},
17093 @samp{powerpc64}, and @samp{rs64}.
17095 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
17096 PowerPC and 64-bit PowerPC architecture machine
17097 types, with an appropriate, generic processor model assumed for
17098 scheduling purposes.
17100 The other options specify a specific processor.  Code generated under
17101 those options runs best on that processor, and may not run at all on
17102 others.
17104 The @option{-mcpu} options automatically enable or disable the
17105 following options:
17107 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
17108 -mpopcntb -mpopcntd  -mpowerpc64 @gol
17109 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
17110 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
17112 The particular options set for any particular CPU varies between
17113 compiler versions, depending on what setting seems to produce optimal
17114 code for that CPU; it doesn't necessarily reflect the actual hardware's
17115 capabilities.  If you wish to set an individual option to a particular
17116 value, you may specify it after the @option{-mcpu} option, like
17117 @option{-mcpu=970 -mno-altivec}.
17119 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
17120 not enabled or disabled by the @option{-mcpu} option at present because
17121 AIX does not have full support for these options.  You may still
17122 enable or disable them individually if you're sure it'll work in your
17123 environment.
17125 @item -mtune=@var{cpu_type}
17126 @opindex mtune
17127 Set the instruction scheduling parameters for machine type
17128 @var{cpu_type}, but do not set the architecture type or register usage,
17129 as @option{-mcpu=@var{cpu_type}} does.  The same
17130 values for @var{cpu_type} are used for @option{-mtune} as for
17131 @option{-mcpu}.  If both are specified, the code generated uses the
17132 architecture and registers set by @option{-mcpu}, but the
17133 scheduling parameters set by @option{-mtune}.
17135 @item -mcmodel=small
17136 @opindex mcmodel=small
17137 Generate PowerPC64 code for the small model: The TOC is limited to
17138 64k.
17140 @item -mcmodel=medium
17141 @opindex mcmodel=medium
17142 Generate PowerPC64 code for the medium model: The TOC and other static
17143 data may be up to a total of 4G in size.
17145 @item -mcmodel=large
17146 @opindex mcmodel=large
17147 Generate PowerPC64 code for the large model: The TOC may be up to 4G
17148 in size.  Other data and code is only limited by the 64-bit address
17149 space.
17151 @item -maltivec
17152 @itemx -mno-altivec
17153 @opindex maltivec
17154 @opindex mno-altivec
17155 Generate code that uses (does not use) AltiVec instructions, and also
17156 enable the use of built-in functions that allow more direct access to
17157 the AltiVec instruction set.  You may also need to set
17158 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
17159 enhancements.
17161 @item -mvrsave
17162 @itemx -mno-vrsave
17163 @opindex mvrsave
17164 @opindex mno-vrsave
17165 Generate VRSAVE instructions when generating AltiVec code.
17167 @item -mgen-cell-microcode
17168 @opindex mgen-cell-microcode
17169 Generate Cell microcode instructions.
17171 @item -mwarn-cell-microcode
17172 @opindex mwarn-cell-microcode
17173 Warn when a Cell microcode instruction is emitted.  An example
17174 of a Cell microcode instruction is a variable shift.
17176 @item -msecure-plt
17177 @opindex msecure-plt
17178 Generate code that allows @command{ld} and @command{ld.so}
17179 to build executables and shared
17180 libraries with non-executable @code{.plt} and @code{.got} sections.
17181 This is a PowerPC
17182 32-bit SYSV ABI option.
17184 @item -mbss-plt
17185 @opindex mbss-plt
17186 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
17187 fills in, and
17188 requires @code{.plt} and @code{.got}
17189 sections that are both writable and executable.
17190 This is a PowerPC 32-bit SYSV ABI option.
17192 @item -misel
17193 @itemx -mno-isel
17194 @opindex misel
17195 @opindex mno-isel
17196 This switch enables or disables the generation of ISEL instructions.
17198 @item -misel=@var{yes/no}
17199 This switch has been deprecated.  Use @option{-misel} and
17200 @option{-mno-isel} instead.
17202 @item -mspe
17203 @itemx -mno-spe
17204 @opindex mspe
17205 @opindex mno-spe
17206 This switch enables or disables the generation of SPE simd
17207 instructions.
17209 @item -mpaired
17210 @itemx -mno-paired
17211 @opindex mpaired
17212 @opindex mno-paired
17213 This switch enables or disables the generation of PAIRED simd
17214 instructions.
17216 @item -mspe=@var{yes/no}
17217 This option has been deprecated.  Use @option{-mspe} and
17218 @option{-mno-spe} instead.
17220 @item -mvsx
17221 @itemx -mno-vsx
17222 @opindex mvsx
17223 @opindex mno-vsx
17224 Generate code that uses (does not use) vector/scalar (VSX)
17225 instructions, and also enable the use of built-in functions that allow
17226 more direct access to the VSX instruction set.
17228 @item -mfloat-gprs=@var{yes/single/double/no}
17229 @itemx -mfloat-gprs
17230 @opindex mfloat-gprs
17231 This switch enables or disables the generation of floating-point
17232 operations on the general-purpose registers for architectures that
17233 support it.
17235 The argument @var{yes} or @var{single} enables the use of
17236 single-precision floating-point operations.
17238 The argument @var{double} enables the use of single and
17239 double-precision floating-point operations.
17241 The argument @var{no} disables floating-point operations on the
17242 general-purpose registers.
17244 This option is currently only available on the MPC854x.
17246 @item -m32
17247 @itemx -m64
17248 @opindex m32
17249 @opindex m64
17250 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
17251 targets (including GNU/Linux).  The 32-bit environment sets int, long
17252 and pointer to 32 bits and generates code that runs on any PowerPC
17253 variant.  The 64-bit environment sets int to 32 bits and long and
17254 pointer to 64 bits, and generates code for PowerPC64, as for
17255 @option{-mpowerpc64}.
17257 @item -mfull-toc
17258 @itemx -mno-fp-in-toc
17259 @itemx -mno-sum-in-toc
17260 @itemx -mminimal-toc
17261 @opindex mfull-toc
17262 @opindex mno-fp-in-toc
17263 @opindex mno-sum-in-toc
17264 @opindex mminimal-toc
17265 Modify generation of the TOC (Table Of Contents), which is created for
17266 every executable file.  The @option{-mfull-toc} option is selected by
17267 default.  In that case, GCC allocates at least one TOC entry for
17268 each unique non-automatic variable reference in your program.  GCC
17269 also places floating-point constants in the TOC@.  However, only
17270 16,384 entries are available in the TOC@.
17272 If you receive a linker error message that saying you have overflowed
17273 the available TOC space, you can reduce the amount of TOC space used
17274 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
17275 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
17276 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
17277 generate code to calculate the sum of an address and a constant at
17278 run time instead of putting that sum into the TOC@.  You may specify one
17279 or both of these options.  Each causes GCC to produce very slightly
17280 slower and larger code at the expense of conserving TOC space.
17282 If you still run out of space in the TOC even when you specify both of
17283 these options, specify @option{-mminimal-toc} instead.  This option causes
17284 GCC to make only one TOC entry for every file.  When you specify this
17285 option, GCC produces code that is slower and larger but which
17286 uses extremely little TOC space.  You may wish to use this option
17287 only on files that contain less frequently-executed code.
17289 @item -maix64
17290 @itemx -maix32
17291 @opindex maix64
17292 @opindex maix32
17293 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
17294 @code{long} type, and the infrastructure needed to support them.
17295 Specifying @option{-maix64} implies @option{-mpowerpc64},
17296 while @option{-maix32} disables the 64-bit ABI and
17297 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
17299 @item -mxl-compat
17300 @itemx -mno-xl-compat
17301 @opindex mxl-compat
17302 @opindex mno-xl-compat
17303 Produce code that conforms more closely to IBM XL compiler semantics
17304 when using AIX-compatible ABI@.  Pass floating-point arguments to
17305 prototyped functions beyond the register save area (RSA) on the stack
17306 in addition to argument FPRs.  Do not assume that most significant
17307 double in 128-bit long double value is properly rounded when comparing
17308 values and converting to double.  Use XL symbol names for long double
17309 support routines.
17311 The AIX calling convention was extended but not initially documented to
17312 handle an obscure K&R C case of calling a function that takes the
17313 address of its arguments with fewer arguments than declared.  IBM XL
17314 compilers access floating-point arguments that do not fit in the
17315 RSA from the stack when a subroutine is compiled without
17316 optimization.  Because always storing floating-point arguments on the
17317 stack is inefficient and rarely needed, this option is not enabled by
17318 default and only is necessary when calling subroutines compiled by IBM
17319 XL compilers without optimization.
17321 @item -mpe
17322 @opindex mpe
17323 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
17324 application written to use message passing with special startup code to
17325 enable the application to run.  The system must have PE installed in the
17326 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
17327 must be overridden with the @option{-specs=} option to specify the
17328 appropriate directory location.  The Parallel Environment does not
17329 support threads, so the @option{-mpe} option and the @option{-pthread}
17330 option are incompatible.
17332 @item -malign-natural
17333 @itemx -malign-power
17334 @opindex malign-natural
17335 @opindex malign-power
17336 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
17337 @option{-malign-natural} overrides the ABI-defined alignment of larger
17338 types, such as floating-point doubles, on their natural size-based boundary.
17339 The option @option{-malign-power} instructs GCC to follow the ABI-specified
17340 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
17342 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
17343 is not supported.
17345 @item -msoft-float
17346 @itemx -mhard-float
17347 @opindex msoft-float
17348 @opindex mhard-float
17349 Generate code that does not use (uses) the floating-point register set.
17350 Software floating-point emulation is provided if you use the
17351 @option{-msoft-float} option, and pass the option to GCC when linking.
17353 @item -msingle-float
17354 @itemx -mdouble-float
17355 @opindex msingle-float
17356 @opindex mdouble-float
17357 Generate code for single- or double-precision floating-point operations.
17358 @option{-mdouble-float} implies @option{-msingle-float}.
17360 @item -msimple-fpu
17361 @opindex msimple-fpu
17362 Do not generate @code{sqrt} and @code{div} instructions for hardware
17363 floating-point unit.
17365 @item -mfpu=@var{name}
17366 @opindex mfpu
17367 Specify type of floating-point unit.  Valid values for @var{name} are
17368 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
17369 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
17370 @samp{sp_full} (equivalent to @option{-msingle-float}),
17371 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17373 @item -mxilinx-fpu
17374 @opindex mxilinx-fpu
17375 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17377 @item -mmultiple
17378 @itemx -mno-multiple
17379 @opindex mmultiple
17380 @opindex mno-multiple
17381 Generate code that uses (does not use) the load multiple word
17382 instructions and the store multiple word instructions.  These
17383 instructions are generated by default on POWER systems, and not
17384 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17385 PowerPC systems, since those instructions do not work when the
17386 processor is in little-endian mode.  The exceptions are PPC740 and
17387 PPC750 which permit these instructions in little-endian mode.
17389 @item -mstring
17390 @itemx -mno-string
17391 @opindex mstring
17392 @opindex mno-string
17393 Generate code that uses (does not use) the load string instructions
17394 and the store string word instructions to save multiple registers and
17395 do small block moves.  These instructions are generated by default on
17396 POWER systems, and not generated on PowerPC systems.  Do not use
17397 @option{-mstring} on little-endian PowerPC systems, since those
17398 instructions do not work when the processor is in little-endian mode.
17399 The exceptions are PPC740 and PPC750 which permit these instructions
17400 in little-endian mode.
17402 @item -mupdate
17403 @itemx -mno-update
17404 @opindex mupdate
17405 @opindex mno-update
17406 Generate code that uses (does not use) the load or store instructions
17407 that update the base register to the address of the calculated memory
17408 location.  These instructions are generated by default.  If you use
17409 @option{-mno-update}, there is a small window between the time that the
17410 stack pointer is updated and the address of the previous frame is
17411 stored, which means code that walks the stack frame across interrupts or
17412 signals may get corrupted data.
17414 @item -mavoid-indexed-addresses
17415 @itemx -mno-avoid-indexed-addresses
17416 @opindex mavoid-indexed-addresses
17417 @opindex mno-avoid-indexed-addresses
17418 Generate code that tries to avoid (not avoid) the use of indexed load
17419 or store instructions. These instructions can incur a performance
17420 penalty on Power6 processors in certain situations, such as when
17421 stepping through large arrays that cross a 16M boundary.  This option
17422 is enabled by default when targeting Power6 and disabled otherwise.
17424 @item -mfused-madd
17425 @itemx -mno-fused-madd
17426 @opindex mfused-madd
17427 @opindex mno-fused-madd
17428 Generate code that uses (does not use) the floating-point multiply and
17429 accumulate instructions.  These instructions are generated by default
17430 if hardware floating point is used.  The machine-dependent
17431 @option{-mfused-madd} option is now mapped to the machine-independent
17432 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
17433 mapped to @option{-ffp-contract=off}.
17435 @item -mmulhw
17436 @itemx -mno-mulhw
17437 @opindex mmulhw
17438 @opindex mno-mulhw
17439 Generate code that uses (does not use) the half-word multiply and
17440 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
17441 These instructions are generated by default when targeting those
17442 processors.
17444 @item -mdlmzb
17445 @itemx -mno-dlmzb
17446 @opindex mdlmzb
17447 @opindex mno-dlmzb
17448 Generate code that uses (does not use) the string-search @samp{dlmzb}
17449 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
17450 generated by default when targeting those processors.
17452 @item -mno-bit-align
17453 @itemx -mbit-align
17454 @opindex mno-bit-align
17455 @opindex mbit-align
17456 On System V.4 and embedded PowerPC systems do not (do) force structures
17457 and unions that contain bit-fields to be aligned to the base type of the
17458 bit-field.
17460 For example, by default a structure containing nothing but 8
17461 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17462 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17463 the structure is aligned to a 1-byte boundary and is 1 byte in
17464 size.
17466 @item -mno-strict-align
17467 @itemx -mstrict-align
17468 @opindex mno-strict-align
17469 @opindex mstrict-align
17470 On System V.4 and embedded PowerPC systems do not (do) assume that
17471 unaligned memory references are handled by the system.
17473 @item -mrelocatable
17474 @itemx -mno-relocatable
17475 @opindex mrelocatable
17476 @opindex mno-relocatable
17477 Generate code that allows (does not allow) a static executable to be
17478 relocated to a different address at run time.  A simple embedded
17479 PowerPC system loader should relocate the entire contents of
17480 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17481 a table of 32-bit addresses generated by this option.  For this to
17482 work, all objects linked together must be compiled with
17483 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17484 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17486 @item -mrelocatable-lib
17487 @itemx -mno-relocatable-lib
17488 @opindex mrelocatable-lib
17489 @opindex mno-relocatable-lib
17490 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
17491 @code{.fixup} section to allow static executables to be relocated at
17492 run time, but @option{-mrelocatable-lib} does not use the smaller stack
17493 alignment of @option{-mrelocatable}.  Objects compiled with
17494 @option{-mrelocatable-lib} may be linked with objects compiled with
17495 any combination of the @option{-mrelocatable} options.
17497 @item -mno-toc
17498 @itemx -mtoc
17499 @opindex mno-toc
17500 @opindex mtoc
17501 On System V.4 and embedded PowerPC systems do not (do) assume that
17502 register 2 contains a pointer to a global area pointing to the addresses
17503 used in the program.
17505 @item -mlittle
17506 @itemx -mlittle-endian
17507 @opindex mlittle
17508 @opindex mlittle-endian
17509 On System V.4 and embedded PowerPC systems compile code for the
17510 processor in little-endian mode.  The @option{-mlittle-endian} option is
17511 the same as @option{-mlittle}.
17513 @item -mbig
17514 @itemx -mbig-endian
17515 @opindex mbig
17516 @opindex mbig-endian
17517 On System V.4 and embedded PowerPC systems compile code for the
17518 processor in big-endian mode.  The @option{-mbig-endian} option is
17519 the same as @option{-mbig}.
17521 @item -mdynamic-no-pic
17522 @opindex mdynamic-no-pic
17523 On Darwin and Mac OS X systems, compile code so that it is not
17524 relocatable, but that its external references are relocatable.  The
17525 resulting code is suitable for applications, but not shared
17526 libraries.
17528 @item -msingle-pic-base
17529 @opindex msingle-pic-base
17530 Treat the register used for PIC addressing as read-only, rather than
17531 loading it in the prologue for each function.  The runtime system is
17532 responsible for initializing this register with an appropriate value
17533 before execution begins.
17535 @item -mprioritize-restricted-insns=@var{priority}
17536 @opindex mprioritize-restricted-insns
17537 This option controls the priority that is assigned to
17538 dispatch-slot restricted instructions during the second scheduling
17539 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
17540 or @samp{2} to assign no, highest, or second-highest (respectively) 
17541 priority to dispatch-slot restricted
17542 instructions.
17544 @item -msched-costly-dep=@var{dependence_type}
17545 @opindex msched-costly-dep
17546 This option controls which dependences are considered costly
17547 by the target during instruction scheduling.  The argument
17548 @var{dependence_type} takes one of the following values:
17550 @table @asis
17551 @item @samp{no}
17552 No dependence is costly.
17554 @item @samp{all}
17555 All dependences are costly.
17557 @item @samp{true_store_to_load}
17558 A true dependence from store to load is costly.
17560 @item @samp{store_to_load}
17561 Any dependence from store to load is costly.
17563 @item @var{number}
17564 Any dependence for which the latency is greater than or equal to 
17565 @var{number} is costly.
17566 @end table
17568 @item -minsert-sched-nops=@var{scheme}
17569 @opindex minsert-sched-nops
17570 This option controls which NOP insertion scheme is used during
17571 the second scheduling pass.  The argument @var{scheme} takes one of the
17572 following values:
17574 @table @asis
17575 @item @samp{no}
17576 Don't insert NOPs.
17578 @item @samp{pad}
17579 Pad with NOPs any dispatch group that has vacant issue slots,
17580 according to the scheduler's grouping.
17582 @item @samp{regroup_exact}
17583 Insert NOPs to force costly dependent insns into
17584 separate groups.  Insert exactly as many NOPs as needed to force an insn
17585 to a new group, according to the estimated processor grouping.
17587 @item @var{number}
17588 Insert NOPs to force costly dependent insns into
17589 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
17590 @end table
17592 @item -mcall-sysv
17593 @opindex mcall-sysv
17594 On System V.4 and embedded PowerPC systems compile code using calling
17595 conventions that adhere to the March 1995 draft of the System V
17596 Application Binary Interface, PowerPC processor supplement.  This is the
17597 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
17599 @item -mcall-sysv-eabi
17600 @itemx -mcall-eabi
17601 @opindex mcall-sysv-eabi
17602 @opindex mcall-eabi
17603 Specify both @option{-mcall-sysv} and @option{-meabi} options.
17605 @item -mcall-sysv-noeabi
17606 @opindex mcall-sysv-noeabi
17607 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
17609 @item -mcall-aixdesc
17610 @opindex m
17611 On System V.4 and embedded PowerPC systems compile code for the AIX
17612 operating system.
17614 @item -mcall-linux
17615 @opindex mcall-linux
17616 On System V.4 and embedded PowerPC systems compile code for the
17617 Linux-based GNU system.
17619 @item -mcall-freebsd
17620 @opindex mcall-freebsd
17621 On System V.4 and embedded PowerPC systems compile code for the
17622 FreeBSD operating system.
17624 @item -mcall-netbsd
17625 @opindex mcall-netbsd
17626 On System V.4 and embedded PowerPC systems compile code for the
17627 NetBSD operating system.
17629 @item -mcall-openbsd
17630 @opindex mcall-netbsd
17631 On System V.4 and embedded PowerPC systems compile code for the
17632 OpenBSD operating system.
17634 @item -maix-struct-return
17635 @opindex maix-struct-return
17636 Return all structures in memory (as specified by the AIX ABI)@.
17638 @item -msvr4-struct-return
17639 @opindex msvr4-struct-return
17640 Return structures smaller than 8 bytes in registers (as specified by the
17641 SVR4 ABI)@.
17643 @item -mabi=@var{abi-type}
17644 @opindex mabi
17645 Extend the current ABI with a particular extension, or remove such extension.
17646 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
17647 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
17649 @item -mabi=spe
17650 @opindex mabi=spe
17651 Extend the current ABI with SPE ABI extensions.  This does not change
17652 the default ABI, instead it adds the SPE ABI extensions to the current
17653 ABI@.
17655 @item -mabi=no-spe
17656 @opindex mabi=no-spe
17657 Disable Book-E SPE ABI extensions for the current ABI@.
17659 @item -mabi=ibmlongdouble
17660 @opindex mabi=ibmlongdouble
17661 Change the current ABI to use IBM extended-precision long double.
17662 This is a PowerPC 32-bit SYSV ABI option.
17664 @item -mabi=ieeelongdouble
17665 @opindex mabi=ieeelongdouble
17666 Change the current ABI to use IEEE extended-precision long double.
17667 This is a PowerPC 32-bit Linux ABI option.
17669 @item -mprototype
17670 @itemx -mno-prototype
17671 @opindex mprototype
17672 @opindex mno-prototype
17673 On System V.4 and embedded PowerPC systems assume that all calls to
17674 variable argument functions are properly prototyped.  Otherwise, the
17675 compiler must insert an instruction before every non-prototyped call to
17676 set or clear bit 6 of the condition code register (@var{CR}) to
17677 indicate whether floating-point values are passed in the floating-point
17678 registers in case the function takes variable arguments.  With
17679 @option{-mprototype}, only calls to prototyped variable argument functions
17680 set or clear the bit.
17682 @item -msim
17683 @opindex msim
17684 On embedded PowerPC systems, assume that the startup module is called
17685 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
17686 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
17687 configurations.
17689 @item -mmvme
17690 @opindex mmvme
17691 On embedded PowerPC systems, assume that the startup module is called
17692 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
17693 @file{libc.a}.
17695 @item -mads
17696 @opindex mads
17697 On embedded PowerPC systems, assume that the startup module is called
17698 @file{crt0.o} and the standard C libraries are @file{libads.a} and
17699 @file{libc.a}.
17701 @item -myellowknife
17702 @opindex myellowknife
17703 On embedded PowerPC systems, assume that the startup module is called
17704 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
17705 @file{libc.a}.
17707 @item -mvxworks
17708 @opindex mvxworks
17709 On System V.4 and embedded PowerPC systems, specify that you are
17710 compiling for a VxWorks system.
17712 @item -memb
17713 @opindex memb
17714 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
17715 header to indicate that @samp{eabi} extended relocations are used.
17717 @item -meabi
17718 @itemx -mno-eabi
17719 @opindex meabi
17720 @opindex mno-eabi
17721 On System V.4 and embedded PowerPC systems do (do not) adhere to the
17722 Embedded Applications Binary Interface (EABI), which is a set of
17723 modifications to the System V.4 specifications.  Selecting @option{-meabi}
17724 means that the stack is aligned to an 8-byte boundary, a function
17725 @code{__eabi} is called from @code{main} to set up the EABI
17726 environment, and the @option{-msdata} option can use both @code{r2} and
17727 @code{r13} to point to two separate small data areas.  Selecting
17728 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
17729 no EABI initialization function is called from @code{main}, and the
17730 @option{-msdata} option only uses @code{r13} to point to a single
17731 small data area.  The @option{-meabi} option is on by default if you
17732 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
17734 @item -msdata=eabi
17735 @opindex msdata=eabi
17736 On System V.4 and embedded PowerPC systems, put small initialized
17737 @code{const} global and static data in the @samp{.sdata2} section, which
17738 is pointed to by register @code{r2}.  Put small initialized
17739 non-@code{const} global and static data in the @samp{.sdata} section,
17740 which is pointed to by register @code{r13}.  Put small uninitialized
17741 global and static data in the @samp{.sbss} section, which is adjacent to
17742 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
17743 incompatible with the @option{-mrelocatable} option.  The
17744 @option{-msdata=eabi} option also sets the @option{-memb} option.
17746 @item -msdata=sysv
17747 @opindex msdata=sysv
17748 On System V.4 and embedded PowerPC systems, put small global and static
17749 data in the @samp{.sdata} section, which is pointed to by register
17750 @code{r13}.  Put small uninitialized global and static data in the
17751 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
17752 The @option{-msdata=sysv} option is incompatible with the
17753 @option{-mrelocatable} option.
17755 @item -msdata=default
17756 @itemx -msdata
17757 @opindex msdata=default
17758 @opindex msdata
17759 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
17760 compile code the same as @option{-msdata=eabi}, otherwise compile code the
17761 same as @option{-msdata=sysv}.
17763 @item -msdata=data
17764 @opindex msdata=data
17765 On System V.4 and embedded PowerPC systems, put small global
17766 data in the @samp{.sdata} section.  Put small uninitialized global
17767 data in the @samp{.sbss} section.  Do not use register @code{r13}
17768 to address small data however.  This is the default behavior unless
17769 other @option{-msdata} options are used.
17771 @item -msdata=none
17772 @itemx -mno-sdata
17773 @opindex msdata=none
17774 @opindex mno-sdata
17775 On embedded PowerPC systems, put all initialized global and static data
17776 in the @samp{.data} section, and all uninitialized data in the
17777 @samp{.bss} section.
17779 @item -mblock-move-inline-limit=@var{num}
17780 @opindex mblock-move-inline-limit
17781 Inline all block moves (such as calls to @code{memcpy} or structure
17782 copies) less than or equal to @var{num} bytes.  The minimum value for
17783 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
17784 targets.  The default value is target-specific.
17786 @item -G @var{num}
17787 @opindex G
17788 @cindex smaller data references (PowerPC)
17789 @cindex .sdata/.sdata2 references (PowerPC)
17790 On embedded PowerPC systems, put global and static items less than or
17791 equal to @var{num} bytes into the small data or BSS sections instead of
17792 the normal data or BSS section.  By default, @var{num} is 8.  The
17793 @option{-G @var{num}} switch is also passed to the linker.
17794 All modules should be compiled with the same @option{-G @var{num}} value.
17796 @item -mregnames
17797 @itemx -mno-regnames
17798 @opindex mregnames
17799 @opindex mno-regnames
17800 On System V.4 and embedded PowerPC systems do (do not) emit register
17801 names in the assembly language output using symbolic forms.
17803 @item -mlongcall
17804 @itemx -mno-longcall
17805 @opindex mlongcall
17806 @opindex mno-longcall
17807 By default assume that all calls are far away so that a longer and more
17808 expensive calling sequence is required.  This is required for calls
17809 farther than 32 megabytes (33,554,432 bytes) from the current location.
17810 A short call is generated if the compiler knows
17811 the call cannot be that far away.  This setting can be overridden by
17812 the @code{shortcall} function attribute, or by @code{#pragma
17813 longcall(0)}.
17815 Some linkers are capable of detecting out-of-range calls and generating
17816 glue code on the fly.  On these systems, long calls are unnecessary and
17817 generate slower code.  As of this writing, the AIX linker can do this,
17818 as can the GNU linker for PowerPC/64.  It is planned to add this feature
17819 to the GNU linker for 32-bit PowerPC systems as well.
17821 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
17822 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
17823 addresses represent the callee and the branch island.  The
17824 Darwin/PPC linker prefers the first address and generates a @code{bl
17825 callee} if the PPC @code{bl} instruction reaches the callee directly;
17826 otherwise, the linker generates @code{bl L42} to call the branch
17827 island.  The branch island is appended to the body of the
17828 calling function; it computes the full 32-bit address of the callee
17829 and jumps to it.
17831 On Mach-O (Darwin) systems, this option directs the compiler emit to
17832 the glue for every direct call, and the Darwin linker decides whether
17833 to use or discard it.
17835 In the future, GCC may ignore all longcall specifications
17836 when the linker is known to generate glue.
17838 @item -mtls-markers
17839 @itemx -mno-tls-markers
17840 @opindex mtls-markers
17841 @opindex mno-tls-markers
17842 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
17843 specifying the function argument.  The relocation allows the linker to
17844 reliably associate function call with argument setup instructions for
17845 TLS optimization, which in turn allows GCC to better schedule the
17846 sequence.
17848 @item -pthread
17849 @opindex pthread
17850 Adds support for multithreading with the @dfn{pthreads} library.
17851 This option sets flags for both the preprocessor and linker.
17853 @item -mrecip
17854 @itemx -mno-recip
17855 @opindex mrecip
17856 This option enables use of the reciprocal estimate and
17857 reciprocal square root estimate instructions with additional
17858 Newton-Raphson steps to increase precision instead of doing a divide or
17859 square root and divide for floating-point arguments.  You should use
17860 the @option{-ffast-math} option when using @option{-mrecip} (or at
17861 least @option{-funsafe-math-optimizations},
17862 @option{-finite-math-only}, @option{-freciprocal-math} and
17863 @option{-fno-trapping-math}).  Note that while the throughput of the
17864 sequence is generally higher than the throughput of the non-reciprocal
17865 instruction, the precision of the sequence can be decreased by up to 2
17866 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
17867 roots.
17869 @item -mrecip=@var{opt}
17870 @opindex mrecip=opt
17871 This option controls which reciprocal estimate instructions
17872 may be used.  @var{opt} is a comma-separated list of options, which may
17873 be preceded by a @code{!} to invert the option:
17874 @code{all}: enable all estimate instructions,
17875 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
17876 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
17877 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
17878 @code{divf}: enable the single-precision reciprocal approximation instructions;
17879 @code{divd}: enable the double-precision reciprocal approximation instructions;
17880 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
17881 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
17882 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
17884 So, for example, @option{-mrecip=all,!rsqrtd} enables
17885 all of the reciprocal estimate instructions, except for the
17886 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
17887 which handle the double-precision reciprocal square root calculations.
17889 @item -mrecip-precision
17890 @itemx -mno-recip-precision
17891 @opindex mrecip-precision
17892 Assume (do not assume) that the reciprocal estimate instructions
17893 provide higher-precision estimates than is mandated by the PowerPC
17894 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
17895 automatically selects @option{-mrecip-precision}.  The double-precision 
17896 square root estimate instructions are not generated by
17897 default on low-precision machines, since they do not provide an
17898 estimate that converges after three steps.
17900 @item -mveclibabi=@var{type}
17901 @opindex mveclibabi
17902 Specifies the ABI type to use for vectorizing intrinsics using an
17903 external library.  The only type supported at present is @code{mass},
17904 which specifies to use IBM's Mathematical Acceleration Subsystem
17905 (MASS) libraries for vectorizing intrinsics using external libraries.
17906 GCC currently emits calls to @code{acosd2}, @code{acosf4},
17907 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
17908 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
17909 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
17910 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
17911 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
17912 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
17913 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
17914 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
17915 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
17916 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
17917 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
17918 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
17919 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
17920 for power7.  Both @option{-ftree-vectorize} and
17921 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
17922 libraries must be specified at link time.
17924 @item -mfriz
17925 @itemx -mno-friz
17926 @opindex mfriz
17927 Generate (do not generate) the @code{friz} instruction when the
17928 @option{-funsafe-math-optimizations} option is used to optimize
17929 rounding of floating-point values to 64-bit integer and back to floating
17930 point.  The @code{friz} instruction does not return the same value if
17931 the floating-point number is too large to fit in an integer.
17933 @item -mpointers-to-nested-functions
17934 @itemx -mno-pointers-to-nested-functions
17935 @opindex mpointers-to-nested-functions
17936 Generate (do not generate) code to load up the static chain register
17937 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
17938 systems where a function pointer points to a 3-word descriptor giving
17939 the function address, TOC value to be loaded in register @var{r2}, and
17940 static chain value to be loaded in register @var{r11}.  The
17941 @option{-mpointers-to-nested-functions} is on by default.  You cannot
17942 call through pointers to nested functions or pointers
17943 to functions compiled in other languages that use the static chain if
17944 you use the @option{-mno-pointers-to-nested-functions}.
17946 @item -msave-toc-indirect
17947 @itemx -mno-save-toc-indirect
17948 @opindex msave-toc-indirect
17949 Generate (do not generate) code to save the TOC value in the reserved
17950 stack location in the function prologue if the function calls through
17951 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
17952 saved in the prologue, it is saved just before the call through the
17953 pointer.  The @option{-mno-save-toc-indirect} option is the default.
17954 @end table
17956 @node RX Options
17957 @subsection RX Options
17958 @cindex RX Options
17960 These command-line options are defined for RX targets:
17962 @table @gcctabopt
17963 @item -m64bit-doubles
17964 @itemx -m32bit-doubles
17965 @opindex m64bit-doubles
17966 @opindex m32bit-doubles
17967 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
17968 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
17969 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
17970 works on 32-bit values, which is why the default is
17971 @option{-m32bit-doubles}.
17973 @item -fpu
17974 @itemx -nofpu
17975 @opindex fpu
17976 @opindex nofpu
17977 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
17978 floating-point hardware.  The default is enabled for the @var{RX600}
17979 series and disabled for the @var{RX200} series.
17981 Floating-point instructions are only generated for 32-bit floating-point 
17982 values, however, so the FPU hardware is not used for doubles if the
17983 @option{-m64bit-doubles} option is used.
17985 @emph{Note} If the @option{-fpu} option is enabled then
17986 @option{-funsafe-math-optimizations} is also enabled automatically.
17987 This is because the RX FPU instructions are themselves unsafe.
17989 @item -mcpu=@var{name}
17990 @opindex -mcpu
17991 Selects the type of RX CPU to be targeted.  Currently three types are
17992 supported, the generic @var{RX600} and @var{RX200} series hardware and
17993 the specific @var{RX610} CPU.  The default is @var{RX600}.
17995 The only difference between @var{RX600} and @var{RX610} is that the
17996 @var{RX610} does not support the @code{MVTIPL} instruction.
17998 The @var{RX200} series does not have a hardware floating-point unit
17999 and so @option{-nofpu} is enabled by default when this type is
18000 selected.
18002 @item -mbig-endian-data
18003 @itemx -mlittle-endian-data
18004 @opindex mbig-endian-data
18005 @opindex mlittle-endian-data
18006 Store data (but not code) in the big-endian format.  The default is
18007 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
18008 format.
18010 @item -msmall-data-limit=@var{N}
18011 @opindex msmall-data-limit
18012 Specifies the maximum size in bytes of global and static variables
18013 which can be placed into the small data area.  Using the small data
18014 area can lead to smaller and faster code, but the size of area is
18015 limited and it is up to the programmer to ensure that the area does
18016 not overflow.  Also when the small data area is used one of the RX's
18017 registers (usually @code{r13}) is reserved for use pointing to this
18018 area, so it is no longer available for use by the compiler.  This
18019 could result in slower and/or larger code if variables are pushed onto
18020 the stack instead of being held in this register.
18022 Note, common variables (variables that have not been initialized) and
18023 constants are not placed into the small data area as they are assigned
18024 to other sections in the output executable.
18026 The default value is zero, which disables this feature.  Note, this
18027 feature is not enabled by default with higher optimization levels
18028 (@option{-O2} etc) because of the potentially detrimental effects of
18029 reserving a register.  It is up to the programmer to experiment and
18030 discover whether this feature is of benefit to their program.  See the
18031 description of the @option{-mpid} option for a description of how the
18032 actual register to hold the small data area pointer is chosen.
18034 @item -msim
18035 @itemx -mno-sim
18036 @opindex msim
18037 @opindex mno-sim
18038 Use the simulator runtime.  The default is to use the libgloss
18039 board-specific runtime.
18041 @item -mas100-syntax
18042 @itemx -mno-as100-syntax
18043 @opindex mas100-syntax
18044 @opindex mno-as100-syntax
18045 When generating assembler output use a syntax that is compatible with
18046 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
18047 assembler, but it has some restrictions so it is not generated by default.
18049 @item -mmax-constant-size=@var{N}
18050 @opindex mmax-constant-size
18051 Specifies the maximum size, in bytes, of a constant that can be used as
18052 an operand in a RX instruction.  Although the RX instruction set does
18053 allow constants of up to 4 bytes in length to be used in instructions,
18054 a longer value equates to a longer instruction.  Thus in some
18055 circumstances it can be beneficial to restrict the size of constants
18056 that are used in instructions.  Constants that are too big are instead
18057 placed into a constant pool and referenced via register indirection.
18059 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
18060 or 4 means that constants of any size are allowed.
18062 @item -mrelax
18063 @opindex mrelax
18064 Enable linker relaxation.  Linker relaxation is a process whereby the
18065 linker attempts to reduce the size of a program by finding shorter
18066 versions of various instructions.  Disabled by default.
18068 @item -mint-register=@var{N}
18069 @opindex mint-register
18070 Specify the number of registers to reserve for fast interrupt handler
18071 functions.  The value @var{N} can be between 0 and 4.  A value of 1
18072 means that register @code{r13} is reserved for the exclusive use
18073 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
18074 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
18075 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
18076 A value of 0, the default, does not reserve any registers.
18078 @item -msave-acc-in-interrupts
18079 @opindex msave-acc-in-interrupts
18080 Specifies that interrupt handler functions should preserve the
18081 accumulator register.  This is only necessary if normal code might use
18082 the accumulator register, for example because it performs 64-bit
18083 multiplications.  The default is to ignore the accumulator as this
18084 makes the interrupt handlers faster.
18086 @item -mpid
18087 @itemx -mno-pid
18088 @opindex mpid
18089 @opindex mno-pid
18090 Enables the generation of position independent data.  When enabled any
18091 access to constant data is done via an offset from a base address
18092 held in a register.  This allows the location of constant data to be
18093 determined at run time without requiring the executable to be
18094 relocated, which is a benefit to embedded applications with tight
18095 memory constraints.  Data that can be modified is not affected by this
18096 option.
18098 Note, using this feature reserves a register, usually @code{r13}, for
18099 the constant data base address.  This can result in slower and/or
18100 larger code, especially in complicated functions.
18102 The actual register chosen to hold the constant data base address
18103 depends upon whether the @option{-msmall-data-limit} and/or the
18104 @option{-mint-register} command-line options are enabled.  Starting
18105 with register @code{r13} and proceeding downwards, registers are
18106 allocated first to satisfy the requirements of @option{-mint-register},
18107 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
18108 is possible for the small data area register to be @code{r8} if both
18109 @option{-mint-register=4} and @option{-mpid} are specified on the
18110 command line.
18112 By default this feature is not enabled.  The default can be restored
18113 via the @option{-mno-pid} command-line option.
18115 @item -mno-warn-multiple-fast-interrupts
18116 @itemx -mwarn-multiple-fast-interrupts
18117 @opindex mno-warn-multiple-fast-interrupts
18118 @opindex mwarn-multiple-fast-interrupts
18119 Prevents GCC from issuing a warning message if it finds more than one
18120 fast interrupt handler when it is compiling a file.  The default is to
18121 issue a warning for each extra fast interrupt handler found, as the RX
18122 only supports one such interrupt.
18124 @end table
18126 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
18127 has special significance to the RX port when used with the
18128 @code{interrupt} function attribute.  This attribute indicates a
18129 function intended to process fast interrupts.  GCC ensures
18130 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
18131 and/or @code{r13} and only provided that the normal use of the
18132 corresponding registers have been restricted via the
18133 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
18134 options.
18136 @node S/390 and zSeries Options
18137 @subsection S/390 and zSeries Options
18138 @cindex S/390 and zSeries Options
18140 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
18142 @table @gcctabopt
18143 @item -mhard-float
18144 @itemx -msoft-float
18145 @opindex mhard-float
18146 @opindex msoft-float
18147 Use (do not use) the hardware floating-point instructions and registers
18148 for floating-point operations.  When @option{-msoft-float} is specified,
18149 functions in @file{libgcc.a} are used to perform floating-point
18150 operations.  When @option{-mhard-float} is specified, the compiler
18151 generates IEEE floating-point instructions.  This is the default.
18153 @item -mhard-dfp
18154 @itemx -mno-hard-dfp
18155 @opindex mhard-dfp
18156 @opindex mno-hard-dfp
18157 Use (do not use) the hardware decimal-floating-point instructions for
18158 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
18159 specified, functions in @file{libgcc.a} are used to perform
18160 decimal-floating-point operations.  When @option{-mhard-dfp} is
18161 specified, the compiler generates decimal-floating-point hardware
18162 instructions.  This is the default for @option{-march=z9-ec} or higher.
18164 @item -mlong-double-64
18165 @itemx -mlong-double-128
18166 @opindex mlong-double-64
18167 @opindex mlong-double-128
18168 These switches control the size of @code{long double} type. A size
18169 of 64 bits makes the @code{long double} type equivalent to the @code{double}
18170 type. This is the default.
18172 @item -mbackchain
18173 @itemx -mno-backchain
18174 @opindex mbackchain
18175 @opindex mno-backchain
18176 Store (do not store) the address of the caller's frame as backchain pointer
18177 into the callee's stack frame.
18178 A backchain may be needed to allow debugging using tools that do not understand
18179 DWARF 2 call frame information.
18180 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
18181 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
18182 the backchain is placed into the topmost word of the 96/160 byte register
18183 save area.
18185 In general, code compiled with @option{-mbackchain} is call-compatible with
18186 code compiled with @option{-mmo-backchain}; however, use of the backchain
18187 for debugging purposes usually requires that the whole binary is built with
18188 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
18189 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18190 to build a linux kernel use @option{-msoft-float}.
18192 The default is to not maintain the backchain.
18194 @item -mpacked-stack
18195 @itemx -mno-packed-stack
18196 @opindex mpacked-stack
18197 @opindex mno-packed-stack
18198 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
18199 specified, the compiler uses the all fields of the 96/160 byte register save
18200 area only for their default purpose; unused fields still take up stack space.
18201 When @option{-mpacked-stack} is specified, register save slots are densely
18202 packed at the top of the register save area; unused space is reused for other
18203 purposes, allowing for more efficient use of the available stack space.
18204 However, when @option{-mbackchain} is also in effect, the topmost word of
18205 the save area is always used to store the backchain, and the return address
18206 register is always saved two words below the backchain.
18208 As long as the stack frame backchain is not used, code generated with
18209 @option{-mpacked-stack} is call-compatible with code generated with
18210 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
18211 S/390 or zSeries generated code that uses the stack frame backchain at run
18212 time, not just for debugging purposes.  Such code is not call-compatible
18213 with code compiled with @option{-mpacked-stack}.  Also, note that the
18214 combination of @option{-mbackchain},
18215 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18216 to build a linux kernel use @option{-msoft-float}.
18218 The default is to not use the packed stack layout.
18220 @item -msmall-exec
18221 @itemx -mno-small-exec
18222 @opindex msmall-exec
18223 @opindex mno-small-exec
18224 Generate (or do not generate) code using the @code{bras} instruction
18225 to do subroutine calls.
18226 This only works reliably if the total executable size does not
18227 exceed 64k.  The default is to use the @code{basr} instruction instead,
18228 which does not have this limitation.
18230 @item -m64
18231 @itemx -m31
18232 @opindex m64
18233 @opindex m31
18234 When @option{-m31} is specified, generate code compliant to the
18235 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
18236 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
18237 particular to generate 64-bit instructions.  For the @samp{s390}
18238 targets, the default is @option{-m31}, while the @samp{s390x}
18239 targets default to @option{-m64}.
18241 @item -mzarch
18242 @itemx -mesa
18243 @opindex mzarch
18244 @opindex mesa
18245 When @option{-mzarch} is specified, generate code using the
18246 instructions available on z/Architecture.
18247 When @option{-mesa} is specified, generate code using the
18248 instructions available on ESA/390.  Note that @option{-mesa} is
18249 not possible with @option{-m64}.
18250 When generating code compliant to the GNU/Linux for S/390 ABI,
18251 the default is @option{-mesa}.  When generating code compliant
18252 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
18254 @item -mmvcle
18255 @itemx -mno-mvcle
18256 @opindex mmvcle
18257 @opindex mno-mvcle
18258 Generate (or do not generate) code using the @code{mvcle} instruction
18259 to perform block moves.  When @option{-mno-mvcle} is specified,
18260 use a @code{mvc} loop instead.  This is the default unless optimizing for
18261 size.
18263 @item -mdebug
18264 @itemx -mno-debug
18265 @opindex mdebug
18266 @opindex mno-debug
18267 Print (or do not print) additional debug information when compiling.
18268 The default is to not print debug information.
18270 @item -march=@var{cpu-type}
18271 @opindex march
18272 Generate code that runs on @var{cpu-type}, which is the name of a system
18273 representing a certain processor type.  Possible values for
18274 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
18275 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
18276 When generating code using the instructions available on z/Architecture,
18277 the default is @option{-march=z900}.  Otherwise, the default is
18278 @option{-march=g5}.
18280 @item -mtune=@var{cpu-type}
18281 @opindex mtune
18282 Tune to @var{cpu-type} everything applicable about the generated code,
18283 except for the ABI and the set of available instructions.
18284 The list of @var{cpu-type} values is the same as for @option{-march}.
18285 The default is the value used for @option{-march}.
18287 @item -mtpf-trace
18288 @itemx -mno-tpf-trace
18289 @opindex mtpf-trace
18290 @opindex mno-tpf-trace
18291 Generate code that adds (does not add) in TPF OS specific branches to trace
18292 routines in the operating system.  This option is off by default, even
18293 when compiling for the TPF OS@.
18295 @item -mfused-madd
18296 @itemx -mno-fused-madd
18297 @opindex mfused-madd
18298 @opindex mno-fused-madd
18299 Generate code that uses (does not use) the floating-point multiply and
18300 accumulate instructions.  These instructions are generated by default if
18301 hardware floating point is used.
18303 @item -mwarn-framesize=@var{framesize}
18304 @opindex mwarn-framesize
18305 Emit a warning if the current function exceeds the given frame size.  Because
18306 this is a compile-time check it doesn't need to be a real problem when the program
18307 runs.  It is intended to identify functions that most probably cause
18308 a stack overflow.  It is useful to be used in an environment with limited stack
18309 size e.g.@: the linux kernel.
18311 @item -mwarn-dynamicstack
18312 @opindex mwarn-dynamicstack
18313 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
18314 arrays.  This is generally a bad idea with a limited stack size.
18316 @item -mstack-guard=@var{stack-guard}
18317 @itemx -mstack-size=@var{stack-size}
18318 @opindex mstack-guard
18319 @opindex mstack-size
18320 If these options are provided the S/390 back end emits additional instructions in
18321 the function prologue that trigger a trap if the stack size is @var{stack-guard}
18322 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
18323 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
18324 the frame size of the compiled function is chosen.
18325 These options are intended to be used to help debugging stack overflow problems.
18326 The additionally emitted code causes only little overhead and hence can also be
18327 used in production-like systems without greater performance degradation.  The given
18328 values have to be exact powers of 2 and @var{stack-size} has to be greater than
18329 @var{stack-guard} without exceeding 64k.
18330 In order to be efficient the extra code makes the assumption that the stack starts
18331 at an address aligned to the value given by @var{stack-size}.
18332 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
18333 @end table
18335 @node Score Options
18336 @subsection Score Options
18337 @cindex Score Options
18339 These options are defined for Score implementations:
18341 @table @gcctabopt
18342 @item -meb
18343 @opindex meb
18344 Compile code for big-endian mode.  This is the default.
18346 @item -mel
18347 @opindex mel
18348 Compile code for little-endian mode.
18350 @item -mnhwloop
18351 @opindex mnhwloop
18352 Disable generation of @code{bcnz} instructions.
18354 @item -muls
18355 @opindex muls
18356 Enable generation of unaligned load and store instructions.
18358 @item -mmac
18359 @opindex mmac
18360 Enable the use of multiply-accumulate instructions. Disabled by default.
18362 @item -mscore5
18363 @opindex mscore5
18364 Specify the SCORE5 as the target architecture.
18366 @item -mscore5u
18367 @opindex mscore5u
18368 Specify the SCORE5U of the target architecture.
18370 @item -mscore7
18371 @opindex mscore7
18372 Specify the SCORE7 as the target architecture. This is the default.
18374 @item -mscore7d
18375 @opindex mscore7d
18376 Specify the SCORE7D as the target architecture.
18377 @end table
18379 @node SH Options
18380 @subsection SH Options
18382 These @samp{-m} options are defined for the SH implementations:
18384 @table @gcctabopt
18385 @item -m1
18386 @opindex m1
18387 Generate code for the SH1.
18389 @item -m2
18390 @opindex m2
18391 Generate code for the SH2.
18393 @item -m2e
18394 Generate code for the SH2e.
18396 @item -m2a-nofpu
18397 @opindex m2a-nofpu
18398 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18399 that the floating-point unit is not used.
18401 @item -m2a-single-only
18402 @opindex m2a-single-only
18403 Generate code for the SH2a-FPU, in such a way that no double-precision
18404 floating-point operations are used.
18406 @item -m2a-single
18407 @opindex m2a-single
18408 Generate code for the SH2a-FPU assuming the floating-point unit is in
18409 single-precision mode by default.
18411 @item -m2a
18412 @opindex m2a
18413 Generate code for the SH2a-FPU assuming the floating-point unit is in
18414 double-precision mode by default.
18416 @item -m3
18417 @opindex m3
18418 Generate code for the SH3.
18420 @item -m3e
18421 @opindex m3e
18422 Generate code for the SH3e.
18424 @item -m4-nofpu
18425 @opindex m4-nofpu
18426 Generate code for the SH4 without a floating-point unit.
18428 @item -m4-single-only
18429 @opindex m4-single-only
18430 Generate code for the SH4 with a floating-point unit that only
18431 supports single-precision arithmetic.
18433 @item -m4-single
18434 @opindex m4-single
18435 Generate code for the SH4 assuming the floating-point unit is in
18436 single-precision mode by default.
18438 @item -m4
18439 @opindex m4
18440 Generate code for the SH4.
18442 @item -m4a-nofpu
18443 @opindex m4a-nofpu
18444 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
18445 floating-point unit is not used.
18447 @item -m4a-single-only
18448 @opindex m4a-single-only
18449 Generate code for the SH4a, in such a way that no double-precision
18450 floating-point operations are used.
18452 @item -m4a-single
18453 @opindex m4a-single
18454 Generate code for the SH4a assuming the floating-point unit is in
18455 single-precision mode by default.
18457 @item -m4a
18458 @opindex m4a
18459 Generate code for the SH4a.
18461 @item -m4al
18462 @opindex m4al
18463 Same as @option{-m4a-nofpu}, except that it implicitly passes
18464 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18465 instructions at the moment.
18467 @item -mb
18468 @opindex mb
18469 Compile code for the processor in big-endian mode.
18471 @item -ml
18472 @opindex ml
18473 Compile code for the processor in little-endian mode.
18475 @item -mdalign
18476 @opindex mdalign
18477 Align doubles at 64-bit boundaries.  Note that this changes the calling
18478 conventions, and thus some functions from the standard C library do
18479 not work unless you recompile it first with @option{-mdalign}.
18481 @item -mrelax
18482 @opindex mrelax
18483 Shorten some address references at link time, when possible; uses the
18484 linker option @option{-relax}.
18486 @item -mbigtable
18487 @opindex mbigtable
18488 Use 32-bit offsets in @code{switch} tables.  The default is to use
18489 16-bit offsets.
18491 @item -mbitops
18492 @opindex mbitops
18493 Enable the use of bit manipulation instructions on SH2A.
18495 @item -mfmovd
18496 @opindex mfmovd
18497 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
18498 alignment constraints.
18500 @item -mhitachi
18501 @opindex mhitachi
18502 Comply with the calling conventions defined by Renesas.
18504 @item -mrenesas
18505 @opindex mhitachi
18506 Comply with the calling conventions defined by Renesas.
18508 @item -mno-renesas
18509 @opindex mhitachi
18510 Comply with the calling conventions defined for GCC before the Renesas
18511 conventions were available.  This option is the default for all
18512 targets of the SH toolchain.
18514 @item -mnomacsave
18515 @opindex mnomacsave
18516 Mark the @code{MAC} register as call-clobbered, even if
18517 @option{-mhitachi} is given.
18519 @item -mieee
18520 @itemx -mno-ieee
18521 @opindex mieee
18522 @opindex mnoieee
18523 Control the IEEE compliance of floating-point comparisons, which affects the
18524 handling of cases where the result of a comparison is unordered.  By default
18525 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
18526 enabled @option{-mno-ieee} is implicitly set, which results in faster
18527 floating-point greater-equal and less-equal comparisons.  The implcit settings
18528 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
18530 @item -minline-ic_invalidate
18531 @opindex minline-ic_invalidate
18532 Inline code to invalidate instruction cache entries after setting up
18533 nested function trampolines.
18534 This option has no effect if @option{-musermode} is in effect and the selected
18535 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
18536 instruction.
18537 If the selected code generation option does not allow the use of the @code{icbi}
18538 instruction, and @option{-musermode} is not in effect, the inlined code
18539 manipulates the instruction cache address array directly with an associative
18540 write.  This not only requires privileged mode at run time, but it also
18541 fails if the cache line had been mapped via the TLB and has become unmapped.
18543 @item -misize
18544 @opindex misize
18545 Dump instruction size and location in the assembly code.
18547 @item -mpadstruct
18548 @opindex mpadstruct
18549 This option is deprecated.  It pads structures to multiple of 4 bytes,
18550 which is incompatible with the SH ABI@.
18552 @item -matomic-model=@var{model}
18553 @opindex matomic-model=@var{model}
18554 Sets the model of atomic operations and additional parameters as a comma
18555 separated list.  For details on the atomic built-in functions see
18556 @ref{__atomic Builtins}.  The following models and parameters are supported:
18558 @table @samp
18560 @item none
18561 Disable compiler generated atomic sequences and emit library calls for atomic
18562 operations.  This is the default if the target is not @code{sh-*-linux*}.
18564 @item soft-gusa
18565 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
18566 built-in functions.  The generated atomic sequences require additional support
18567 from the interrupt/exception handling code of the system and are only suitable
18568 for SH3* and SH4* single-core systems.  This option is enabled by default when
18569 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
18570 this option will also partially utilize the hardware atomic instructions
18571 @code{movli.l} and @code{movco.l} to create more efficient code, unless
18572 @samp{strict} is specified.  
18574 @item soft-tcb
18575 Generate software atomic sequences that use a variable in the thread control
18576 block.  This is a variation of the gUSA sequences which can also be used on
18577 SH1* and SH2* targets.  The generated atomic sequences require additional
18578 support from the interrupt/exception handling code of the system and are only
18579 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
18580 parameter has to be specified as well.
18582 @item soft-imask
18583 Generate software atomic sequences that temporarily disable interrupts by
18584 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
18585 in privileged mode and is only suitable for single-core systems.  Additional
18586 support from the interrupt/exception handling code of the system is not
18587 required.  This model is enabled by default when the target is
18588 @code{sh-*-linux*} and SH1* or SH2*.
18590 @item hard-llcs
18591 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
18592 instructions only.  This is only available on SH4A and is suitable for
18593 multi-core systems.  Since the hardware instructions support only 32 bit atomic
18594 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
18595 Code compiled with this option will also be compatible with other software
18596 atomic model interrupt/exception handling systems if executed on an SH4A
18597 system.  Additional support from the interrupt/exception handling code of the
18598 system is not required for this model.
18600 @item gbr-offset=
18601 This parameter specifies the offset in bytes of the variable in the thread
18602 control block structure that should be used by the generated atomic sequences
18603 when the @samp{soft-tcb} model has been selected.  For other models this
18604 parameter is ignored.  The specified value must be an integer multiple of four
18605 and in the range 0-1020.
18607 @item strict
18608 This parameter prevents mixed usage of multiple atomic models, even though they
18609 would be compatible, and will make the compiler generate atomic sequences of the
18610 specified model only.
18612 @end table
18614 @item -mtas
18615 @opindex mtas
18616 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
18617 Notice that depending on the particular hardware and software configuration
18618 this can degrade overall performance due to the operand cache line flushes
18619 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
18620 processors the @code{tas.b} instruction must be used with caution since it
18621 can result in data corruption for certain cache configurations.
18623 @item -mspace
18624 @opindex mspace
18625 Optimize for space instead of speed.  Implied by @option{-Os}.
18627 @item -mprefergot
18628 @opindex mprefergot
18629 When generating position-independent code, emit function calls using
18630 the Global Offset Table instead of the Procedure Linkage Table.
18632 @item -musermode
18633 @opindex musermode
18634 Don't generate privileged mode only code.  This option
18635 implies @option{-mno-inline-ic_invalidate}
18636 if the inlined code would not work in user mode.
18637 This is the default when the target is @code{sh-*-linux*}.
18639 @item -multcost=@var{number}
18640 @opindex multcost=@var{number}
18641 Set the cost to assume for a multiply insn.
18643 @item -mdiv=@var{strategy}
18644 @opindex mdiv=@var{strategy}
18645 Set the division strategy to use for SHmedia code.  @var{strategy} must be
18646 one of: 
18648 @table @samp
18650 @item fp 
18651 Performs the operation in floating point.  This has a very high latency,
18652 but needs only a few instructions, so it might be a good choice if
18653 your code has enough easily-exploitable ILP to allow the compiler to
18654 schedule the floating-point instructions together with other instructions.
18655 Division by zero causes a floating-point exception.
18657 @item inv
18658 Uses integer operations to calculate the inverse of the divisor,
18659 and then multiplies the dividend with the inverse.  This strategy allows
18660 CSE and hoisting of the inverse calculation.  Division by zero calculates
18661 an unspecified result, but does not trap.
18663 @item inv:minlat
18664 A variant of @samp{inv} where, if no CSE or hoisting opportunities
18665 have been found, or if the entire operation has been hoisted to the same
18666 place, the last stages of the inverse calculation are intertwined with the
18667 final multiply to reduce the overall latency, at the expense of using a few
18668 more instructions, and thus offering fewer scheduling opportunities with
18669 other code.
18671 @item call
18672 Calls a library function that usually implements the @samp{inv:minlat}
18673 strategy.
18674 This gives high code density for @code{m5-*media-nofpu} compilations.
18676 @item call2
18677 Uses a different entry point of the same library function, where it
18678 assumes that a pointer to a lookup table has already been set up, which
18679 exposes the pointer load to CSE and code hoisting optimizations.
18681 @item inv:call
18682 @itemx inv:call2
18683 @itemx inv:fp
18684 Use the @samp{inv} algorithm for initial
18685 code generation, but if the code stays unoptimized, revert to the @samp{call},
18686 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
18687 potentially-trapping side effect of division by zero is carried by a
18688 separate instruction, so it is possible that all the integer instructions
18689 are hoisted out, but the marker for the side effect stays where it is.
18690 A recombination to floating-point operations or a call is not possible
18691 in that case.
18693 @item inv20u
18694 @itemx inv20l
18695 Variants of the @samp{inv:minlat} strategy.  In the case
18696 that the inverse calculation is not separated from the multiply, they speed
18697 up division where the dividend fits into 20 bits (plus sign where applicable)
18698 by inserting a test to skip a number of operations in this case; this test
18699 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
18700 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
18702 @end table
18704 @item -maccumulate-outgoing-args
18705 @opindex maccumulate-outgoing-args
18706 Reserve space once for outgoing arguments in the function prologue rather
18707 than around each call.  Generally beneficial for performance and size.  Also
18708 needed for unwinding to avoid changing the stack frame around conditional code.
18710 @item -mdivsi3_libfunc=@var{name}
18711 @opindex mdivsi3_libfunc=@var{name}
18712 Set the name of the library function used for 32-bit signed division to
18713 @var{name}.
18714 This only affects the name used in the @samp{call} and @samp{inv:call}
18715 division strategies, and the compiler still expects the same
18716 sets of input/output/clobbered registers as if this option were not present.
18718 @item -mfixed-range=@var{register-range}
18719 @opindex mfixed-range
18720 Generate code treating the given register range as fixed registers.
18721 A fixed register is one that the register allocator can not use.  This is
18722 useful when compiling kernel code.  A register range is specified as
18723 two registers separated by a dash.  Multiple register ranges can be
18724 specified separated by a comma.
18726 @item -mindexed-addressing
18727 @opindex mindexed-addressing
18728 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
18729 This is only safe if the hardware and/or OS implement 32-bit wrap-around
18730 semantics for the indexed addressing mode.  The architecture allows the
18731 implementation of processors with 64-bit MMU, which the OS could use to
18732 get 32-bit addressing, but since no current hardware implementation supports
18733 this or any other way to make the indexed addressing mode safe to use in
18734 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
18736 @item -mgettrcost=@var{number}
18737 @opindex mgettrcost=@var{number}
18738 Set the cost assumed for the @code{gettr} instruction to @var{number}.
18739 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
18741 @item -mpt-fixed
18742 @opindex mpt-fixed
18743 Assume @code{pt*} instructions won't trap.  This generally generates
18744 better-scheduled code, but is unsafe on current hardware.
18745 The current architecture
18746 definition says that @code{ptabs} and @code{ptrel} trap when the target 
18747 anded with 3 is 3.
18748 This has the unintentional effect of making it unsafe to schedule these
18749 instructions before a branch, or hoist them out of a loop.  For example,
18750 @code{__do_global_ctors}, a part of @file{libgcc}
18751 that runs constructors at program
18752 startup, calls functions in a list which is delimited by @minus{}1.  With the
18753 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
18754 That means that all the constructors run a bit more quickly, but when
18755 the loop comes to the end of the list, the program crashes because @code{ptabs}
18756 loads @minus{}1 into a target register.  
18758 Since this option is unsafe for any
18759 hardware implementing the current architecture specification, the default
18760 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
18761 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
18762 this deters register allocation from using target registers for storing
18763 ordinary integers.
18765 @item -minvalid-symbols
18766 @opindex minvalid-symbols
18767 Assume symbols might be invalid.  Ordinary function symbols generated by
18768 the compiler are always valid to load with
18769 @code{movi}/@code{shori}/@code{ptabs} or
18770 @code{movi}/@code{shori}/@code{ptrel},
18771 but with assembler and/or linker tricks it is possible
18772 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
18773 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
18774 It prevents cross-basic-block CSE, hoisting and most scheduling
18775 of symbol loads.  The default is @option{-mno-invalid-symbols}.
18777 @item -mbranch-cost=@var{num}
18778 @opindex mbranch-cost=@var{num}
18779 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
18780 make the compiler try to generate more branch-free code if possible.  
18781 If not specified the value is selected depending on the processor type that
18782 is being compiled for.
18784 @item -mzdcbranch
18785 @itemx -mno-zdcbranch
18786 @opindex mzdcbranch
18787 @opindex mno-zdcbranch
18788 Assume (do not assume) that zero displacement conditional branch instructions
18789 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
18790 compiler will try to prefer zero displacement branch code sequences.  This is
18791 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
18792 disabled by specifying @option{-mno-zdcbranch}.
18794 @item -mcbranchdi
18795 @opindex mcbranchdi
18796 Enable the @code{cbranchdi4} instruction pattern.
18798 @item -mcmpeqdi
18799 @opindex mcmpeqdi
18800 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
18801 is in effect.
18803 @item -mfused-madd
18804 @itemx -mno-fused-madd
18805 @opindex mfused-madd
18806 @opindex mno-fused-madd
18807 Generate code that uses (does not use) the floating-point multiply and
18808 accumulate instructions.  These instructions are generated by default
18809 if hardware floating point is used.  The machine-dependent
18810 @option{-mfused-madd} option is now mapped to the machine-independent
18811 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
18812 mapped to @option{-ffp-contract=off}.
18814 @item -mfsca
18815 @itemx -mno-fsca
18816 @opindex mfsca
18817 @opindex mno-fsca
18818 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
18819 and cosine approximations.  The option @code{-mfsca} must be used in
18820 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
18821 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
18822 approximations even if @code{-funsafe-math-optimizations} is in effect.
18824 @item -mfsrra
18825 @itemx -mno-fsrra
18826 @opindex mfsrra
18827 @opindex mno-fsrra
18828 Allow or disallow the compiler to emit the @code{fsrra} instruction for
18829 reciprocal square root approximations.  The option @code{-mfsrra} must be used
18830 in combination with @code{-funsafe-math-optimizations} and
18831 @code{-ffinite-math-only}.  It is enabled by default when generating code for
18832 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
18833 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
18834 in effect.
18836 @item -mpretend-cmove
18837 @opindex mpretend-cmove
18838 Prefer zero-displacement conditional branches for conditional move instruction
18839 patterns.  This can result in faster code on the SH4 processor.
18841 @end table
18843 @node Solaris 2 Options
18844 @subsection Solaris 2 Options
18845 @cindex Solaris 2 options
18847 These @samp{-m} options are supported on Solaris 2:
18849 @table @gcctabopt
18850 @item -mimpure-text
18851 @opindex mimpure-text
18852 @option{-mimpure-text}, used in addition to @option{-shared}, tells
18853 the compiler to not pass @option{-z text} to the linker when linking a
18854 shared object.  Using this option, you can link position-dependent
18855 code into a shared object.
18857 @option{-mimpure-text} suppresses the ``relocations remain against
18858 allocatable but non-writable sections'' linker error message.
18859 However, the necessary relocations trigger copy-on-write, and the
18860 shared object is not actually shared across processes.  Instead of
18861 using @option{-mimpure-text}, you should compile all source code with
18862 @option{-fpic} or @option{-fPIC}.
18864 @end table
18866 These switches are supported in addition to the above on Solaris 2:
18868 @table @gcctabopt
18869 @item -pthreads
18870 @opindex pthreads
18871 Add support for multithreading using the POSIX threads library.  This
18872 option sets flags for both the preprocessor and linker.  This option does
18873 not affect the thread safety of object code produced  by the compiler or
18874 that of libraries supplied with it.
18876 @item -pthread
18877 @opindex pthread
18878 This is a synonym for @option{-pthreads}.
18879 @end table
18881 @node SPARC Options
18882 @subsection SPARC Options
18883 @cindex SPARC options
18885 These @samp{-m} options are supported on the SPARC:
18887 @table @gcctabopt
18888 @item -mno-app-regs
18889 @itemx -mapp-regs
18890 @opindex mno-app-regs
18891 @opindex mapp-regs
18892 Specify @option{-mapp-regs} to generate output using the global registers
18893 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
18894 is the default.
18896 To be fully SVR4 ABI-compliant at the cost of some performance loss,
18897 specify @option{-mno-app-regs}.  You should compile libraries and system
18898 software with this option.
18900 @item -mflat
18901 @itemx -mno-flat
18902 @opindex mflat
18903 @opindex mno-flat
18904 With @option{-mflat}, the compiler does not generate save/restore instructions
18905 and uses a ``flat'' or single register window model.  This model is compatible
18906 with the regular register window model.  The local registers and the input
18907 registers (0--5) are still treated as ``call-saved'' registers and are
18908 saved on the stack as needed.
18910 With @option{-mno-flat} (the default), the compiler generates save/restore
18911 instructions (except for leaf functions).  This is the normal operating mode.
18913 @item -mfpu
18914 @itemx -mhard-float
18915 @opindex mfpu
18916 @opindex mhard-float
18917 Generate output containing floating-point instructions.  This is the
18918 default.
18920 @item -mno-fpu
18921 @itemx -msoft-float
18922 @opindex mno-fpu
18923 @opindex msoft-float
18924 Generate output containing library calls for floating point.
18925 @strong{Warning:} the requisite libraries are not available for all SPARC
18926 targets.  Normally the facilities of the machine's usual C compiler are
18927 used, but this cannot be done directly in cross-compilation.  You must make
18928 your own arrangements to provide suitable library functions for
18929 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
18930 @samp{sparclite-*-*} do provide software floating-point support.
18932 @option{-msoft-float} changes the calling convention in the output file;
18933 therefore, it is only useful if you compile @emph{all} of a program with
18934 this option.  In particular, you need to compile @file{libgcc.a}, the
18935 library that comes with GCC, with @option{-msoft-float} in order for
18936 this to work.
18938 @item -mhard-quad-float
18939 @opindex mhard-quad-float
18940 Generate output containing quad-word (long double) floating-point
18941 instructions.
18943 @item -msoft-quad-float
18944 @opindex msoft-quad-float
18945 Generate output containing library calls for quad-word (long double)
18946 floating-point instructions.  The functions called are those specified
18947 in the SPARC ABI@.  This is the default.
18949 As of this writing, there are no SPARC implementations that have hardware
18950 support for the quad-word floating-point instructions.  They all invoke
18951 a trap handler for one of these instructions, and then the trap handler
18952 emulates the effect of the instruction.  Because of the trap handler overhead,
18953 this is much slower than calling the ABI library routines.  Thus the
18954 @option{-msoft-quad-float} option is the default.
18956 @item -mno-unaligned-doubles
18957 @itemx -munaligned-doubles
18958 @opindex mno-unaligned-doubles
18959 @opindex munaligned-doubles
18960 Assume that doubles have 8-byte alignment.  This is the default.
18962 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
18963 alignment only if they are contained in another type, or if they have an
18964 absolute address.  Otherwise, it assumes they have 4-byte alignment.
18965 Specifying this option avoids some rare compatibility problems with code
18966 generated by other compilers.  It is not the default because it results
18967 in a performance loss, especially for floating-point code.
18969 @item -mno-faster-structs
18970 @itemx -mfaster-structs
18971 @opindex mno-faster-structs
18972 @opindex mfaster-structs
18973 With @option{-mfaster-structs}, the compiler assumes that structures
18974 should have 8-byte alignment.  This enables the use of pairs of
18975 @code{ldd} and @code{std} instructions for copies in structure
18976 assignment, in place of twice as many @code{ld} and @code{st} pairs.
18977 However, the use of this changed alignment directly violates the SPARC
18978 ABI@.  Thus, it's intended only for use on targets where the developer
18979 acknowledges that their resulting code is not directly in line with
18980 the rules of the ABI@.
18982 @item -mcpu=@var{cpu_type}
18983 @opindex mcpu
18984 Set the instruction set, register set, and instruction scheduling parameters
18985 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
18986 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
18987 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
18988 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
18989 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
18990 and @samp{niagara4}.
18992 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
18993 which selects the best architecture option for the host processor.
18994 @option{-mcpu=native} has no effect if GCC does not recognize
18995 the processor.
18997 Default instruction scheduling parameters are used for values that select
18998 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
18999 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
19001 Here is a list of each supported architecture and their supported
19002 implementations.
19004 @table @asis
19005 @item v7
19006 cypress
19008 @item v8
19009 supersparc, hypersparc, leon
19011 @item sparclite
19012 f930, f934, sparclite86x
19014 @item sparclet
19015 tsc701
19017 @item v9
19018 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
19019 @end table
19021 By default (unless configured otherwise), GCC generates code for the V7
19022 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
19023 additionally optimizes it for the Cypress CY7C602 chip, as used in the
19024 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
19025 SPARCStation 1, 2, IPX etc.
19027 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
19028 architecture.  The only difference from V7 code is that the compiler emits
19029 the integer multiply and integer divide instructions which exist in SPARC-V8
19030 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
19031 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
19032 2000 series.
19034 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
19035 the SPARC architecture.  This adds the integer multiply, integer divide step
19036 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
19037 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
19038 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
19039 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
19040 MB86934 chip, which is the more recent SPARClite with FPU@.
19042 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
19043 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
19044 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
19045 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
19046 optimizes it for the TEMIC SPARClet chip.
19048 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
19049 architecture.  This adds 64-bit integer and floating-point move instructions,
19050 3 additional floating-point condition code registers and conditional move
19051 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
19052 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
19053 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
19054 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
19055 @option{-mcpu=niagara}, the compiler additionally optimizes it for
19056 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
19057 additionally optimizes it for Sun UltraSPARC T2 chips. With
19058 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
19059 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
19060 additionally optimizes it for Sun UltraSPARC T4 chips.
19062 @item -mtune=@var{cpu_type}
19063 @opindex mtune
19064 Set the instruction scheduling parameters for machine type
19065 @var{cpu_type}, but do not set the instruction set or register set that the
19066 option @option{-mcpu=@var{cpu_type}} does.
19068 The same values for @option{-mcpu=@var{cpu_type}} can be used for
19069 @option{-mtune=@var{cpu_type}}, but the only useful values are those
19070 that select a particular CPU implementation.  Those are @samp{cypress},
19071 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
19072 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
19073 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
19074 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
19076 @item -mv8plus
19077 @itemx -mno-v8plus
19078 @opindex mv8plus
19079 @opindex mno-v8plus
19080 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
19081 difference from the V8 ABI is that the global and out registers are
19082 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
19083 mode for all SPARC-V9 processors.
19085 @item -mvis
19086 @itemx -mno-vis
19087 @opindex mvis
19088 @opindex mno-vis
19089 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
19090 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
19092 @item -mvis2
19093 @itemx -mno-vis2
19094 @opindex mvis2
19095 @opindex mno-vis2
19096 With @option{-mvis2}, GCC generates code that takes advantage of
19097 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
19098 default is @option{-mvis2} when targeting a cpu that supports such
19099 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
19100 also sets @option{-mvis}.
19102 @item -mvis3
19103 @itemx -mno-vis3
19104 @opindex mvis3
19105 @opindex mno-vis3
19106 With @option{-mvis3}, GCC generates code that takes advantage of
19107 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
19108 default is @option{-mvis3} when targeting a cpu that supports such
19109 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
19110 also sets @option{-mvis2} and @option{-mvis}.
19112 @item -mpopc
19113 @itemx -mno-popc
19114 @opindex mpopc
19115 @opindex mno-popc
19116 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
19117 population count instruction.  The default is @option{-mpopc}
19118 when targeting a cpu that supports such instructions, such as Niagara-2 and
19119 later.
19121 @item -mfmaf
19122 @itemx -mno-fmaf
19123 @opindex mfmaf
19124 @opindex mno-fmaf
19125 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
19126 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
19127 when targeting a cpu that supports such instructions, such as Niagara-3 and
19128 later.
19130 @item -mfix-at697f
19131 @opindex mfix-at697f
19132 Enable the documented workaround for the single erratum of the Atmel AT697F
19133 processor (which corresponds to erratum #13 of the AT697E processor).
19134 @end table
19136 These @samp{-m} options are supported in addition to the above
19137 on SPARC-V9 processors in 64-bit environments:
19139 @table @gcctabopt
19140 @item -mlittle-endian
19141 @opindex mlittle-endian
19142 Generate code for a processor running in little-endian mode.  It is only
19143 available for a few configurations and most notably not on Solaris and Linux.
19145 @item -m32
19146 @itemx -m64
19147 @opindex m32
19148 @opindex m64
19149 Generate code for a 32-bit or 64-bit environment.
19150 The 32-bit environment sets int, long and pointer to 32 bits.
19151 The 64-bit environment sets int to 32 bits and long and pointer
19152 to 64 bits.
19154 @item -mcmodel=@var{which}
19155 @opindex mcmodel
19156 Set the code model to one of
19158 @table @samp
19159 @item medlow
19160 The Medium/Low code model: 64-bit addresses, programs
19161 must be linked in the low 32 bits of memory.  Programs can be statically
19162 or dynamically linked.
19164 @item medmid
19165 The Medium/Middle code model: 64-bit addresses, programs
19166 must be linked in the low 44 bits of memory, the text and data segments must
19167 be less than 2GB in size and the data segment must be located within 2GB of
19168 the text segment.
19170 @item medany
19171 The Medium/Anywhere code model: 64-bit addresses, programs
19172 may be linked anywhere in memory, the text and data segments must be less
19173 than 2GB in size and the data segment must be located within 2GB of the
19174 text segment.
19176 @item embmedany
19177 The Medium/Anywhere code model for embedded systems:
19178 64-bit addresses, the text and data segments must be less than 2GB in
19179 size, both starting anywhere in memory (determined at link time).  The
19180 global register %g4 points to the base of the data segment.  Programs
19181 are statically linked and PIC is not supported.
19182 @end table
19184 @item -mmemory-model=@var{mem-model}
19185 @opindex mmemory-model
19186 Set the memory model in force on the processor to one of
19188 @table @samp
19189 @item default
19190 The default memory model for the processor and operating system.
19192 @item rmo
19193 Relaxed Memory Order
19195 @item pso
19196 Partial Store Order
19198 @item tso
19199 Total Store Order
19201 @item sc
19202 Sequential Consistency
19203 @end table
19205 These memory models are formally defined in Appendix D of the Sparc V9
19206 architecture manual, as set in the processor's @code{PSTATE.MM} field.
19208 @item -mstack-bias
19209 @itemx -mno-stack-bias
19210 @opindex mstack-bias
19211 @opindex mno-stack-bias
19212 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
19213 frame pointer if present, are offset by @minus{}2047 which must be added back
19214 when making stack frame references.  This is the default in 64-bit mode.
19215 Otherwise, assume no such offset is present.
19216 @end table
19218 @node SPU Options
19219 @subsection SPU Options
19220 @cindex SPU options
19222 These @samp{-m} options are supported on the SPU:
19224 @table @gcctabopt
19225 @item -mwarn-reloc
19226 @itemx -merror-reloc
19227 @opindex mwarn-reloc
19228 @opindex merror-reloc
19230 The loader for SPU does not handle dynamic relocations.  By default, GCC
19231 gives an error when it generates code that requires a dynamic
19232 relocation.  @option{-mno-error-reloc} disables the error,
19233 @option{-mwarn-reloc} generates a warning instead.
19235 @item -msafe-dma
19236 @itemx -munsafe-dma
19237 @opindex msafe-dma
19238 @opindex munsafe-dma
19240 Instructions that initiate or test completion of DMA must not be
19241 reordered with respect to loads and stores of the memory that is being
19242 accessed.
19243 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
19244 memory accesses, but that can lead to inefficient code in places where the
19245 memory is known to not change.  Rather than mark the memory as volatile,
19246 you can use @option{-msafe-dma} to tell the compiler to treat
19247 the DMA instructions as potentially affecting all memory.  
19249 @item -mbranch-hints
19250 @opindex mbranch-hints
19252 By default, GCC generates a branch hint instruction to avoid
19253 pipeline stalls for always-taken or probably-taken branches.  A hint
19254 is not generated closer than 8 instructions away from its branch.
19255 There is little reason to disable them, except for debugging purposes,
19256 or to make an object a little bit smaller.
19258 @item -msmall-mem
19259 @itemx -mlarge-mem
19260 @opindex msmall-mem
19261 @opindex mlarge-mem
19263 By default, GCC generates code assuming that addresses are never larger
19264 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
19265 a full 32-bit address.
19267 @item -mstdmain
19268 @opindex mstdmain
19270 By default, GCC links against startup code that assumes the SPU-style
19271 main function interface (which has an unconventional parameter list).
19272 With @option{-mstdmain}, GCC links your program against startup
19273 code that assumes a C99-style interface to @code{main}, including a
19274 local copy of @code{argv} strings.
19276 @item -mfixed-range=@var{register-range}
19277 @opindex mfixed-range
19278 Generate code treating the given register range as fixed registers.
19279 A fixed register is one that the register allocator cannot use.  This is
19280 useful when compiling kernel code.  A register range is specified as
19281 two registers separated by a dash.  Multiple register ranges can be
19282 specified separated by a comma.
19284 @item -mea32
19285 @itemx -mea64
19286 @opindex mea32
19287 @opindex mea64
19288 Compile code assuming that pointers to the PPU address space accessed
19289 via the @code{__ea} named address space qualifier are either 32 or 64
19290 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
19291 all object code in an executable must be compiled with the same setting.
19293 @item -maddress-space-conversion
19294 @itemx -mno-address-space-conversion
19295 @opindex maddress-space-conversion
19296 @opindex mno-address-space-conversion
19297 Allow/disallow treating the @code{__ea} address space as superset
19298 of the generic address space.  This enables explicit type casts
19299 between @code{__ea} and generic pointer as well as implicit
19300 conversions of generic pointers to @code{__ea} pointers.  The
19301 default is to allow address space pointer conversions.
19303 @item -mcache-size=@var{cache-size}
19304 @opindex mcache-size
19305 This option controls the version of libgcc that the compiler links to an
19306 executable and selects a software-managed cache for accessing variables
19307 in the @code{__ea} address space with a particular cache size.  Possible
19308 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
19309 and @samp{128}.  The default cache size is 64KB.
19311 @item -matomic-updates
19312 @itemx -mno-atomic-updates
19313 @opindex matomic-updates
19314 @opindex mno-atomic-updates
19315 This option controls the version of libgcc that the compiler links to an
19316 executable and selects whether atomic updates to the software-managed
19317 cache of PPU-side variables are used.  If you use atomic updates, changes
19318 to a PPU variable from SPU code using the @code{__ea} named address space
19319 qualifier do not interfere with changes to other PPU variables residing
19320 in the same cache line from PPU code.  If you do not use atomic updates,
19321 such interference may occur; however, writing back cache lines is
19322 more efficient.  The default behavior is to use atomic updates.
19324 @item -mdual-nops
19325 @itemx -mdual-nops=@var{n}
19326 @opindex mdual-nops
19327 By default, GCC inserts nops to increase dual issue when it expects
19328 it to increase performance.  @var{n} can be a value from 0 to 10.  A
19329 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
19330 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
19332 @item -mhint-max-nops=@var{n}
19333 @opindex mhint-max-nops
19334 Maximum number of nops to insert for a branch hint.  A branch hint must
19335 be at least 8 instructions away from the branch it is affecting.  GCC
19336 inserts up to @var{n} nops to enforce this, otherwise it does not
19337 generate the branch hint.
19339 @item -mhint-max-distance=@var{n}
19340 @opindex mhint-max-distance
19341 The encoding of the branch hint instruction limits the hint to be within
19342 256 instructions of the branch it is affecting.  By default, GCC makes
19343 sure it is within 125.
19345 @item -msafe-hints
19346 @opindex msafe-hints
19347 Work around a hardware bug that causes the SPU to stall indefinitely.
19348 By default, GCC inserts the @code{hbrp} instruction to make sure
19349 this stall won't happen.
19351 @end table
19353 @node System V Options
19354 @subsection Options for System V
19356 These additional options are available on System V Release 4 for
19357 compatibility with other compilers on those systems:
19359 @table @gcctabopt
19360 @item -G
19361 @opindex G
19362 Create a shared object.
19363 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
19365 @item -Qy
19366 @opindex Qy
19367 Identify the versions of each tool used by the compiler, in a
19368 @code{.ident} assembler directive in the output.
19370 @item -Qn
19371 @opindex Qn
19372 Refrain from adding @code{.ident} directives to the output file (this is
19373 the default).
19375 @item -YP,@var{dirs}
19376 @opindex YP
19377 Search the directories @var{dirs}, and no others, for libraries
19378 specified with @option{-l}.
19380 @item -Ym,@var{dir}
19381 @opindex Ym
19382 Look in the directory @var{dir} to find the M4 preprocessor.
19383 The assembler uses this option.
19384 @c This is supposed to go with a -Yd for predefined M4 macro files, but
19385 @c the generic assembler that comes with Solaris takes just -Ym.
19386 @end table
19388 @node TILE-Gx Options
19389 @subsection TILE-Gx Options
19390 @cindex TILE-Gx options
19392 These @samp{-m} options are supported on the TILE-Gx:
19394 @table @gcctabopt
19395 @item -mcmodel=small
19396 @opindex mcmodel=small
19397 Generate code for the small model.  The distance for direct calls is
19398 limited to 500M in either direction.  PC-relative addresses are 32
19399 bits.  Absolute addresses support the full address range.
19401 @item -mcmodel=large
19402 @opindex mcmodel=large
19403 Generate code for the large model.  There is no limitation on call
19404 distance, pc-relative addresses, or absolute addresses.
19406 @item -mcpu=@var{name}
19407 @opindex mcpu
19408 Selects the type of CPU to be targeted.  Currently the only supported
19409 type is @samp{tilegx}.
19411 @item -m32
19412 @itemx -m64
19413 @opindex m32
19414 @opindex m64
19415 Generate code for a 32-bit or 64-bit environment.  The 32-bit
19416 environment sets int, long, and pointer to 32 bits.  The 64-bit
19417 environment sets int to 32 bits and long and pointer to 64 bits.
19418 @end table
19420 @node TILEPro Options
19421 @subsection TILEPro Options
19422 @cindex TILEPro options
19424 These @samp{-m} options are supported on the TILEPro:
19426 @table @gcctabopt
19427 @item -mcpu=@var{name}
19428 @opindex mcpu
19429 Selects the type of CPU to be targeted.  Currently the only supported
19430 type is @samp{tilepro}.
19432 @item -m32
19433 @opindex m32
19434 Generate code for a 32-bit environment, which sets int, long, and
19435 pointer to 32 bits.  This is the only supported behavior so the flag
19436 is essentially ignored.
19437 @end table
19439 @node V850 Options
19440 @subsection V850 Options
19441 @cindex V850 Options
19443 These @samp{-m} options are defined for V850 implementations:
19445 @table @gcctabopt
19446 @item -mlong-calls
19447 @itemx -mno-long-calls
19448 @opindex mlong-calls
19449 @opindex mno-long-calls
19450 Treat all calls as being far away (near).  If calls are assumed to be
19451 far away, the compiler always loads the function's address into a
19452 register, and calls indirect through the pointer.
19454 @item -mno-ep
19455 @itemx -mep
19456 @opindex mno-ep
19457 @opindex mep
19458 Do not optimize (do optimize) basic blocks that use the same index
19459 pointer 4 or more times to copy pointer into the @code{ep} register, and
19460 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
19461 option is on by default if you optimize.
19463 @item -mno-prolog-function
19464 @itemx -mprolog-function
19465 @opindex mno-prolog-function
19466 @opindex mprolog-function
19467 Do not use (do use) external functions to save and restore registers
19468 at the prologue and epilogue of a function.  The external functions
19469 are slower, but use less code space if more than one function saves
19470 the same number of registers.  The @option{-mprolog-function} option
19471 is on by default if you optimize.
19473 @item -mspace
19474 @opindex mspace
19475 Try to make the code as small as possible.  At present, this just turns
19476 on the @option{-mep} and @option{-mprolog-function} options.
19478 @item -mtda=@var{n}
19479 @opindex mtda
19480 Put static or global variables whose size is @var{n} bytes or less into
19481 the tiny data area that register @code{ep} points to.  The tiny data
19482 area can hold up to 256 bytes in total (128 bytes for byte references).
19484 @item -msda=@var{n}
19485 @opindex msda
19486 Put static or global variables whose size is @var{n} bytes or less into
19487 the small data area that register @code{gp} points to.  The small data
19488 area can hold up to 64 kilobytes.
19490 @item -mzda=@var{n}
19491 @opindex mzda
19492 Put static or global variables whose size is @var{n} bytes or less into
19493 the first 32 kilobytes of memory.
19495 @item -mv850
19496 @opindex mv850
19497 Specify that the target processor is the V850.
19499 @item -mbig-switch
19500 @opindex mbig-switch
19501 Generate code suitable for big switch tables.  Use this option only if
19502 the assembler/linker complain about out of range branches within a switch
19503 table.
19505 @item -mapp-regs
19506 @opindex mapp-regs
19507 This option causes r2 and r5 to be used in the code generated by
19508 the compiler.  This setting is the default.
19510 @item -mno-app-regs
19511 @opindex mno-app-regs
19512 This option causes r2 and r5 to be treated as fixed registers.
19514 @item -mv850e2v3
19515 @opindex mv850e2v3
19516 Specify that the target processor is the V850E2V3.  The preprocessor
19517 constant @samp{__v850e2v3__} is defined if
19518 this option is used.
19520 @item -mv850e2
19521 @opindex mv850e2
19522 Specify that the target processor is the V850E2.  The preprocessor
19523 constant @samp{__v850e2__} is defined if this option is used.
19525 @item -mv850e1
19526 @opindex mv850e1
19527 Specify that the target processor is the V850E1.  The preprocessor
19528 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
19529 this option is used.
19531 @item -mv850es
19532 @opindex mv850es
19533 Specify that the target processor is the V850ES.  This is an alias for
19534 the @option{-mv850e1} option.
19536 @item -mv850e
19537 @opindex mv850e
19538 Specify that the target processor is the V850E@.  The preprocessor
19539 constant @samp{__v850e__} is defined if this option is used.
19541 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
19542 nor @option{-mv850e2} nor @option{-mv850e2v3}
19543 are defined then a default target processor is chosen and the
19544 relevant @samp{__v850*__} preprocessor constant is defined.
19546 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
19547 defined, regardless of which processor variant is the target.
19549 @item -mdisable-callt
19550 @opindex mdisable-callt
19551 This option suppresses generation of the @code{CALLT} instruction for the
19552 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
19553 @option{-mno-disable-callt} which allows the @code{CALLT} instruction to be used.
19555 @end table
19557 @node VAX Options
19558 @subsection VAX Options
19559 @cindex VAX options
19561 These @samp{-m} options are defined for the VAX:
19563 @table @gcctabopt
19564 @item -munix
19565 @opindex munix
19566 Do not output certain jump instructions (@code{aobleq} and so on)
19567 that the Unix assembler for the VAX cannot handle across long
19568 ranges.
19570 @item -mgnu
19571 @opindex mgnu
19572 Do output those jump instructions, on the assumption that the
19573 GNU assembler is being used.
19575 @item -mg
19576 @opindex mg
19577 Output code for G-format floating-point numbers instead of D-format.
19578 @end table
19580 @node VMS Options
19581 @subsection VMS Options
19583 These @samp{-m} options are defined for the VMS implementations:
19585 @table @gcctabopt
19586 @item -mvms-return-codes
19587 @opindex mvms-return-codes
19588 Return VMS condition codes from @code{main}. The default is to return POSIX-style
19589 condition (e.g.@ error) codes.
19591 @item -mdebug-main=@var{prefix}
19592 @opindex mdebug-main=@var{prefix}
19593 Flag the first routine whose name starts with @var{prefix} as the main
19594 routine for the debugger.
19596 @item -mmalloc64
19597 @opindex mmalloc64
19598 Default to 64-bit memory allocation routines.
19600 @item -mpointer-size=@var{size}
19601 @opindex -mpointer-size=@var{size}
19602 Set the default size of pointers. Possible options for @var{size} are
19603 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
19604 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
19605 The later option disables @code{pragma pointer_size}.
19606 @end table
19608 @node VxWorks Options
19609 @subsection VxWorks Options
19610 @cindex VxWorks Options
19612 The options in this section are defined for all VxWorks targets.
19613 Options specific to the target hardware are listed with the other
19614 options for that target.
19616 @table @gcctabopt
19617 @item -mrtp
19618 @opindex mrtp
19619 GCC can generate code for both VxWorks kernels and real time processes
19620 (RTPs).  This option switches from the former to the latter.  It also
19621 defines the preprocessor macro @code{__RTP__}.
19623 @item -non-static
19624 @opindex non-static
19625 Link an RTP executable against shared libraries rather than static
19626 libraries.  The options @option{-static} and @option{-shared} can
19627 also be used for RTPs (@pxref{Link Options}); @option{-static}
19628 is the default.
19630 @item -Bstatic
19631 @itemx -Bdynamic
19632 @opindex Bstatic
19633 @opindex Bdynamic
19634 These options are passed down to the linker.  They are defined for
19635 compatibility with Diab.
19637 @item -Xbind-lazy
19638 @opindex Xbind-lazy
19639 Enable lazy binding of function calls.  This option is equivalent to
19640 @option{-Wl,-z,now} and is defined for compatibility with Diab.
19642 @item -Xbind-now
19643 @opindex Xbind-now
19644 Disable lazy binding of function calls.  This option is the default and
19645 is defined for compatibility with Diab.
19646 @end table
19648 @node x86-64 Options
19649 @subsection x86-64 Options
19650 @cindex x86-64 options
19652 These are listed under @xref{i386 and x86-64 Options}.
19654 @node Xstormy16 Options
19655 @subsection Xstormy16 Options
19656 @cindex Xstormy16 Options
19658 These options are defined for Xstormy16:
19660 @table @gcctabopt
19661 @item -msim
19662 @opindex msim
19663 Choose startup files and linker script suitable for the simulator.
19664 @end table
19666 @node Xtensa Options
19667 @subsection Xtensa Options
19668 @cindex Xtensa Options
19670 These options are supported for Xtensa targets:
19672 @table @gcctabopt
19673 @item -mconst16
19674 @itemx -mno-const16
19675 @opindex mconst16
19676 @opindex mno-const16
19677 Enable or disable use of @code{CONST16} instructions for loading
19678 constant values.  The @code{CONST16} instruction is currently not a
19679 standard option from Tensilica.  When enabled, @code{CONST16}
19680 instructions are always used in place of the standard @code{L32R}
19681 instructions.  The use of @code{CONST16} is enabled by default only if
19682 the @code{L32R} instruction is not available.
19684 @item -mfused-madd
19685 @itemx -mno-fused-madd
19686 @opindex mfused-madd
19687 @opindex mno-fused-madd
19688 Enable or disable use of fused multiply/add and multiply/subtract
19689 instructions in the floating-point option.  This has no effect if the
19690 floating-point option is not also enabled.  Disabling fused multiply/add
19691 and multiply/subtract instructions forces the compiler to use separate
19692 instructions for the multiply and add/subtract operations.  This may be
19693 desirable in some cases where strict IEEE 754-compliant results are
19694 required: the fused multiply add/subtract instructions do not round the
19695 intermediate result, thereby producing results with @emph{more} bits of
19696 precision than specified by the IEEE standard.  Disabling fused multiply
19697 add/subtract instructions also ensures that the program output is not
19698 sensitive to the compiler's ability to combine multiply and add/subtract
19699 operations.
19701 @item -mserialize-volatile
19702 @itemx -mno-serialize-volatile
19703 @opindex mserialize-volatile
19704 @opindex mno-serialize-volatile
19705 When this option is enabled, GCC inserts @code{MEMW} instructions before
19706 @code{volatile} memory references to guarantee sequential consistency.
19707 The default is @option{-mserialize-volatile}.  Use
19708 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
19710 @item -mforce-no-pic
19711 @opindex mforce-no-pic
19712 For targets, like GNU/Linux, where all user-mode Xtensa code must be
19713 position-independent code (PIC), this option disables PIC for compiling
19714 kernel code.
19716 @item -mtext-section-literals
19717 @itemx -mno-text-section-literals
19718 @opindex mtext-section-literals
19719 @opindex mno-text-section-literals
19720 Control the treatment of literal pools.  The default is
19721 @option{-mno-text-section-literals}, which places literals in a separate
19722 section in the output file.  This allows the literal pool to be placed
19723 in a data RAM/ROM, and it also allows the linker to combine literal
19724 pools from separate object files to remove redundant literals and
19725 improve code size.  With @option{-mtext-section-literals}, the literals
19726 are interspersed in the text section in order to keep them as close as
19727 possible to their references.  This may be necessary for large assembly
19728 files.
19730 @item -mtarget-align
19731 @itemx -mno-target-align
19732 @opindex mtarget-align
19733 @opindex mno-target-align
19734 When this option is enabled, GCC instructs the assembler to
19735 automatically align instructions to reduce branch penalties at the
19736 expense of some code density.  The assembler attempts to widen density
19737 instructions to align branch targets and the instructions following call
19738 instructions.  If there are not enough preceding safe density
19739 instructions to align a target, no widening is performed.  The
19740 default is @option{-mtarget-align}.  These options do not affect the
19741 treatment of auto-aligned instructions like @code{LOOP}, which the
19742 assembler always aligns, either by widening density instructions or
19743 by inserting NOP instructions.
19745 @item -mlongcalls
19746 @itemx -mno-longcalls
19747 @opindex mlongcalls
19748 @opindex mno-longcalls
19749 When this option is enabled, GCC instructs the assembler to translate
19750 direct calls to indirect calls unless it can determine that the target
19751 of a direct call is in the range allowed by the call instruction.  This
19752 translation typically occurs for calls to functions in other source
19753 files.  Specifically, the assembler translates a direct @code{CALL}
19754 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
19755 The default is @option{-mno-longcalls}.  This option should be used in
19756 programs where the call target can potentially be out of range.  This
19757 option is implemented in the assembler, not the compiler, so the
19758 assembly code generated by GCC still shows direct call
19759 instructions---look at the disassembled object code to see the actual
19760 instructions.  Note that the assembler uses an indirect call for
19761 every cross-file call, not just those that really are out of range.
19762 @end table
19764 @node zSeries Options
19765 @subsection zSeries Options
19766 @cindex zSeries options
19768 These are listed under @xref{S/390 and zSeries Options}.
19770 @node Code Gen Options
19771 @section Options for Code Generation Conventions
19772 @cindex code generation conventions
19773 @cindex options, code generation
19774 @cindex run-time options
19776 These machine-independent options control the interface conventions
19777 used in code generation.
19779 Most of them have both positive and negative forms; the negative form
19780 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
19781 one of the forms is listed---the one that is not the default.  You
19782 can figure out the other form by either removing @samp{no-} or adding
19785 @table @gcctabopt
19786 @item -fbounds-check
19787 @opindex fbounds-check
19788 For front ends that support it, generate additional code to check that
19789 indices used to access arrays are within the declared range.  This is
19790 currently only supported by the Java and Fortran front ends, where
19791 this option defaults to true and false respectively.
19793 @item -fstack-reuse=@var{reuse-level}
19794 @opindex fstack_reuse
19795 This option controls stack space reuse for user declared local/auto variables
19796 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
19797 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
19798 local variables and temporaries, @samp{named_vars} enables the reuse only for
19799 user defined local variables with names, and @samp{none} disables stack reuse
19800 completely. The default value is @samp{all}. The option is needed when the
19801 program extends the lifetime of a scoped local variable or a compiler generated
19802 temporary beyond the end point defined by the language.  When a lifetime of
19803 a variable ends, and if the variable lives in memory, the optimizing compiler
19804 has the freedom to reuse its stack space with other temporaries or scoped
19805 local variables whose live range does not overlap with it. Legacy code extending
19806 local lifetime will likely to break with the stack reuse optimization.
19808 For example,
19810 @smallexample
19811    int *p;
19812    @{
19813      int local1;
19815      p = &local1;
19816      local1 = 10;
19817      ....
19818    @}
19819    @{
19820       int local2;
19821       local2 = 20;
19822       ...
19823    @}
19825    if (*p == 10)  // out of scope use of local1
19826      @{
19828      @}
19829 @end smallexample
19831 Another example:
19832 @smallexample
19834    struct A
19835    @{
19836        A(int k) : i(k), j(k) @{ @}
19837        int i;
19838        int j;
19839    @};
19841    A *ap;
19843    void foo(const A& ar)
19844    @{
19845       ap = &ar;
19846    @}
19848    void bar()
19849    @{
19850       foo(A(10)); // temp object's lifetime ends when foo returns
19852       @{
19853         A a(20);
19854         ....
19855       @}
19856       ap->i+= 10;  // ap references out of scope temp whose space
19857                    // is reused with a. What is the value of ap->i?
19858    @}
19860 @end smallexample
19862 The lifetime of a compiler generated temporary is well defined by the C++
19863 standard. When a lifetime of a temporary ends, and if the temporary lives
19864 in memory, the optimizing compiler has the freedom to reuse its stack
19865 space with other temporaries or scoped local variables whose live range
19866 does not overlap with it. However some of the legacy code relies on
19867 the behavior of older compilers in which temporaries' stack space is
19868 not reused, the aggressive stack reuse can lead to runtime errors. This
19869 option is used to control the temporary stack reuse optimization.
19871 @item -ftrapv
19872 @opindex ftrapv
19873 This option generates traps for signed overflow on addition, subtraction,
19874 multiplication operations.
19876 @item -fwrapv
19877 @opindex fwrapv
19878 This option instructs the compiler to assume that signed arithmetic
19879 overflow of addition, subtraction and multiplication wraps around
19880 using twos-complement representation.  This flag enables some optimizations
19881 and disables others.  This option is enabled by default for the Java
19882 front end, as required by the Java language specification.
19884 @item -fexceptions
19885 @opindex fexceptions
19886 Enable exception handling.  Generates extra code needed to propagate
19887 exceptions.  For some targets, this implies GCC generates frame
19888 unwind information for all functions, which can produce significant data
19889 size overhead, although it does not affect execution.  If you do not
19890 specify this option, GCC enables it by default for languages like
19891 C++ that normally require exception handling, and disables it for
19892 languages like C that do not normally require it.  However, you may need
19893 to enable this option when compiling C code that needs to interoperate
19894 properly with exception handlers written in C++.  You may also wish to
19895 disable this option if you are compiling older C++ programs that don't
19896 use exception handling.
19898 @item -fnon-call-exceptions
19899 @opindex fnon-call-exceptions
19900 Generate code that allows trapping instructions to throw exceptions.
19901 Note that this requires platform-specific runtime support that does
19902 not exist everywhere.  Moreover, it only allows @emph{trapping}
19903 instructions to throw exceptions, i.e.@: memory references or floating-point
19904 instructions.  It does not allow exceptions to be thrown from
19905 arbitrary signal handlers such as @code{SIGALRM}.
19907 @item -fdelete-dead-exceptions
19908 @opindex fdelete-dead-exceptions
19909 Consider that instructions that may throw exceptions but don't otherwise
19910 contribute to the execution of the program can be optimized away.
19911 This option is enabled by default for the Ada front end, as permitted by
19912 the Ada language specification.
19913 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
19915 @item -funwind-tables
19916 @opindex funwind-tables
19917 Similar to @option{-fexceptions}, except that it just generates any needed
19918 static data, but does not affect the generated code in any other way.
19919 You normally do not need to enable this option; instead, a language processor
19920 that needs this handling enables it on your behalf.
19922 @item -fasynchronous-unwind-tables
19923 @opindex fasynchronous-unwind-tables
19924 Generate unwind table in DWARF 2 format, if supported by target machine.  The
19925 table is exact at each instruction boundary, so it can be used for stack
19926 unwinding from asynchronous events (such as debugger or garbage collector).
19928 @item -fpcc-struct-return
19929 @opindex fpcc-struct-return
19930 Return ``short'' @code{struct} and @code{union} values in memory like
19931 longer ones, rather than in registers.  This convention is less
19932 efficient, but it has the advantage of allowing intercallability between
19933 GCC-compiled files and files compiled with other compilers, particularly
19934 the Portable C Compiler (pcc).
19936 The precise convention for returning structures in memory depends
19937 on the target configuration macros.
19939 Short structures and unions are those whose size and alignment match
19940 that of some integer type.
19942 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
19943 switch is not binary compatible with code compiled with the
19944 @option{-freg-struct-return} switch.
19945 Use it to conform to a non-default application binary interface.
19947 @item -freg-struct-return
19948 @opindex freg-struct-return
19949 Return @code{struct} and @code{union} values in registers when possible.
19950 This is more efficient for small structures than
19951 @option{-fpcc-struct-return}.
19953 If you specify neither @option{-fpcc-struct-return} nor
19954 @option{-freg-struct-return}, GCC defaults to whichever convention is
19955 standard for the target.  If there is no standard convention, GCC
19956 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
19957 the principal compiler.  In those cases, we can choose the standard, and
19958 we chose the more efficient register return alternative.
19960 @strong{Warning:} code compiled with the @option{-freg-struct-return}
19961 switch is not binary compatible with code compiled with the
19962 @option{-fpcc-struct-return} switch.
19963 Use it to conform to a non-default application binary interface.
19965 @item -fshort-enums
19966 @opindex fshort-enums
19967 Allocate to an @code{enum} type only as many bytes as it needs for the
19968 declared range of possible values.  Specifically, the @code{enum} type
19969 is equivalent to the smallest integer type that has enough room.
19971 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
19972 code that is not binary compatible with code generated without that switch.
19973 Use it to conform to a non-default application binary interface.
19975 @item -fshort-double
19976 @opindex fshort-double
19977 Use the same size for @code{double} as for @code{float}.
19979 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
19980 code that is not binary compatible with code generated without that switch.
19981 Use it to conform to a non-default application binary interface.
19983 @item -fshort-wchar
19984 @opindex fshort-wchar
19985 Override the underlying type for @samp{wchar_t} to be @samp{short
19986 unsigned int} instead of the default for the target.  This option is
19987 useful for building programs to run under WINE@.
19989 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
19990 code that is not binary compatible with code generated without that switch.
19991 Use it to conform to a non-default application binary interface.
19993 @item -fno-common
19994 @opindex fno-common
19995 In C code, controls the placement of uninitialized global variables.
19996 Unix C compilers have traditionally permitted multiple definitions of
19997 such variables in different compilation units by placing the variables
19998 in a common block.
19999 This is the behavior specified by @option{-fcommon}, and is the default
20000 for GCC on most targets.
20001 On the other hand, this behavior is not required by ISO C, and on some
20002 targets may carry a speed or code size penalty on variable references.
20003 The @option{-fno-common} option specifies that the compiler should place
20004 uninitialized global variables in the data section of the object file,
20005 rather than generating them as common blocks.
20006 This has the effect that if the same variable is declared
20007 (without @code{extern}) in two different compilations,
20008 you get a multiple-definition error when you link them.
20009 In this case, you must compile with @option{-fcommon} instead.
20010 Compiling with @option{-fno-common} is useful on targets for which
20011 it provides better performance, or if you wish to verify that the
20012 program will work on other systems that always treat uninitialized
20013 variable declarations this way.
20015 @item -fno-ident
20016 @opindex fno-ident
20017 Ignore the @samp{#ident} directive.
20019 @item -finhibit-size-directive
20020 @opindex finhibit-size-directive
20021 Don't output a @code{.size} assembler directive, or anything else that
20022 would cause trouble if the function is split in the middle, and the
20023 two halves are placed at locations far apart in memory.  This option is
20024 used when compiling @file{crtstuff.c}; you should not need to use it
20025 for anything else.
20027 @item -fverbose-asm
20028 @opindex fverbose-asm
20029 Put extra commentary information in the generated assembly code to
20030 make it more readable.  This option is generally only of use to those
20031 who actually need to read the generated assembly code (perhaps while
20032 debugging the compiler itself).
20034 @option{-fno-verbose-asm}, the default, causes the
20035 extra information to be omitted and is useful when comparing two assembler
20036 files.
20038 @item -frecord-gcc-switches
20039 @opindex frecord-gcc-switches
20040 This switch causes the command line used to invoke the
20041 compiler to be recorded into the object file that is being created.
20042 This switch is only implemented on some targets and the exact format
20043 of the recording is target and binary file format dependent, but it
20044 usually takes the form of a section containing ASCII text.  This
20045 switch is related to the @option{-fverbose-asm} switch, but that
20046 switch only records information in the assembler output file as
20047 comments, so it never reaches the object file.
20048 See also @option{-grecord-gcc-switches} for another
20049 way of storing compiler options into the object file.
20051 @item -fpic
20052 @opindex fpic
20053 @cindex global offset table
20054 @cindex PIC
20055 Generate position-independent code (PIC) suitable for use in a shared
20056 library, if supported for the target machine.  Such code accesses all
20057 constant addresses through a global offset table (GOT)@.  The dynamic
20058 loader resolves the GOT entries when the program starts (the dynamic
20059 loader is not part of GCC; it is part of the operating system).  If
20060 the GOT size for the linked executable exceeds a machine-specific
20061 maximum size, you get an error message from the linker indicating that
20062 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
20063 instead.  (These maximums are 8k on the SPARC and 32k
20064 on the m68k and RS/6000.  The 386 has no such limit.)
20066 Position-independent code requires special support, and therefore works
20067 only on certain machines.  For the 386, GCC supports PIC for System V
20068 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
20069 position-independent.
20071 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20072 are defined to 1.
20074 @item -fPIC
20075 @opindex fPIC
20076 If supported for the target machine, emit position-independent code,
20077 suitable for dynamic linking and avoiding any limit on the size of the
20078 global offset table.  This option makes a difference on the m68k,
20079 PowerPC and SPARC@.
20081 Position-independent code requires special support, and therefore works
20082 only on certain machines.
20084 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20085 are defined to 2.
20087 @item -fpie
20088 @itemx -fPIE
20089 @opindex fpie
20090 @opindex fPIE
20091 These options are similar to @option{-fpic} and @option{-fPIC}, but
20092 generated position independent code can be only linked into executables.
20093 Usually these options are used when @option{-pie} GCC option is
20094 used during linking.
20096 @option{-fpie} and @option{-fPIE} both define the macros
20097 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
20098 for @option{-fpie} and 2 for @option{-fPIE}.
20100 @item -fno-jump-tables
20101 @opindex fno-jump-tables
20102 Do not use jump tables for switch statements even where it would be
20103 more efficient than other code generation strategies.  This option is
20104 of use in conjunction with @option{-fpic} or @option{-fPIC} for
20105 building code that forms part of a dynamic linker and cannot
20106 reference the address of a jump table.  On some targets, jump tables
20107 do not require a GOT and this option is not needed.
20109 @item -ffixed-@var{reg}
20110 @opindex ffixed
20111 Treat the register named @var{reg} as a fixed register; generated code
20112 should never refer to it (except perhaps as a stack pointer, frame
20113 pointer or in some other fixed role).
20115 @var{reg} must be the name of a register.  The register names accepted
20116 are machine-specific and are defined in the @code{REGISTER_NAMES}
20117 macro in the machine description macro file.
20119 This flag does not have a negative form, because it specifies a
20120 three-way choice.
20122 @item -fcall-used-@var{reg}
20123 @opindex fcall-used
20124 Treat the register named @var{reg} as an allocable register that is
20125 clobbered by function calls.  It may be allocated for temporaries or
20126 variables that do not live across a call.  Functions compiled this way
20127 do not save and restore the register @var{reg}.
20129 It is an error to use this flag with the frame pointer or stack pointer.
20130 Use of this flag for other registers that have fixed pervasive roles in
20131 the machine's execution model produces disastrous results.
20133 This flag does not have a negative form, because it specifies a
20134 three-way choice.
20136 @item -fcall-saved-@var{reg}
20137 @opindex fcall-saved
20138 Treat the register named @var{reg} as an allocable register saved by
20139 functions.  It may be allocated even for temporaries or variables that
20140 live across a call.  Functions compiled this way save and restore
20141 the register @var{reg} if they use it.
20143 It is an error to use this flag with the frame pointer or stack pointer.
20144 Use of this flag for other registers that have fixed pervasive roles in
20145 the machine's execution model produces disastrous results.
20147 A different sort of disaster results from the use of this flag for
20148 a register in which function values may be returned.
20150 This flag does not have a negative form, because it specifies a
20151 three-way choice.
20153 @item -fpack-struct[=@var{n}]
20154 @opindex fpack-struct
20155 Without a value specified, pack all structure members together without
20156 holes.  When a value is specified (which must be a small power of two), pack
20157 structure members according to this value, representing the maximum
20158 alignment (that is, objects with default alignment requirements larger than
20159 this are output potentially unaligned at the next fitting location.
20161 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
20162 code that is not binary compatible with code generated without that switch.
20163 Additionally, it makes the code suboptimal.
20164 Use it to conform to a non-default application binary interface.
20166 @item -finstrument-functions
20167 @opindex finstrument-functions
20168 Generate instrumentation calls for entry and exit to functions.  Just
20169 after function entry and just before function exit, the following
20170 profiling functions are called with the address of the current
20171 function and its call site.  (On some platforms,
20172 @code{__builtin_return_address} does not work beyond the current
20173 function, so the call site information may not be available to the
20174 profiling functions otherwise.)
20176 @smallexample
20177 void __cyg_profile_func_enter (void *this_fn,
20178                                void *call_site);
20179 void __cyg_profile_func_exit  (void *this_fn,
20180                                void *call_site);
20181 @end smallexample
20183 The first argument is the address of the start of the current function,
20184 which may be looked up exactly in the symbol table.
20186 This instrumentation is also done for functions expanded inline in other
20187 functions.  The profiling calls indicate where, conceptually, the
20188 inline function is entered and exited.  This means that addressable
20189 versions of such functions must be available.  If all your uses of a
20190 function are expanded inline, this may mean an additional expansion of
20191 code size.  If you use @samp{extern inline} in your C code, an
20192 addressable version of such functions must be provided.  (This is
20193 normally the case anyway, but if you get lucky and the optimizer always
20194 expands the functions inline, you might have gotten away without
20195 providing static copies.)
20197 A function may be given the attribute @code{no_instrument_function}, in
20198 which case this instrumentation is not done.  This can be used, for
20199 example, for the profiling functions listed above, high-priority
20200 interrupt routines, and any functions from which the profiling functions
20201 cannot safely be called (perhaps signal handlers, if the profiling
20202 routines generate output or allocate memory).
20204 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
20205 @opindex finstrument-functions-exclude-file-list
20207 Set the list of functions that are excluded from instrumentation (see
20208 the description of @code{-finstrument-functions}).  If the file that
20209 contains a function definition matches with one of @var{file}, then
20210 that function is not instrumented.  The match is done on substrings:
20211 if the @var{file} parameter is a substring of the file name, it is
20212 considered to be a match.
20214 For example:
20216 @smallexample
20217 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
20218 @end smallexample
20220 @noindent
20221 excludes any inline function defined in files whose pathnames
20222 contain @code{/bits/stl} or @code{include/sys}.
20224 If, for some reason, you want to include letter @code{','} in one of
20225 @var{sym}, write @code{'\,'}. For example,
20226 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
20227 (note the single quote surrounding the option).
20229 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
20230 @opindex finstrument-functions-exclude-function-list
20232 This is similar to @code{-finstrument-functions-exclude-file-list},
20233 but this option sets the list of function names to be excluded from
20234 instrumentation.  The function name to be matched is its user-visible
20235 name, such as @code{vector<int> blah(const vector<int> &)}, not the
20236 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
20237 match is done on substrings: if the @var{sym} parameter is a substring
20238 of the function name, it is considered to be a match.  For C99 and C++
20239 extended identifiers, the function name must be given in UTF-8, not
20240 using universal character names.
20242 @item -fstack-check
20243 @opindex fstack-check
20244 Generate code to verify that you do not go beyond the boundary of the
20245 stack.  You should specify this flag if you are running in an
20246 environment with multiple threads, but you only rarely need to specify it in
20247 a single-threaded environment since stack overflow is automatically
20248 detected on nearly all systems if there is only one stack.
20250 Note that this switch does not actually cause checking to be done; the
20251 operating system or the language runtime must do that.  The switch causes
20252 generation of code to ensure that they see the stack being extended.
20254 You can additionally specify a string parameter: @code{no} means no
20255 checking, @code{generic} means force the use of old-style checking,
20256 @code{specific} means use the best checking method and is equivalent
20257 to bare @option{-fstack-check}.
20259 Old-style checking is a generic mechanism that requires no specific
20260 target support in the compiler but comes with the following drawbacks:
20262 @enumerate
20263 @item
20264 Modified allocation strategy for large objects: they are always
20265 allocated dynamically if their size exceeds a fixed threshold.
20267 @item
20268 Fixed limit on the size of the static frame of functions: when it is
20269 topped by a particular function, stack checking is not reliable and
20270 a warning is issued by the compiler.
20272 @item
20273 Inefficiency: because of both the modified allocation strategy and the
20274 generic implementation, code performance is hampered.
20275 @end enumerate
20277 Note that old-style stack checking is also the fallback method for
20278 @code{specific} if no target support has been added in the compiler.
20280 @item -fstack-limit-register=@var{reg}
20281 @itemx -fstack-limit-symbol=@var{sym}
20282 @itemx -fno-stack-limit
20283 @opindex fstack-limit-register
20284 @opindex fstack-limit-symbol
20285 @opindex fno-stack-limit
20286 Generate code to ensure that the stack does not grow beyond a certain value,
20287 either the value of a register or the address of a symbol.  If a larger
20288 stack is required, a signal is raised at run time.  For most targets,
20289 the signal is raised before the stack overruns the boundary, so
20290 it is possible to catch the signal without taking special precautions.
20292 For instance, if the stack starts at absolute address @samp{0x80000000}
20293 and grows downwards, you can use the flags
20294 @option{-fstack-limit-symbol=__stack_limit} and
20295 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
20296 of 128KB@.  Note that this may only work with the GNU linker.
20298 @item -fsplit-stack
20299 @opindex fsplit-stack
20300 Generate code to automatically split the stack before it overflows.
20301 The resulting program has a discontiguous stack which can only
20302 overflow if the program is unable to allocate any more memory.  This
20303 is most useful when running threaded programs, as it is no longer
20304 necessary to calculate a good stack size to use for each thread.  This
20305 is currently only implemented for the i386 and x86_64 back ends running
20306 GNU/Linux.
20308 When code compiled with @option{-fsplit-stack} calls code compiled
20309 without @option{-fsplit-stack}, there may not be much stack space
20310 available for the latter code to run.  If compiling all code,
20311 including library code, with @option{-fsplit-stack} is not an option,
20312 then the linker can fix up these calls so that the code compiled
20313 without @option{-fsplit-stack} always has a large stack.  Support for
20314 this is implemented in the gold linker in GNU binutils release 2.21
20315 and later.
20317 @item -fleading-underscore
20318 @opindex fleading-underscore
20319 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
20320 change the way C symbols are represented in the object file.  One use
20321 is to help link with legacy assembly code.
20323 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
20324 generate code that is not binary compatible with code generated without that
20325 switch.  Use it to conform to a non-default application binary interface.
20326 Not all targets provide complete support for this switch.
20328 @item -ftls-model=@var{model}
20329 @opindex ftls-model
20330 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
20331 The @var{model} argument should be one of @code{global-dynamic},
20332 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
20334 The default without @option{-fpic} is @code{initial-exec}; with
20335 @option{-fpic} the default is @code{global-dynamic}.
20337 @item -fvisibility=@var{default|internal|hidden|protected}
20338 @opindex fvisibility
20339 Set the default ELF image symbol visibility to the specified option---all
20340 symbols are marked with this unless overridden within the code.
20341 Using this feature can very substantially improve linking and
20342 load times of shared object libraries, produce more optimized
20343 code, provide near-perfect API export and prevent symbol clashes.
20344 It is @strong{strongly} recommended that you use this in any shared objects
20345 you distribute.
20347 Despite the nomenclature, @code{default} always means public; i.e.,
20348 available to be linked against from outside the shared object.
20349 @code{protected} and @code{internal} are pretty useless in real-world
20350 usage so the only other commonly used option is @code{hidden}.
20351 The default if @option{-fvisibility} isn't specified is
20352 @code{default}, i.e., make every
20353 symbol public---this causes the same behavior as previous versions of
20354 GCC@.
20356 A good explanation of the benefits offered by ensuring ELF
20357 symbols have the correct visibility is given by ``How To Write
20358 Shared Libraries'' by Ulrich Drepper (which can be found at
20359 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
20360 solution made possible by this option to marking things hidden when
20361 the default is public is to make the default hidden and mark things
20362 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
20363 and @code{__attribute__ ((visibility("default")))} instead of
20364 @code{__declspec(dllexport)} you get almost identical semantics with
20365 identical syntax.  This is a great boon to those working with
20366 cross-platform projects.
20368 For those adding visibility support to existing code, you may find
20369 @samp{#pragma GCC visibility} of use.  This works by you enclosing
20370 the declarations you wish to set visibility for with (for example)
20371 @samp{#pragma GCC visibility push(hidden)} and
20372 @samp{#pragma GCC visibility pop}.
20373 Bear in mind that symbol visibility should be viewed @strong{as
20374 part of the API interface contract} and thus all new code should
20375 always specify visibility when it is not the default; i.e., declarations
20376 only for use within the local DSO should @strong{always} be marked explicitly
20377 as hidden as so to avoid PLT indirection overheads---making this
20378 abundantly clear also aids readability and self-documentation of the code.
20379 Note that due to ISO C++ specification requirements, @code{operator new} and
20380 @code{operator delete} must always be of default visibility.
20382 Be aware that headers from outside your project, in particular system
20383 headers and headers from any other library you use, may not be
20384 expecting to be compiled with visibility other than the default.  You
20385 may need to explicitly say @samp{#pragma GCC visibility push(default)}
20386 before including any such headers.
20388 @samp{extern} declarations are not affected by @option{-fvisibility}, so
20389 a lot of code can be recompiled with @option{-fvisibility=hidden} with
20390 no modifications.  However, this means that calls to @code{extern}
20391 functions with no explicit visibility use the PLT, so it is more
20392 effective to use @code{__attribute ((visibility))} and/or
20393 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
20394 declarations should be treated as hidden.
20396 Note that @option{-fvisibility} does affect C++ vague linkage
20397 entities. This means that, for instance, an exception class that is
20398 be thrown between DSOs must be explicitly marked with default
20399 visibility so that the @samp{type_info} nodes are unified between
20400 the DSOs.
20402 An overview of these techniques, their benefits and how to use them
20403 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
20405 @item -fstrict-volatile-bitfields
20406 @opindex fstrict-volatile-bitfields
20407 This option should be used if accesses to volatile bit-fields (or other
20408 structure fields, although the compiler usually honors those types
20409 anyway) should use a single access of the width of the
20410 field's type, aligned to a natural alignment if possible.  For
20411 example, targets with memory-mapped peripheral registers might require
20412 all such accesses to be 16 bits wide; with this flag you can
20413 declare all peripheral bit-fields as @code{unsigned short} (assuming short
20414 is 16 bits on these targets) to force GCC to use 16-bit accesses
20415 instead of, perhaps, a more efficient 32-bit access.
20417 If this option is disabled, the compiler uses the most efficient
20418 instruction.  In the previous example, that might be a 32-bit load
20419 instruction, even though that accesses bytes that do not contain
20420 any portion of the bit-field, or memory-mapped registers unrelated to
20421 the one being updated.
20423 If the target requires strict alignment, and honoring the field
20424 type would require violating this alignment, a warning is issued.
20425 If the field has @code{packed} attribute, the access is done without
20426 honoring the field type.  If the field doesn't have @code{packed}
20427 attribute, the access is done honoring the field type.  In both cases,
20428 GCC assumes that the user knows something about the target hardware
20429 that it is unaware of.
20431 The default value of this option is determined by the application binary
20432 interface for the target processor.
20434 @item -fsync-libcalls
20435 @opindex fsync-libcalls
20436 This option controls whether any out-of-line instance of the @code{__sync}
20437 family of functions may be used to implement the C++11 @code{__atomic}
20438 family of functions.
20440 The default value of this option is enabled, thus the only useful form
20441 of the option is @option{-fno-sync-libcalls}.  This option is used in
20442 the implementation of the @file{libatomic} runtime library.
20444 @end table
20446 @c man end
20448 @node Environment Variables
20449 @section Environment Variables Affecting GCC
20450 @cindex environment variables
20452 @c man begin ENVIRONMENT
20453 This section describes several environment variables that affect how GCC
20454 operates.  Some of them work by specifying directories or prefixes to use
20455 when searching for various kinds of files.  Some are used to specify other
20456 aspects of the compilation environment.
20458 Note that you can also specify places to search using options such as
20459 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
20460 take precedence over places specified using environment variables, which
20461 in turn take precedence over those specified by the configuration of GCC@.
20462 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
20463 GNU Compiler Collection (GCC) Internals}.
20465 @table @env
20466 @item LANG
20467 @itemx LC_CTYPE
20468 @c @itemx LC_COLLATE
20469 @itemx LC_MESSAGES
20470 @c @itemx LC_MONETARY
20471 @c @itemx LC_NUMERIC
20472 @c @itemx LC_TIME
20473 @itemx LC_ALL
20474 @findex LANG
20475 @findex LC_CTYPE
20476 @c @findex LC_COLLATE
20477 @findex LC_MESSAGES
20478 @c @findex LC_MONETARY
20479 @c @findex LC_NUMERIC
20480 @c @findex LC_TIME
20481 @findex LC_ALL
20482 @cindex locale
20483 These environment variables control the way that GCC uses
20484 localization information which allows GCC to work with different
20485 national conventions.  GCC inspects the locale categories
20486 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
20487 so.  These locale categories can be set to any value supported by your
20488 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
20489 Kingdom encoded in UTF-8.
20491 The @env{LC_CTYPE} environment variable specifies character
20492 classification.  GCC uses it to determine the character boundaries in
20493 a string; this is needed for some multibyte encodings that contain quote
20494 and escape characters that are otherwise interpreted as a string
20495 end or escape.
20497 The @env{LC_MESSAGES} environment variable specifies the language to
20498 use in diagnostic messages.
20500 If the @env{LC_ALL} environment variable is set, it overrides the value
20501 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
20502 and @env{LC_MESSAGES} default to the value of the @env{LANG}
20503 environment variable.  If none of these variables are set, GCC
20504 defaults to traditional C English behavior.
20506 @item TMPDIR
20507 @findex TMPDIR
20508 If @env{TMPDIR} is set, it specifies the directory to use for temporary
20509 files.  GCC uses temporary files to hold the output of one stage of
20510 compilation which is to be used as input to the next stage: for example,
20511 the output of the preprocessor, which is the input to the compiler
20512 proper.
20514 @item GCC_COMPARE_DEBUG
20515 @findex GCC_COMPARE_DEBUG
20516 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
20517 @option{-fcompare-debug} to the compiler driver.  See the documentation
20518 of this option for more details.
20520 @item GCC_EXEC_PREFIX
20521 @findex GCC_EXEC_PREFIX
20522 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
20523 names of the subprograms executed by the compiler.  No slash is added
20524 when this prefix is combined with the name of a subprogram, but you can
20525 specify a prefix that ends with a slash if you wish.
20527 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
20528 an appropriate prefix to use based on the pathname it is invoked with.
20530 If GCC cannot find the subprogram using the specified prefix, it
20531 tries looking in the usual places for the subprogram.
20533 The default value of @env{GCC_EXEC_PREFIX} is
20534 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
20535 the installed compiler. In many cases @var{prefix} is the value
20536 of @code{prefix} when you ran the @file{configure} script.
20538 Other prefixes specified with @option{-B} take precedence over this prefix.
20540 This prefix is also used for finding files such as @file{crt0.o} that are
20541 used for linking.
20543 In addition, the prefix is used in an unusual way in finding the
20544 directories to search for header files.  For each of the standard
20545 directories whose name normally begins with @samp{/usr/local/lib/gcc}
20546 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
20547 replacing that beginning with the specified prefix to produce an
20548 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
20549 @file{foo/bar} just before it searches the standard directory 
20550 @file{/usr/local/lib/bar}.
20551 If a standard directory begins with the configured
20552 @var{prefix} then the value of @var{prefix} is replaced by
20553 @env{GCC_EXEC_PREFIX} when looking for header files.
20555 @item COMPILER_PATH
20556 @findex COMPILER_PATH
20557 The value of @env{COMPILER_PATH} is a colon-separated list of
20558 directories, much like @env{PATH}.  GCC tries the directories thus
20559 specified when searching for subprograms, if it can't find the
20560 subprograms using @env{GCC_EXEC_PREFIX}.
20562 @item LIBRARY_PATH
20563 @findex LIBRARY_PATH
20564 The value of @env{LIBRARY_PATH} is a colon-separated list of
20565 directories, much like @env{PATH}.  When configured as a native compiler,
20566 GCC tries the directories thus specified when searching for special
20567 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
20568 using GCC also uses these directories when searching for ordinary
20569 libraries for the @option{-l} option (but directories specified with
20570 @option{-L} come first).
20572 @item LANG
20573 @findex LANG
20574 @cindex locale definition
20575 This variable is used to pass locale information to the compiler.  One way in
20576 which this information is used is to determine the character set to be used
20577 when character literals, string literals and comments are parsed in C and C++.
20578 When the compiler is configured to allow multibyte characters,
20579 the following values for @env{LANG} are recognized:
20581 @table @samp
20582 @item C-JIS
20583 Recognize JIS characters.
20584 @item C-SJIS
20585 Recognize SJIS characters.
20586 @item C-EUCJP
20587 Recognize EUCJP characters.
20588 @end table
20590 If @env{LANG} is not defined, or if it has some other value, then the
20591 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
20592 recognize and translate multibyte characters.
20593 @end table
20595 @noindent
20596 Some additional environment variables affect the behavior of the
20597 preprocessor.
20599 @include cppenv.texi
20601 @c man end
20603 @node Precompiled Headers
20604 @section Using Precompiled Headers
20605 @cindex precompiled headers
20606 @cindex speed of compilation
20608 Often large projects have many header files that are included in every
20609 source file.  The time the compiler takes to process these header files
20610 over and over again can account for nearly all of the time required to
20611 build the project.  To make builds faster, GCC allows you to
20612 @dfn{precompile} a header file.
20614 To create a precompiled header file, simply compile it as you would any
20615 other file, if necessary using the @option{-x} option to make the driver
20616 treat it as a C or C++ header file.  You may want to use a
20617 tool like @command{make} to keep the precompiled header up-to-date when
20618 the headers it contains change.
20620 A precompiled header file is searched for when @code{#include} is
20621 seen in the compilation.  As it searches for the included file
20622 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
20623 compiler looks for a precompiled header in each directory just before it
20624 looks for the include file in that directory.  The name searched for is
20625 the name specified in the @code{#include} with @samp{.gch} appended.  If
20626 the precompiled header file can't be used, it is ignored.
20628 For instance, if you have @code{#include "all.h"}, and you have
20629 @file{all.h.gch} in the same directory as @file{all.h}, then the
20630 precompiled header file is used if possible, and the original
20631 header is used otherwise.
20633 Alternatively, you might decide to put the precompiled header file in a
20634 directory and use @option{-I} to ensure that directory is searched
20635 before (or instead of) the directory containing the original header.
20636 Then, if you want to check that the precompiled header file is always
20637 used, you can put a file of the same name as the original header in this
20638 directory containing an @code{#error} command.
20640 This also works with @option{-include}.  So yet another way to use
20641 precompiled headers, good for projects not designed with precompiled
20642 header files in mind, is to simply take most of the header files used by
20643 a project, include them from another header file, precompile that header
20644 file, and @option{-include} the precompiled header.  If the header files
20645 have guards against multiple inclusion, they are skipped because
20646 they've already been included (in the precompiled header).
20648 If you need to precompile the same header file for different
20649 languages, targets, or compiler options, you can instead make a
20650 @emph{directory} named like @file{all.h.gch}, and put each precompiled
20651 header in the directory, perhaps using @option{-o}.  It doesn't matter
20652 what you call the files in the directory; every precompiled header in
20653 the directory is considered.  The first precompiled header
20654 encountered in the directory that is valid for this compilation is
20655 used; they're searched in no particular order.
20657 There are many other possibilities, limited only by your imagination,
20658 good sense, and the constraints of your build system.
20660 A precompiled header file can be used only when these conditions apply:
20662 @itemize
20663 @item
20664 Only one precompiled header can be used in a particular compilation.
20666 @item
20667 A precompiled header can't be used once the first C token is seen.  You
20668 can have preprocessor directives before a precompiled header; you cannot
20669 include a precompiled header from inside another header.
20671 @item
20672 The precompiled header file must be produced for the same language as
20673 the current compilation.  You can't use a C precompiled header for a C++
20674 compilation.
20676 @item
20677 The precompiled header file must have been produced by the same compiler
20678 binary as the current compilation is using.
20680 @item
20681 Any macros defined before the precompiled header is included must
20682 either be defined in the same way as when the precompiled header was
20683 generated, or must not affect the precompiled header, which usually
20684 means that they don't appear in the precompiled header at all.
20686 The @option{-D} option is one way to define a macro before a
20687 precompiled header is included; using a @code{#define} can also do it.
20688 There are also some options that define macros implicitly, like
20689 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
20690 defined this way.
20692 @item If debugging information is output when using the precompiled
20693 header, using @option{-g} or similar, the same kind of debugging information
20694 must have been output when building the precompiled header.  However,
20695 a precompiled header built using @option{-g} can be used in a compilation
20696 when no debugging information is being output.
20698 @item The same @option{-m} options must generally be used when building
20699 and using the precompiled header.  @xref{Submodel Options},
20700 for any cases where this rule is relaxed.
20702 @item Each of the following options must be the same when building and using
20703 the precompiled header:
20705 @gccoptlist{-fexceptions}
20707 @item
20708 Some other command-line options starting with @option{-f},
20709 @option{-p}, or @option{-O} must be defined in the same way as when
20710 the precompiled header was generated.  At present, it's not clear
20711 which options are safe to change and which are not; the safest choice
20712 is to use exactly the same options when generating and using the
20713 precompiled header.  The following are known to be safe:
20715 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
20716 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
20717 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
20718 -pedantic-errors}
20720 @end itemize
20722 For all of these except the last, the compiler automatically
20723 ignores the precompiled header if the conditions aren't met.  If you
20724 find an option combination that doesn't work and doesn't cause the
20725 precompiled header to be ignored, please consider filing a bug report,
20726 see @ref{Bugs}.
20728 If you do use differing options when generating and using the
20729 precompiled header, the actual behavior is a mixture of the
20730 behavior for the options.  For instance, if you use @option{-g} to
20731 generate the precompiled header but not when using it, you may or may
20732 not get debugging information for routines in the precompiled header.