8ca2f4ecd02654496d16bc9cba815342018e66e5
[platform/upstream/gcc.git] / gcc / doc / invoke.texi
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.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
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.
17
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.
25
26 (a) The FSF's Front-Cover Text is:
27
28      A GNU Manual
29
30 (b) The FSF's Back-Cover Text is:
31
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{}
47
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
67
68 @node Invoking GCC
69 @chapter GCC Command Options
70 @cindex GCC command options
71 @cindex command options
72 @cindex options, GCC command
73
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.
80
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.
85
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.
92
93 @cindex C++ compilation options
94 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
95 options for compiling C++ programs.
96
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}}.
103
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.
111
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.
118
119 @c man end
120
121 @xref{Option Index}, for an index to GCC's options.
122
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
153
154 @c man begin OPTIONS
155
156 @node Option Summary
157 @section Option Summary
158
159 Here is a summary of all the options, grouped by type.  Explanations are
160 in the following sections.
161
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{]} -fdump-go-spec=@var{file}}
170
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}
181
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 -fconserve-space  -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 -Wnarrowing -Wnoexcept @gol
202 -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}
207
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}
228
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}
234
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-format-attribute  -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 @gol
265 -Wreturn-type  -Wsequence-point  -Wshadow @gol
266 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
267 -Wstack-usage=@var{len} -Wstrict-aliasing -Wstrict-aliasing=n @gol
268 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
269 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
270 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
271 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
272 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
273 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
274 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
275 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
276 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
277 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
278 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
279
280 @item C and Objective-C-only Warning Options
281 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
282 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
283 -Wold-style-declaration  -Wold-style-definition @gol
284 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
285 -Wdeclaration-after-statement -Wpointer-sign}
286
287 @item Debugging Options
288 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
289 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
290 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
291 -fdisable-ipa-@var{pass_name} @gol
292 -fdisable-rtl-@var{pass_name} @gol
293 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
294 -fdisable-tree-@var{pass_name} @gol
295 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
296 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
297 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
298 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
299 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
300 -fdump-passes @gol
301 -fdump-statistics @gol
302 -fdump-tree-all @gol
303 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
304 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
306 -fdump-tree-ch @gol
307 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-nrv -fdump-tree-vect @gol
317 -fdump-tree-sink @gol
318 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
322 -ftree-vectorizer-verbose=@var{n} @gol
323 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
324 -fdump-final-insns=@var{file} @gol
325 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
326 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
327 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
328 -fenable-@var{kind}-@var{pass} @gol
329 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
330 -fdebug-types-section @gol
331 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
332 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
333 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
334 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
335 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
336 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
337 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
338 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
339 -gvms  -gxcoff  -gxcoff+ @gol
340 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
341 -fdebug-prefix-map=@var{old}=@var{new} @gol
342 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
343 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
344 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
345 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
346 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
347 -print-sysroot -print-sysroot-headers-suffix @gol
348 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
349
350 @item Optimization Options
351 @xref{Optimize Options,,Options that Control Optimization}.
352 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
353 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
354 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
355 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
356 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
357 -fcompare-elim -fcprop-registers -fcrossjumping @gol
358 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
359 -fcx-limited-range @gol
360 -fdata-sections -fdce -fdelayed-branch @gol
361 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
362 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
363 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
364 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
365 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
366 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
367 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
368 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
369 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
370 -fira-algorithm=@var{algorithm} @gol
371 -fira-region=@var{region} @gol
372 -fira-loop-pressure -fno-ira-share-save-slots @gol
373 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
374 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
375 -floop-block -floop-interchange -floop-strip-mine @gol
376 -floop-parallelize-all -flto -flto-compression-level @gol
377 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
378 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
379 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
380 -fno-default-inline @gol
381 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
382 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
383 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
384 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
385 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
386 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
387 -fprefetch-loop-arrays @gol
388 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
389 -fprofile-generate=@var{path} @gol
390 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
391 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
392 -freorder-blocks-and-partition -freorder-functions @gol
393 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
394 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
395 -fsched-spec-load -fsched-spec-load-dangerous @gol
396 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
397 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
398 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
399 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
400 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
401 -fselective-scheduling -fselective-scheduling2 @gol
402 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
403 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
404 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
405 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
406 -fthread-jumps -ftracer -ftree-bit-ccp @gol
407 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
408 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
409 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
410 -ftree-loop-if-convert-stores -ftree-loop-im @gol
411 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
412 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
413 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
414 -ftree-sink -ftree-sra -ftree-switch-conversion -ftree-tail-merge @gol
415 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
416 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
417 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
418 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
419 -fwhole-program -fwpa -fuse-linker-plugin @gol
420 --param @var{name}=@var{value}
421 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
422
423 @item Preprocessor Options
424 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
425 @gccoptlist{-A@var{question}=@var{answer} @gol
426 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
427 -C  -dD  -dI  -dM  -dN @gol
428 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
429 -idirafter @var{dir} @gol
430 -include @var{file}  -imacros @var{file} @gol
431 -iprefix @var{file}  -iwithprefix @var{dir} @gol
432 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
433 -imultilib @var{dir} -isysroot @var{dir} @gol
434 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
435 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
436 -remap -trigraphs  -undef  -U@var{macro}  @gol
437 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
438
439 @item Assembler Option
440 @xref{Assembler Options,,Passing Options to the Assembler}.
441 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
442
443 @item Linker Options
444 @xref{Link Options,,Options for Linking}.
445 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
446 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
447 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
448 -shared-libgcc  -symbolic @gol
449 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
450 -u @var{symbol}}
451
452 @item Directory Options
453 @xref{Directory Options,,Options for Directory Search}.
454 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
455 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
456 --sysroot=@var{dir}}
457
458 @item Machine Dependent Options
459 @xref{Submodel Options,,Hardware Models and Configurations}.
460 @c This list is ordered alphanumerically by subsection name.
461 @c Try and put the significant identifier (CPU or system) first,
462 @c so users have a clue at guessing where the ones they want will be.
463
464 @emph{Adapteva Epiphany Options}
465 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
466 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
467 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
468 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
469 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
470 -msplit-vecmove-early -m1reg-@var{reg}}
471
472 @emph{ARM Options}
473 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
474 -mabi=@var{name} @gol
475 -mapcs-stack-check  -mno-apcs-stack-check @gol
476 -mapcs-float  -mno-apcs-float @gol
477 -mapcs-reentrant  -mno-apcs-reentrant @gol
478 -msched-prolog  -mno-sched-prolog @gol
479 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
480 -mfloat-abi=@var{name}  -mfpe @gol
481 -mfp16-format=@var{name}
482 -mthumb-interwork  -mno-thumb-interwork @gol
483 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
484 -mstructure-size-boundary=@var{n} @gol
485 -mabort-on-noreturn @gol
486 -mlong-calls  -mno-long-calls @gol
487 -msingle-pic-base  -mno-single-pic-base @gol
488 -mpic-register=@var{reg} @gol
489 -mnop-fun-dllimport @gol
490 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
491 -mpoke-function-name @gol
492 -mthumb  -marm @gol
493 -mtpcs-frame  -mtpcs-leaf-frame @gol
494 -mcaller-super-interworking  -mcallee-super-interworking @gol
495 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
496 -mword-relocations @gol
497 -mfix-cortex-m3-ldrd}
498
499 @emph{AVR Options}
500 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
501 -mcall-prologues -mint8 -mno-interrupts -mrelax -mshort-calls @gol
502 -mstrict-X -mtiny-stack}
503
504 @emph{Blackfin Options}
505 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
506 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
507 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
508 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
509 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
510 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
511 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
512 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
513 -micplb}
514
515 @emph{C6X Options}
516 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
517 -msim -msdata=@var{sdata-type}}
518
519 @emph{CRIS Options}
520 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
521 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
522 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
523 -mstack-align  -mdata-align  -mconst-align @gol
524 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
525 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
526 -mmul-bug-workaround  -mno-mul-bug-workaround}
527
528 @emph{CR16 Options}
529 @gccoptlist{-mmac @gol
530 -mcr16cplus -mcr16c @gol
531 -msim -mint32 -mbit-ops
532 -mdata-model=@var{model}}
533
534 @emph{Darwin Options}
535 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
536 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
537 -client_name  -compatibility_version  -current_version @gol
538 -dead_strip @gol
539 -dependency-file  -dylib_file  -dylinker_install_name @gol
540 -dynamic  -dynamiclib  -exported_symbols_list @gol
541 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
542 -force_flat_namespace  -headerpad_max_install_names @gol
543 -iframework @gol
544 -image_base  -init  -install_name  -keep_private_externs @gol
545 -multi_module  -multiply_defined  -multiply_defined_unused @gol
546 -noall_load   -no_dead_strip_inits_and_terms @gol
547 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
548 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
549 -private_bundle  -read_only_relocs  -sectalign @gol
550 -sectobjectsymbols  -whyload  -seg1addr @gol
551 -sectcreate  -sectobjectsymbols  -sectorder @gol
552 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
553 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
554 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
555 -single_module  -static  -sub_library  -sub_umbrella @gol
556 -twolevel_namespace  -umbrella  -undefined @gol
557 -unexported_symbols_list  -weak_reference_mismatches @gol
558 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
559 -mkernel -mone-byte-bool}
560
561 @emph{DEC Alpha Options}
562 @gccoptlist{-mno-fp-regs  -msoft-float @gol
563 -mieee  -mieee-with-inexact  -mieee-conformant @gol
564 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
565 -mtrap-precision=@var{mode}  -mbuild-constants @gol
566 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
567 -mbwx  -mmax  -mfix  -mcix @gol
568 -mfloat-vax  -mfloat-ieee @gol
569 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
570 -msmall-text  -mlarge-text @gol
571 -mmemory-latency=@var{time}}
572
573 @emph{FR30 Options}
574 @gccoptlist{-msmall-model -mno-lsim}
575
576 @emph{FRV Options}
577 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
578 -mhard-float  -msoft-float @gol
579 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
580 -mdouble  -mno-double @gol
581 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
582 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
583 -mlinked-fp  -mlong-calls  -malign-labels @gol
584 -mlibrary-pic  -macc-4  -macc-8 @gol
585 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
586 -moptimize-membar -mno-optimize-membar @gol
587 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
588 -mvliw-branch  -mno-vliw-branch @gol
589 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
590 -mno-nested-cond-exec  -mtomcat-stats @gol
591 -mTLS -mtls @gol
592 -mcpu=@var{cpu}}
593
594 @emph{GNU/Linux Options}
595 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
596 -tno-android-cc -tno-android-ld}
597
598 @emph{H8/300 Options}
599 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
600
601 @emph{HPPA Options}
602 @gccoptlist{-march=@var{architecture-type} @gol
603 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
604 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
605 -mfixed-range=@var{register-range} @gol
606 -mjump-in-delay -mlinker-opt -mlong-calls @gol
607 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
608 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
609 -mno-jump-in-delay  -mno-long-load-store @gol
610 -mno-portable-runtime  -mno-soft-float @gol
611 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
612 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
613 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
614 -munix=@var{unix-std}  -nolibdld  -static  -threads}
615
616 @emph{i386 and x86-64 Options}
617 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
618 -mfpmath=@var{unit} @gol
619 -masm=@var{dialect}  -mno-fancy-math-387 @gol
620 -mno-fp-ret-in-387  -msoft-float @gol
621 -mno-wide-multiply  -mrtd  -malign-double @gol
622 -mpreferred-stack-boundary=@var{num} @gol
623 -mincoming-stack-boundary=@var{num} @gol
624 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
625 -mrecip -mrecip=@var{opt} @gol
626 -mvzeroupper @gol
627 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
628 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
629 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
630 -mbmi2 -mrtm -mlwp -mthreads @gol
631 -mno-align-stringops  -minline-all-stringops @gol
632 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
633 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
634 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
635 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
636 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
637 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
638 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
639 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
640 -msse2avx -mfentry -m8bit-idiv @gol
641 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
642
643 @emph{i386 and x86-64 Windows Options}
644 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
645 -mnop-fun-dllimport -mthread @gol
646 -municode -mwin32 -mwindows -fno-set-stack-executable}
647
648 @emph{IA-64 Options}
649 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
650 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
651 -mconstant-gp  -mauto-pic  -mfused-madd @gol
652 -minline-float-divide-min-latency @gol
653 -minline-float-divide-max-throughput @gol
654 -mno-inline-float-divide @gol
655 -minline-int-divide-min-latency @gol
656 -minline-int-divide-max-throughput  @gol
657 -mno-inline-int-divide @gol
658 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
659 -mno-inline-sqrt @gol
660 -mdwarf2-asm -mearly-stop-bits @gol
661 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
662 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
663 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
664 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
665 -msched-spec-ldc -msched-spec-control-ldc @gol
666 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
667 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
668 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
669 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
670
671 @emph{LM32 Options}
672 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
673 -msign-extend-enabled -muser-enabled}
674
675 @emph{M32R/D Options}
676 @gccoptlist{-m32r2 -m32rx -m32r @gol
677 -mdebug @gol
678 -malign-loops -mno-align-loops @gol
679 -missue-rate=@var{number} @gol
680 -mbranch-cost=@var{number} @gol
681 -mmodel=@var{code-size-model-type} @gol
682 -msdata=@var{sdata-type} @gol
683 -mno-flush-func -mflush-func=@var{name} @gol
684 -mno-flush-trap -mflush-trap=@var{number} @gol
685 -G @var{num}}
686
687 @emph{M32C Options}
688 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
689
690 @emph{M680x0 Options}
691 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
692 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
693 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
694 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
695 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
696 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
697 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
698 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
699 -mxgot -mno-xgot}
700
701 @emph{MCore Options}
702 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
703 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
704 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
705 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
706 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
707
708 @emph{MeP Options}
709 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
710 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
711 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
712 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
713 -mtiny=@var{n}}
714
715 @emph{MicroBlaze Options}
716 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
717 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
718 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
719 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
720 -mxl-mode-@var{app-model}}
721
722 @emph{MIPS Options}
723 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
724 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
725 -mips64  -mips64r2 @gol
726 -mips16  -mno-mips16  -mflip-mips16 @gol
727 -minterlink-mips16  -mno-interlink-mips16 @gol
728 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
729 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
730 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
731 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
732 -mfpu=@var{fpu-type} @gol
733 -msmartmips  -mno-smartmips @gol
734 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
735 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
736 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
737 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
738 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
739 -membedded-data  -mno-embedded-data @gol
740 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
741 -mcode-readable=@var{setting} @gol
742 -msplit-addresses  -mno-split-addresses @gol
743 -mexplicit-relocs  -mno-explicit-relocs @gol
744 -mcheck-zero-division  -mno-check-zero-division @gol
745 -mdivide-traps  -mdivide-breaks @gol
746 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
747 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
748 -mfix-24k -mno-fix-24k @gol
749 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
750 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
751 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
752 -mflush-func=@var{func}  -mno-flush-func @gol
753 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
754 -mfp-exceptions -mno-fp-exceptions @gol
755 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
756 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
757
758 @emph{MMIX Options}
759 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
760 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
761 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
762 -mno-base-addresses  -msingle-exit  -mno-single-exit}
763
764 @emph{MN10300 Options}
765 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
766 -mno-am33 -mam33 -mam33-2 -mam34 @gol
767 -mtune=@var{cpu-type} @gol
768 -mreturn-pointer-on-d0 @gol
769 -mno-crt0  -mrelax -mliw -msetlb}
770
771 @emph{PDP-11 Options}
772 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
773 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
774 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
775 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
776 -mbranch-expensive  -mbranch-cheap @gol
777 -munix-asm  -mdec-asm}
778
779 @emph{picoChip Options}
780 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
781 -msymbol-as-address -mno-inefficient-warnings}
782
783 @emph{PowerPC Options}
784 See RS/6000 and PowerPC Options.
785
786 @emph{RL78 Options}
787 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
788
789 @emph{RS/6000 and PowerPC Options}
790 @gccoptlist{-mcpu=@var{cpu-type} @gol
791 -mtune=@var{cpu-type} @gol
792 -mcmodel=@var{code-model} @gol
793 -mpower  -mno-power  -mpower2  -mno-power2 @gol
794 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
795 -maltivec  -mno-altivec @gol
796 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
797 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
798 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
799 -mfprnd  -mno-fprnd @gol
800 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
801 -mnew-mnemonics  -mold-mnemonics @gol
802 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
803 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
804 -malign-power  -malign-natural @gol
805 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
806 -msingle-float -mdouble-float -msimple-fpu @gol
807 -mstring  -mno-string  -mupdate  -mno-update @gol
808 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
809 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
810 -mstrict-align  -mno-strict-align  -mrelocatable @gol
811 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
812 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
813 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
814 -mprioritize-restricted-insns=@var{priority} @gol
815 -msched-costly-dep=@var{dependence_type} @gol
816 -minsert-sched-nops=@var{scheme} @gol
817 -mcall-sysv  -mcall-netbsd @gol
818 -maix-struct-return  -msvr4-struct-return @gol
819 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
820 -mblock-move-inline-limit=@var{num} @gol
821 -misel -mno-isel @gol
822 -misel=yes  -misel=no @gol
823 -mspe -mno-spe @gol
824 -mspe=yes  -mspe=no @gol
825 -mpaired @gol
826 -mgen-cell-microcode -mwarn-cell-microcode @gol
827 -mvrsave -mno-vrsave @gol
828 -mmulhw -mno-mulhw @gol
829 -mdlmzb -mno-dlmzb @gol
830 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
831 -mprototype  -mno-prototype @gol
832 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
833 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
834 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
835 -mno-recip-precision @gol
836 -mveclibabi=@var{type} -mfriz -mno-friz @gol
837 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
838 -msave-toc-indirect -mno-save-toc-indirect}
839
840 @emph{RX Options}
841 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
842 -mcpu=@gol
843 -mbig-endian-data -mlittle-endian-data @gol
844 -msmall-data @gol
845 -msim  -mno-sim@gol
846 -mas100-syntax -mno-as100-syntax@gol
847 -mrelax@gol
848 -mmax-constant-size=@gol
849 -mint-register=@gol
850 -mpid@gol
851 -msave-acc-in-interrupts}
852
853 @emph{S/390 and zSeries Options}
854 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
855 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
856 -mlong-double-64 -mlong-double-128 @gol
857 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
858 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
859 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
860 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
861 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
862
863 @emph{Score Options}
864 @gccoptlist{-meb -mel @gol
865 -mnhwloop @gol
866 -muls @gol
867 -mmac @gol
868 -mscore5 -mscore5u -mscore7 -mscore7d}
869
870 @emph{SH Options}
871 @gccoptlist{-m1  -m2  -m2e @gol
872 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
873 -m3  -m3e @gol
874 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
875 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
876 -m5-64media  -m5-64media-nofpu @gol
877 -m5-32media  -m5-32media-nofpu @gol
878 -m5-compact  -m5-compact-nofpu @gol
879 -mb  -ml  -mdalign  -mrelax @gol
880 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
881 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
882 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
883 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
884 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
885 -maccumulate-outgoing-args -minvalid-symbols -msoft-atomic @gol
886 -mbranch-cost=@var{num} -mcbranchdi -mcmpeqdi -mfused-madd -mpretend-cmove @gol
887 -menable-tas}
888
889 @emph{Solaris 2 Options}
890 @gccoptlist{-mimpure-text  -mno-impure-text @gol
891 -pthreads -pthread}
892
893 @emph{SPARC Options}
894 @gccoptlist{-mcpu=@var{cpu-type} @gol
895 -mtune=@var{cpu-type} @gol
896 -mcmodel=@var{code-model} @gol
897 -mmemory-model=@var{mem-model} @gol
898 -m32  -m64  -mapp-regs  -mno-app-regs @gol
899 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
900 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
901 -mhard-quad-float  -msoft-quad-float @gol
902 -mlittle-endian @gol
903 -mstack-bias  -mno-stack-bias @gol
904 -munaligned-doubles  -mno-unaligned-doubles @gol
905 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
906 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
907 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
908 -mfix-at697f}
909
910 @emph{SPU Options}
911 @gccoptlist{-mwarn-reloc -merror-reloc @gol
912 -msafe-dma -munsafe-dma @gol
913 -mbranch-hints @gol
914 -msmall-mem -mlarge-mem -mstdmain @gol
915 -mfixed-range=@var{register-range} @gol
916 -mea32 -mea64 @gol
917 -maddress-space-conversion -mno-address-space-conversion @gol
918 -mcache-size=@var{cache-size} @gol
919 -matomic-updates -mno-atomic-updates}
920
921 @emph{System V Options}
922 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
923
924 @emph{TILE-Gx Options}
925 @gccoptlist{-mcpu=CPU -m32 -m64}
926
927 @emph{TILEPro Options}
928 @gccoptlist{-mcpu=CPU -m32}
929
930 @emph{V850 Options}
931 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
932 -mprolog-function  -mno-prolog-function  -mspace @gol
933 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
934 -mapp-regs  -mno-app-regs @gol
935 -mdisable-callt  -mno-disable-callt @gol
936 -mv850e2v3 @gol
937 -mv850e2 @gol
938 -mv850e1 -mv850es @gol
939 -mv850e @gol
940 -mv850  -mbig-switch}
941
942 @emph{VAX Options}
943 @gccoptlist{-mg  -mgnu  -munix}
944
945 @emph{VMS Options}
946 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
947 -mpointer-size=@var{size}}
948
949 @emph{VxWorks Options}
950 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
951 -Xbind-lazy  -Xbind-now}
952
953 @emph{x86-64 Options}
954 See i386 and x86-64 Options.
955
956 @emph{Xstormy16 Options}
957 @gccoptlist{-msim}
958
959 @emph{Xtensa Options}
960 @gccoptlist{-mconst16 -mno-const16 @gol
961 -mfused-madd  -mno-fused-madd @gol
962 -mforce-no-pic @gol
963 -mserialize-volatile  -mno-serialize-volatile @gol
964 -mtext-section-literals  -mno-text-section-literals @gol
965 -mtarget-align  -mno-target-align @gol
966 -mlongcalls  -mno-longcalls}
967
968 @emph{zSeries Options}
969 See S/390 and zSeries Options.
970
971 @item Code Generation Options
972 @xref{Code Gen Options,,Options for Code Generation Conventions}.
973 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
974 -ffixed-@var{reg}  -fexceptions @gol
975 -fnon-call-exceptions  -funwind-tables @gol
976 -fasynchronous-unwind-tables @gol
977 -finhibit-size-directive  -finstrument-functions @gol
978 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
979 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
980 -fno-common  -fno-ident @gol
981 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
982 -fno-jump-tables @gol
983 -frecord-gcc-switches @gol
984 -freg-struct-return  -fshort-enums @gol
985 -fshort-double  -fshort-wchar @gol
986 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
987 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
988 -fno-stack-limit -fsplit-stack @gol
989 -fleading-underscore  -ftls-model=@var{model} @gol
990 -ftrapv  -fwrapv  -fbounds-check @gol
991 -fvisibility -fstrict-volatile-bitfields}
992 @end table
993
994 @menu
995 * Overall Options::     Controlling the kind of output:
996                         an executable, object files, assembler files,
997                         or preprocessed source.
998 * C Dialect Options::   Controlling the variant of C language compiled.
999 * C++ Dialect Options:: Variations on C++.
1000 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1001                         and Objective-C++.
1002 * Language Independent Options:: Controlling how diagnostics should be
1003                         formatted.
1004 * Warning Options::     How picky should the compiler be?
1005 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1006 * Optimize Options::    How much optimization?
1007 * Preprocessor Options:: Controlling header files and macro definitions.
1008                          Also, getting dependency information for Make.
1009 * Assembler Options::   Passing options to the assembler.
1010 * Link Options::        Specifying libraries and so on.
1011 * Directory Options::   Where to find header files and libraries.
1012                         Where to find the compiler executable files.
1013 * Spec Files::          How to pass switches to sub-processes.
1014 * Target Options::      Running a cross-compiler, or an old version of GCC.
1015 @end menu
1016
1017 @node Overall Options
1018 @section Options Controlling the Kind of Output
1019
1020 Compilation can involve up to four stages: preprocessing, compilation
1021 proper, assembly and linking, always in that order.  GCC is capable of
1022 preprocessing and compiling several files either into several
1023 assembler input files, or into one assembler input file; then each
1024 assembler input file produces an object file, and linking combines all
1025 the object files (those newly compiled, and those specified as input)
1026 into an executable file.
1027
1028 @cindex file name suffix
1029 For any given input file, the file name suffix determines what kind of
1030 compilation is done:
1031
1032 @table @gcctabopt
1033 @item @var{file}.c
1034 C source code that must be preprocessed.
1035
1036 @item @var{file}.i
1037 C source code that should not be preprocessed.
1038
1039 @item @var{file}.ii
1040 C++ source code that should not be preprocessed.
1041
1042 @item @var{file}.m
1043 Objective-C source code.  Note that you must link with the @file{libobjc}
1044 library to make an Objective-C program work.
1045
1046 @item @var{file}.mi
1047 Objective-C source code that should not be preprocessed.
1048
1049 @item @var{file}.mm
1050 @itemx @var{file}.M
1051 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1052 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1053 to a literal capital M@.
1054
1055 @item @var{file}.mii
1056 Objective-C++ source code that should not be preprocessed.
1057
1058 @item @var{file}.h
1059 C, C++, Objective-C or Objective-C++ header file to be turned into a
1060 precompiled header (default), or C, C++ header file to be turned into an
1061 Ada spec (via the @option{-fdump-ada-spec} switch).
1062
1063 @item @var{file}.cc
1064 @itemx @var{file}.cp
1065 @itemx @var{file}.cxx
1066 @itemx @var{file}.cpp
1067 @itemx @var{file}.CPP
1068 @itemx @var{file}.c++
1069 @itemx @var{file}.C
1070 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1071 the last two letters must both be literally @samp{x}.  Likewise,
1072 @samp{.C} refers to a literal capital C@.
1073
1074 @item @var{file}.mm
1075 @itemx @var{file}.M
1076 Objective-C++ source code that must be preprocessed.
1077
1078 @item @var{file}.mii
1079 Objective-C++ source code that should not be preprocessed.
1080
1081 @item @var{file}.hh
1082 @itemx @var{file}.H
1083 @itemx @var{file}.hp
1084 @itemx @var{file}.hxx
1085 @itemx @var{file}.hpp
1086 @itemx @var{file}.HPP
1087 @itemx @var{file}.h++
1088 @itemx @var{file}.tcc
1089 C++ header file to be turned into a precompiled header or Ada spec.
1090
1091 @item @var{file}.f
1092 @itemx @var{file}.for
1093 @itemx @var{file}.ftn
1094 Fixed form Fortran source code that should not be preprocessed.
1095
1096 @item @var{file}.F
1097 @itemx @var{file}.FOR
1098 @itemx @var{file}.fpp
1099 @itemx @var{file}.FPP
1100 @itemx @var{file}.FTN
1101 Fixed form Fortran source code that must be preprocessed (with the traditional
1102 preprocessor).
1103
1104 @item @var{file}.f90
1105 @itemx @var{file}.f95
1106 @itemx @var{file}.f03
1107 @itemx @var{file}.f08
1108 Free form Fortran source code that should not be preprocessed.
1109
1110 @item @var{file}.F90
1111 @itemx @var{file}.F95
1112 @itemx @var{file}.F03
1113 @itemx @var{file}.F08
1114 Free form Fortran source code that must be preprocessed (with the
1115 traditional preprocessor).
1116
1117 @item @var{file}.go
1118 Go source code.
1119
1120 @c FIXME: Descriptions of Java file types.
1121 @c @var{file}.java
1122 @c @var{file}.class
1123 @c @var{file}.zip
1124 @c @var{file}.jar
1125
1126 @item @var{file}.ads
1127 Ada source code file that contains a library unit declaration (a
1128 declaration of a package, subprogram, or generic, or a generic
1129 instantiation), or a library unit renaming declaration (a package,
1130 generic, or subprogram renaming declaration).  Such files are also
1131 called @dfn{specs}.
1132
1133 @item @var{file}.adb
1134 Ada source code file containing a library unit body (a subprogram or
1135 package body).  Such files are also called @dfn{bodies}.
1136
1137 @c GCC also knows about some suffixes for languages not yet included:
1138 @c Pascal:
1139 @c @var{file}.p
1140 @c @var{file}.pas
1141 @c Ratfor:
1142 @c @var{file}.r
1143
1144 @item @var{file}.s
1145 Assembler code.
1146
1147 @item @var{file}.S
1148 @itemx @var{file}.sx
1149 Assembler code that must be preprocessed.
1150
1151 @item @var{other}
1152 An object file to be fed straight into linking.
1153 Any file name with no recognized suffix is treated this way.
1154 @end table
1155
1156 @opindex x
1157 You can specify the input language explicitly with the @option{-x} option:
1158
1159 @table @gcctabopt
1160 @item -x @var{language}
1161 Specify explicitly the @var{language} for the following input files
1162 (rather than letting the compiler choose a default based on the file
1163 name suffix).  This option applies to all following input files until
1164 the next @option{-x} option.  Possible values for @var{language} are:
1165 @smallexample
1166 c  c-header  cpp-output
1167 c++  c++-header  c++-cpp-output
1168 objective-c  objective-c-header  objective-c-cpp-output
1169 objective-c++ objective-c++-header objective-c++-cpp-output
1170 assembler  assembler-with-cpp
1171 ada
1172 f77  f77-cpp-input f95  f95-cpp-input
1173 go
1174 java
1175 @end smallexample
1176
1177 @item -x none
1178 Turn off any specification of a language, so that subsequent files are
1179 handled according to their file name suffixes (as they are if @option{-x}
1180 has not been used at all).
1181
1182 @item -pass-exit-codes
1183 @opindex pass-exit-codes
1184 Normally the @command{gcc} program exits with the code of 1 if any
1185 phase of the compiler returns a non-success return code.  If you specify
1186 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1187 the numerically highest error produced by any phase returning an error
1188 indication.  The C, C++, and Fortran front ends return 4 if an internal
1189 compiler error is encountered.
1190 @end table
1191
1192 If you only want some of the stages of compilation, you can use
1193 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1194 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1195 @command{gcc} is to stop.  Note that some combinations (for example,
1196 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1197
1198 @table @gcctabopt
1199 @item -c
1200 @opindex c
1201 Compile or assemble the source files, but do not link.  The linking
1202 stage simply is not done.  The ultimate output is in the form of an
1203 object file for each source file.
1204
1205 By default, the object file name for a source file is made by replacing
1206 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1207
1208 Unrecognized input files, not requiring compilation or assembly, are
1209 ignored.
1210
1211 @item -S
1212 @opindex S
1213 Stop after the stage of compilation proper; do not assemble.  The output
1214 is in the form of an assembler code file for each non-assembler input
1215 file specified.
1216
1217 By default, the assembler file name for a source file is made by
1218 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1219
1220 Input files that don't require compilation are ignored.
1221
1222 @item -E
1223 @opindex E
1224 Stop after the preprocessing stage; do not run the compiler proper.  The
1225 output is in the form of preprocessed source code, which is sent to the
1226 standard output.
1227
1228 Input files that don't require preprocessing are ignored.
1229
1230 @cindex output file option
1231 @item -o @var{file}
1232 @opindex o
1233 Place output in file @var{file}.  This applies regardless to whatever
1234 sort of output is being produced, whether it be an executable file,
1235 an object file, an assembler file or preprocessed C code.
1236
1237 If @option{-o} is not specified, the default is to put an executable
1238 file in @file{a.out}, the object file for
1239 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1240 assembler file in @file{@var{source}.s}, a precompiled header file in
1241 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1242 standard output.
1243
1244 @item -v
1245 @opindex v
1246 Print (on standard error output) the commands executed to run the stages
1247 of compilation.  Also print the version number of the compiler driver
1248 program and of the preprocessor and the compiler proper.
1249
1250 @item -###
1251 @opindex ###
1252 Like @option{-v} except the commands are not executed and arguments
1253 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1254 This is useful for shell scripts to capture the driver-generated command lines.
1255
1256 @item -pipe
1257 @opindex pipe
1258 Use pipes rather than temporary files for communication between the
1259 various stages of compilation.  This fails to work on some systems where
1260 the assembler is unable to read from a pipe; but the GNU assembler has
1261 no trouble.
1262
1263 @item --help
1264 @opindex help
1265 Print (on the standard output) a description of the command-line options
1266 understood by @command{gcc}.  If the @option{-v} option is also specified
1267 then @option{--help} is also passed on to the various processes
1268 invoked by @command{gcc}, so that they can display the command-line options
1269 they accept.  If the @option{-Wextra} option has also been specified
1270 (prior to the @option{--help} option), then command-line options that
1271 have no documentation associated with them are also displayed.
1272
1273 @item --target-help
1274 @opindex target-help
1275 Print (on the standard output) a description of target-specific command-line
1276 options for each tool.  For some targets extra target-specific
1277 information may also be printed.
1278
1279 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1280 Print (on the standard output) a description of the command-line
1281 options understood by the compiler that fit into all specified classes
1282 and qualifiers.  These are the supported classes:
1283
1284 @table @asis
1285 @item @samp{optimizers}
1286 Display all of the optimization options supported by the
1287 compiler.
1288
1289 @item @samp{warnings}
1290 Display all of the options controlling warning messages
1291 produced by the compiler.
1292
1293 @item @samp{target}
1294 Display target-specific options.  Unlike the
1295 @option{--target-help} option however, target-specific options of the
1296 linker and assembler are not displayed.  This is because those
1297 tools do not currently support the extended @option{--help=} syntax.
1298
1299 @item @samp{params}
1300 Display the values recognized by the @option{--param}
1301 option.
1302
1303 @item @var{language}
1304 Display the options supported for @var{language}, where
1305 @var{language} is the name of one of the languages supported in this
1306 version of GCC@.
1307
1308 @item @samp{common}
1309 Display the options that are common to all languages.
1310 @end table
1311
1312 These are the supported qualifiers:
1313
1314 @table @asis
1315 @item @samp{undocumented}
1316 Display only those options that are undocumented.
1317
1318 @item @samp{joined}
1319 Display options taking an argument that appears after an equal
1320 sign in the same continuous piece of text, such as:
1321 @samp{--help=target}.
1322
1323 @item @samp{separate}
1324 Display options taking an argument that appears as a separate word
1325 following the original option, such as: @samp{-o output-file}.
1326 @end table
1327
1328 Thus for example to display all the undocumented target-specific
1329 switches supported by the compiler the following can be used:
1330
1331 @smallexample
1332 --help=target,undocumented
1333 @end smallexample
1334
1335 The sense of a qualifier can be inverted by prefixing it with the
1336 @samp{^} character, so for example to display all binary warning
1337 options (i.e., ones that are either on or off and that do not take an
1338 argument) that have a description, use:
1339
1340 @smallexample
1341 --help=warnings,^joined,^undocumented
1342 @end smallexample
1343
1344 The argument to @option{--help=} should not consist solely of inverted
1345 qualifiers.
1346
1347 Combining several classes is possible, although this usually
1348 restricts the output by so much that there is nothing to display.  One
1349 case where it does work however is when one of the classes is
1350 @var{target}.  So for example to display all the target-specific
1351 optimization options the following can be used:
1352
1353 @smallexample
1354 --help=target,optimizers
1355 @end smallexample
1356
1357 The @option{--help=} option can be repeated on the command line.  Each
1358 successive use displays its requested class of options, skipping
1359 those that have already been displayed.
1360
1361 If the @option{-Q} option appears on the command line before the
1362 @option{--help=} option, then the descriptive text displayed by
1363 @option{--help=} is changed.  Instead of describing the displayed
1364 options, an indication is given as to whether the option is enabled,
1365 disabled or set to a specific value (assuming that the compiler
1366 knows this at the point where the @option{--help=} option is used).
1367
1368 Here is a truncated example from the ARM port of @command{gcc}:
1369
1370 @smallexample
1371   % gcc -Q -mabi=2 --help=target -c
1372   The following options are target specific:
1373   -mabi=                                2
1374   -mabort-on-noreturn                   [disabled]
1375   -mapcs                                [disabled]
1376 @end smallexample
1377
1378 The output is sensitive to the effects of previous command-line
1379 options, so for example it is possible to find out which optimizations
1380 are enabled at @option{-O2} by using:
1381
1382 @smallexample
1383 -Q -O2 --help=optimizers
1384 @end smallexample
1385
1386 Alternatively you can discover which binary optimizations are enabled
1387 by @option{-O3} by using:
1388
1389 @smallexample
1390 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1391 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1392 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1393 @end smallexample
1394
1395 @item -no-canonical-prefixes
1396 @opindex no-canonical-prefixes
1397 Do not expand any symbolic links, resolve references to @samp{/../}
1398 or @samp{/./}, or make the path absolute when generating a relative
1399 prefix.
1400
1401 @item --version
1402 @opindex version
1403 Display the version number and copyrights of the invoked GCC@.
1404
1405 @item -wrapper
1406 @opindex wrapper
1407 Invoke all subcommands under a wrapper program.  The name of the
1408 wrapper program and its parameters are passed as a comma separated
1409 list.
1410
1411 @smallexample
1412 gcc -c t.c -wrapper gdb,--args
1413 @end smallexample
1414
1415 @noindent
1416 This invokes all subprograms of @command{gcc} under
1417 @samp{gdb --args}, thus the invocation of @command{cc1} is
1418 @samp{gdb --args cc1 @dots{}}.
1419
1420 @item -fplugin=@var{name}.so
1421 Load the plugin code in file @var{name}.so, assumed to be a
1422 shared object to be dlopen'd by the compiler.  The base name of
1423 the shared object file is used to identify the plugin for the
1424 purposes of argument parsing (See
1425 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1426 Each plugin should define the callback functions specified in the
1427 Plugins API.
1428
1429 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1430 Define an argument called @var{key} with a value of @var{value}
1431 for the plugin called @var{name}.
1432
1433 @item -fdump-ada-spec@r{[}-slim@r{]}
1434 For C and C++ source and include files, generate corresponding Ada
1435 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1436 GNAT User's Guide}, which provides detailed documentation on this feature.
1437
1438 @item -fdump-go-spec=@var{file}
1439 For input files in any language, generate corresponding Go
1440 declarations in @var{file}.  This generates Go @code{const},
1441 @code{type}, @code{var}, and @code{func} declarations which may be a
1442 useful way to start writing a Go interface to code written in some
1443 other language.
1444
1445 @include @value{srcdir}/../libiberty/at-file.texi
1446 @end table
1447
1448 @node Invoking G++
1449 @section Compiling C++ Programs
1450
1451 @cindex suffixes for C++ source
1452 @cindex C++ source file suffixes
1453 C++ source files conventionally use one of the suffixes @samp{.C},
1454 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1455 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1456 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1457 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1458 files with these names and compiles them as C++ programs even if you
1459 call the compiler the same way as for compiling C programs (usually
1460 with the name @command{gcc}).
1461
1462 @findex g++
1463 @findex c++
1464 However, the use of @command{gcc} does not add the C++ library.
1465 @command{g++} is a program that calls GCC and treats @samp{.c},
1466 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1467 files unless @option{-x} is used, and automatically specifies linking
1468 against the C++ library.  This program is also useful when
1469 precompiling a C header file with a @samp{.h} extension for use in C++
1470 compilations.  On many systems, @command{g++} is also installed with
1471 the name @command{c++}.
1472
1473 @cindex invoking @command{g++}
1474 When you compile C++ programs, you may specify many of the same
1475 command-line options that you use for compiling programs in any
1476 language; or command-line options meaningful for C and related
1477 languages; or options that are meaningful only for C++ programs.
1478 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1479 explanations of options for languages related to C@.
1480 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1481 explanations of options that are meaningful only for C++ programs.
1482
1483 @node C Dialect Options
1484 @section Options Controlling C Dialect
1485 @cindex dialect options
1486 @cindex language dialect options
1487 @cindex options, dialect
1488
1489 The following options control the dialect of C (or languages derived
1490 from C, such as C++, Objective-C and Objective-C++) that the compiler
1491 accepts:
1492
1493 @table @gcctabopt
1494 @cindex ANSI support
1495 @cindex ISO support
1496 @item -ansi
1497 @opindex ansi
1498 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1499 equivalent to @option{-std=c++98}.
1500
1501 This turns off certain features of GCC that are incompatible with ISO
1502 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1503 such as the @code{asm} and @code{typeof} keywords, and
1504 predefined macros such as @code{unix} and @code{vax} that identify the
1505 type of system you are using.  It also enables the undesirable and
1506 rarely used ISO trigraph feature.  For the C compiler,
1507 it disables recognition of C++ style @samp{//} comments as well as
1508 the @code{inline} keyword.
1509
1510 The alternate keywords @code{__asm__}, @code{__extension__},
1511 @code{__inline__} and @code{__typeof__} continue to work despite
1512 @option{-ansi}.  You would not want to use them in an ISO C program, of
1513 course, but it is useful to put them in header files that might be included
1514 in compilations done with @option{-ansi}.  Alternate predefined macros
1515 such as @code{__unix__} and @code{__vax__} are also available, with or
1516 without @option{-ansi}.
1517
1518 The @option{-ansi} option does not cause non-ISO programs to be
1519 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1520 addition to @option{-ansi}.  @xref{Warning Options}.
1521
1522 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1523 option is used.  Some header files may notice this macro and refrain
1524 from declaring certain functions or defining certain macros that the
1525 ISO standard doesn't call for; this is to avoid interfering with any
1526 programs that might use these names for other things.
1527
1528 Functions that are normally built in but do not have semantics
1529 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1530 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1531 built-in functions provided by GCC}, for details of the functions
1532 affected.
1533
1534 @item -std=
1535 @opindex std
1536 Determine the language standard. @xref{Standards,,Language Standards
1537 Supported by GCC}, for details of these standard versions.  This option
1538 is currently only supported when compiling C or C++.
1539
1540 The compiler can accept several base standards, such as @samp{c90} or
1541 @samp{c++98}, and GNU dialects of those standards, such as
1542 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1543 compiler accepts all programs following that standard plus those
1544 using GNU extensions that do not contradict it.  For example,
1545 @option{-std=c90} turns off certain features of GCC that are
1546 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1547 keywords, but not other GNU extensions that do not have a meaning in
1548 ISO C90, such as omitting the middle term of a @code{?:}
1549 expression. On the other hand, by specifying a GNU dialect of a
1550 standard, all features the compiler support are enabled, even when
1551 those features change the meaning of the base standard and some
1552 strict-conforming programs may be rejected.  The particular standard
1553 is used by @option{-Wpedantic} to identify which features are GNU
1554 extensions given that version of the standard. For example
1555 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1556 comments, while @option{-std=gnu99 -Wpedantic} does not.
1557
1558 A value for this option must be provided; possible values are
1559
1560 @table @samp
1561 @item c90
1562 @itemx c89
1563 @itemx iso9899:1990
1564 Support all ISO C90 programs (certain GNU extensions that conflict
1565 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1566
1567 @item iso9899:199409
1568 ISO C90 as modified in amendment 1.
1569
1570 @item c99
1571 @itemx c9x
1572 @itemx iso9899:1999
1573 @itemx iso9899:199x
1574 ISO C99.  Note that this standard is not yet fully supported; see
1575 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1576 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1577
1578 @item c11
1579 @itemx c1x
1580 @itemx iso9899:2011
1581 ISO C11, the 2011 revision of the ISO C standard.
1582 Support is incomplete and experimental.  The name @samp{c1x} is
1583 deprecated.
1584
1585 @item gnu90
1586 @itemx gnu89
1587 GNU dialect of ISO C90 (including some C99 features). This
1588 is the default for C code.
1589
1590 @item gnu99
1591 @itemx gnu9x
1592 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1593 this will become the default.  The name @samp{gnu9x} is deprecated.
1594
1595 @item gnu11
1596 @item gnu1x
1597 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1598 name @samp{gnu1x} is deprecated.
1599
1600 @item c++98
1601 @itemx c++03
1602 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1603 additional defect reports. Same as @option{-ansi} for C++ code.
1604
1605 @item gnu++98
1606 @itemx gnu++03
1607 GNU dialect of @option{-std=c++98}.  This is the default for
1608 C++ code.
1609
1610 @item c++11
1611 @itemx c++0x
1612 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1613 experimental, and may change in incompatible ways in future releases.
1614 The name @samp{c++0x} is deprecated.
1615
1616 @item gnu++11
1617 @itemx gnu++0x
1618 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1619 experimental, and may change in incompatible ways in future releases.
1620 The name @samp{gnu++0x} is deprecated.
1621
1622 @item c++1y
1623 The next revision of the ISO C++ standard, tentatively planned for
1624 2017.  Support is highly experimental, and will almost certainly
1625 change in incompatible ways in future releases.
1626
1627 @item gnu++1y
1628 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1629 and will almost certainly change in incompatible ways in future
1630 releases.
1631 @end table
1632
1633 @item -fgnu89-inline
1634 @opindex fgnu89-inline
1635 The option @option{-fgnu89-inline} tells GCC to use the traditional
1636 GNU semantics for @code{inline} functions when in C99 mode.
1637 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1638 is accepted and ignored by GCC versions 4.1.3 up to but not including
1639 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1640 C99 mode.  Using this option is roughly equivalent to adding the
1641 @code{gnu_inline} function attribute to all inline functions
1642 (@pxref{Function Attributes}).
1643
1644 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1645 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1646 specifies the default behavior).  This option was first supported in
1647 GCC 4.3.  This option is not supported in @option{-std=c90} or
1648 @option{-std=gnu90} mode.
1649
1650 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1651 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1652 in effect for @code{inline} functions.  @xref{Common Predefined
1653 Macros,,,cpp,The C Preprocessor}.
1654
1655 @item -aux-info @var{filename}
1656 @opindex aux-info
1657 Output to the given filename prototyped declarations for all functions
1658 declared and/or defined in a translation unit, including those in header
1659 files.  This option is silently ignored in any language other than C@.
1660
1661 Besides declarations, the file indicates, in comments, the origin of
1662 each declaration (source file and line), whether the declaration was
1663 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1664 @samp{O} for old, respectively, in the first character after the line
1665 number and the colon), and whether it came from a declaration or a
1666 definition (@samp{C} or @samp{F}, respectively, in the following
1667 character).  In the case of function definitions, a K&R-style list of
1668 arguments followed by their declarations is also provided, inside
1669 comments, after the declaration.
1670
1671 @item -fallow-parameterless-variadic-functions
1672 Accept variadic functions without named parameters.
1673
1674 Although it is possible to define such a function, this is not very
1675 useful as it is not possible to read the arguments.  This is only
1676 supported for C as this construct is allowed by C++.
1677
1678 @item -fno-asm
1679 @opindex fno-asm
1680 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1681 keyword, so that code can use these words as identifiers.  You can use
1682 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1683 instead.  @option{-ansi} implies @option{-fno-asm}.
1684
1685 In C++, this switch only affects the @code{typeof} keyword, since
1686 @code{asm} and @code{inline} are standard keywords.  You may want to
1687 use the @option{-fno-gnu-keywords} flag instead, which has the same
1688 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1689 switch only affects the @code{asm} and @code{typeof} keywords, since
1690 @code{inline} is a standard keyword in ISO C99.
1691
1692 @item -fno-builtin
1693 @itemx -fno-builtin-@var{function}
1694 @opindex fno-builtin
1695 @cindex built-in functions
1696 Don't recognize built-in functions that do not begin with
1697 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1698 functions provided by GCC}, for details of the functions affected,
1699 including those which are not built-in functions when @option{-ansi} or
1700 @option{-std} options for strict ISO C conformance are used because they
1701 do not have an ISO standard meaning.
1702
1703 GCC normally generates special code to handle certain built-in functions
1704 more efficiently; for instance, calls to @code{alloca} may become single
1705 instructions which adjust the stack directly, and calls to @code{memcpy}
1706 may become inline copy loops.  The resulting code is often both smaller
1707 and faster, but since the function calls no longer appear as such, you
1708 cannot set a breakpoint on those calls, nor can you change the behavior
1709 of the functions by linking with a different library.  In addition,
1710 when a function is recognized as a built-in function, GCC may use
1711 information about that function to warn about problems with calls to
1712 that function, or to generate more efficient code, even if the
1713 resulting code still contains calls to that function.  For example,
1714 warnings are given with @option{-Wformat} for bad calls to
1715 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1716 known not to modify global memory.
1717
1718 With the @option{-fno-builtin-@var{function}} option
1719 only the built-in function @var{function} is
1720 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1721 function is named that is not built-in in this version of GCC, this
1722 option is ignored.  There is no corresponding
1723 @option{-fbuiltin-@var{function}} option; if you wish to enable
1724 built-in functions selectively when using @option{-fno-builtin} or
1725 @option{-ffreestanding}, you may define macros such as:
1726
1727 @smallexample
1728 #define abs(n)          __builtin_abs ((n))
1729 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1730 @end smallexample
1731
1732 @item -fhosted
1733 @opindex fhosted
1734 @cindex hosted environment
1735
1736 Assert that compilation takes place in a hosted environment.  This implies
1737 @option{-fbuiltin}.  A hosted environment is one in which the
1738 entire standard library is available, and in which @code{main} has a return
1739 type of @code{int}.  Examples are nearly everything except a kernel.
1740 This is equivalent to @option{-fno-freestanding}.
1741
1742 @item -ffreestanding
1743 @opindex ffreestanding
1744 @cindex hosted environment
1745
1746 Assert that compilation takes place in a freestanding environment.  This
1747 implies @option{-fno-builtin}.  A freestanding environment
1748 is one in which the standard library may not exist, and program startup may
1749 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1750 This is equivalent to @option{-fno-hosted}.
1751
1752 @xref{Standards,,Language Standards Supported by GCC}, for details of
1753 freestanding and hosted environments.
1754
1755 @item -fopenmp
1756 @opindex fopenmp
1757 @cindex OpenMP parallel
1758 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1759 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1760 compiler generates parallel code according to the OpenMP Application
1761 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1762 implies @option{-pthread}, and thus is only supported on targets that
1763 have support for @option{-pthread}.
1764
1765 @item -fgnu-tm
1766 @opindex fgnu-tm
1767 When the option @option{-fgnu-tm} is specified, the compiler
1768 generates code for the Linux variant of Intel's current Transactional
1769 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1770 an experimental feature whose interface may change in future versions
1771 of GCC, as the official specification changes.  Please note that not
1772 all architectures are supported for this feature.
1773
1774 For more information on GCC's support for transactional memory,
1775 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1776 Transactional Memory Library}.
1777
1778 Note that the transactional memory feature is not supported with
1779 non-call exceptions (@option{-fnon-call-exceptions}).
1780
1781 @item -fms-extensions
1782 @opindex fms-extensions
1783 Accept some non-standard constructs used in Microsoft header files.
1784
1785 In C++ code, this allows member names in structures to be similar
1786 to previous types declarations.
1787
1788 @smallexample
1789 typedef int UOW;
1790 struct ABC @{
1791   UOW UOW;
1792 @};
1793 @end smallexample
1794
1795 Some cases of unnamed fields in structures and unions are only
1796 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1797 fields within structs/unions}, for details.
1798
1799 @item -fplan9-extensions
1800 Accept some non-standard constructs used in Plan 9 code.
1801
1802 This enables @option{-fms-extensions}, permits passing pointers to
1803 structures with anonymous fields to functions that expect pointers to
1804 elements of the type of the field, and permits referring to anonymous
1805 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1806 struct/union fields within structs/unions}, for details.  This is only
1807 supported for C, not C++.
1808
1809 @item -trigraphs
1810 @opindex trigraphs
1811 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1812 options for strict ISO C conformance) implies @option{-trigraphs}.
1813
1814 @cindex traditional C language
1815 @cindex C language, traditional
1816 @item -traditional
1817 @itemx -traditional-cpp
1818 @opindex traditional-cpp
1819 @opindex traditional
1820 Formerly, these options caused GCC to attempt to emulate a pre-standard
1821 C compiler.  They are now only supported with the @option{-E} switch.
1822 The preprocessor continues to support a pre-standard mode.  See the GNU
1823 CPP manual for details.
1824
1825 @item -fcond-mismatch
1826 @opindex fcond-mismatch
1827 Allow conditional expressions with mismatched types in the second and
1828 third arguments.  The value of such an expression is void.  This option
1829 is not supported for C++.
1830
1831 @item -flax-vector-conversions
1832 @opindex flax-vector-conversions
1833 Allow implicit conversions between vectors with differing numbers of
1834 elements and/or incompatible element types.  This option should not be
1835 used for new code.
1836
1837 @item -funsigned-char
1838 @opindex funsigned-char
1839 Let the type @code{char} be unsigned, like @code{unsigned char}.
1840
1841 Each kind of machine has a default for what @code{char} should
1842 be.  It is either like @code{unsigned char} by default or like
1843 @code{signed char} by default.
1844
1845 Ideally, a portable program should always use @code{signed char} or
1846 @code{unsigned char} when it depends on the signedness of an object.
1847 But many programs have been written to use plain @code{char} and
1848 expect it to be signed, or expect it to be unsigned, depending on the
1849 machines they were written for.  This option, and its inverse, let you
1850 make such a program work with the opposite default.
1851
1852 The type @code{char} is always a distinct type from each of
1853 @code{signed char} or @code{unsigned char}, even though its behavior
1854 is always just like one of those two.
1855
1856 @item -fsigned-char
1857 @opindex fsigned-char
1858 Let the type @code{char} be signed, like @code{signed char}.
1859
1860 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1861 the negative form of @option{-funsigned-char}.  Likewise, the option
1862 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1863
1864 @item -fsigned-bitfields
1865 @itemx -funsigned-bitfields
1866 @itemx -fno-signed-bitfields
1867 @itemx -fno-unsigned-bitfields
1868 @opindex fsigned-bitfields
1869 @opindex funsigned-bitfields
1870 @opindex fno-signed-bitfields
1871 @opindex fno-unsigned-bitfields
1872 These options control whether a bit-field is signed or unsigned, when the
1873 declaration does not use either @code{signed} or @code{unsigned}.  By
1874 default, such a bit-field is signed, because this is consistent: the
1875 basic integer types such as @code{int} are signed types.
1876 @end table
1877
1878 @node C++ Dialect Options
1879 @section Options Controlling C++ Dialect
1880
1881 @cindex compiler options, C++
1882 @cindex C++ options, command-line
1883 @cindex options, C++
1884 This section describes the command-line options that are only meaningful
1885 for C++ programs; but you can also use most of the GNU compiler options
1886 regardless of what language your program is in.  For example, you
1887 might compile a file @code{firstClass.C} like this:
1888
1889 @smallexample
1890 g++ -g -frepo -O -c firstClass.C
1891 @end smallexample
1892
1893 @noindent
1894 In this example, only @option{-frepo} is an option meant
1895 only for C++ programs; you can use the other options with any
1896 language supported by GCC@.
1897
1898 Here is a list of options that are @emph{only} for compiling C++ programs:
1899
1900 @table @gcctabopt
1901
1902 @item -fabi-version=@var{n}
1903 @opindex fabi-version
1904 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1905 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1906 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1907 the version that conforms most closely to the C++ ABI specification.
1908 Therefore, the ABI obtained using version 0 will change as ABI bugs
1909 are fixed.
1910
1911 The default is version 2.
1912
1913 Version 3 corrects an error in mangling a constant address as a
1914 template argument.
1915
1916 Version 4, which first appeared in G++ 4.5, implements a standard
1917 mangling for vector types.
1918
1919 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1920 attribute const/volatile on function pointer types, decltype of a
1921 plain decl, and use of a function parameter in the declaration of
1922 another parameter.
1923
1924 Version 6, which first appeared in G++ 4.7, corrects the promotion
1925 behavior of C++11 scoped enums and the mangling of template argument
1926 packs, const/static_cast, prefix ++ and --, and a class scope function
1927 used as a template argument.
1928
1929 See also @option{-Wabi}.
1930
1931 @item -fno-access-control
1932 @opindex fno-access-control
1933 Turn off all access checking.  This switch is mainly useful for working
1934 around bugs in the access control code.
1935
1936 @item -fcheck-new
1937 @opindex fcheck-new
1938 Check that the pointer returned by @code{operator new} is non-null
1939 before attempting to modify the storage allocated.  This check is
1940 normally unnecessary because the C++ standard specifies that
1941 @code{operator new} only returns @code{0} if it is declared
1942 @samp{throw()}, in which case the compiler always checks the
1943 return value even without this option.  In all other cases, when
1944 @code{operator new} has a non-empty exception specification, memory
1945 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1946 @samp{new (nothrow)}.
1947
1948 @item -fconserve-space
1949 @opindex fconserve-space
1950 Put uninitialized or run-time-initialized global variables into the
1951 common segment, as C does.  This saves space in the executable at the
1952 cost of not diagnosing duplicate definitions.  If you compile with this
1953 flag and your program mysteriously crashes after @code{main()} has
1954 completed, you may have an object that is being destroyed twice because
1955 two definitions are merged.
1956
1957 This option is no longer useful on most targets, now that support has
1958 been added for putting variables into BSS without making them common.
1959
1960 @item -fconstexpr-depth=@var{n}
1961 @opindex fconstexpr-depth
1962 Set the maximum nested evaluation depth for C++11 constexpr functions
1963 to @var{n}.  A limit is needed to detect endless recursion during
1964 constant expression evaluation.  The minimum specified by the standard
1965 is 512.
1966
1967 @item -fdeduce-init-list
1968 @opindex fdeduce-init-list
1969 Enable deduction of a template type parameter as
1970 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
1971
1972 @smallexample
1973 template <class T> auto forward(T t) -> decltype (realfn (t))
1974 @{
1975   return realfn (t);
1976 @}
1977
1978 void f()
1979 @{
1980   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1981 @}
1982 @end smallexample
1983
1984 This deduction was implemented as a possible extension to the
1985 originally proposed semantics for the C++11 standard, but was not part
1986 of the final standard, so it is disabled by default.  This option is
1987 deprecated, and may be removed in a future version of G++.
1988
1989 @item -ffriend-injection
1990 @opindex ffriend-injection
1991 Inject friend functions into the enclosing namespace, so that they are
1992 visible outside the scope of the class in which they are declared.
1993 Friend functions were documented to work this way in the old Annotated
1994 C++ Reference Manual, and versions of G++ before 4.1 always worked
1995 that way.  However, in ISO C++ a friend function that is not declared
1996 in an enclosing scope can only be found using argument dependent
1997 lookup.  This option causes friends to be injected as they were in
1998 earlier releases.
1999
2000 This option is for compatibility, and may be removed in a future
2001 release of G++.
2002
2003 @item -fno-elide-constructors
2004 @opindex fno-elide-constructors
2005 The C++ standard allows an implementation to omit creating a temporary
2006 that is only used to initialize another object of the same type.
2007 Specifying this option disables that optimization, and forces G++ to
2008 call the copy constructor in all cases.
2009
2010 @item -fno-enforce-eh-specs
2011 @opindex fno-enforce-eh-specs
2012 Don't generate code to check for violation of exception specifications
2013 at run time.  This option violates the C++ standard, but may be useful
2014 for reducing code size in production builds, much like defining
2015 @samp{NDEBUG}.  This does not give user code permission to throw
2016 exceptions in violation of the exception specifications; the compiler
2017 still optimizes based on the specifications, so throwing an
2018 unexpected exception results in undefined behavior at run time.
2019
2020 @item -ffor-scope
2021 @itemx -fno-for-scope
2022 @opindex ffor-scope
2023 @opindex fno-for-scope
2024 If @option{-ffor-scope} is specified, the scope of variables declared in
2025 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2026 as specified by the C++ standard.
2027 If @option{-fno-for-scope} is specified, the scope of variables declared in
2028 a @i{for-init-statement} extends to the end of the enclosing scope,
2029 as was the case in old versions of G++, and other (traditional)
2030 implementations of C++.
2031
2032 The default if neither flag is given to follow the standard,
2033 but to allow and give a warning for old-style code that would
2034 otherwise be invalid, or have different behavior.
2035
2036 @item -fno-gnu-keywords
2037 @opindex fno-gnu-keywords
2038 Do not recognize @code{typeof} as a keyword, so that code can use this
2039 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2040 @option{-ansi} implies @option{-fno-gnu-keywords}.
2041
2042 @item -fno-implicit-templates
2043 @opindex fno-implicit-templates
2044 Never emit code for non-inline templates that are instantiated
2045 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2046 @xref{Template Instantiation}, for more information.
2047
2048 @item -fno-implicit-inline-templates
2049 @opindex fno-implicit-inline-templates
2050 Don't emit code for implicit instantiations of inline templates, either.
2051 The default is to handle inlines differently so that compiles with and
2052 without optimization need the same set of explicit instantiations.
2053
2054 @item -fno-implement-inlines
2055 @opindex fno-implement-inlines
2056 To save space, do not emit out-of-line copies of inline functions
2057 controlled by @samp{#pragma implementation}.  This causes linker
2058 errors if these functions are not inlined everywhere they are called.
2059
2060 @item -fms-extensions
2061 @opindex fms-extensions
2062 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2063 int and getting a pointer to member function via non-standard syntax.
2064
2065 @item -fno-nonansi-builtins
2066 @opindex fno-nonansi-builtins
2067 Disable built-in declarations of functions that are not mandated by
2068 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2069 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2070
2071 @item -fnothrow-opt
2072 @opindex fnothrow-opt
2073 Treat a @code{throw()} exception specification as if it were a
2074 @code{noexcept} specification to reduce or eliminate the text size
2075 overhead relative to a function with no exception specification.  If
2076 the function has local variables of types with non-trivial
2077 destructors, the exception specification actually makes the
2078 function smaller because the EH cleanups for those variables can be
2079 optimized away.  The semantic effect is that an exception thrown out of
2080 a function with such an exception specification results in a call
2081 to @code{terminate} rather than @code{unexpected}.
2082
2083 @item -fno-operator-names
2084 @opindex fno-operator-names
2085 Do not treat the operator name keywords @code{and}, @code{bitand},
2086 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2087 synonyms as keywords.
2088
2089 @item -fno-optional-diags
2090 @opindex fno-optional-diags
2091 Disable diagnostics that the standard says a compiler does not need to
2092 issue.  Currently, the only such diagnostic issued by G++ is the one for
2093 a name having multiple meanings within a class.
2094
2095 @item -fpermissive
2096 @opindex fpermissive
2097 Downgrade some diagnostics about nonconformant code from errors to
2098 warnings.  Thus, using @option{-fpermissive} allows some
2099 nonconforming code to compile.
2100
2101 @item -fno-pretty-templates
2102 @opindex fno-pretty-templates
2103 When an error message refers to a specialization of a function
2104 template, the compiler normally prints the signature of the
2105 template followed by the template arguments and any typedefs or
2106 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2107 rather than @code{void f(int)}) so that it's clear which template is
2108 involved.  When an error message refers to a specialization of a class
2109 template, the compiler omits any template arguments that match
2110 the default template arguments for that template.  If either of these
2111 behaviors make it harder to understand the error message rather than
2112 easier, you can use @option{-fno-pretty-templates} to disable them.
2113
2114 @item -frepo
2115 @opindex frepo
2116 Enable automatic template instantiation at link time.  This option also
2117 implies @option{-fno-implicit-templates}.  @xref{Template
2118 Instantiation}, for more information.
2119
2120 @item -fno-rtti
2121 @opindex fno-rtti
2122 Disable generation of information about every class with virtual
2123 functions for use by the C++ run-time type identification features
2124 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2125 of the language, you can save some space by using this flag.  Note that
2126 exception handling uses the same information, but G++ generates it as
2127 needed. The @samp{dynamic_cast} operator can still be used for casts that
2128 do not require run-time type information, i.e.@: casts to @code{void *} or to
2129 unambiguous base classes.
2130
2131 @item -fstats
2132 @opindex fstats
2133 Emit statistics about front-end processing at the end of the compilation.
2134 This information is generally only useful to the G++ development team.
2135
2136 @item -fstrict-enums
2137 @opindex fstrict-enums
2138 Allow the compiler to optimize using the assumption that a value of
2139 enumerated type can only be one of the values of the enumeration (as
2140 defined in the C++ standard; basically, a value that can be
2141 represented in the minimum number of bits needed to represent all the
2142 enumerators).  This assumption may not be valid if the program uses a
2143 cast to convert an arbitrary integer value to the enumerated type.
2144
2145 @item -ftemplate-backtrace-limit=@var{n}
2146 @opindex ftemplate-backtrace-limit
2147 Set the maximum number of template instantiation notes for a single
2148 warning or error to @var{n}.  The default value is 10.
2149
2150 @item -ftemplate-depth=@var{n}
2151 @opindex ftemplate-depth
2152 Set the maximum instantiation depth for template classes to @var{n}.
2153 A limit on the template instantiation depth is needed to detect
2154 endless recursions during template class instantiation.  ANSI/ISO C++
2155 conforming programs must not rely on a maximum depth greater than 17
2156 (changed to 1024 in C++11).  The default value is 900, as the compiler
2157 can run out of stack space before hitting 1024 in some situations.
2158
2159 @item -fno-threadsafe-statics
2160 @opindex fno-threadsafe-statics
2161 Do not emit the extra code to use the routines specified in the C++
2162 ABI for thread-safe initialization of local statics.  You can use this
2163 option to reduce code size slightly in code that doesn't need to be
2164 thread-safe.
2165
2166 @item -fuse-cxa-atexit
2167 @opindex fuse-cxa-atexit
2168 Register destructors for objects with static storage duration with the
2169 @code{__cxa_atexit} function rather than the @code{atexit} function.
2170 This option is required for fully standards-compliant handling of static
2171 destructors, but only works if your C library supports
2172 @code{__cxa_atexit}.
2173
2174 @item -fno-use-cxa-get-exception-ptr
2175 @opindex fno-use-cxa-get-exception-ptr
2176 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2177 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2178 if the runtime routine is not available.
2179
2180 @item -fvisibility-inlines-hidden
2181 @opindex fvisibility-inlines-hidden
2182 This switch declares that the user does not attempt to compare
2183 pointers to inline functions or methods where the addresses of the two functions
2184 are taken in different shared objects.
2185
2186 The effect of this is that GCC may, effectively, mark inline methods with
2187 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2188 appear in the export table of a DSO and do not require a PLT indirection
2189 when used within the DSO@.  Enabling this option can have a dramatic effect
2190 on load and link times of a DSO as it massively reduces the size of the
2191 dynamic export table when the library makes heavy use of templates.
2192
2193 The behavior of this switch is not quite the same as marking the
2194 methods as hidden directly, because it does not affect static variables
2195 local to the function or cause the compiler to deduce that
2196 the function is defined in only one shared object.
2197
2198 You may mark a method as having a visibility explicitly to negate the
2199 effect of the switch for that method.  For example, if you do want to
2200 compare pointers to a particular inline method, you might mark it as
2201 having default visibility.  Marking the enclosing class with explicit
2202 visibility has no effect.
2203
2204 Explicitly instantiated inline methods are unaffected by this option
2205 as their linkage might otherwise cross a shared library boundary.
2206 @xref{Template Instantiation}.
2207
2208 @item -fvisibility-ms-compat
2209 @opindex fvisibility-ms-compat
2210 This flag attempts to use visibility settings to make GCC's C++
2211 linkage model compatible with that of Microsoft Visual Studio.
2212
2213 The flag makes these changes to GCC's linkage model:
2214
2215 @enumerate
2216 @item
2217 It sets the default visibility to @code{hidden}, like
2218 @option{-fvisibility=hidden}.
2219
2220 @item
2221 Types, but not their members, are not hidden by default.
2222
2223 @item
2224 The One Definition Rule is relaxed for types without explicit
2225 visibility specifications that are defined in more than one
2226 shared object: those declarations are permitted if they are
2227 permitted when this option is not used.
2228 @end enumerate
2229
2230 In new code it is better to use @option{-fvisibility=hidden} and
2231 export those classes that are intended to be externally visible.
2232 Unfortunately it is possible for code to rely, perhaps accidentally,
2233 on the Visual Studio behavior.
2234
2235 Among the consequences of these changes are that static data members
2236 of the same type with the same name but defined in different shared
2237 objects are different, so changing one does not change the other;
2238 and that pointers to function members defined in different shared
2239 objects may not compare equal.  When this flag is given, it is a
2240 violation of the ODR to define types with the same name differently.
2241
2242 @item -fno-weak
2243 @opindex fno-weak
2244 Do not use weak symbol support, even if it is provided by the linker.
2245 By default, G++ uses weak symbols if they are available.  This
2246 option exists only for testing, and should not be used by end-users;
2247 it results in inferior code and has no benefits.  This option may
2248 be removed in a future release of G++.
2249
2250 @item -nostdinc++
2251 @opindex nostdinc++
2252 Do not search for header files in the standard directories specific to
2253 C++, but do still search the other standard directories.  (This option
2254 is used when building the C++ library.)
2255 @end table
2256
2257 In addition, these optimization, warning, and code generation options
2258 have meanings only for C++ programs:
2259
2260 @table @gcctabopt
2261 @item -fno-default-inline
2262 @opindex fno-default-inline
2263 Do not assume @samp{inline} for functions defined inside a class scope.
2264 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2265 functions have linkage like inline functions; they just aren't
2266 inlined by default.
2267
2268 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2269 @opindex Wabi
2270 @opindex Wno-abi
2271 Warn when G++ generates code that is probably not compatible with the
2272 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2273 all such cases, there are probably some cases that are not warned about,
2274 even though G++ is generating incompatible code.  There may also be
2275 cases where warnings are emitted even though the code that is generated
2276 is compatible.
2277
2278 You should rewrite your code to avoid these warnings if you are
2279 concerned about the fact that code generated by G++ may not be binary
2280 compatible with code generated by other compilers.
2281
2282 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2283
2284 @itemize @bullet
2285
2286 @item
2287 A template with a non-type template parameter of reference type is
2288 mangled incorrectly:
2289 @smallexample
2290 extern int N;
2291 template <int &> struct S @{@};
2292 void n (S<N>) @{2@}
2293 @end smallexample
2294
2295 This is fixed in @option{-fabi-version=3}.
2296
2297 @item
2298 SIMD vector types declared using @code{__attribute ((vector_size))} are
2299 mangled in a non-standard way that does not allow for overloading of
2300 functions taking vectors of different sizes.
2301
2302 The mangling is changed in @option{-fabi-version=4}.
2303 @end itemize
2304
2305 The known incompatibilities in @option{-fabi-version=1} include:
2306
2307 @itemize @bullet
2308
2309 @item
2310 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2311 pack data into the same byte as a base class.  For example:
2312
2313 @smallexample
2314 struct A @{ virtual void f(); int f1 : 1; @};
2315 struct B : public A @{ int f2 : 1; @};
2316 @end smallexample
2317
2318 @noindent
2319 In this case, G++ places @code{B::f2} into the same byte
2320 as@code{A::f1}; other compilers do not.  You can avoid this problem
2321 by explicitly padding @code{A} so that its size is a multiple of the
2322 byte size on your platform; that causes G++ and other compilers to
2323 lay out @code{B} identically.
2324
2325 @item
2326 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2327 tail padding when laying out virtual bases.  For example:
2328
2329 @smallexample
2330 struct A @{ virtual void f(); char c1; @};
2331 struct B @{ B(); char c2; @};
2332 struct C : public A, public virtual B @{@};
2333 @end smallexample
2334
2335 @noindent
2336 In this case, G++ does not place @code{B} into the tail-padding for
2337 @code{A}; other compilers do.  You can avoid this problem by
2338 explicitly padding @code{A} so that its size is a multiple of its
2339 alignment (ignoring virtual base classes); that causes G++ and other
2340 compilers to lay out @code{C} identically.
2341
2342 @item
2343 Incorrect handling of bit-fields with declared widths greater than that
2344 of their underlying types, when the bit-fields appear in a union.  For
2345 example:
2346
2347 @smallexample
2348 union U @{ int i : 4096; @};
2349 @end smallexample
2350
2351 @noindent
2352 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2353 union too small by the number of bits in an @code{int}.
2354
2355 @item
2356 Empty classes can be placed at incorrect offsets.  For example:
2357
2358 @smallexample
2359 struct A @{@};
2360
2361 struct B @{
2362   A a;
2363   virtual void f ();
2364 @};
2365
2366 struct C : public B, public A @{@};
2367 @end smallexample
2368
2369 @noindent
2370 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2371 it should be placed at offset zero.  G++ mistakenly believes that the
2372 @code{A} data member of @code{B} is already at offset zero.
2373
2374 @item
2375 Names of template functions whose types involve @code{typename} or
2376 template template parameters can be mangled incorrectly.
2377
2378 @smallexample
2379 template <typename Q>
2380 void f(typename Q::X) @{@}
2381
2382 template <template <typename> class Q>
2383 void f(typename Q<int>::X) @{@}
2384 @end smallexample
2385
2386 @noindent
2387 Instantiations of these templates may be mangled incorrectly.
2388
2389 @end itemize
2390
2391 It also warns about psABI-related changes.  The known psABI changes at this
2392 point include:
2393
2394 @itemize @bullet
2395
2396 @item
2397 For SysV/x86-64, unions with @code{long double} members are 
2398 passed in memory as specified in psABI.  For example:
2399
2400 @smallexample
2401 union U @{
2402   long double ld;
2403   int i;
2404 @};
2405 @end smallexample
2406
2407 @noindent
2408 @code{union U} is always passed in memory.
2409
2410 @end itemize
2411
2412 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2413 @opindex Wctor-dtor-privacy
2414 @opindex Wno-ctor-dtor-privacy
2415 Warn when a class seems unusable because all the constructors or
2416 destructors in that class are private, and it has neither friends nor
2417 public static member functions.
2418
2419 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2420 @opindex Wdelete-non-virtual-dtor
2421 @opindex Wno-delete-non-virtual-dtor
2422 Warn when @samp{delete} is used to destroy an instance of a class that
2423 has virtual functions and non-virtual destructor. It is unsafe to delete
2424 an instance of a derived class through a pointer to a base class if the
2425 base class does not have a virtual destructor.  This warning is enabled
2426 by @option{-Wall}.
2427
2428 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2429 @opindex Wnarrowing
2430 @opindex Wno-narrowing
2431 Warn when a narrowing conversion prohibited by C++11 occurs within
2432 @samp{@{ @}}, e.g.
2433
2434 @smallexample
2435 int i = @{ 2.2 @}; // error: narrowing from double to int
2436 @end smallexample
2437
2438 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2439
2440 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2441 required by the standard.  Note that this does not affect the meaning
2442 of well-formed code; narrowing conversions are still considered
2443 ill-formed in SFINAE context.
2444
2445 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2446 @opindex Wnoexcept
2447 @opindex Wno-noexcept
2448 Warn when a noexcept-expression evaluates to false because of a call
2449 to a function that does not have a non-throwing exception
2450 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2451 the compiler to never throw an exception.
2452
2453 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2454 @opindex Wnon-virtual-dtor
2455 @opindex Wno-non-virtual-dtor
2456 Warn when a class has virtual functions and an accessible non-virtual
2457 destructor, in which case it is possible but unsafe to delete
2458 an instance of a derived class through a pointer to the base class.
2459 This warning is also enabled if @option{-Weffc++} is specified.
2460
2461 @item -Wreorder @r{(C++ and Objective-C++ only)}
2462 @opindex Wreorder
2463 @opindex Wno-reorder
2464 @cindex reordering, warning
2465 @cindex warning for reordering of member initializers
2466 Warn when the order of member initializers given in the code does not
2467 match the order in which they must be executed.  For instance:
2468
2469 @smallexample
2470 struct A @{
2471   int i;
2472   int j;
2473   A(): j (0), i (1) @{ @}
2474 @};
2475 @end smallexample
2476
2477 @noindent
2478 The compiler rearranges the member initializers for @samp{i}
2479 and @samp{j} to match the declaration order of the members, emitting
2480 a warning to that effect.  This warning is enabled by @option{-Wall}.
2481 @end table
2482
2483 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2484
2485 @table @gcctabopt
2486 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2487 @opindex Weffc++
2488 @opindex Wno-effc++
2489 Warn about violations of the following style guidelines from Scott Meyers'
2490 @cite{Effective C++, Second Edition} book:
2491
2492 @itemize @bullet
2493 @item
2494 Item 11:  Define a copy constructor and an assignment operator for classes
2495 with dynamically allocated memory.
2496
2497 @item
2498 Item 12:  Prefer initialization to assignment in constructors.
2499
2500 @item
2501 Item 14:  Make destructors virtual in base classes.
2502
2503 @item
2504 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2505
2506 @item
2507 Item 23:  Don't try to return a reference when you must return an object.
2508
2509 @end itemize
2510
2511 Also warn about violations of the following style guidelines from
2512 Scott Meyers' @cite{More Effective C++} book:
2513
2514 @itemize @bullet
2515 @item
2516 Item 6:  Distinguish between prefix and postfix forms of increment and
2517 decrement operators.
2518
2519 @item
2520 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2521
2522 @end itemize
2523
2524 When selecting this option, be aware that the standard library
2525 headers do not obey all of these guidelines; use @samp{grep -v}
2526 to filter out those warnings.
2527
2528 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2529 @opindex Wstrict-null-sentinel
2530 @opindex Wno-strict-null-sentinel
2531 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2532 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2533 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2534 it is guaranteed to be of the same size as a pointer.  But this use is
2535 not portable across different compilers.
2536
2537 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2538 @opindex Wno-non-template-friend
2539 @opindex Wnon-template-friend
2540 Disable warnings when non-templatized friend functions are declared
2541 within a template.  Since the advent of explicit template specification
2542 support in G++, if the name of the friend is an unqualified-id (i.e.,
2543 @samp{friend foo(int)}), the C++ language specification demands that the
2544 friend declare or define an ordinary, nontemplate function.  (Section
2545 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2546 could be interpreted as a particular specialization of a templatized
2547 function.  Because this non-conforming behavior is no longer the default
2548 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2549 check existing code for potential trouble spots and is on by default.
2550 This new compiler behavior can be turned off with
2551 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2552 but disables the helpful warning.
2553
2554 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2555 @opindex Wold-style-cast
2556 @opindex Wno-old-style-cast
2557 Warn if an old-style (C-style) cast to a non-void type is used within
2558 a C++ program.  The new-style casts (@samp{dynamic_cast},
2559 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2560 less vulnerable to unintended effects and much easier to search for.
2561
2562 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2563 @opindex Woverloaded-virtual
2564 @opindex Wno-overloaded-virtual
2565 @cindex overloaded virtual function, warning
2566 @cindex warning for overloaded virtual function
2567 Warn when a function declaration hides virtual functions from a
2568 base class.  For example, in:
2569
2570 @smallexample
2571 struct A @{
2572   virtual void f();
2573 @};
2574
2575 struct B: public A @{
2576   void f(int);
2577 @};
2578 @end smallexample
2579
2580 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2581 like:
2582
2583 @smallexample
2584 B* b;
2585 b->f();
2586 @end smallexample
2587
2588 @noindent
2589 fails to compile.
2590
2591 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2592 @opindex Wno-pmf-conversions
2593 @opindex Wpmf-conversions
2594 Disable the diagnostic for converting a bound pointer to member function
2595 to a plain pointer.
2596
2597 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2598 @opindex Wsign-promo
2599 @opindex Wno-sign-promo
2600 Warn when overload resolution chooses a promotion from unsigned or
2601 enumerated type to a signed type, over a conversion to an unsigned type of
2602 the same size.  Previous versions of G++ tried to preserve
2603 unsignedness, but the standard mandates the current behavior.
2604
2605 @smallexample
2606 struct A @{
2607   operator int ();
2608   A& operator = (int);
2609 @};
2610
2611 main ()
2612 @{
2613   A a,b;
2614   a = b;
2615 @}
2616 @end smallexample
2617
2618 @noindent
2619 In this example, G++ synthesizes a default @samp{A& operator =
2620 (const A&);}, while cfront uses the user-defined @samp{operator =}.
2621 @end table
2622
2623 @node Objective-C and Objective-C++ Dialect Options
2624 @section Options Controlling Objective-C and Objective-C++ Dialects
2625
2626 @cindex compiler options, Objective-C and Objective-C++
2627 @cindex Objective-C and Objective-C++ options, command-line
2628 @cindex options, Objective-C and Objective-C++
2629 (NOTE: This manual does not describe the Objective-C and Objective-C++
2630 languages themselves.  @xref{Standards,,Language Standards
2631 Supported by GCC}, for references.)
2632
2633 This section describes the command-line options that are only meaningful
2634 for Objective-C and Objective-C++ programs, but you can also use most of
2635 the language-independent GNU compiler options.
2636 For example, you might compile a file @code{some_class.m} like this:
2637
2638 @smallexample
2639 gcc -g -fgnu-runtime -O -c some_class.m
2640 @end smallexample
2641
2642 @noindent
2643 In this example, @option{-fgnu-runtime} is an option meant only for
2644 Objective-C and Objective-C++ programs; you can use the other options with
2645 any language supported by GCC@.
2646
2647 Note that since Objective-C is an extension of the C language, Objective-C
2648 compilations may also use options specific to the C front-end (e.g.,
2649 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2650 C++-specific options (e.g., @option{-Wabi}).
2651
2652 Here is a list of options that are @emph{only} for compiling Objective-C
2653 and Objective-C++ programs:
2654
2655 @table @gcctabopt
2656 @item -fconstant-string-class=@var{class-name}
2657 @opindex fconstant-string-class
2658 Use @var{class-name} as the name of the class to instantiate for each
2659 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2660 class name is @code{NXConstantString} if the GNU runtime is being used, and
2661 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2662 @option{-fconstant-cfstrings} option, if also present, overrides the
2663 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2664 to be laid out as constant CoreFoundation strings.
2665
2666 @item -fgnu-runtime
2667 @opindex fgnu-runtime
2668 Generate object code compatible with the standard GNU Objective-C
2669 runtime.  This is the default for most types of systems.
2670
2671 @item -fnext-runtime
2672 @opindex fnext-runtime
2673 Generate output compatible with the NeXT runtime.  This is the default
2674 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2675 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2676 used.
2677
2678 @item -fno-nil-receivers
2679 @opindex fno-nil-receivers
2680 Assume that all Objective-C message dispatches (@code{[receiver
2681 message:arg]}) in this translation unit ensure that the receiver is
2682 not @code{nil}.  This allows for more efficient entry points in the
2683 runtime to be used.  This option is only available in conjunction with
2684 the NeXT runtime and ABI version 0 or 1.
2685
2686 @item -fobjc-abi-version=@var{n}
2687 @opindex fobjc-abi-version
2688 Use version @var{n} of the Objective-C ABI for the selected runtime.
2689 This option is currently supported only for the NeXT runtime.  In that
2690 case, Version 0 is the traditional (32-bit) ABI without support for
2691 properties and other Objective-C 2.0 additions.  Version 1 is the
2692 traditional (32-bit) ABI with support for properties and other
2693 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2694 nothing is specified, the default is Version 0 on 32-bit target
2695 machines, and Version 2 on 64-bit target machines.
2696
2697 @item -fobjc-call-cxx-cdtors
2698 @opindex fobjc-call-cxx-cdtors
2699 For each Objective-C class, check if any of its instance variables is a
2700 C++ object with a non-trivial default constructor.  If so, synthesize a
2701 special @code{- (id) .cxx_construct} instance method which runs
2702 non-trivial default constructors on any such instance variables, in order,
2703 and then return @code{self}.  Similarly, check if any instance variable
2704 is a C++ object with a non-trivial destructor, and if so, synthesize a
2705 special @code{- (void) .cxx_destruct} method which runs
2706 all such default destructors, in reverse order.
2707
2708 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2709 methods thusly generated only operate on instance variables
2710 declared in the current Objective-C class, and not those inherited
2711 from superclasses.  It is the responsibility of the Objective-C
2712 runtime to invoke all such methods in an object's inheritance
2713 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2714 by the runtime immediately after a new object instance is allocated;
2715 the @code{- (void) .cxx_destruct} methods are invoked immediately
2716 before the runtime deallocates an object instance.
2717
2718 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2719 support for invoking the @code{- (id) .cxx_construct} and
2720 @code{- (void) .cxx_destruct} methods.
2721
2722 @item -fobjc-direct-dispatch
2723 @opindex fobjc-direct-dispatch
2724 Allow fast jumps to the message dispatcher.  On Darwin this is
2725 accomplished via the comm page.
2726
2727 @item -fobjc-exceptions
2728 @opindex fobjc-exceptions
2729 Enable syntactic support for structured exception handling in
2730 Objective-C, similar to what is offered by C++ and Java.  This option
2731 is required to use the Objective-C keywords @code{@@try},
2732 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2733 @code{@@synchronized}.  This option is available with both the GNU
2734 runtime and the NeXT runtime (but not available in conjunction with
2735 the NeXT runtime on Mac OS X 10.2 and earlier).
2736
2737 @item -fobjc-gc
2738 @opindex fobjc-gc
2739 Enable garbage collection (GC) in Objective-C and Objective-C++
2740 programs.  This option is only available with the NeXT runtime; the
2741 GNU runtime has a different garbage collection implementation that
2742 does not require special compiler flags.
2743
2744 @item -fobjc-nilcheck
2745 @opindex fobjc-nilcheck
2746 For the NeXT runtime with version 2 of the ABI, check for a nil
2747 receiver in method invocations before doing the actual method call.
2748 This is the default and can be disabled using
2749 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2750 checked for nil in this way no matter what this flag is set to.
2751 Currently this flag does nothing when the GNU runtime, or an older
2752 version of the NeXT runtime ABI, is used.
2753
2754 @item -fobjc-std=objc1
2755 @opindex fobjc-std
2756 Conform to the language syntax of Objective-C 1.0, the language
2757 recognized by GCC 4.0.  This only affects the Objective-C additions to
2758 the C/C++ language; it does not affect conformance to C/C++ standards,
2759 which is controlled by the separate C/C++ dialect option flags.  When
2760 this option is used with the Objective-C or Objective-C++ compiler,
2761 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2762 This is useful if you need to make sure that your Objective-C code can
2763 be compiled with older versions of GCC@.
2764
2765 @item -freplace-objc-classes
2766 @opindex freplace-objc-classes
2767 Emit a special marker instructing @command{ld(1)} not to statically link in
2768 the resulting object file, and allow @command{dyld(1)} to load it in at
2769 run time instead.  This is used in conjunction with the Fix-and-Continue
2770 debugging mode, where the object file in question may be recompiled and
2771 dynamically reloaded in the course of program execution, without the need
2772 to restart the program itself.  Currently, Fix-and-Continue functionality
2773 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2774 and later.
2775
2776 @item -fzero-link
2777 @opindex fzero-link
2778 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2779 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2780 compile time) with static class references that get initialized at load time,
2781 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2782 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2783 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2784 for individual class implementations to be modified during program execution.
2785 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2786 regardless of command-line options.
2787
2788 @item -gen-decls
2789 @opindex gen-decls
2790 Dump interface declarations for all classes seen in the source file to a
2791 file named @file{@var{sourcename}.decl}.
2792
2793 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2794 @opindex Wassign-intercept
2795 @opindex Wno-assign-intercept
2796 Warn whenever an Objective-C assignment is being intercepted by the
2797 garbage collector.
2798
2799 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2800 @opindex Wno-protocol
2801 @opindex Wprotocol
2802 If a class is declared to implement a protocol, a warning is issued for
2803 every method in the protocol that is not implemented by the class.  The
2804 default behavior is to issue a warning for every method not explicitly
2805 implemented in the class, even if a method implementation is inherited
2806 from the superclass.  If you use the @option{-Wno-protocol} option, then
2807 methods inherited from the superclass are considered to be implemented,
2808 and no warning is issued for them.
2809
2810 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2811 @opindex Wselector
2812 @opindex Wno-selector
2813 Warn if multiple methods of different types for the same selector are
2814 found during compilation.  The check is performed on the list of methods
2815 in the final stage of compilation.  Additionally, a check is performed
2816 for each selector appearing in a @code{@@selector(@dots{})}
2817 expression, and a corresponding method for that selector has been found
2818 during compilation.  Because these checks scan the method table only at
2819 the end of compilation, these warnings are not produced if the final
2820 stage of compilation is not reached, for example because an error is
2821 found during compilation, or because the @option{-fsyntax-only} option is
2822 being used.
2823
2824 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2825 @opindex Wstrict-selector-match
2826 @opindex Wno-strict-selector-match
2827 Warn if multiple methods with differing argument and/or return types are
2828 found for a given selector when attempting to send a message using this
2829 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2830 is off (which is the default behavior), the compiler omits such warnings
2831 if any differences found are confined to types that share the same size
2832 and alignment.
2833
2834 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2835 @opindex Wundeclared-selector
2836 @opindex Wno-undeclared-selector
2837 Warn if a @code{@@selector(@dots{})} expression referring to an
2838 undeclared selector is found.  A selector is considered undeclared if no
2839 method with that name has been declared before the
2840 @code{@@selector(@dots{})} expression, either explicitly in an
2841 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2842 an @code{@@implementation} section.  This option always performs its
2843 checks as soon as a @code{@@selector(@dots{})} expression is found,
2844 while @option{-Wselector} only performs its checks in the final stage of
2845 compilation.  This also enforces the coding style convention
2846 that methods and selectors must be declared before being used.
2847
2848 @item -print-objc-runtime-info
2849 @opindex print-objc-runtime-info
2850 Generate C header describing the largest structure that is passed by
2851 value, if any.
2852
2853 @end table
2854
2855 @node Language Independent Options
2856 @section Options to Control Diagnostic Messages Formatting
2857 @cindex options to control diagnostics formatting
2858 @cindex diagnostic messages
2859 @cindex message formatting
2860
2861 Traditionally, diagnostic messages have been formatted irrespective of
2862 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
2863 options described below
2864 to control the formatting algorithm for diagnostic messages, 
2865 e.g.@: how many characters per line, how often source location
2866 information should be reported.  Note that some language front ends may not
2867 honor these options.
2868
2869 @table @gcctabopt
2870 @item -fmessage-length=@var{n}
2871 @opindex fmessage-length
2872 Try to format error messages so that they fit on lines of about @var{n}
2873 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2874 the front ends supported by GCC@.  If @var{n} is zero, then no
2875 line-wrapping is done; each error message appears on a single
2876 line.
2877
2878 @item -fdiagnostics-show-location=once
2879 @opindex fdiagnostics-show-location
2880 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2881 reporter to emit @emph{once} source location information; that is, in
2882 case the message is too long to fit on a single physical line and has to
2883 be wrapped, the source location won't be emitted (as prefix) again,
2884 over and over, in subsequent continuation lines.  This is the default
2885 behavior.
2886
2887 @item -fdiagnostics-show-location=every-line
2888 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2889 messages reporter to emit the same source location information (as
2890 prefix) for physical lines that result from the process of breaking
2891 a message which is too long to fit on a single line.
2892
2893 @item -fno-diagnostics-show-option
2894 @opindex fno-diagnostics-show-option
2895 @opindex fdiagnostics-show-option
2896 By default, each diagnostic emitted includes text indicating the
2897 command-line option that directly controls the diagnostic (if such an
2898 option is known to the diagnostic machinery).  Specifying the
2899 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2900
2901 @item -fno-diagnostics-show-caret
2902 @opindex fno-diagnostics-show-caret
2903 @opindex fdiagnostics-show-caret
2904 By default, each diagnostic emitted includes the original source line
2905 and a caret '^' indicating the column.  This option suppresses this
2906 information.
2907
2908 @end table
2909
2910 @node Warning Options
2911 @section Options to Request or Suppress Warnings
2912 @cindex options to control warnings
2913 @cindex warning messages
2914 @cindex messages, warning
2915 @cindex suppressing warnings
2916
2917 Warnings are diagnostic messages that report constructions that
2918 are not inherently erroneous but that are risky or suggest there
2919 may have been an error.
2920
2921 The following language-independent options do not enable specific
2922 warnings but control the kinds of diagnostics produced by GCC@.
2923
2924 @table @gcctabopt
2925 @cindex syntax checking
2926 @item -fsyntax-only
2927 @opindex fsyntax-only
2928 Check the code for syntax errors, but don't do anything beyond that.
2929
2930 @item -fmax-errors=@var{n}
2931 @opindex fmax-errors
2932 Limits the maximum number of error messages to @var{n}, at which point
2933 GCC bails out rather than attempting to continue processing the source
2934 code.  If @var{n} is 0 (the default), there is no limit on the number
2935 of error messages produced.  If @option{-Wfatal-errors} is also
2936 specified, then @option{-Wfatal-errors} takes precedence over this
2937 option.
2938
2939 @item -w
2940 @opindex w
2941 Inhibit all warning messages.
2942
2943 @item -Werror
2944 @opindex Werror
2945 @opindex Wno-error
2946 Make all warnings into errors.
2947
2948 @item -Werror=
2949 @opindex Werror=
2950 @opindex Wno-error=
2951 Make the specified warning into an error.  The specifier for a warning
2952 is appended, for example @option{-Werror=switch} turns the warnings
2953 controlled by @option{-Wswitch} into errors.  This switch takes a
2954 negative form, to be used to negate @option{-Werror} for specific
2955 warnings, for example @option{-Wno-error=switch} makes
2956 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2957 is in effect.
2958
2959 The warning message for each controllable warning includes the
2960 option that controls the warning.  That option can then be used with
2961 @option{-Werror=} and @option{-Wno-error=} as described above.
2962 (Printing of the option in the warning message can be disabled using the
2963 @option{-fno-diagnostics-show-option} flag.)
2964
2965 Note that specifying @option{-Werror=}@var{foo} automatically implies
2966 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2967 imply anything.
2968
2969 @item -Wfatal-errors
2970 @opindex Wfatal-errors
2971 @opindex Wno-fatal-errors
2972 This option causes the compiler to abort compilation on the first error
2973 occurred rather than trying to keep going and printing further error
2974 messages.
2975
2976 @end table
2977
2978 You can request many specific warnings with options beginning
2979 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2980 implicit declarations.  Each of these specific warning options also
2981 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2982 example, @option{-Wno-implicit}.  This manual lists only one of the
2983 two forms, whichever is not the default.  For further,
2984 language-specific options also refer to @ref{C++ Dialect Options} and
2985 @ref{Objective-C and Objective-C++ Dialect Options}.
2986
2987 When an unrecognized warning option is requested (e.g.,
2988 @option{-Wunknown-warning}), GCC emits a diagnostic stating
2989 that the option is not recognized.  However, if the @option{-Wno-} form
2990 is used, the behavior is slightly different: no diagnostic is
2991 produced for @option{-Wno-unknown-warning} unless other diagnostics
2992 are being produced.  This allows the use of new @option{-Wno-} options
2993 with old compilers, but if something goes wrong, the compiler
2994 warns that an unrecognized option is present.
2995
2996 @table @gcctabopt
2997 @item -Wpedantic
2998 @itemx -pedantic
2999 @opindex pedantic
3000 @opindex Wpedantic
3001 Issue all the warnings demanded by strict ISO C and ISO C++;
3002 reject all programs that use forbidden extensions, and some other
3003 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3004 version of the ISO C standard specified by any @option{-std} option used.
3005
3006 Valid ISO C and ISO C++ programs should compile properly with or without
3007 this option (though a rare few require @option{-ansi} or a
3008 @option{-std} option specifying the required version of ISO C)@.  However,
3009 without this option, certain GNU extensions and traditional C and C++
3010 features are supported as well.  With this option, they are rejected.
3011
3012 @option{-Wpedantic} does not cause warning messages for use of the
3013 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3014 warnings are also disabled in the expression that follows
3015 @code{__extension__}.  However, only system header files should use
3016 these escape routes; application programs should avoid them.
3017 @xref{Alternate Keywords}.
3018
3019 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3020 C conformance.  They soon find that it does not do quite what they want:
3021 it finds some non-ISO practices, but not all---only those for which
3022 ISO C @emph{requires} a diagnostic, and some others for which
3023 diagnostics have been added.
3024
3025 A feature to report any failure to conform to ISO C might be useful in
3026 some instances, but would require considerable additional work and would
3027 be quite different from @option{-Wpedantic}.  We don't have plans to
3028 support such a feature in the near future.
3029
3030 Where the standard specified with @option{-std} represents a GNU
3031 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3032 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3033 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3034 where they are required by the base standard.  (It does not make sense
3035 for such warnings to be given only for features not in the specified GNU
3036 C dialect, since by definition the GNU dialects of C include all
3037 features the compiler supports with the given option, and there would be
3038 nothing to warn about.)
3039
3040 @item -pedantic-errors
3041 @opindex pedantic-errors
3042 Like @option{-Wpedantic}, except that errors are produced rather than
3043 warnings.
3044
3045 @item -Wall
3046 @opindex Wall
3047 @opindex Wno-all
3048 This enables all the warnings about constructions that some users
3049 consider questionable, and that are easy to avoid (or modify to
3050 prevent the warning), even in conjunction with macros.  This also
3051 enables some language-specific warnings described in @ref{C++ Dialect
3052 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3053
3054 @option{-Wall} turns on the following warning flags:
3055
3056 @gccoptlist{-Waddress   @gol
3057 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3058 -Wc++11-compat  @gol
3059 -Wchar-subscripts  @gol
3060 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
3061 -Wimplicit-int @r{(C and Objective-C only)} @gol
3062 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3063 -Wcomment  @gol
3064 -Wformat   @gol
3065 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3066 -Wmaybe-uninitialized @gol
3067 -Wmissing-braces  @gol
3068 -Wnonnull  @gol
3069 -Wparentheses  @gol
3070 -Wpointer-sign  @gol
3071 -Wreorder   @gol
3072 -Wreturn-type  @gol
3073 -Wsequence-point  @gol
3074 -Wsign-compare @r{(only in C++)}  @gol
3075 -Wstrict-aliasing  @gol
3076 -Wstrict-overflow=1  @gol
3077 -Wswitch  @gol
3078 -Wtrigraphs  @gol
3079 -Wuninitialized  @gol
3080 -Wunknown-pragmas  @gol
3081 -Wunused-function  @gol
3082 -Wunused-label     @gol
3083 -Wunused-value     @gol
3084 -Wunused-variable  @gol
3085 -Wvolatile-register-var @gol
3086 }
3087
3088 Note that some warning flags are not implied by @option{-Wall}.  Some of
3089 them warn about constructions that users generally do not consider
3090 questionable, but which occasionally you might wish to check for;
3091 others warn about constructions that are necessary or hard to avoid in
3092 some cases, and there is no simple way to modify the code to suppress
3093 the warning. Some of them are enabled by @option{-Wextra} but many of
3094 them must be enabled individually.
3095
3096 @item -Wextra
3097 @opindex W
3098 @opindex Wextra
3099 @opindex Wno-extra
3100 This enables some extra warning flags that are not enabled by
3101 @option{-Wall}. (This option used to be called @option{-W}.  The older
3102 name is still supported, but the newer name is more descriptive.)
3103
3104 @gccoptlist{-Wclobbered  @gol
3105 -Wempty-body  @gol
3106 -Wignored-qualifiers @gol
3107 -Wmissing-field-initializers  @gol
3108 -Wmissing-parameter-type @r{(C only)}  @gol
3109 -Wold-style-declaration @r{(C only)}  @gol
3110 -Woverride-init  @gol
3111 -Wsign-compare  @gol
3112 -Wtype-limits  @gol
3113 -Wuninitialized  @gol
3114 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3115 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3116 }
3117
3118 The option @option{-Wextra} also prints warning messages for the
3119 following cases:
3120
3121 @itemize @bullet
3122
3123 @item
3124 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3125 @samp{>}, or @samp{>=}.
3126
3127 @item
3128 (C++ only) An enumerator and a non-enumerator both appear in a
3129 conditional expression.
3130
3131 @item
3132 (C++ only) Ambiguous virtual bases.
3133
3134 @item
3135 (C++ only) Subscripting an array that has been declared @samp{register}.
3136
3137 @item
3138 (C++ only) Taking the address of a variable that has been declared
3139 @samp{register}.
3140
3141 @item
3142 (C++ only) A base class is not initialized in a derived class' copy
3143 constructor.
3144
3145 @end itemize
3146
3147 @item -Wchar-subscripts
3148 @opindex Wchar-subscripts
3149 @opindex Wno-char-subscripts
3150 Warn if an array subscript has type @code{char}.  This is a common cause
3151 of error, as programmers often forget that this type is signed on some
3152 machines.
3153 This warning is enabled by @option{-Wall}.
3154
3155 @item -Wcomment
3156 @opindex Wcomment
3157 @opindex Wno-comment
3158 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3159 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3160 This warning is enabled by @option{-Wall}.
3161
3162 @item -Wno-coverage-mismatch
3163 @opindex Wno-coverage-mismatch
3164 Warn if feedback profiles do not match when using the
3165 @option{-fprofile-use} option.
3166 If a source file is changed between compiling with @option{-fprofile-gen} and
3167 with @option{-fprofile-use}, the files with the profile feedback can fail
3168 to match the source file and GCC cannot use the profile feedback
3169 information.  By default, this warning is enabled and is treated as an
3170 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3171 warning or @option{-Wno-error=coverage-mismatch} can be used to
3172 disable the error.  Disabling the error for this warning can result in
3173 poorly optimized code and is useful only in the
3174 case of very minor changes such as bug fixes to an existing code-base.
3175 Completely disabling the warning is not recommended.
3176
3177 @item -Wno-cpp
3178 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3179
3180 Suppress warning messages emitted by @code{#warning} directives.
3181
3182 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3183 @opindex Wdouble-promotion
3184 @opindex Wno-double-promotion
3185 Give a warning when a value of type @code{float} is implicitly
3186 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3187 floating-point unit implement @code{float} in hardware, but emulate
3188 @code{double} in software.  On such a machine, doing computations
3189 using @code{double} values is much more expensive because of the
3190 overhead required for software emulation.
3191
3192 It is easy to accidentally do computations with @code{double} because
3193 floating-point literals are implicitly of type @code{double}.  For
3194 example, in:
3195 @smallexample
3196 @group
3197 float area(float radius)
3198 @{
3199    return 3.14159 * radius * radius;
3200 @}
3201 @end group
3202 @end smallexample
3203 the compiler performs the entire computation with @code{double}
3204 because the floating-point literal is a @code{double}.
3205
3206 @item -Wformat
3207 @opindex Wformat
3208 @opindex Wno-format
3209 @opindex ffreestanding
3210 @opindex fno-builtin
3211 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3212 the arguments supplied have types appropriate to the format string
3213 specified, and that the conversions specified in the format string make
3214 sense.  This includes standard functions, and others specified by format
3215 attributes (@pxref{Function Attributes}), in the @code{printf},
3216 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3217 not in the C standard) families (or other target-specific families).
3218 Which functions are checked without format attributes having been
3219 specified depends on the standard version selected, and such checks of
3220 functions without the attribute specified are disabled by
3221 @option{-ffreestanding} or @option{-fno-builtin}.
3222
3223 The formats are checked against the format features supported by GNU
3224 libc version 2.2.  These include all ISO C90 and C99 features, as well
3225 as features from the Single Unix Specification and some BSD and GNU
3226 extensions.  Other library implementations may not support all these
3227 features; GCC does not support warning about features that go beyond a
3228 particular library's limitations.  However, if @option{-Wpedantic} is used
3229 with @option{-Wformat}, warnings are given about format features not
3230 in the selected standard version (but not for @code{strfmon} formats,
3231 since those are not in any version of the C standard).  @xref{C Dialect
3232 Options,,Options Controlling C Dialect}.
3233
3234 Since @option{-Wformat} also checks for null format arguments for
3235 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3236
3237 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3238 aspects of format checking, the options @option{-Wformat-y2k},
3239 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3240 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3241 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3242
3243 @item -Wformat-y2k
3244 @opindex Wformat-y2k
3245 @opindex Wno-format-y2k
3246 If @option{-Wformat} is specified, also warn about @code{strftime}
3247 formats that may yield only a two-digit year.
3248
3249 @item -Wno-format-contains-nul
3250 @opindex Wno-format-contains-nul
3251 @opindex Wformat-contains-nul
3252 If @option{-Wformat} is specified, do not warn about format strings that
3253 contain NUL bytes.
3254
3255 @item -Wno-format-extra-args
3256 @opindex Wno-format-extra-args
3257 @opindex Wformat-extra-args
3258 If @option{-Wformat} is specified, do not warn about excess arguments to a
3259 @code{printf} or @code{scanf} format function.  The C standard specifies
3260 that such arguments are ignored.
3261
3262 Where the unused arguments lie between used arguments that are
3263 specified with @samp{$} operand number specifications, normally
3264 warnings are still given, since the implementation could not know what
3265 type to pass to @code{va_arg} to skip the unused arguments.  However,
3266 in the case of @code{scanf} formats, this option suppresses the
3267 warning if the unused arguments are all pointers, since the Single
3268 Unix Specification says that such unused arguments are allowed.
3269
3270 @item -Wno-format-zero-length
3271 @opindex Wno-format-zero-length
3272 @opindex Wformat-zero-length
3273 If @option{-Wformat} is specified, do not warn about zero-length formats.
3274 The C standard specifies that zero-length formats are allowed.
3275
3276 @item -Wformat-nonliteral
3277 @opindex Wformat-nonliteral
3278 @opindex Wno-format-nonliteral
3279 If @option{-Wformat} is specified, also warn if the format string is not a
3280 string literal and so cannot be checked, unless the format function
3281 takes its format arguments as a @code{va_list}.
3282
3283 @item -Wformat-security
3284 @opindex Wformat-security
3285 @opindex Wno-format-security
3286 If @option{-Wformat} is specified, also warn about uses of format
3287 functions that represent possible security problems.  At present, this
3288 warns about calls to @code{printf} and @code{scanf} functions where the
3289 format string is not a string literal and there are no format arguments,
3290 as in @code{printf (foo);}.  This may be a security hole if the format
3291 string came from untrusted input and contains @samp{%n}.  (This is
3292 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3293 in future warnings may be added to @option{-Wformat-security} that are not
3294 included in @option{-Wformat-nonliteral}.)
3295
3296 @item -Wformat=2
3297 @opindex Wformat=2
3298 @opindex Wno-format=2
3299 Enable @option{-Wformat} plus format checks not included in
3300 @option{-Wformat}.  Currently equivalent to @option{-Wformat
3301 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3302
3303 @item -Wnonnull
3304 @opindex Wnonnull
3305 @opindex Wno-nonnull
3306 Warn about passing a null pointer for arguments marked as
3307 requiring a non-null value by the @code{nonnull} function attribute.
3308
3309 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3310 can be disabled with the @option{-Wno-nonnull} option.
3311
3312 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3313 @opindex Winit-self
3314 @opindex Wno-init-self
3315 Warn about uninitialized variables that are initialized with themselves.
3316 Note this option can only be used with the @option{-Wuninitialized} option.
3317
3318 For example, GCC warns about @code{i} being uninitialized in the
3319 following snippet only when @option{-Winit-self} has been specified:
3320 @smallexample
3321 @group
3322 int f()
3323 @{
3324   int i = i;
3325   return i;
3326 @}
3327 @end group
3328 @end smallexample
3329
3330 @item -Wimplicit-int @r{(C and Objective-C only)}
3331 @opindex Wimplicit-int
3332 @opindex Wno-implicit-int
3333 Warn when a declaration does not specify a type.
3334 This warning is enabled by @option{-Wall}.
3335
3336 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3337 @opindex Wimplicit-function-declaration
3338 @opindex Wno-implicit-function-declaration
3339 Give a warning whenever a function is used before being declared. In
3340 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3341 enabled by default and it is made into an error by
3342 @option{-pedantic-errors}. This warning is also enabled by
3343 @option{-Wall}.
3344
3345 @item -Wimplicit @r{(C and Objective-C only)}
3346 @opindex Wimplicit
3347 @opindex Wno-implicit
3348 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3349 This warning is enabled by @option{-Wall}.
3350
3351 @item -Wignored-qualifiers @r{(C and C++ only)}
3352 @opindex Wignored-qualifiers
3353 @opindex Wno-ignored-qualifiers
3354 Warn if the return type of a function has a type qualifier
3355 such as @code{const}.  For ISO C such a type qualifier has no effect,
3356 since the value returned by a function is not an lvalue.
3357 For C++, the warning is only emitted for scalar types or @code{void}.
3358 ISO C prohibits qualified @code{void} return types on function
3359 definitions, so such return types always receive a warning
3360 even without this option.
3361
3362 This warning is also enabled by @option{-Wextra}.
3363
3364 @item -Wmain
3365 @opindex Wmain
3366 @opindex Wno-main
3367 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3368 a function with external linkage, returning int, taking either zero
3369 arguments, two, or three arguments of appropriate types.  This warning
3370 is enabled by default in C++ and is enabled by either @option{-Wall}
3371 or @option{-Wpedantic}.
3372
3373 @item -Wmissing-braces
3374 @opindex Wmissing-braces
3375 @opindex Wno-missing-braces
3376 Warn if an aggregate or union initializer is not fully bracketed.  In
3377 the following example, the initializer for @samp{a} is not fully
3378 bracketed, but that for @samp{b} is fully bracketed.
3379
3380 @smallexample
3381 int a[2][2] = @{ 0, 1, 2, 3 @};
3382 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3383 @end smallexample
3384
3385 This warning is enabled by @option{-Wall}.
3386
3387 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3388 @opindex Wmissing-include-dirs
3389 @opindex Wno-missing-include-dirs
3390 Warn if a user-supplied include directory does not exist.
3391
3392 @item -Wparentheses
3393 @opindex Wparentheses
3394 @opindex Wno-parentheses
3395 Warn if parentheses are omitted in certain contexts, such
3396 as when there is an assignment in a context where a truth value
3397 is expected, or when operators are nested whose precedence people
3398 often get confused about.
3399
3400 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3401 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3402 interpretation from that of ordinary mathematical notation.
3403
3404 Also warn about constructions where there may be confusion to which
3405 @code{if} statement an @code{else} branch belongs.  Here is an example of
3406 such a case:
3407
3408 @smallexample
3409 @group
3410 @{
3411   if (a)
3412     if (b)
3413       foo ();
3414   else
3415     bar ();
3416 @}
3417 @end group
3418 @end smallexample
3419
3420 In C/C++, every @code{else} branch belongs to the innermost possible
3421 @code{if} statement, which in this example is @code{if (b)}.  This is
3422 often not what the programmer expected, as illustrated in the above
3423 example by indentation the programmer chose.  When there is the
3424 potential for this confusion, GCC issues a warning when this flag
3425 is specified.  To eliminate the warning, add explicit braces around
3426 the innermost @code{if} statement so there is no way the @code{else}
3427 can belong to the enclosing @code{if}.  The resulting code
3428 looks like this:
3429
3430 @smallexample
3431 @group
3432 @{
3433   if (a)
3434     @{
3435       if (b)
3436         foo ();
3437       else
3438         bar ();
3439     @}
3440 @}
3441 @end group
3442 @end smallexample
3443
3444 Also warn for dangerous uses of the GNU extension to
3445 @code{?:} with omitted middle operand. When the condition
3446 in the @code{?}: operator is a boolean expression, the omitted value is
3447 always 1.  Often programmers expect it to be a value computed
3448 inside the conditional expression instead.
3449
3450 This warning is enabled by @option{-Wall}.
3451
3452 @item -Wsequence-point
3453 @opindex Wsequence-point
3454 @opindex Wno-sequence-point
3455 Warn about code that may have undefined semantics because of violations
3456 of sequence point rules in the C and C++ standards.
3457
3458 The C and C++ standards defines the order in which expressions in a C/C++
3459 program are evaluated in terms of @dfn{sequence points}, which represent
3460 a partial ordering between the execution of parts of the program: those
3461 executed before the sequence point, and those executed after it.  These
3462 occur after the evaluation of a full expression (one which is not part
3463 of a larger expression), after the evaluation of the first operand of a
3464 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3465 function is called (but after the evaluation of its arguments and the
3466 expression denoting the called function), and in certain other places.
3467 Other than as expressed by the sequence point rules, the order of
3468 evaluation of subexpressions of an expression is not specified.  All
3469 these rules describe only a partial order rather than a total order,
3470 since, for example, if two functions are called within one expression
3471 with no sequence point between them, the order in which the functions
3472 are called is not specified.  However, the standards committee have
3473 ruled that function calls do not overlap.
3474
3475 It is not specified when between sequence points modifications to the
3476 values of objects take effect.  Programs whose behavior depends on this
3477 have undefined behavior; the C and C++ standards specify that ``Between
3478 the previous and next sequence point an object shall have its stored
3479 value modified at most once by the evaluation of an expression.
3480 Furthermore, the prior value shall be read only to determine the value
3481 to be stored.''.  If a program breaks these rules, the results on any
3482 particular implementation are entirely unpredictable.
3483
3484 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3485 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3486 diagnosed by this option, and it may give an occasional false positive
3487 result, but in general it has been found fairly effective at detecting
3488 this sort of problem in programs.
3489
3490 The standard is worded confusingly, therefore there is some debate
3491 over the precise meaning of the sequence point rules in subtle cases.
3492 Links to discussions of the problem, including proposed formal
3493 definitions, may be found on the GCC readings page, at
3494 @uref{http://gcc.gnu.org/@/readings.html}.
3495
3496 This warning is enabled by @option{-Wall} for C and C++.
3497
3498 @item -Wreturn-type
3499 @opindex Wreturn-type
3500 @opindex Wno-return-type
3501 Warn whenever a function is defined with a return-type that defaults
3502 to @code{int}.  Also warn about any @code{return} statement with no
3503 return-value in a function whose return-type is not @code{void}
3504 (falling off the end of the function body is considered returning
3505 without a value), and about a @code{return} statement with an
3506 expression in a function whose return-type is @code{void}.
3507
3508 For C++, a function without return type always produces a diagnostic
3509 message, even when @option{-Wno-return-type} is specified.  The only
3510 exceptions are @samp{main} and functions defined in system headers.
3511
3512 This warning is enabled by @option{-Wall}.
3513
3514 @item -Wswitch
3515 @opindex Wswitch
3516 @opindex Wno-switch
3517 Warn whenever a @code{switch} statement has an index of enumerated type
3518 and lacks a @code{case} for one or more of the named codes of that
3519 enumeration.  (The presence of a @code{default} label prevents this
3520 warning.)  @code{case} labels outside the enumeration range also
3521 provoke warnings when this option is used (even if there is a
3522 @code{default} label).
3523 This warning is enabled by @option{-Wall}.
3524
3525 @item -Wswitch-default
3526 @opindex Wswitch-default
3527 @opindex Wno-switch-default
3528 Warn whenever a @code{switch} statement does not have a @code{default}
3529 case.
3530
3531 @item -Wswitch-enum
3532 @opindex Wswitch-enum
3533 @opindex Wno-switch-enum
3534 Warn whenever a @code{switch} statement has an index of enumerated type
3535 and lacks a @code{case} for one or more of the named codes of that
3536 enumeration.  @code{case} labels outside the enumeration range also
3537 provoke warnings when this option is used.  The only difference
3538 between @option{-Wswitch} and this option is that this option gives a
3539 warning about an omitted enumeration code even if there is a
3540 @code{default} label.
3541
3542 @item -Wsync-nand @r{(C and C++ only)}
3543 @opindex Wsync-nand
3544 @opindex Wno-sync-nand
3545 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3546 built-in functions are used.  These functions changed semantics in GCC 4.4.
3547
3548 @item -Wtrigraphs
3549 @opindex Wtrigraphs
3550 @opindex Wno-trigraphs
3551 Warn if any trigraphs are encountered that might change the meaning of
3552 the program (trigraphs within comments are not warned about).
3553 This warning is enabled by @option{-Wall}.
3554
3555 @item -Wunused-but-set-parameter
3556 @opindex Wunused-but-set-parameter
3557 @opindex Wno-unused-but-set-parameter
3558 Warn whenever a function parameter is assigned to, but otherwise unused
3559 (aside from its declaration).
3560
3561 To suppress this warning use the @samp{unused} attribute
3562 (@pxref{Variable Attributes}).
3563
3564 This warning is also enabled by @option{-Wunused} together with
3565 @option{-Wextra}.
3566
3567 @item -Wunused-but-set-variable
3568 @opindex Wunused-but-set-variable
3569 @opindex Wno-unused-but-set-variable
3570 Warn whenever a local variable is assigned to, but otherwise unused
3571 (aside from its declaration).
3572 This warning is enabled by @option{-Wall}.
3573
3574 To suppress this warning use the @samp{unused} attribute
3575 (@pxref{Variable Attributes}).
3576
3577 This warning is also enabled by @option{-Wunused}, which is enabled
3578 by @option{-Wall}.
3579
3580 @item -Wunused-function
3581 @opindex Wunused-function
3582 @opindex Wno-unused-function
3583 Warn whenever a static function is declared but not defined or a
3584 non-inline static function is unused.
3585 This warning is enabled by @option{-Wall}.
3586
3587 @item -Wunused-label
3588 @opindex Wunused-label
3589 @opindex Wno-unused-label
3590 Warn whenever a label is declared but not used.
3591 This warning is enabled by @option{-Wall}.
3592
3593 To suppress this warning use the @samp{unused} attribute
3594 (@pxref{Variable Attributes}).
3595
3596 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3597 @opindex Wunused-local-typedefs
3598 Warn when a typedef locally defined in a function is not used.
3599
3600 @item -Wunused-parameter
3601 @opindex Wunused-parameter
3602 @opindex Wno-unused-parameter
3603 Warn whenever a function parameter is unused aside from its declaration.
3604
3605 To suppress this warning use the @samp{unused} attribute
3606 (@pxref{Variable Attributes}).
3607
3608 @item -Wno-unused-result
3609 @opindex Wunused-result
3610 @opindex Wno-unused-result
3611 Do not warn if a caller of a function marked with attribute
3612 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3613 its return value. The default is @option{-Wunused-result}.
3614
3615 @item -Wunused-variable
3616 @opindex Wunused-variable
3617 @opindex Wno-unused-variable
3618 Warn whenever a local variable or non-constant static variable is unused
3619 aside from its declaration.
3620 This warning is enabled by @option{-Wall}.
3621
3622 To suppress this warning use the @samp{unused} attribute
3623 (@pxref{Variable Attributes}).
3624
3625 @item -Wunused-value
3626 @opindex Wunused-value
3627 @opindex Wno-unused-value
3628 Warn whenever a statement computes a result that is explicitly not
3629 used. To suppress this warning cast the unused expression to
3630 @samp{void}. This includes an expression-statement or the left-hand
3631 side of a comma expression that contains no side effects. For example,
3632 an expression such as @samp{x[i,j]} causes a warning, while
3633 @samp{x[(void)i,j]} does not.
3634
3635 This warning is enabled by @option{-Wall}.
3636
3637 @item -Wunused
3638 @opindex Wunused
3639 @opindex Wno-unused
3640 All the above @option{-Wunused} options combined.
3641
3642 In order to get a warning about an unused function parameter, you must
3643 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3644 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3645
3646 @item -Wuninitialized
3647 @opindex Wuninitialized
3648 @opindex Wno-uninitialized
3649 Warn if an automatic variable is used without first being initialized
3650 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3651 warn if a non-static reference or non-static @samp{const} member
3652 appears in a class without constructors.
3653
3654 If you want to warn about code that uses the uninitialized value of the
3655 variable in its own initializer, use the @option{-Winit-self} option.
3656
3657 These warnings occur for individual uninitialized or clobbered
3658 elements of structure, union or array variables as well as for
3659 variables that are uninitialized or clobbered as a whole.  They do
3660 not occur for variables or elements declared @code{volatile}.  Because
3661 these warnings depend on optimization, the exact variables or elements
3662 for which there are warnings depends on the precise optimization
3663 options and version of GCC used.
3664
3665 Note that there may be no warning about a variable that is used only
3666 to compute a value that itself is never used, because such
3667 computations may be deleted by data flow analysis before the warnings
3668 are printed.
3669
3670 @item -Wmaybe-uninitialized
3671 @opindex Wmaybe-uninitialized
3672 @opindex Wno-maybe-uninitialized
3673 For an automatic variable, if there exists a path from the function
3674 entry to a use of the variable that is initialized, but there exist
3675 some other paths for which the variable is not initialized, the compiler
3676 emits a warning if it cannot prove the uninitialized paths are not
3677 executed at run time. These warnings are made optional because GCC is
3678 not smart enough to see all the reasons why the code might be correct
3679 in spite of appearing to have an error.  Here is one example of how
3680 this can happen:
3681
3682 @smallexample
3683 @group
3684 @{
3685   int x;
3686   switch (y)
3687     @{
3688     case 1: x = 1;
3689       break;
3690     case 2: x = 4;
3691       break;
3692     case 3: x = 5;
3693     @}
3694   foo (x);
3695 @}
3696 @end group
3697 @end smallexample
3698
3699 @noindent
3700 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3701 always initialized, but GCC doesn't know this. To suppress the
3702 warning, you need to provide a default case with assert(0) or
3703 similar code.
3704
3705 @cindex @code{longjmp} warnings
3706 This option also warns when a non-volatile automatic variable might be
3707 changed by a call to @code{longjmp}.  These warnings as well are possible
3708 only in optimizing compilation.
3709
3710 The compiler sees only the calls to @code{setjmp}.  It cannot know
3711 where @code{longjmp} will be called; in fact, a signal handler could
3712 call it at any point in the code.  As a result, you may get a warning
3713 even when there is in fact no problem because @code{longjmp} cannot
3714 in fact be called at the place that would cause a problem.
3715
3716 Some spurious warnings can be avoided if you declare all the functions
3717 you use that never return as @code{noreturn}.  @xref{Function
3718 Attributes}.
3719
3720 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3721
3722 @item -Wunknown-pragmas
3723 @opindex Wunknown-pragmas
3724 @opindex Wno-unknown-pragmas
3725 @cindex warning for unknown pragmas
3726 @cindex unknown pragmas, warning
3727 @cindex pragmas, warning of unknown
3728 Warn when a @code{#pragma} directive is encountered that is not understood by 
3729 GCC@.  If this command-line option is used, warnings are even issued
3730 for unknown pragmas in system header files.  This is not the case if
3731 the warnings are only enabled by the @option{-Wall} command-line option.
3732
3733 @item -Wno-pragmas
3734 @opindex Wno-pragmas
3735 @opindex Wpragmas
3736 Do not warn about misuses of pragmas, such as incorrect parameters,
3737 invalid syntax, or conflicts between pragmas.  See also
3738 @option{-Wunknown-pragmas}.
3739
3740 @item -Wstrict-aliasing
3741 @opindex Wstrict-aliasing
3742 @opindex Wno-strict-aliasing
3743 This option is only active when @option{-fstrict-aliasing} is active.
3744 It warns about code that might break the strict aliasing rules that the
3745 compiler is using for optimization.  The warning does not catch all
3746 cases, but does attempt to catch the more common pitfalls.  It is
3747 included in @option{-Wall}.
3748 It is equivalent to @option{-Wstrict-aliasing=3}
3749
3750 @item -Wstrict-aliasing=n
3751 @opindex Wstrict-aliasing=n
3752 @opindex Wno-strict-aliasing=n
3753 This option is only active when @option{-fstrict-aliasing} is active.
3754 It warns about code that might break the strict aliasing rules that the
3755 compiler is using for optimization.
3756 Higher levels correspond to higher accuracy (fewer false positives).
3757 Higher levels also correspond to more effort, similar to the way @option{-O} 
3758 works.
3759 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3760
3761 Level 1: Most aggressive, quick, least accurate.
3762 Possibly useful when higher levels
3763 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3764 false negatives.  However, it has many false positives.
3765 Warns for all pointer conversions between possibly incompatible types,
3766 even if never dereferenced.  Runs in the front end only.
3767
3768 Level 2: Aggressive, quick, not too precise.
3769 May still have many false positives (not as many as level 1 though),
3770 and few false negatives (but possibly more than level 1).
3771 Unlike level 1, it only warns when an address is taken.  Warns about
3772 incomplete types.  Runs in the front end only.
3773
3774 Level 3 (default for @option{-Wstrict-aliasing}):
3775 Should have very few false positives and few false
3776 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3777 Takes care of the common pun+dereference pattern in the front end:
3778 @code{*(int*)&some_float}.
3779 If optimization is enabled, it also runs in the back end, where it deals
3780 with multiple statement cases using flow-sensitive points-to information.
3781 Only warns when the converted pointer is dereferenced.
3782 Does not warn about incomplete types.
3783
3784 @item -Wstrict-overflow
3785 @itemx -Wstrict-overflow=@var{n}
3786 @opindex Wstrict-overflow
3787 @opindex Wno-strict-overflow
3788 This option is only active when @option{-fstrict-overflow} is active.
3789 It warns about cases where the compiler optimizes based on the
3790 assumption that signed overflow does not occur.  Note that it does not
3791 warn about all cases where the code might overflow: it only warns
3792 about cases where the compiler implements some optimization.  Thus
3793 this warning depends on the optimization level.
3794
3795 An optimization that assumes that signed overflow does not occur is
3796 perfectly safe if the values of the variables involved are such that
3797 overflow never does, in fact, occur.  Therefore this warning can
3798 easily give a false positive: a warning about code that is not
3799 actually a problem.  To help focus on important issues, several
3800 warning levels are defined.  No warnings are issued for the use of
3801 undefined signed overflow when estimating how many iterations a loop
3802 requires, in particular when determining whether a loop will be
3803 executed at all.
3804
3805 @table @gcctabopt
3806 @item -Wstrict-overflow=1
3807 Warn about cases that are both questionable and easy to avoid.  For
3808 example,  with @option{-fstrict-overflow}, the compiler simplifies
3809 @code{x + 1 > x} to @code{1}.  This level of
3810 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3811 are not, and must be explicitly requested.
3812
3813 @item -Wstrict-overflow=2
3814 Also warn about other cases where a comparison is simplified to a
3815 constant.  For example: @code{abs (x) >= 0}.  This can only be
3816 simplified when @option{-fstrict-overflow} is in effect, because
3817 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3818 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3819 @option{-Wstrict-overflow=2}.
3820
3821 @item -Wstrict-overflow=3
3822 Also warn about other cases where a comparison is simplified.  For
3823 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
3824
3825 @item -Wstrict-overflow=4
3826 Also warn about other simplifications not covered by the above cases.
3827 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
3828
3829 @item -Wstrict-overflow=5
3830 Also warn about cases where the compiler reduces the magnitude of a
3831 constant involved in a comparison.  For example: @code{x + 2 > y} is
3832 simplified to @code{x + 1 >= y}.  This is reported only at the
3833 highest warning level because this simplification applies to many
3834 comparisons, so this warning level gives a very large number of
3835 false positives.
3836 @end table
3837
3838 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3839 @opindex Wsuggest-attribute=
3840 @opindex Wno-suggest-attribute=
3841 Warn for cases where adding an attribute may be beneficial. The
3842 attributes currently supported are listed below.
3843
3844 @table @gcctabopt
3845 @item -Wsuggest-attribute=pure
3846 @itemx -Wsuggest-attribute=const
3847 @itemx -Wsuggest-attribute=noreturn
3848 @opindex Wsuggest-attribute=pure
3849 @opindex Wno-suggest-attribute=pure
3850 @opindex Wsuggest-attribute=const
3851 @opindex Wno-suggest-attribute=const
3852 @opindex Wsuggest-attribute=noreturn
3853 @opindex Wno-suggest-attribute=noreturn
3854
3855 Warn about functions that might be candidates for attributes
3856 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3857 functions visible in other compilation units or (in the case of @code{pure} and
3858 @code{const}) if it cannot prove that the function returns normally. A function
3859 returns normally if it doesn't contain an infinite loop nor returns abnormally
3860 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3861 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3862 higher.  Higher optimization levels improve the accuracy of the analysis.
3863 @end table
3864
3865 @item -Warray-bounds
3866 @opindex Wno-array-bounds
3867 @opindex Warray-bounds
3868 This option is only active when @option{-ftree-vrp} is active
3869 (default for @option{-O2} and above). It warns about subscripts to arrays
3870 that are always out of bounds. This warning is enabled by @option{-Wall}.
3871
3872 @item -Wno-div-by-zero
3873 @opindex Wno-div-by-zero
3874 @opindex Wdiv-by-zero
3875 Do not warn about compile-time integer division by zero.  Floating-point
3876 division by zero is not warned about, as it can be a legitimate way of
3877 obtaining infinities and NaNs.
3878
3879 @item -Wsystem-headers
3880 @opindex Wsystem-headers
3881 @opindex Wno-system-headers
3882 @cindex warnings from system headers
3883 @cindex system headers, warnings from
3884 Print warning messages for constructs found in system header files.
3885 Warnings from system headers are normally suppressed, on the assumption
3886 that they usually do not indicate real problems and would only make the
3887 compiler output harder to read.  Using this command-line option tells
3888 GCC to emit warnings from system headers as if they occurred in user
3889 code.  However, note that using @option{-Wall} in conjunction with this
3890 option does @emph{not} warn about unknown pragmas in system
3891 headers---for that, @option{-Wunknown-pragmas} must also be used.
3892
3893 @item -Wtrampolines
3894 @opindex Wtrampolines
3895 @opindex Wno-trampolines
3896  Warn about trampolines generated for pointers to nested functions.
3897
3898  A trampoline is a small piece of data or code that is created at run
3899  time on the stack when the address of a nested function is taken, and
3900  is used to call the nested function indirectly.  For some targets, it
3901  is made up of data only and thus requires no special treatment.  But,
3902  for most targets, it is made up of code and thus requires the stack
3903  to be made executable in order for the program to work properly.
3904
3905 @item -Wfloat-equal
3906 @opindex Wfloat-equal
3907 @opindex Wno-float-equal
3908 Warn if floating-point values are used in equality comparisons.
3909
3910 The idea behind this is that sometimes it is convenient (for the
3911 programmer) to consider floating-point values as approximations to
3912 infinitely precise real numbers.  If you are doing this, then you need
3913 to compute (by analyzing the code, or in some other way) the maximum or
3914 likely maximum error that the computation introduces, and allow for it
3915 when performing comparisons (and when producing output, but that's a
3916 different problem).  In particular, instead of testing for equality, you
3917 should check to see whether the two values have ranges that overlap; and
3918 this is done with the relational operators, so equality comparisons are
3919 probably mistaken.
3920
3921 @item -Wtraditional @r{(C and Objective-C only)}
3922 @opindex Wtraditional
3923 @opindex Wno-traditional
3924 Warn about certain constructs that behave differently in traditional and
3925 ISO C@.  Also warn about ISO C constructs that have no traditional C
3926 equivalent, and/or problematic constructs that should be avoided.
3927
3928 @itemize @bullet
3929 @item
3930 Macro parameters that appear within string literals in the macro body.
3931 In traditional C macro replacement takes place within string literals,
3932 but does not in ISO C@.
3933
3934 @item
3935 In traditional C, some preprocessor directives did not exist.
3936 Traditional preprocessors only considered a line to be a directive
3937 if the @samp{#} appeared in column 1 on the line.  Therefore
3938 @option{-Wtraditional} warns about directives that traditional C
3939 understands but ignores because the @samp{#} does not appear as the
3940 first character on the line.  It also suggests you hide directives like
3941 @samp{#pragma} not understood by traditional C by indenting them.  Some
3942 traditional implementations do not recognize @samp{#elif}, so this option
3943 suggests avoiding it altogether.
3944
3945 @item
3946 A function-like macro that appears without arguments.
3947
3948 @item
3949 The unary plus operator.
3950
3951 @item
3952 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
3953 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3954 constants.)  Note, these suffixes appear in macros defined in the system
3955 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3956 Use of these macros in user code might normally lead to spurious
3957 warnings, however GCC's integrated preprocessor has enough context to
3958 avoid warning in these cases.
3959
3960 @item
3961 A function declared external in one block and then used after the end of
3962 the block.
3963
3964 @item
3965 A @code{switch} statement has an operand of type @code{long}.
3966
3967 @item
3968 A non-@code{static} function declaration follows a @code{static} one.
3969 This construct is not accepted by some traditional C compilers.
3970
3971 @item
3972 The ISO type of an integer constant has a different width or
3973 signedness from its traditional type.  This warning is only issued if
3974 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3975 typically represent bit patterns, are not warned about.
3976
3977 @item
3978 Usage of ISO string concatenation is detected.
3979
3980 @item
3981 Initialization of automatic aggregates.
3982
3983 @item
3984 Identifier conflicts with labels.  Traditional C lacks a separate
3985 namespace for labels.
3986
3987 @item
3988 Initialization of unions.  If the initializer is zero, the warning is
3989 omitted.  This is done under the assumption that the zero initializer in
3990 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3991 initializer warnings and relies on default initialization to zero in the
3992 traditional C case.
3993
3994 @item
3995 Conversions by prototypes between fixed/floating-point values and vice
3996 versa.  The absence of these prototypes when compiling with traditional
3997 C causes serious problems.  This is a subset of the possible
3998 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
3999
4000 @item
4001 Use of ISO C style function definitions.  This warning intentionally is
4002 @emph{not} issued for prototype declarations or variadic functions
4003 because these ISO C features appear in your code when using
4004 libiberty's traditional C compatibility macros, @code{PARAMS} and
4005 @code{VPARAMS}.  This warning is also bypassed for nested functions
4006 because that feature is already a GCC extension and thus not relevant to
4007 traditional C compatibility.
4008 @end itemize
4009
4010 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4011 @opindex Wtraditional-conversion
4012 @opindex Wno-traditional-conversion
4013 Warn if a prototype causes a type conversion that is different from what
4014 would happen to the same argument in the absence of a prototype.  This
4015 includes conversions of fixed point to floating and vice versa, and
4016 conversions changing the width or signedness of a fixed-point argument
4017 except when the same as the default promotion.
4018
4019 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4020 @opindex Wdeclaration-after-statement
4021 @opindex Wno-declaration-after-statement
4022 Warn when a declaration is found after a statement in a block.  This
4023 construct, known from C++, was introduced with ISO C99 and is by default
4024 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4025 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4026
4027 @item -Wundef
4028 @opindex Wundef
4029 @opindex Wno-undef
4030 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4031
4032 @item -Wno-endif-labels
4033 @opindex Wno-endif-labels
4034 @opindex Wendif-labels
4035 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4036
4037 @item -Wshadow
4038 @opindex Wshadow
4039 @opindex Wno-shadow
4040 Warn whenever a local variable or type declaration shadows another variable,
4041 parameter, type, or class member (in C++), or whenever a built-in function
4042 is shadowed. Note that in C++, the compiler warns if a local variable
4043 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4044
4045 @item -Wlarger-than=@var{len}
4046 @opindex Wlarger-than=@var{len}
4047 @opindex Wlarger-than-@var{len}
4048 Warn whenever an object of larger than @var{len} bytes is defined.
4049
4050 @item -Wframe-larger-than=@var{len}
4051 @opindex Wframe-larger-than
4052 Warn if the size of a function frame is larger than @var{len} bytes.
4053 The computation done to determine the stack frame size is approximate
4054 and not conservative.
4055 The actual requirements may be somewhat greater than @var{len}
4056 even if you do not get a warning.  In addition, any space allocated
4057 via @code{alloca}, variable-length arrays, or related constructs
4058 is not included by the compiler when determining
4059 whether or not to issue a warning.
4060
4061 @item -Wno-free-nonheap-object
4062 @opindex Wno-free-nonheap-object
4063 @opindex Wfree-nonheap-object
4064 Do not warn when attempting to free an object that was not allocated
4065 on the heap.
4066
4067 @item -Wstack-usage=@var{len}
4068 @opindex Wstack-usage
4069 Warn if the stack usage of a function might be larger than @var{len} bytes.
4070 The computation done to determine the stack usage is conservative.
4071 Any space allocated via @code{alloca}, variable-length arrays, or related
4072 constructs is included by the compiler when determining whether or not to
4073 issue a warning.
4074
4075 The message is in keeping with the output of @option{-fstack-usage}.
4076
4077 @itemize
4078 @item
4079 If the stack usage is fully static but exceeds the specified amount, it's:
4080
4081 @smallexample
4082   warning: stack usage is 1120 bytes
4083 @end smallexample
4084 @item
4085 If the stack usage is (partly) dynamic but bounded, it's:
4086
4087 @smallexample
4088   warning: stack usage might be 1648 bytes
4089 @end smallexample
4090 @item
4091 If the stack usage is (partly) dynamic and not bounded, it's:
4092
4093 @smallexample
4094   warning: stack usage might be unbounded
4095 @end smallexample
4096 @end itemize
4097
4098 @item -Wunsafe-loop-optimizations
4099 @opindex Wunsafe-loop-optimizations
4100 @opindex Wno-unsafe-loop-optimizations
4101 Warn if the loop cannot be optimized because the compiler cannot
4102 assume anything on the bounds of the loop indices.  With
4103 @option{-funsafe-loop-optimizations} warn if the compiler makes
4104 such assumptions.
4105
4106 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4107 @opindex Wno-pedantic-ms-format
4108 @opindex Wpedantic-ms-format
4109 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
4110 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
4111 depending on the MS runtime, when you are using the options @option{-Wformat}
4112 and @option{-Wpedantic} without gnu-extensions.
4113
4114 @item -Wpointer-arith
4115 @opindex Wpointer-arith
4116 @opindex Wno-pointer-arith
4117 Warn about anything that depends on the ``size of'' a function type or
4118 of @code{void}.  GNU C assigns these types a size of 1, for
4119 convenience in calculations with @code{void *} pointers and pointers
4120 to functions.  In C++, warn also when an arithmetic operation involves
4121 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4122
4123 @item -Wtype-limits
4124 @opindex Wtype-limits
4125 @opindex Wno-type-limits
4126 Warn if a comparison is always true or always false due to the limited
4127 range of the data type, but do not warn for constant expressions.  For
4128 example, warn if an unsigned variable is compared against zero with
4129 @samp{<} or @samp{>=}.  This warning is also enabled by
4130 @option{-Wextra}.
4131
4132 @item -Wbad-function-cast @r{(C and Objective-C only)}
4133 @opindex Wbad-function-cast
4134 @opindex Wno-bad-function-cast
4135 Warn whenever a function call is cast to a non-matching type.
4136 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4137
4138 @item -Wc++-compat @r{(C and Objective-C only)}
4139 Warn about ISO C constructs that are outside of the common subset of
4140 ISO C and ISO C++, e.g.@: request for implicit conversion from
4141 @code{void *} to a pointer to non-@code{void} type.
4142
4143 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4144 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4145 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4146 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4147 enabled by @option{-Wall}.
4148
4149 @item -Wcast-qual
4150 @opindex Wcast-qual
4151 @opindex Wno-cast-qual
4152 Warn whenever a pointer is cast so as to remove a type qualifier from
4153 the target type.  For example, warn if a @code{const char *} is cast
4154 to an ordinary @code{char *}.
4155
4156 Also warn when making a cast that introduces a type qualifier in an
4157 unsafe way.  For example, casting @code{char **} to @code{const char **}
4158 is unsafe, as in this example:
4159
4160 @smallexample
4161   /* p is char ** value.  */
4162   const char **q = (const char **) p;
4163   /* Assignment of readonly string to const char * is OK.  */
4164   *q = "string";
4165   /* Now char** pointer points to read-only memory.  */
4166   **p = 'b';
4167 @end smallexample
4168
4169 @item -Wcast-align
4170 @opindex Wcast-align
4171 @opindex Wno-cast-align
4172 Warn whenever a pointer is cast such that the required alignment of the
4173 target is increased.  For example, warn if a @code{char *} is cast to
4174 an @code{int *} on machines where integers can only be accessed at
4175 two- or four-byte boundaries.
4176
4177 @item -Wwrite-strings
4178 @opindex Wwrite-strings
4179 @opindex Wno-write-strings
4180 When compiling C, give string constants the type @code{const
4181 char[@var{length}]} so that copying the address of one into a
4182 non-@code{const} @code{char *} pointer produces a warning.  These
4183 warnings help you find at compile time code that can try to write
4184 into a string constant, but only if you have been very careful about
4185 using @code{const} in declarations and prototypes.  Otherwise, it is
4186 just a nuisance. This is why we did not make @option{-Wall} request
4187 these warnings.
4188
4189 When compiling C++, warn about the deprecated conversion from string
4190 literals to @code{char *}.  This warning is enabled by default for C++
4191 programs.
4192
4193 @item -Wclobbered
4194 @opindex Wclobbered
4195 @opindex Wno-clobbered
4196 Warn for variables that might be changed by @samp{longjmp} or
4197 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4198
4199 @item -Wconversion
4200 @opindex Wconversion
4201 @opindex Wno-conversion
4202 Warn for implicit conversions that may alter a value. This includes
4203 conversions between real and integer, like @code{abs (x)} when
4204 @code{x} is @code{double}; conversions between signed and unsigned,
4205 like @code{unsigned ui = -1}; and conversions to smaller types, like
4206 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4207 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4208 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4209 conversions between signed and unsigned integers can be disabled by
4210 using @option{-Wno-sign-conversion}.
4211
4212 For C++, also warn for confusing overload resolution for user-defined
4213 conversions; and conversions that never use a type conversion
4214 operator: conversions to @code{void}, the same type, a base class or a
4215 reference to them. Warnings about conversions between signed and
4216 unsigned integers are disabled by default in C++ unless
4217 @option{-Wsign-conversion} is explicitly enabled.
4218
4219 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4220 @opindex Wconversion-null
4221 @opindex Wno-conversion-null
4222 Do not warn for conversions between @code{NULL} and non-pointer
4223 types. @option{-Wconversion-null} is enabled by default.
4224
4225 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4226 @opindex Wzero-as-null-pointer-constant
4227 @opindex Wno-zero-as-null-pointer-constant
4228 Warn when a literal '0' is used as null pointer constant.  This can
4229 be useful to facilitate the conversion to @code{nullptr} in C++11.
4230
4231 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4232 @opindex Wuseless-cast
4233 @opindex Wno-useless-cast
4234 Warn when an expression is casted to its own type.
4235
4236 @item -Wempty-body
4237 @opindex Wempty-body
4238 @opindex Wno-empty-body
4239 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4240 while} statement.  This warning is also enabled by @option{-Wextra}.
4241
4242 @item -Wenum-compare
4243 @opindex Wenum-compare
4244 @opindex Wno-enum-compare
4245 Warn about a comparison between values of different enumerated types. In C++
4246 this warning is enabled by default.  In C this warning is enabled by
4247 @option{-Wall}.
4248
4249 @item -Wjump-misses-init @r{(C, Objective-C only)}
4250 @opindex Wjump-misses-init
4251 @opindex Wno-jump-misses-init
4252 Warn if a @code{goto} statement or a @code{switch} statement jumps
4253 forward across the initialization of a variable, or jumps backward to a
4254 label after the variable has been initialized.  This only warns about
4255 variables that are initialized when they are declared.  This warning is
4256 only supported for C and Objective-C; in C++ this sort of branch is an
4257 error in any case.
4258
4259 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4260 can be disabled with the @option{-Wno-jump-misses-init} option.
4261
4262 @item -Wsign-compare
4263 @opindex Wsign-compare
4264 @opindex Wno-sign-compare
4265 @cindex warning for comparison of signed and unsigned values
4266 @cindex comparison of signed and unsigned values, warning
4267 @cindex signed and unsigned values, comparison warning
4268 Warn when a comparison between signed and unsigned values could produce
4269 an incorrect result when the signed value is converted to unsigned.
4270 This warning is also enabled by @option{-Wextra}; to get the other warnings
4271 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4272
4273 @item -Wsign-conversion
4274 @opindex Wsign-conversion
4275 @opindex Wno-sign-conversion
4276 Warn for implicit conversions that may change the sign of an integer
4277 value, like assigning a signed integer expression to an unsigned
4278 integer variable. An explicit cast silences the warning. In C, this
4279 option is enabled also by @option{-Wconversion}.
4280
4281 @item -Waddress
4282 @opindex Waddress
4283 @opindex Wno-address
4284 Warn about suspicious uses of memory addresses. These include using
4285 the address of a function in a conditional expression, such as
4286 @code{void func(void); if (func)}, and comparisons against the memory
4287 address of a string literal, such as @code{if (x == "abc")}.  Such
4288 uses typically indicate a programmer error: the address of a function
4289 always evaluates to true, so their use in a conditional usually
4290 indicate that the programmer forgot the parentheses in a function
4291 call; and comparisons against string literals result in unspecified
4292 behavior and are not portable in C, so they usually indicate that the
4293 programmer intended to use @code{strcmp}.  This warning is enabled by
4294 @option{-Wall}.
4295
4296 @item -Wlogical-op
4297 @opindex Wlogical-op
4298 @opindex Wno-logical-op
4299 Warn about suspicious uses of logical operators in expressions.
4300 This includes using logical operators in contexts where a
4301 bit-wise operator is likely to be expected.
4302
4303 @item -Waggregate-return
4304 @opindex Waggregate-return
4305 @opindex Wno-aggregate-return
4306 Warn if any functions that return structures or unions are defined or
4307 called.  (In languages where you can return an array, this also elicits
4308 a warning.)
4309
4310 @item -Wno-attributes
4311 @opindex Wno-attributes
4312 @opindex Wattributes
4313 Do not warn if an unexpected @code{__attribute__} is used, such as
4314 unrecognized attributes, function attributes applied to variables,
4315 etc.  This does not stop errors for incorrect use of supported
4316 attributes.
4317
4318 @item -Wno-builtin-macro-redefined
4319 @opindex Wno-builtin-macro-redefined
4320 @opindex Wbuiltin-macro-redefined
4321 Do not warn if certain built-in macros are redefined.  This suppresses
4322 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4323 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4324
4325 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4326 @opindex Wstrict-prototypes
4327 @opindex Wno-strict-prototypes
4328 Warn if a function is declared or defined without specifying the
4329 argument types.  (An old-style function definition is permitted without
4330 a warning if preceded by a declaration that specifies the argument
4331 types.)
4332
4333 @item -Wold-style-declaration @r{(C and Objective-C only)}
4334 @opindex Wold-style-declaration
4335 @opindex Wno-old-style-declaration
4336 Warn for obsolescent usages, according to the C Standard, in a
4337 declaration. For example, warn if storage-class specifiers like
4338 @code{static} are not the first things in a declaration.  This warning
4339 is also enabled by @option{-Wextra}.
4340
4341 @item -Wold-style-definition @r{(C and Objective-C only)}
4342 @opindex Wold-style-definition
4343 @opindex Wno-old-style-definition
4344 Warn if an old-style function definition is used.  A warning is given
4345 even if there is a previous prototype.
4346
4347 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4348 @opindex Wmissing-parameter-type
4349 @opindex Wno-missing-parameter-type
4350 A function parameter is declared without a type specifier in K&R-style
4351 functions:
4352
4353 @smallexample
4354 void foo(bar) @{ @}
4355 @end smallexample
4356
4357 This warning is also enabled by @option{-Wextra}.
4358
4359 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4360 @opindex Wmissing-prototypes
4361 @opindex Wno-missing-prototypes
4362 Warn if a global function is defined without a previous prototype
4363 declaration.  This warning is issued even if the definition itself
4364 provides a prototype.  The aim is to detect global functions that 
4365 are not declared in header files.
4366
4367 @item -Wmissing-declarations
4368 @opindex Wmissing-declarations
4369 @opindex Wno-missing-declarations
4370 Warn if a global function is defined without a previous declaration.
4371 Do so even if the definition itself provides a prototype.
4372 Use this option to detect global functions that are not declared in
4373 header files.  In C++, no warnings are issued for function templates,
4374 or for inline functions, or for functions in anonymous namespaces.
4375
4376 @item -Wmissing-field-initializers
4377 @opindex Wmissing-field-initializers
4378 @opindex Wno-missing-field-initializers
4379 @opindex W
4380 @opindex Wextra
4381 @opindex Wno-extra
4382 Warn if a structure's initializer has some fields missing.  For
4383 example, the following code causes such a warning, because
4384 @code{x.h} is implicitly zero:
4385
4386 @smallexample
4387 struct s @{ int f, g, h; @};
4388 struct s x = @{ 3, 4 @};
4389 @end smallexample
4390
4391 This option does not warn about designated initializers, so the following
4392 modification does not trigger a warning:
4393
4394 @smallexample
4395 struct s @{ int f, g, h; @};
4396 struct s x = @{ .f = 3, .g = 4 @};
4397 @end smallexample
4398
4399 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4400 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4401
4402 @item -Wmissing-format-attribute
4403 @opindex Wmissing-format-attribute
4404 @opindex Wno-missing-format-attribute
4405 @opindex Wformat
4406 @opindex Wno-format
4407 Warn about function pointers that might be candidates for @code{format}
4408 attributes.  Note these are only possible candidates, not absolute ones.
4409 GCC guesses that function pointers with @code{format} attributes that
4410 are used in assignment, initialization, parameter passing or return
4411 statements should have a corresponding @code{format} attribute in the
4412 resulting type.  I.e.@: the left-hand side of the assignment or
4413 initialization, the type of the parameter variable, or the return type
4414 of the containing function respectively should also have a @code{format}
4415 attribute to avoid the warning.
4416
4417 GCC also warns about function definitions that might be
4418 candidates for @code{format} attributes.  Again, these are only
4419 possible candidates.  GCC guesses that @code{format} attributes
4420 might be appropriate for any function that calls a function like
4421 @code{vprintf} or @code{vscanf}, but this might not always be the
4422 case, and some functions for which @code{format} attributes are
4423 appropriate may not be detected.
4424
4425 @item -Wno-multichar
4426 @opindex Wno-multichar
4427 @opindex Wmultichar
4428 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4429 Usually they indicate a typo in the user's code, as they have
4430 implementation-defined values, and should not be used in portable code.
4431
4432 @item -Wnormalized=<none|id|nfc|nfkc>
4433 @opindex Wnormalized=
4434 @cindex NFC
4435 @cindex NFKC
4436 @cindex character set, input normalization
4437 In ISO C and ISO C++, two identifiers are different if they are
4438 different sequences of characters.  However, sometimes when characters
4439 outside the basic ASCII character set are used, you can have two
4440 different character sequences that look the same.  To avoid confusion,
4441 the ISO 10646 standard sets out some @dfn{normalization rules} which
4442 when applied ensure that two sequences that look the same are turned into
4443 the same sequence.  GCC can warn you if you are using identifiers that
4444 have not been normalized; this option controls that warning.
4445
4446 There are four levels of warning supported by GCC@.  The default is
4447 @option{-Wnormalized=nfc}, which warns about any identifier that is
4448 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4449 recommended form for most uses.
4450
4451 Unfortunately, there are some characters allowed in identifiers by
4452 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4453 identifiers.  That is, there's no way to use these symbols in portable
4454 ISO C or C++ and have all your identifiers in NFC@.
4455 @option{-Wnormalized=id} suppresses the warning for these characters.
4456 It is hoped that future versions of the standards involved will correct
4457 this, which is why this option is not the default.
4458
4459 You can switch the warning off for all characters by writing
4460 @option{-Wnormalized=none}.  You should only do this if you
4461 are using some other normalization scheme (like ``D''), because
4462 otherwise you can easily create bugs that are literally impossible to see.
4463
4464 Some characters in ISO 10646 have distinct meanings but look identical
4465 in some fonts or display methodologies, especially once formatting has
4466 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4467 LETTER N'', displays just like a regular @code{n} that has been
4468 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4469 normalization scheme to convert all these into a standard form as
4470 well, and GCC warns if your code is not in NFKC if you use
4471 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4472 about every identifier that contains the letter O because it might be
4473 confused with the digit 0, and so is not the default, but may be
4474 useful as a local coding convention if the programming environment 
4475 cannot be fixed to display these characters distinctly.
4476
4477 @item -Wno-deprecated
4478 @opindex Wno-deprecated
4479 @opindex Wdeprecated
4480 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4481
4482 @item -Wno-deprecated-declarations
4483 @opindex Wno-deprecated-declarations
4484 @opindex Wdeprecated-declarations
4485 Do not warn about uses of functions (@pxref{Function Attributes}),
4486 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4487 Attributes}) marked as deprecated by using the @code{deprecated}
4488 attribute.
4489
4490 @item -Wno-overflow
4491 @opindex Wno-overflow
4492 @opindex Woverflow
4493 Do not warn about compile-time overflow in constant expressions.
4494
4495 @item -Woverride-init @r{(C and Objective-C only)}
4496 @opindex Woverride-init
4497 @opindex Wno-override-init
4498 @opindex W
4499 @opindex Wextra
4500 @opindex Wno-extra
4501 Warn if an initialized field without side effects is overridden when
4502 using designated initializers (@pxref{Designated Inits, , Designated
4503 Initializers}).
4504
4505 This warning is included in @option{-Wextra}.  To get other
4506 @option{-Wextra} warnings without this one, use @option{-Wextra
4507 -Wno-override-init}.
4508
4509 @item -Wpacked
4510 @opindex Wpacked
4511 @opindex Wno-packed
4512 Warn if a structure is given the packed attribute, but the packed
4513 attribute has no effect on the layout or size of the structure.
4514 Such structures may be mis-aligned for little benefit.  For
4515 instance, in this code, the variable @code{f.x} in @code{struct bar}
4516 is misaligned even though @code{struct bar} does not itself
4517 have the packed attribute:
4518
4519 @smallexample
4520 @group
4521 struct foo @{
4522   int x;
4523   char a, b, c, d;
4524 @} __attribute__((packed));
4525 struct bar @{
4526   char z;
4527   struct foo f;
4528 @};
4529 @end group
4530 @end smallexample
4531
4532 @item -Wpacked-bitfield-compat
4533 @opindex Wpacked-bitfield-compat
4534 @opindex Wno-packed-bitfield-compat
4535 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4536 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4537 the change can lead to differences in the structure layout.  GCC
4538 informs you when the offset of such a field has changed in GCC 4.4.
4539 For example there is no longer a 4-bit padding between field @code{a}
4540 and @code{b} in this structure:
4541
4542 @smallexample
4543 struct foo
4544 @{
4545   char a:4;
4546   char b:8;
4547 @} __attribute__ ((packed));
4548 @end smallexample
4549
4550 This warning is enabled by default.  Use
4551 @option{-Wno-packed-bitfield-compat} to disable this warning.
4552
4553 @item -Wpadded
4554 @opindex Wpadded
4555 @opindex Wno-padded
4556 Warn if padding is included in a structure, either to align an element
4557 of the structure or to align the whole structure.  Sometimes when this
4558 happens it is possible to rearrange the fields of the structure to
4559 reduce the padding and so make the structure smaller.
4560
4561 @item -Wredundant-decls
4562 @opindex Wredundant-decls
4563 @opindex Wno-redundant-decls
4564 Warn if anything is declared more than once in the same scope, even in
4565 cases where multiple declaration is valid and changes nothing.
4566
4567 @item -Wnested-externs @r{(C and Objective-C only)}
4568 @opindex Wnested-externs
4569 @opindex Wno-nested-externs
4570 Warn if an @code{extern} declaration is encountered within a function.
4571
4572 @item -Winline
4573 @opindex Winline
4574 @opindex Wno-inline
4575 Warn if a function that is declared as inline cannot be inlined.
4576 Even with this option, the compiler does not warn about failures to
4577 inline functions declared in system headers.
4578
4579 The compiler uses a variety of heuristics to determine whether or not
4580 to inline a function.  For example, the compiler takes into account
4581 the size of the function being inlined and the amount of inlining
4582 that has already been done in the current function.  Therefore,
4583 seemingly insignificant changes in the source program can cause the
4584 warnings produced by @option{-Winline} to appear or disappear.
4585
4586 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4587 @opindex Wno-invalid-offsetof
4588 @opindex Winvalid-offsetof
4589 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4590 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4591 to a non-POD type is undefined.  In existing C++ implementations,
4592 however, @samp{offsetof} typically gives meaningful results even when
4593 applied to certain kinds of non-POD types. (Such as a simple
4594 @samp{struct} that fails to be a POD type only by virtue of having a
4595 constructor.)  This flag is for users who are aware that they are
4596 writing nonportable code and who have deliberately chosen to ignore the
4597 warning about it.
4598
4599 The restrictions on @samp{offsetof} may be relaxed in a future version
4600 of the C++ standard.
4601
4602 @item -Wno-int-to-pointer-cast
4603 @opindex Wno-int-to-pointer-cast
4604 @opindex Wint-to-pointer-cast
4605 Suppress warnings from casts to pointer type of an integer of a
4606 different size. In C++, casting to a pointer type of smaller size is
4607 an error. @option{Wint-to-pointer-cast} is enabled by default.
4608
4609
4610 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4611 @opindex Wno-pointer-to-int-cast
4612 @opindex Wpointer-to-int-cast
4613 Suppress warnings from casts from a pointer to an integer type of a
4614 different size.
4615
4616 @item -Winvalid-pch
4617 @opindex Winvalid-pch
4618 @opindex Wno-invalid-pch
4619 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4620 the search path but can't be used.
4621
4622 @item -Wlong-long
4623 @opindex Wlong-long
4624 @opindex Wno-long-long
4625 Warn if @samp{long long} type is used.  This is enabled by either
4626 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4627 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4628
4629 @item -Wvariadic-macros
4630 @opindex Wvariadic-macros
4631 @opindex Wno-variadic-macros
4632 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4633 alternate syntax when in pedantic ISO C99 mode.  This is default.
4634 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4635
4636 @item -Wvector-operation-performance
4637 @opindex Wvector-operation-performance
4638 @opindex Wno-vector-operation-performance
4639 Warn if vector operation is not implemented via SIMD capabilities of the
4640 architecture.  Mainly useful for the performance tuning.
4641 Vector operation can be implemented @code{piecewise}, which means that the
4642 scalar operation is performed on every vector element; 
4643 @code{in parallel}, which means that the vector operation is implemented
4644 using scalars of wider type, which normally is more performance efficient;
4645 and @code{as a single scalar}, which means that vector fits into a
4646 scalar type.
4647
4648 @item -Wvla
4649 @opindex Wvla
4650 @opindex Wno-vla
4651 Warn if variable length array is used in the code.
4652 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4653 the variable length array.
4654
4655 @item -Wvolatile-register-var
4656 @opindex Wvolatile-register-var
4657 @opindex Wno-volatile-register-var
4658 Warn if a register variable is declared volatile.  The volatile
4659 modifier does not inhibit all optimizations that may eliminate reads
4660 and/or writes to register variables.  This warning is enabled by
4661 @option{-Wall}.
4662
4663 @item -Wdisabled-optimization
4664 @opindex Wdisabled-optimization
4665 @opindex Wno-disabled-optimization
4666 Warn if a requested optimization pass is disabled.  This warning does
4667 not generally indicate that there is anything wrong with your code; it
4668 merely indicates that GCC's optimizers are unable to handle the code
4669 effectively.  Often, the problem is that your code is too big or too
4670 complex; GCC refuses to optimize programs when the optimization
4671 itself is likely to take inordinate amounts of time.
4672
4673 @item -Wpointer-sign @r{(C and Objective-C only)}
4674 @opindex Wpointer-sign
4675 @opindex Wno-pointer-sign
4676 Warn for pointer argument passing or assignment with different signedness.
4677 This option is only supported for C and Objective-C@.  It is implied by
4678 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4679 @option{-Wno-pointer-sign}.
4680
4681 @item -Wstack-protector
4682 @opindex Wstack-protector
4683 @opindex Wno-stack-protector
4684 This option is only active when @option{-fstack-protector} is active.  It
4685 warns about functions that are not protected against stack smashing.
4686
4687 @item -Wno-mudflap
4688 @opindex Wno-mudflap
4689 Suppress warnings about constructs that cannot be instrumented by
4690 @option{-fmudflap}.
4691
4692 @item -Woverlength-strings
4693 @opindex Woverlength-strings
4694 @opindex Wno-overlength-strings
4695 Warn about string constants that are longer than the ``minimum
4696 maximum'' length specified in the C standard.  Modern compilers
4697 generally allow string constants that are much longer than the
4698 standard's minimum limit, but very portable programs should avoid
4699 using longer strings.
4700
4701 The limit applies @emph{after} string constant concatenation, and does
4702 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4703 C99, it was raised to 4095.  C++98 does not specify a normative
4704 minimum maximum, so we do not diagnose overlength strings in C++@.
4705
4706 This option is implied by @option{-Wpedantic}, and can be disabled with
4707 @option{-Wno-overlength-strings}.
4708
4709 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4710 @opindex Wunsuffixed-float-constants
4711
4712 Issue a warning for any floating constant that does not have
4713 a suffix.  When used together with @option{-Wsystem-headers} it
4714 warns about such constants in system header files.  This can be useful
4715 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4716 from the decimal floating-point extension to C99.
4717 @end table
4718
4719 @node Debugging Options
4720 @section Options for Debugging Your Program or GCC
4721 @cindex options, debugging
4722 @cindex debugging information options
4723
4724 GCC has various special options that are used for debugging
4725 either your program or GCC:
4726
4727 @table @gcctabopt
4728 @item -g
4729 @opindex g
4730 Produce debugging information in the operating system's native format
4731 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4732 information.
4733
4734 On most systems that use stabs format, @option{-g} enables use of extra
4735 debugging information that only GDB can use; this extra information
4736 makes debugging work better in GDB but probably makes other debuggers
4737 crash or
4738 refuse to read the program.  If you want to control for certain whether
4739 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4740 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4741
4742 GCC allows you to use @option{-g} with
4743 @option{-O}.  The shortcuts taken by optimized code may occasionally
4744 produce surprising results: some variables you declared may not exist
4745 at all; flow of control may briefly move where you did not expect it;
4746 some statements may not be executed because they compute constant
4747 results or their values are already at hand; some statements may
4748 execute in different places because they have been moved out of loops.
4749
4750 Nevertheless it proves possible to debug optimized output.  This makes
4751 it reasonable to use the optimizer for programs that might have bugs.
4752
4753 The following options are useful when GCC is generated with the
4754 capability for more than one debugging format.
4755
4756 @item -ggdb
4757 @opindex ggdb
4758 Produce debugging information for use by GDB@.  This means to use the
4759 most expressive format available (DWARF 2, stabs, or the native format
4760 if neither of those are supported), including GDB extensions if at all
4761 possible.
4762
4763 @item -gstabs
4764 @opindex gstabs
4765 Produce debugging information in stabs format (if that is supported),
4766 without GDB extensions.  This is the format used by DBX on most BSD
4767 systems.  On MIPS, Alpha and System V Release 4 systems this option
4768 produces stabs debugging output that is not understood by DBX or SDB@.
4769 On System V Release 4 systems this option requires the GNU assembler.
4770
4771 @item -feliminate-unused-debug-symbols
4772 @opindex feliminate-unused-debug-symbols
4773 Produce debugging information in stabs format (if that is supported),
4774 for only symbols that are actually used.
4775
4776 @item -femit-class-debug-always
4777 Instead of emitting debugging information for a C++ class in only one
4778 object file, emit it in all object files using the class.  This option
4779 should be used only with debuggers that are unable to handle the way GCC
4780 normally emits debugging information for classes because using this
4781 option increases the size of debugging information by as much as a
4782 factor of two.
4783
4784 @item -fno-debug-types-section
4785 @opindex fno-debug-types-section
4786 @opindex fdebug-types-section
4787 By default when using DWARF Version 4 or higher, type DIEs are put into
4788 their own @code{.debug_types} section instead of making them part of the
4789 @code{.debug_info} section.  It is more efficient to put them in a separate
4790 comdat sections since the linker can then remove duplicates.
4791 But not all DWARF consumers support @code{.debug_types} sections yet.
4792
4793 @item -gstabs+
4794 @opindex gstabs+
4795 Produce debugging information in stabs format (if that is supported),
4796 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4797 use of these extensions is likely to make other debuggers crash or
4798 refuse to read the program.
4799
4800 @item -gcoff
4801 @opindex gcoff
4802 Produce debugging information in COFF format (if that is supported).
4803 This is the format used by SDB on most System V systems prior to
4804 System V Release 4.
4805
4806 @item -gxcoff
4807 @opindex gxcoff
4808 Produce debugging information in XCOFF format (if that is supported).
4809 This is the format used by the DBX debugger on IBM RS/6000 systems.
4810
4811 @item -gxcoff+
4812 @opindex gxcoff+
4813 Produce debugging information in XCOFF format (if that is supported),
4814 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4815 use of these extensions is likely to make other debuggers crash or
4816 refuse to read the program, and may cause assemblers other than the GNU
4817 assembler (GAS) to fail with an error.
4818
4819 @item -gdwarf-@var{version}
4820 @opindex gdwarf-@var{version}
4821 Produce debugging information in DWARF format (if that is supported).
4822 The value of @var{version} may be either 2, 3 or 4; the default version is 2.
4823
4824 Note that with DWARF Version 2, some ports require and always
4825 use some non-conflicting DWARF 3 extensions in the unwind tables.
4826
4827 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4828 for maximum benefit.
4829
4830 @item -grecord-gcc-switches
4831 @opindex grecord-gcc-switches
4832 This switch causes the command-line options used to invoke the
4833 compiler that may affect code generation to be appended to the
4834 DW_AT_producer attribute in DWARF debugging information.  The options
4835 are concatenated with spaces separating them from each other and from
4836 the compiler version.  See also @option{-frecord-gcc-switches} for another
4837 way of storing compiler options into the object file.
4838
4839 @item -gno-record-gcc-switches
4840 @opindex gno-record-gcc-switches
4841 Disallow appending command-line options to the DW_AT_producer attribute
4842 in DWARF debugging information.  This is the default.
4843
4844 @item -gstrict-dwarf
4845 @opindex gstrict-dwarf
4846 Disallow using extensions of later DWARF standard version than selected
4847 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4848 DWARF extensions from later standard versions is allowed.
4849
4850 @item -gno-strict-dwarf
4851 @opindex gno-strict-dwarf
4852 Allow using extensions of later DWARF standard version than selected with
4853 @option{-gdwarf-@var{version}}.
4854
4855 @item -gvms
4856 @opindex gvms
4857 Produce debugging information in Alpha/VMS debug format (if that is
4858 supported).  This is the format used by DEBUG on Alpha/VMS systems.
4859
4860 @item -g@var{level}
4861 @itemx -ggdb@var{level}
4862 @itemx -gstabs@var{level}
4863 @itemx -gcoff@var{level}
4864 @itemx -gxcoff@var{level}
4865 @itemx -gvms@var{level}
4866 Request debugging information and also use @var{level} to specify how
4867 much information.  The default level is 2.
4868
4869 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4870 @option{-g}.
4871
4872 Level 1 produces minimal information, enough for making backtraces in
4873 parts of the program that you don't plan to debug.  This includes
4874 descriptions of functions and external variables, but no information
4875 about local variables and no line numbers.
4876
4877 Level 3 includes extra information, such as all the macro definitions
4878 present in the program.  Some debuggers support macro expansion when
4879 you use @option{-g3}.
4880
4881 @option{-gdwarf-2} does not accept a concatenated debug level, because
4882 GCC used to support an option @option{-gdwarf} that meant to generate
4883 debug information in version 1 of the DWARF format (which is very
4884 different from version 2), and it would have been too confusing.  That
4885 debug format is long obsolete, but the option cannot be changed now.
4886 Instead use an additional @option{-g@var{level}} option to change the
4887 debug level for DWARF.
4888
4889 @item -gtoggle
4890 @opindex gtoggle
4891 Turn off generation of debug info, if leaving out this option
4892 generates it, or turn it on at level 2 otherwise.  The position of this
4893 argument in the command line does not matter; it takes effect after all
4894 other options are processed, and it does so only once, no matter how
4895 many times it is given.  This is mainly intended to be used with
4896 @option{-fcompare-debug}.
4897
4898 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4899 @opindex fdump-final-insns
4900 Dump the final internal representation (RTL) to @var{file}.  If the
4901 optional argument is omitted (or if @var{file} is @code{.}), the name
4902 of the dump file is determined by appending @code{.gkd} to the
4903 compilation output file name.
4904
4905 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4906 @opindex fcompare-debug
4907 @opindex fno-compare-debug
4908 If no error occurs during compilation, run the compiler a second time,
4909 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4910 passed to the second compilation.  Dump the final internal
4911 representation in both compilations, and print an error if they differ.
4912
4913 If the equal sign is omitted, the default @option{-gtoggle} is used.
4914
4915 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4916 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4917 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4918 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4919 is used.
4920
4921 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4922 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4923 of the final representation and the second compilation, preventing even
4924 @env{GCC_COMPARE_DEBUG} from taking effect.
4925
4926 To verify full coverage during @option{-fcompare-debug} testing, set
4927 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4928 which GCC rejects as an invalid option in any actual compilation
4929 (rather than preprocessing, assembly or linking).  To get just a
4930 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4931 not overridden} will do.
4932
4933 @item -fcompare-debug-second
4934 @opindex fcompare-debug-second
4935 This option is implicitly passed to the compiler for the second
4936 compilation requested by @option{-fcompare-debug}, along with options to
4937 silence warnings, and omitting other options that would cause
4938 side-effect compiler outputs to files or to the standard output.  Dump
4939 files and preserved temporary files are renamed so as to contain the
4940 @code{.gk} additional extension during the second compilation, to avoid
4941 overwriting those generated by the first.
4942
4943 When this option is passed to the compiler driver, it causes the
4944 @emph{first} compilation to be skipped, which makes it useful for little
4945 other than debugging the compiler proper.
4946
4947 @item -feliminate-dwarf2-dups
4948 @opindex feliminate-dwarf2-dups
4949 Compress DWARF 2 debugging information by eliminating duplicated
4950 information about each symbol.  This option only makes sense when
4951 generating DWARF 2 debugging information with @option{-gdwarf-2}.
4952
4953 @item -femit-struct-debug-baseonly
4954 Emit debug information for struct-like types
4955 only when the base name of the compilation source file
4956 matches the base name of file in which the struct is defined.
4957
4958 This option substantially reduces the size of debugging information,
4959 but at significant potential loss in type information to the debugger.
4960 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4961 See @option{-femit-struct-debug-detailed} for more detailed control.
4962
4963 This option works only with DWARF 2.
4964
4965 @item -femit-struct-debug-reduced
4966 Emit debug information for struct-like types
4967 only when the base name of the compilation source file
4968 matches the base name of file in which the type is defined,
4969 unless the struct is a template or defined in a system header.
4970
4971 This option significantly reduces the size of debugging information,
4972 with some potential loss in type information to the debugger.
4973 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4974 See @option{-femit-struct-debug-detailed} for more detailed control.
4975
4976 This option works only with DWARF 2.
4977
4978 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4979 Specify the struct-like types
4980 for which the compiler generates debug information.
4981 The intent is to reduce duplicate struct debug information
4982 between different object files within the same program.
4983
4984 This option is a detailed version of
4985 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4986 which serves for most needs.
4987
4988 A specification has the syntax@*
4989 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4990
4991 The optional first word limits the specification to
4992 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4993 A struct type is used directly when it is the type of a variable, member.
4994 Indirect uses arise through pointers to structs.
4995 That is, when use of an incomplete struct is valid, the use is indirect.
4996 An example is
4997 @samp{struct one direct; struct two * indirect;}.
4998
4999 The optional second word limits the specification to
5000 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5001 Generic structs are a bit complicated to explain.
5002 For C++, these are non-explicit specializations of template classes,
5003 or non-template classes within the above.
5004 Other programming languages have generics,
5005 but @option{-femit-struct-debug-detailed} does not yet implement them.
5006
5007 The third word specifies the source files for those
5008 structs for which the compiler should emit debug information.
5009 The values @samp{none} and @samp{any} have the normal meaning.
5010 The value @samp{base} means that
5011 the base of name of the file in which the type declaration appears
5012 must match the base of the name of the main compilation file.
5013 In practice, this means that when compiling @file{foo.c}, debug information
5014 is generated for types declared in that file and @file{foo.h},
5015 but not other header files.
5016 The value @samp{sys} means those types satisfying @samp{base}
5017 or declared in system or compiler headers.
5018
5019 You may need to experiment to determine the best settings for your application.
5020
5021 The default is @option{-femit-struct-debug-detailed=all}.
5022
5023 This option works only with DWARF 2.
5024
5025 @item -fno-merge-debug-strings
5026 @opindex fmerge-debug-strings
5027 @opindex fno-merge-debug-strings
5028 Direct the linker to not merge together strings in the debugging
5029 information that are identical in different object files.  Merging is
5030 not supported by all assemblers or linkers.  Merging decreases the size
5031 of the debug information in the output file at the cost of increasing
5032 link processing time.  Merging is enabled by default.
5033
5034 @item -fdebug-prefix-map=@var{old}=@var{new}
5035 @opindex fdebug-prefix-map
5036 When compiling files in directory @file{@var{old}}, record debugging
5037 information describing them as in @file{@var{new}} instead.
5038
5039 @item -fno-dwarf2-cfi-asm
5040 @opindex fdwarf2-cfi-asm
5041 @opindex fno-dwarf2-cfi-asm
5042 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5043 instead of using GAS @code{.cfi_*} directives.
5044
5045 @cindex @command{prof}
5046 @item -p
5047 @opindex p
5048 Generate extra code to write profile information suitable for the
5049 analysis program @command{prof}.  You must use this option when compiling
5050 the source files you want data about, and you must also use it when
5051 linking.
5052
5053 @cindex @command{gprof}
5054 @item -pg
5055 @opindex pg
5056 Generate extra code to write profile information suitable for the
5057 analysis program @command{gprof}.  You must use this option when compiling
5058 the source files you want data about, and you must also use it when
5059 linking.
5060
5061 @item -Q
5062 @opindex Q
5063 Makes the compiler print out each function name as it is compiled, and
5064 print some statistics about each pass when it finishes.
5065
5066 @item -ftime-report
5067 @opindex ftime-report
5068 Makes the compiler print some statistics about the time consumed by each
5069 pass when it finishes.
5070
5071 @item -fmem-report
5072 @opindex fmem-report
5073 Makes the compiler print some statistics about permanent memory
5074 allocation when it finishes.
5075
5076 @item -fpre-ipa-mem-report
5077 @opindex fpre-ipa-mem-report
5078 @item -fpost-ipa-mem-report
5079 @opindex fpost-ipa-mem-report
5080 Makes the compiler print some statistics about permanent memory
5081 allocation before or after interprocedural optimization.
5082
5083 @item -fstack-usage
5084 @opindex fstack-usage
5085 Makes the compiler output stack usage information for the program, on a
5086 per-function basis.  The filename for the dump is made by appending
5087 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5088 the output file, if explicitly specified and it is not an executable,
5089 otherwise it is the basename of the source file.  An entry is made up
5090 of three fields:
5091
5092 @itemize
5093 @item
5094 The name of the function.
5095 @item
5096 A number of bytes.
5097 @item
5098 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5099 @end itemize
5100
5101 The qualifier @code{static} means that the function manipulates the stack
5102 statically: a fixed number of bytes are allocated for the frame on function
5103 entry and released on function exit; no stack adjustments are otherwise made
5104 in the function.  The second field is this fixed number of bytes.
5105
5106 The qualifier @code{dynamic} means that the function manipulates the stack
5107 dynamically: in addition to the static allocation described above, stack
5108 adjustments are made in the body of the function, for example to push/pop
5109 arguments around function calls.  If the qualifier @code{bounded} is also
5110 present, the amount of these adjustments is bounded at compile time and
5111 the second field is an upper bound of the total amount of stack used by
5112 the function.  If it is not present, the amount of these adjustments is
5113 not bounded at compile time and the second field only represents the
5114 bounded part.
5115
5116 @item -fprofile-arcs
5117 @opindex fprofile-arcs
5118 Add code so that program flow @dfn{arcs} are instrumented.  During
5119 execution the program records how many times each branch and call is
5120 executed and how many times it is taken or returns.  When the compiled
5121 program exits it saves this data to a file called
5122 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5123 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5124 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5125 @var{auxname} is generated from the name of the output file, if
5126 explicitly specified and it is not the final executable, otherwise it is
5127 the basename of the source file.  In both cases any suffix is removed
5128 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5129 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5130 @xref{Cross-profiling}.
5131
5132 @cindex @command{gcov}
5133 @item --coverage
5134 @opindex coverage
5135
5136 This option is used to compile and link code instrumented for coverage
5137 analysis.  The option is a synonym for @option{-fprofile-arcs}
5138 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5139 linking).  See the documentation for those options for more details.
5140
5141 @itemize
5142
5143 @item
5144 Compile the source files with @option{-fprofile-arcs} plus optimization
5145 and code generation options.  For test coverage analysis, use the
5146 additional @option{-ftest-coverage} option.  You do not need to profile
5147 every source file in a program.
5148
5149 @item
5150 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5151 (the latter implies the former).
5152
5153 @item
5154 Run the program on a representative workload to generate the arc profile
5155 information.  This may be repeated any number of times.  You can run
5156 concurrent instances of your program, and provided that the file system
5157 supports locking, the data files will be correctly updated.  Also
5158 @code{fork} calls are detected and correctly handled (double counting
5159 will not happen).
5160
5161 @item
5162 For profile-directed optimizations, compile the source files again with
5163 the same optimization and code generation options plus
5164 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5165 Control Optimization}).
5166
5167 @item
5168 For test coverage analysis, use @command{gcov} to produce human readable
5169 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5170 @command{gcov} documentation for further information.
5171
5172 @end itemize
5173
5174 With @option{-fprofile-arcs}, for each function of your program GCC
5175 creates a program flow graph, then finds a spanning tree for the graph.
5176 Only arcs that are not on the spanning tree have to be instrumented: the
5177 compiler adds code to count the number of times that these arcs are
5178 executed.  When an arc is the only exit or only entrance to a block, the
5179 instrumentation code can be added to the block; otherwise, a new basic
5180 block must be created to hold the instrumentation code.
5181
5182 @need 2000
5183 @item -ftest-coverage
5184 @opindex ftest-coverage
5185 Produce a notes file that the @command{gcov} code-coverage utility
5186 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5187 show program coverage.  Each source file's note file is called
5188 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5189 above for a description of @var{auxname} and instructions on how to
5190 generate test coverage data.  Coverage data matches the source files
5191 more closely if you do not optimize.
5192
5193 @item -fdbg-cnt-list
5194 @opindex fdbg-cnt-list
5195 Print the name and the counter upper bound for all debug counters.
5196
5197
5198 @item -fdbg-cnt=@var{counter-value-list}
5199 @opindex fdbg-cnt
5200 Set the internal debug counter upper bound.  @var{counter-value-list}
5201 is a comma-separated list of @var{name}:@var{value} pairs
5202 which sets the upper bound of each debug counter @var{name} to @var{value}.
5203 All debug counters have the initial upper bound of @code{UINT_MAX};
5204 thus @code{dbg_cnt()} returns true always unless the upper bound
5205 is set by this option.
5206 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5207 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5208
5209 @itemx -fenable-@var{kind}-@var{pass}
5210 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5211 @opindex fdisable-
5212 @opindex fenable-
5213
5214 This is a set of options that are used to explicitly disable/enable
5215 optimization passes.  These options are intended for use for debugging GCC.
5216 Compiler users should use regular options for enabling/disabling
5217 passes instead.
5218
5219 @table @gcctabopt
5220
5221 @item -fdisable-ipa-@var{pass}
5222 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5223 statically invoked in the compiler multiple times, the pass name should be
5224 appended with a sequential number starting from 1.
5225
5226 @item -fdisable-rtl-@var{pass}
5227 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5228 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5229 statically invoked in the compiler multiple times, the pass name should be
5230 appended with a sequential number starting from 1.  @var{range-list} is a 
5231 comma-separated list of function ranges or assembler names.  Each range is a number
5232 pair separated by a colon.  The range is inclusive in both ends.  If the range
5233 is trivial, the number pair can be simplified as a single number.  If the
5234 function's cgraph node's @var{uid} falls within one of the specified ranges,
5235 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5236 function header of a dump file, and the pass names can be dumped by using
5237 option @option{-fdump-passes}.
5238
5239 @item -fdisable-tree-@var{pass}
5240 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5241 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5242 option arguments.
5243
5244 @item -fenable-ipa-@var{pass}
5245 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5246 statically invoked in the compiler multiple times, the pass name should be
5247 appended with a sequential number starting from 1.
5248
5249 @item -fenable-rtl-@var{pass}
5250 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5251 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5252 description and examples.
5253
5254 @item -fenable-tree-@var{pass}
5255 @itemx -fenable-tree-@var{pass}=@var{range-list}
5256 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5257 of option arguments.
5258
5259 @end table
5260
5261 Here are some examples showing uses of these options.
5262
5263 @smallexample
5264
5265 # disable ccp1 for all functions
5266    -fdisable-tree-ccp1
5267 # disable complete unroll for function whose cgraph node uid is 1
5268    -fenable-tree-cunroll=1
5269 # disable gcse2 for functions at the following ranges [1,1],
5270 # [300,400], and [400,1000]
5271 # disable gcse2 for functions foo and foo2
5272    -fdisable-rtl-gcse2=foo,foo2
5273 # disable early inlining
5274    -fdisable-tree-einline
5275 # disable ipa inlining
5276    -fdisable-ipa-inline
5277 # enable tree full unroll
5278    -fenable-tree-unroll
5279
5280 @end smallexample
5281
5282 @item -d@var{letters}
5283 @itemx -fdump-rtl-@var{pass}
5284 @opindex d
5285 Says to make debugging dumps during compilation at times specified by
5286 @var{letters}.  This is used for debugging the RTL-based passes of the
5287 compiler.  The file names for most of the dumps are made by appending
5288 a pass number and a word to the @var{dumpname}, and the files are
5289 created in the directory of the output file.  Note that the pass
5290 number is computed statically as passes get registered into the pass
5291 manager.  Thus the numbering is not related to the dynamic order of
5292 execution of passes.  In particular, a pass installed by a plugin
5293 could have a number over 200 even if it executed quite early.
5294 @var{dumpname} is generated from the name of the output file, if
5295 explicitly specified and it is not an executable, otherwise it is the
5296 basename of the source file. These switches may have different effects
5297 when @option{-E} is used for preprocessing.
5298
5299 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5300 @option{-d} option @var{letters}.  Here are the possible
5301 letters for use in @var{pass} and @var{letters}, and their meanings:
5302
5303 @table @gcctabopt
5304
5305 @item -fdump-rtl-alignments
5306 @opindex fdump-rtl-alignments
5307 Dump after branch alignments have been computed.
5308
5309 @item -fdump-rtl-asmcons
5310 @opindex fdump-rtl-asmcons
5311 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5312
5313 @item -fdump-rtl-auto_inc_dec
5314 @opindex fdump-rtl-auto_inc_dec
5315 Dump after auto-inc-dec discovery.  This pass is only run on
5316 architectures that have auto inc or auto dec instructions.
5317
5318 @item -fdump-rtl-barriers
5319 @opindex fdump-rtl-barriers
5320 Dump after cleaning up the barrier instructions.
5321
5322 @item -fdump-rtl-bbpart
5323 @opindex fdump-rtl-bbpart
5324 Dump after partitioning hot and cold basic blocks.
5325
5326 @item -fdump-rtl-bbro
5327 @opindex fdump-rtl-bbro
5328 Dump after block reordering.
5329
5330 @item -fdump-rtl-btl1
5331 @itemx -fdump-rtl-btl2
5332 @opindex fdump-rtl-btl2
5333 @opindex fdump-rtl-btl2
5334 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5335 after the two branch
5336 target load optimization passes.
5337
5338 @item -fdump-rtl-bypass
5339 @opindex fdump-rtl-bypass
5340 Dump after jump bypassing and control flow optimizations.
5341
5342 @item -fdump-rtl-combine
5343 @opindex fdump-rtl-combine
5344 Dump after the RTL instruction combination pass.
5345
5346 @item -fdump-rtl-compgotos
5347 @opindex fdump-rtl-compgotos
5348 Dump after duplicating the computed gotos.
5349
5350 @item -fdump-rtl-ce1
5351 @itemx -fdump-rtl-ce2
5352 @itemx -fdump-rtl-ce3
5353 @opindex fdump-rtl-ce1
5354 @opindex fdump-rtl-ce2
5355 @opindex fdump-rtl-ce3
5356 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5357 @option{-fdump-rtl-ce3} enable dumping after the three
5358 if conversion passes.
5359
5360 @itemx -fdump-rtl-cprop_hardreg
5361 @opindex fdump-rtl-cprop_hardreg
5362 Dump after hard register copy propagation.
5363
5364 @itemx -fdump-rtl-csa
5365 @opindex fdump-rtl-csa
5366 Dump after combining stack adjustments.
5367
5368 @item -fdump-rtl-cse1
5369 @itemx -fdump-rtl-cse2
5370 @opindex fdump-rtl-cse1
5371 @opindex fdump-rtl-cse2
5372 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5373 the two common sub-expression elimination passes.
5374
5375 @itemx -fdump-rtl-dce
5376 @opindex fdump-rtl-dce
5377 Dump after the standalone dead code elimination passes.
5378
5379 @itemx -fdump-rtl-dbr
5380 @opindex fdump-rtl-dbr
5381 Dump after delayed branch scheduling.
5382
5383 @item -fdump-rtl-dce1
5384 @itemx -fdump-rtl-dce2
5385 @opindex fdump-rtl-dce1
5386 @opindex fdump-rtl-dce2
5387 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5388 the two dead store elimination passes.
5389
5390 @item -fdump-rtl-eh
5391 @opindex fdump-rtl-eh
5392 Dump after finalization of EH handling code.
5393
5394 @item -fdump-rtl-eh_ranges
5395 @opindex fdump-rtl-eh_ranges
5396 Dump after conversion of EH handling range regions.
5397
5398 @item -fdump-rtl-expand
5399 @opindex fdump-rtl-expand
5400 Dump after RTL generation.
5401
5402 @item -fdump-rtl-fwprop1
5403 @itemx -fdump-rtl-fwprop2
5404 @opindex fdump-rtl-fwprop1
5405 @opindex fdump-rtl-fwprop2
5406 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5407 dumping after the two forward propagation passes.
5408
5409 @item -fdump-rtl-gcse1
5410 @itemx -fdump-rtl-gcse2
5411 @opindex fdump-rtl-gcse1
5412 @opindex fdump-rtl-gcse2
5413 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5414 after global common subexpression elimination.
5415
5416 @item -fdump-rtl-init-regs
5417 @opindex fdump-rtl-init-regs
5418 Dump after the initialization of the registers.
5419
5420 @item -fdump-rtl-initvals
5421 @opindex fdump-rtl-initvals
5422 Dump after the computation of the initial value sets.
5423
5424 @itemx -fdump-rtl-into_cfglayout
5425 @opindex fdump-rtl-into_cfglayout
5426 Dump after converting to cfglayout mode.
5427
5428 @item -fdump-rtl-ira
5429 @opindex fdump-rtl-ira
5430 Dump after iterated register allocation.
5431
5432 @item -fdump-rtl-jump
5433 @opindex fdump-rtl-jump
5434 Dump after the second jump optimization.
5435
5436 @item -fdump-rtl-loop2
5437 @opindex fdump-rtl-loop2
5438 @option{-fdump-rtl-loop2} enables dumping after the rtl
5439 loop optimization passes.
5440
5441 @item -fdump-rtl-mach
5442 @opindex fdump-rtl-mach
5443 Dump after performing the machine dependent reorganization pass, if that
5444 pass exists.
5445
5446 @item -fdump-rtl-mode_sw
5447 @opindex fdump-rtl-mode_sw
5448 Dump after removing redundant mode switches.
5449
5450 @item -fdump-rtl-rnreg
5451 @opindex fdump-rtl-rnreg
5452 Dump after register renumbering.
5453
5454 @itemx -fdump-rtl-outof_cfglayout
5455 @opindex fdump-rtl-outof_cfglayout
5456 Dump after converting from cfglayout mode.
5457
5458 @item -fdump-rtl-peephole2
5459 @opindex fdump-rtl-peephole2
5460 Dump after the peephole pass.
5461
5462 @item -fdump-rtl-postreload
5463 @opindex fdump-rtl-postreload
5464 Dump after post-reload optimizations.
5465
5466 @itemx -fdump-rtl-pro_and_epilogue
5467 @opindex fdump-rtl-pro_and_epilogue
5468 Dump after generating the function prologues and epilogues.
5469
5470 @item -fdump-rtl-regmove
5471 @opindex fdump-rtl-regmove
5472 Dump after the register move pass.
5473
5474 @item -fdump-rtl-sched1
5475 @itemx -fdump-rtl-sched2
5476 @opindex fdump-rtl-sched1
5477 @opindex fdump-rtl-sched2
5478 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5479 after the basic block scheduling passes.
5480
5481 @item -fdump-rtl-see
5482 @opindex fdump-rtl-see
5483 Dump after sign extension elimination.
5484
5485 @item -fdump-rtl-seqabstr
5486 @opindex fdump-rtl-seqabstr
5487 Dump after common sequence discovery.
5488
5489 @item -fdump-rtl-shorten
5490 @opindex fdump-rtl-shorten
5491 Dump after shortening branches.
5492
5493 @item -fdump-rtl-sibling
5494 @opindex fdump-rtl-sibling
5495 Dump after sibling call optimizations.
5496
5497 @item -fdump-rtl-split1
5498 @itemx -fdump-rtl-split2
5499 @itemx -fdump-rtl-split3
5500 @itemx -fdump-rtl-split4
5501 @itemx -fdump-rtl-split5
5502 @opindex fdump-rtl-split1
5503 @opindex fdump-rtl-split2
5504 @opindex fdump-rtl-split3
5505 @opindex fdump-rtl-split4
5506 @opindex fdump-rtl-split5
5507 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5508 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5509 @option{-fdump-rtl-split5} enable dumping after five rounds of
5510 instruction splitting.
5511
5512 @item -fdump-rtl-sms
5513 @opindex fdump-rtl-sms
5514 Dump after modulo scheduling.  This pass is only run on some
5515 architectures.
5516
5517 @item -fdump-rtl-stack
5518 @opindex fdump-rtl-stack
5519 Dump after conversion from GCC's ``flat register file'' registers to the
5520 x87's stack-like registers.  This pass is only run on x86 variants.
5521
5522 @item -fdump-rtl-subreg1
5523 @itemx -fdump-rtl-subreg2
5524 @opindex fdump-rtl-subreg1
5525 @opindex fdump-rtl-subreg2
5526 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5527 the two subreg expansion passes.
5528
5529 @item -fdump-rtl-unshare
5530 @opindex fdump-rtl-unshare
5531 Dump after all rtl has been unshared.
5532
5533 @item -fdump-rtl-vartrack
5534 @opindex fdump-rtl-vartrack
5535 Dump after variable tracking.
5536
5537 @item -fdump-rtl-vregs
5538 @opindex fdump-rtl-vregs
5539 Dump after converting virtual registers to hard registers.
5540
5541 @item -fdump-rtl-web
5542 @opindex fdump-rtl-web
5543 Dump after live range splitting.
5544
5545 @item -fdump-rtl-regclass
5546 @itemx -fdump-rtl-subregs_of_mode_init
5547 @itemx -fdump-rtl-subregs_of_mode_finish
5548 @itemx -fdump-rtl-dfinit
5549 @itemx -fdump-rtl-dfinish
5550 @opindex fdump-rtl-regclass
5551 @opindex fdump-rtl-subregs_of_mode_init
5552 @opindex fdump-rtl-subregs_of_mode_finish
5553 @opindex fdump-rtl-dfinit
5554 @opindex fdump-rtl-dfinish
5555 These dumps are defined but always produce empty files.
5556
5557 @item -fdump-rtl-all
5558 @opindex fdump-rtl-all
5559 Produce all the dumps listed above.
5560
5561 @item -dA
5562 @opindex dA
5563 Annotate the assembler output with miscellaneous debugging information.
5564
5565 @item -dD
5566 @opindex dD
5567 Dump all macro definitions, at the end of preprocessing, in addition to
5568 normal output.
5569
5570 @item -dH
5571 @opindex dH
5572 Produce a core dump whenever an error occurs.
5573
5574 @item -dm
5575 @opindex dm
5576 Print statistics on memory usage, at the end of the run, to
5577 standard error.
5578
5579 @item -dp
5580 @opindex dp
5581 Annotate the assembler output with a comment indicating which
5582 pattern and alternative is used.  The length of each instruction is
5583 also printed.
5584
5585 @item -dP
5586 @opindex dP
5587 Dump the RTL in the assembler output as a comment before each instruction.
5588 Also turns on @option{-dp} annotation.
5589
5590 @item -dv
5591 @opindex dv
5592 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5593 dump a representation of the control flow graph suitable for viewing with VCG
5594 to @file{@var{file}.@var{pass}.vcg}.
5595
5596 @item -dx
5597 @opindex dx
5598 Just generate RTL for a function instead of compiling it.  Usually used
5599 with @option{-fdump-rtl-expand}.
5600 @end table
5601
5602 @item -fdump-noaddr
5603 @opindex fdump-noaddr
5604 When doing debugging dumps, suppress address output.  This makes it more
5605 feasible to use diff on debugging dumps for compiler invocations with
5606 different compiler binaries and/or different
5607 text / bss / data / heap / stack / dso start locations.
5608
5609 @item -fdump-unnumbered
5610 @opindex fdump-unnumbered
5611 When doing debugging dumps, suppress instruction numbers and address output.
5612 This makes it more feasible to use diff on debugging dumps for compiler
5613 invocations with different options, in particular with and without
5614 @option{-g}.
5615
5616 @item -fdump-unnumbered-links
5617 @opindex fdump-unnumbered-links
5618 When doing debugging dumps (see @option{-d} option above), suppress
5619 instruction numbers for the links to the previous and next instructions
5620 in a sequence.
5621
5622 @item -fdump-translation-unit @r{(C++ only)}
5623 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5624 @opindex fdump-translation-unit
5625 Dump a representation of the tree structure for the entire translation
5626 unit to a file.  The file name is made by appending @file{.tu} to the
5627 source file name, and the file is created in the same directory as the
5628 output file.  If the @samp{-@var{options}} form is used, @var{options}
5629 controls the details of the dump as described for the
5630 @option{-fdump-tree} options.
5631
5632 @item -fdump-class-hierarchy @r{(C++ only)}
5633 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5634 @opindex fdump-class-hierarchy
5635 Dump a representation of each class's hierarchy and virtual function
5636 table layout to a file.  The file name is made by appending
5637 @file{.class} to the source file name, and the file is created in the
5638 same directory as the output file.  If the @samp{-@var{options}} form
5639 is used, @var{options} controls the details of the dump as described
5640 for the @option{-fdump-tree} options.
5641
5642 @item -fdump-ipa-@var{switch}
5643 @opindex fdump-ipa
5644 Control the dumping at various stages of inter-procedural analysis
5645 language tree to a file.  The file name is generated by appending a
5646 switch specific suffix to the source file name, and the file is created
5647 in the same directory as the output file.  The following dumps are
5648 possible:
5649
5650 @table @samp
5651 @item all
5652 Enables all inter-procedural analysis dumps.
5653
5654 @item cgraph
5655 Dumps information about call-graph optimization, unused function removal,
5656 and inlining decisions.
5657
5658 @item inline
5659 Dump after function inlining.
5660
5661 @end table
5662
5663 @item -fdump-passes
5664 @opindex fdump-passes
5665 Dump the list of optimization passes that are turned on and off by
5666 the current command-line options.
5667
5668 @item -fdump-statistics-@var{option}
5669 @opindex fdump-statistics
5670 Enable and control dumping of pass statistics in a separate file.  The
5671 file name is generated by appending a suffix ending in
5672 @samp{.statistics} to the source file name, and the file is created in
5673 the same directory as the output file.  If the @samp{-@var{option}}
5674 form is used, @samp{-stats} causes counters to be summed over the
5675 whole compilation unit while @samp{-details} dumps every event as
5676 the passes generate them.  The default with no option is to sum
5677 counters for each function compiled.
5678
5679 @item -fdump-tree-@var{switch}
5680 @itemx -fdump-tree-@var{switch}-@var{options}
5681 @opindex fdump-tree
5682 Control the dumping at various stages of processing the intermediate
5683 language tree to a file.  The file name is generated by appending a
5684 switch specific suffix to the source file name, and the file is
5685 created in the same directory as the output file.  If the
5686 @samp{-@var{options}} form is used, @var{options} is a list of
5687 @samp{-} separated options which control the details of the dump.  Not
5688 all options are applicable to all dumps; those that are not
5689 meaningful are ignored.  The following options are available
5690
5691 @table @samp
5692 @item address
5693 Print the address of each node.  Usually this is not meaningful as it
5694 changes according to the environment and source file.  Its primary use
5695 is for tying up a dump file with a debug environment.
5696 @item asmname
5697 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5698 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5699 use working backward from mangled names in the assembly file.
5700 @item slim
5701 Inhibit dumping of members of a scope or body of a function merely
5702 because that scope has been reached.  Only dump such items when they
5703 are directly reachable by some other path.  When dumping pretty-printed
5704 trees, this option inhibits dumping the bodies of control structures.
5705 @item raw
5706 Print a raw representation of the tree.  By default, trees are
5707 pretty-printed into a C-like representation.
5708 @item details
5709 Enable more detailed dumps (not honored by every dump option).
5710 @item stats
5711 Enable dumping various statistics about the pass (not honored by every dump
5712 option).
5713 @item blocks
5714 Enable showing basic block boundaries (disabled in raw dumps).
5715 @item vops
5716 Enable showing virtual operands for every statement.
5717 @item lineno
5718 Enable showing line numbers for statements.
5719 @item uid
5720 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5721 @item verbose
5722 Enable showing the tree dump for each statement.
5723 @item eh
5724 Enable showing the EH region number holding each statement.
5725 @item scev
5726 Enable showing scalar evolution analysis details.
5727 @item all
5728 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5729 and @option{lineno}.
5730 @end table
5731
5732 The following tree dumps are possible:
5733 @table @samp
5734
5735 @item original
5736 @opindex fdump-tree-original
5737 Dump before any tree based optimization, to @file{@var{file}.original}.
5738
5739 @item optimized
5740 @opindex fdump-tree-optimized
5741 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5742
5743 @item gimple
5744 @opindex fdump-tree-gimple
5745 Dump each function before and after the gimplification pass to a file.  The
5746 file name is made by appending @file{.gimple} to the source file name.
5747
5748 @item cfg
5749 @opindex fdump-tree-cfg
5750 Dump the control flow graph of each function to a file.  The file name is
5751 made by appending @file{.cfg} to the source file name.
5752
5753 @item vcg
5754 @opindex fdump-tree-vcg
5755 Dump the control flow graph of each function to a file in VCG format.  The
5756 file name is made by appending @file{.vcg} to the source file name.  Note
5757 that if the file contains more than one function, the generated file cannot
5758 be used directly by VCG@.  You must cut and paste each function's
5759 graph into its own separate file first.
5760
5761 @item ch
5762 @opindex fdump-tree-ch
5763 Dump each function after copying loop headers.  The file name is made by
5764 appending @file{.ch} to the source file name.
5765
5766 @item ssa
5767 @opindex fdump-tree-ssa
5768 Dump SSA related information to a file.  The file name is made by appending
5769 @file{.ssa} to the source file name.
5770
5771 @item alias
5772 @opindex fdump-tree-alias
5773 Dump aliasing information for each function.  The file name is made by
5774 appending @file{.alias} to the source file name.
5775
5776 @item ccp
5777 @opindex fdump-tree-ccp
5778 Dump each function after CCP@.  The file name is made by appending
5779 @file{.ccp} to the source file name.
5780
5781 @item storeccp
5782 @opindex fdump-tree-storeccp
5783 Dump each function after STORE-CCP@.  The file name is made by appending
5784 @file{.storeccp} to the source file name.
5785
5786 @item pre
5787 @opindex fdump-tree-pre
5788 Dump trees after partial redundancy elimination.  The file name is made
5789 by appending @file{.pre} to the source file name.
5790
5791 @item fre
5792 @opindex fdump-tree-fre
5793 Dump trees after full redundancy elimination.  The file name is made
5794 by appending @file{.fre} to the source file name.
5795
5796 @item copyprop
5797 @opindex fdump-tree-copyprop
5798 Dump trees after copy propagation.  The file name is made
5799 by appending @file{.copyprop} to the source file name.
5800
5801 @item store_copyprop
5802 @opindex fdump-tree-store_copyprop
5803 Dump trees after store copy-propagation.  The file name is made
5804 by appending @file{.store_copyprop} to the source file name.
5805
5806 @item dce
5807 @opindex fdump-tree-dce
5808 Dump each function after dead code elimination.  The file name is made by
5809 appending @file{.dce} to the source file name.
5810
5811 @item mudflap
5812 @opindex fdump-tree-mudflap
5813 Dump each function after adding mudflap instrumentation.  The file name is
5814 made by appending @file{.mudflap} to the source file name.
5815
5816 @item sra
5817 @opindex fdump-tree-sra
5818 Dump each function after performing scalar replacement of aggregates.  The
5819 file name is made by appending @file{.sra} to the source file name.
5820
5821 @item sink
5822 @opindex fdump-tree-sink
5823 Dump each function after performing code sinking.  The file name is made
5824 by appending @file{.sink} to the source file name.
5825
5826 @item dom
5827 @opindex fdump-tree-dom
5828 Dump each function after applying dominator tree optimizations.  The file
5829 name is made by appending @file{.dom} to the source file name.
5830
5831 @item dse
5832 @opindex fdump-tree-dse
5833 Dump each function after applying dead store elimination.  The file
5834 name is made by appending @file{.dse} to the source file name.
5835
5836 @item phiopt
5837 @opindex fdump-tree-phiopt
5838 Dump each function after optimizing PHI nodes into straightline code.  The file
5839 name is made by appending @file{.phiopt} to the source file name.
5840
5841 @item forwprop
5842 @opindex fdump-tree-forwprop
5843 Dump each function after forward propagating single use variables.  The file
5844 name is made by appending @file{.forwprop} to the source file name.
5845
5846 @item copyrename
5847 @opindex fdump-tree-copyrename
5848 Dump each function after applying the copy rename optimization.  The file
5849 name is made by appending @file{.copyrename} to the source file name.
5850
5851 @item nrv
5852 @opindex fdump-tree-nrv
5853 Dump each function after applying the named return value optimization on
5854 generic trees.  The file name is made by appending @file{.nrv} to the source
5855 file name.
5856
5857 @item vect
5858 @opindex fdump-tree-vect
5859 Dump each function after applying vectorization of loops.  The file name is
5860 made by appending @file{.vect} to the source file name.
5861
5862 @item slp
5863 @opindex fdump-tree-slp
5864 Dump each function after applying vectorization of basic blocks.  The file name
5865 is made by appending @file{.slp} to the source file name.
5866
5867 @item vrp
5868 @opindex fdump-tree-vrp
5869 Dump each function after Value Range Propagation (VRP).  The file name
5870 is made by appending @file{.vrp} to the source file name.
5871
5872 @item all
5873 @opindex fdump-tree-all
5874 Enable all the available tree dumps with the flags provided in this option.
5875 @end table
5876
5877 @item -ftree-vectorizer-verbose=@var{n}
5878 @opindex ftree-vectorizer-verbose
5879 This option controls the amount of debugging output the vectorizer prints.
5880 This information is written to standard error, unless
5881 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5882 in which case it is output to the usual dump listing file, @file{.vect}.
5883 For @var{n}=0 no diagnostic information is reported.
5884 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5885 and the total number of loops that got vectorized.
5886 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5887 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5888 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5889 level that @option{-fdump-tree-vect-stats} uses.
5890 Higher verbosity levels mean either more information dumped for each
5891 reported loop, or same amount of information reported for more loops:
5892 if @var{n}=3, vectorizer cost model information is reported.
5893 If @var{n}=4, alignment related information is added to the reports.
5894 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5895 memory access-patterns) is added to the reports.
5896 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5897 that did not pass the first analysis phase (i.e., may not be countable, or
5898 may have complicated control-flow).
5899 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5900 If @var{n}=8, SLP related information is added to the reports.
5901 For @var{n}=9, all the information the vectorizer generates during its
5902 analysis and transformation is reported.  This is the same verbosity level
5903 that @option{-fdump-tree-vect-details} uses.
5904
5905 @item -frandom-seed=@var{string}
5906 @opindex frandom-seed
5907 This option provides a seed that GCC uses in place of
5908 random numbers in generating certain symbol names
5909 that have to be different in every compiled file.  It is also used to
5910 place unique stamps in coverage data files and the object files that
5911 produce them.  You can use the @option{-frandom-seed} option to produce
5912 reproducibly identical object files.
5913
5914 The @var{string} should be different for every file you compile.
5915
5916 @item -fsched-verbose=@var{n}
5917 @opindex fsched-verbose
5918 On targets that use instruction scheduling, this option controls the
5919 amount of debugging output the scheduler prints.  This information is
5920 written to standard error, unless @option{-fdump-rtl-sched1} or
5921 @option{-fdump-rtl-sched2} is specified, in which case it is output
5922 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5923 respectively.  However for @var{n} greater than nine, the output is
5924 always printed to standard error.
5925
5926 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5927 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5928 For @var{n} greater than one, it also output basic block probabilities,
5929 detailed ready list information and unit/insn info.  For @var{n} greater
5930 than two, it includes RTL at abort point, control-flow and regions info.
5931 And for @var{n} over four, @option{-fsched-verbose} also includes
5932 dependence info.
5933
5934 @item -save-temps
5935 @itemx -save-temps=cwd
5936 @opindex save-temps
5937 Store the usual ``temporary'' intermediate files permanently; place them
5938 in the current directory and name them based on the source file.  Thus,
5939 compiling @file{foo.c} with @option{-c -save-temps} produces files
5940 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5941 preprocessed @file{foo.i} output file even though the compiler now
5942 normally uses an integrated preprocessor.
5943
5944 When used in combination with the @option{-x} command-line option,
5945 @option{-save-temps} is sensible enough to avoid over writing an
5946 input source file with the same extension as an intermediate file.
5947 The corresponding intermediate file may be obtained by renaming the
5948 source file before using @option{-save-temps}.
5949
5950 If you invoke GCC in parallel, compiling several different source
5951 files that share a common base name in different subdirectories or the
5952 same source file compiled for multiple output destinations, it is
5953 likely that the different parallel compilers will interfere with each
5954 other, and overwrite the temporary files.  For instance:
5955
5956 @smallexample
5957 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5958 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5959 @end smallexample
5960
5961 may result in @file{foo.i} and @file{foo.o} being written to
5962 simultaneously by both compilers.
5963
5964 @item -save-temps=obj
5965 @opindex save-temps=obj
5966 Store the usual ``temporary'' intermediate files permanently.  If the
5967 @option{-o} option is used, the temporary files are based on the
5968 object file.  If the @option{-o} option is not used, the
5969 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5970
5971 For example:
5972
5973 @smallexample
5974 gcc -save-temps=obj -c foo.c
5975 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5976 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5977 @end smallexample
5978
5979 @noindent
5980 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5981 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5982 @file{dir2/yfoobar.o}.
5983
5984 @item -time@r{[}=@var{file}@r{]}
5985 @opindex time
5986 Report the CPU time taken by each subprocess in the compilation
5987 sequence.  For C source files, this is the compiler proper and assembler
5988 (plus the linker if linking is done).
5989
5990 Without the specification of an output file, the output looks like this:
5991
5992 @smallexample
5993 # cc1 0.12 0.01
5994 # as 0.00 0.01
5995 @end smallexample
5996
5997 The first number on each line is the ``user time'', that is time spent
5998 executing the program itself.  The second number is ``system time'',
5999 time spent executing operating system routines on behalf of the program.
6000 Both numbers are in seconds.
6001
6002 With the specification of an output file, the output is appended to the
6003 named file, and it looks like this:
6004
6005 @smallexample
6006 0.12 0.01 cc1 @var{options}
6007 0.00 0.01 as @var{options}
6008 @end smallexample
6009
6010 The ``user time'' and the ``system time'' are moved before the program
6011 name, and the options passed to the program are displayed, so that one
6012 can later tell what file was being compiled, and with which options.
6013
6014 @item -fvar-tracking
6015 @opindex fvar-tracking
6016 Run variable tracking pass.  It computes where variables are stored at each
6017 position in code.  Better debugging information is then generated
6018 (if the debugging information format supports this information).
6019
6020 It is enabled by default when compiling with optimization (@option{-Os},
6021 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6022 the debug info format supports it.
6023
6024 @item -fvar-tracking-assignments
6025 @opindex fvar-tracking-assignments
6026 @opindex fno-var-tracking-assignments
6027 Annotate assignments to user variables early in the compilation and
6028 attempt to carry the annotations over throughout the compilation all the
6029 way to the end, in an attempt to improve debug information while
6030 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6031
6032 It can be enabled even if var-tracking is disabled, in which case
6033 annotations are created and maintained, but discarded at the end.
6034
6035 @item -fvar-tracking-assignments-toggle
6036 @opindex fvar-tracking-assignments-toggle
6037 @opindex fno-var-tracking-assignments-toggle
6038 Toggle @option{-fvar-tracking-assignments}, in the same way that
6039 @option{-gtoggle} toggles @option{-g}.
6040
6041 @item -print-file-name=@var{library}
6042 @opindex print-file-name
6043 Print the full absolute name of the library file @var{library} that
6044 would be used when linking---and don't do anything else.  With this
6045 option, GCC does not compile or link anything; it just prints the
6046 file name.
6047
6048 @item -print-multi-directory
6049 @opindex print-multi-directory
6050 Print the directory name corresponding to the multilib selected by any
6051 other switches present in the command line.  This directory is supposed
6052 to exist in @env{GCC_EXEC_PREFIX}.
6053
6054 @item -print-multi-lib
6055 @opindex print-multi-lib
6056 Print the mapping from multilib directory names to compiler switches
6057 that enable them.  The directory name is separated from the switches by
6058 @samp{;}, and each switch starts with an @samp{@@} instead of the
6059 @samp{-}, without spaces between multiple switches.  This is supposed to
6060 ease shell-processing.
6061
6062 @item -print-multi-os-directory
6063 @opindex print-multi-os-directory
6064 Print the path to OS libraries for the selected
6065 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6066 present in the @file{lib} subdirectory and no multilibs are used, this is
6067 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6068 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6069 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6070 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6071
6072 @item -print-prog-name=@var{program}
6073 @opindex print-prog-name
6074 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6075
6076 @item -print-libgcc-file-name
6077 @opindex print-libgcc-file-name
6078 Same as @option{-print-file-name=libgcc.a}.
6079
6080 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6081 but you do want to link with @file{libgcc.a}.  You can do
6082
6083 @smallexample
6084 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6085 @end smallexample
6086
6087 @item -print-search-dirs
6088 @opindex print-search-dirs
6089 Print the name of the configured installation directory and a list of
6090 program and library directories @command{gcc} searches---and don't do anything else.
6091
6092 This is useful when @command{gcc} prints the error message
6093 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6094 To resolve this you either need to put @file{cpp0} and the other compiler
6095 components where @command{gcc} expects to find them, or you can set the environment
6096 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6097 Don't forget the trailing @samp{/}.
6098 @xref{Environment Variables}.
6099
6100 @item -print-sysroot
6101 @opindex print-sysroot
6102 Print the target sysroot directory that is used during
6103 compilation.  This is the target sysroot specified either at configure
6104 time or using the @option{--sysroot} option, possibly with an extra
6105 suffix that depends on compilation options.  If no target sysroot is
6106 specified, the option prints nothing.
6107
6108 @item -print-sysroot-headers-suffix
6109 @opindex print-sysroot-headers-suffix
6110 Print the suffix added to the target sysroot when searching for
6111 headers, or give an error if the compiler is not configured with such
6112 a suffix---and don't do anything else.
6113
6114 @item -dumpmachine
6115 @opindex dumpmachine
6116 Print the compiler's target machine (for example,
6117 @samp{i686-pc-linux-gnu})---and don't do anything else.
6118
6119 @item -dumpversion
6120 @opindex dumpversion
6121 Print the compiler version (for example, @samp{3.0})---and don't do
6122 anything else.
6123
6124 @item -dumpspecs
6125 @opindex dumpspecs
6126 Print the compiler's built-in specs---and don't do anything else.  (This
6127 is used when GCC itself is being built.)  @xref{Spec Files}.
6128
6129 @item -feliminate-unused-debug-types
6130 @opindex feliminate-unused-debug-types
6131 Normally, when producing DWARF 2 output, GCC emits debugging
6132 information for all types declared in a compilation
6133 unit, regardless of whether or not they are actually used
6134 in that compilation unit.  Sometimes this is useful, such as
6135 if, in the debugger, you want to cast a value to a type that is
6136 not actually used in your program (but is declared).  More often,
6137 however, this results in a significant amount of wasted space.
6138 With this option, GCC avoids producing debug symbol output
6139 for types that are nowhere used in the source file being compiled.
6140 @end table
6141
6142 @node Optimize Options
6143 @section Options That Control Optimization
6144 @cindex optimize options
6145 @cindex options, optimization
6146
6147 These options control various sorts of optimizations.
6148
6149 Without any optimization option, the compiler's goal is to reduce the
6150 cost of compilation and to make debugging produce the expected
6151 results.  Statements are independent: if you stop the program with a
6152 breakpoint between statements, you can then assign a new value to any
6153 variable or change the program counter to any other statement in the
6154 function and get exactly the results you expect from the source
6155 code.
6156
6157 Turning on optimization flags makes the compiler attempt to improve
6158 the performance and/or code size at the expense of compilation time
6159 and possibly the ability to debug the program.
6160
6161 The compiler performs optimization based on the knowledge it has of the
6162 program.  Compiling multiple files at once to a single output file mode allows
6163 the compiler to use information gained from all of the files when compiling
6164 each of them.
6165
6166 Not all optimizations are controlled directly by a flag.  Only
6167 optimizations that have a flag are listed in this section.
6168
6169 Most optimizations are only enabled if an @option{-O} level is set on
6170 the command line.  Otherwise they are disabled, even if individual
6171 optimization flags are specified.
6172
6173 Depending on the target and how GCC was configured, a slightly different
6174 set of optimizations may be enabled at each @option{-O} level than
6175 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6176 to find out the exact set of optimizations that are enabled at each level.
6177 @xref{Overall Options}, for examples.
6178
6179 @table @gcctabopt
6180 @item -O
6181 @itemx -O1
6182 @opindex O
6183 @opindex O1
6184 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6185 more memory for a large function.
6186
6187 With @option{-O}, the compiler tries to reduce code size and execution
6188 time, without performing any optimizations that take a great deal of
6189 compilation time.
6190
6191 @option{-O} turns on the following optimization flags:
6192 @gccoptlist{
6193 -fauto-inc-dec @gol
6194 -fcompare-elim @gol
6195 -fcprop-registers @gol
6196 -fdce @gol
6197 -fdefer-pop @gol
6198 -fdelayed-branch @gol
6199 -fdse @gol
6200 -fguess-branch-probability @gol
6201 -fif-conversion2 @gol
6202 -fif-conversion @gol
6203 -fipa-pure-const @gol
6204 -fipa-profile @gol
6205 -fipa-reference @gol
6206 -fmerge-constants
6207 -fsplit-wide-types @gol
6208 -ftree-bit-ccp @gol
6209 -ftree-builtin-call-dce @gol
6210 -ftree-ccp @gol
6211 -ftree-ch @gol
6212 -ftree-copyrename @gol
6213 -ftree-dce @gol
6214 -ftree-dominator-opts @gol
6215 -ftree-dse @gol
6216 -ftree-forwprop @gol
6217 -ftree-fre @gol
6218 -ftree-phiprop @gol
6219 -ftree-sra @gol
6220 -ftree-pta @gol
6221 -ftree-ter @gol
6222 -funit-at-a-time}
6223
6224 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6225 where doing so does not interfere with debugging.
6226
6227 @item -O2
6228 @opindex O2
6229 Optimize even more.  GCC performs nearly all supported optimizations
6230 that do not involve a space-speed tradeoff.
6231 As compared to @option{-O}, this option increases both compilation time
6232 and the performance of the generated code.
6233
6234 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6235 also turns on the following optimization flags:
6236 @gccoptlist{-fthread-jumps @gol
6237 -falign-functions  -falign-jumps @gol
6238 -falign-loops  -falign-labels @gol
6239 -fcaller-saves @gol
6240 -fcrossjumping @gol
6241 -fcse-follow-jumps  -fcse-skip-blocks @gol
6242 -fdelete-null-pointer-checks @gol
6243 -fdevirtualize @gol
6244 -fexpensive-optimizations @gol
6245 -fgcse  -fgcse-lm  @gol
6246 -finline-small-functions @gol
6247 -findirect-inlining @gol
6248 -fipa-sra @gol
6249 -foptimize-sibling-calls @gol
6250 -fpartial-inlining @gol
6251 -fpeephole2 @gol
6252 -fregmove @gol
6253 -freorder-blocks  -freorder-functions @gol
6254 -frerun-cse-after-loop  @gol
6255 -fsched-interblock  -fsched-spec @gol
6256 -fschedule-insns  -fschedule-insns2 @gol
6257 -fstrict-aliasing -fstrict-overflow @gol
6258 -ftree-switch-conversion -ftree-tail-merge @gol
6259 -ftree-pre @gol
6260 -ftree-vrp}
6261
6262 Please note the warning under @option{-fgcse} about
6263 invoking @option{-O2} on programs that use computed gotos.
6264
6265 @item -O3
6266 @opindex O3
6267 Optimize yet more.  @option{-O3} turns on all optimizations specified
6268 by @option{-O2} and also turns on the @option{-finline-functions},
6269 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6270 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
6271 @option{-fipa-cp-clone} options.
6272
6273 @item -O0
6274 @opindex O0
6275 Reduce compilation time and make debugging produce the expected
6276 results.  This is the default.
6277
6278 @item -Os
6279 @opindex Os
6280 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6281 do not typically increase code size.  It also performs further
6282 optimizations designed to reduce code size.
6283
6284 @option{-Os} disables the following optimization flags:
6285 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6286 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6287 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6288
6289 @item -Ofast
6290 @opindex Ofast
6291 Disregard strict standards compliance.  @option{-Ofast} enables all
6292 @option{-O3} optimizations.  It also enables optimizations that are not
6293 valid for all standard compliant programs.
6294 It turns on @option{-ffast-math} and the Fortran-specific
6295 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6296
6297 If you use multiple @option{-O} options, with or without level numbers,
6298 the last such option is the one that is effective.
6299 @end table
6300
6301 Options of the form @option{-f@var{flag}} specify machine-independent
6302 flags.  Most flags have both positive and negative forms; the negative
6303 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6304 below, only one of the forms is listed---the one you typically 
6305 use.  You can figure out the other form by either removing @samp{no-}
6306 or adding it.
6307
6308 The following options control specific optimizations.  They are either
6309 activated by @option{-O} options or are related to ones that are.  You
6310 can use the following flags in the rare cases when ``fine-tuning'' of
6311 optimizations to be performed is desired.
6312
6313 @table @gcctabopt
6314 @item -fno-default-inline
6315 @opindex fno-default-inline
6316 Do not make member functions inline by default merely because they are
6317 defined inside the class scope (C++ only).  Otherwise, when you specify
6318 @w{@option{-O}}, member functions defined inside class scope are compiled
6319 inline by default; i.e., you don't need to add @samp{inline} in front of
6320 the member function name.
6321
6322 @item -fno-defer-pop
6323 @opindex fno-defer-pop
6324 Always pop the arguments to each function call as soon as that function
6325 returns.  For machines that must pop arguments after a function call,
6326 the compiler normally lets arguments accumulate on the stack for several
6327 function calls and pops them all at once.
6328
6329 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6330
6331 @item -fforward-propagate
6332 @opindex fforward-propagate
6333 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6334 instructions and checks if the result can be simplified.  If loop unrolling
6335 is active, two passes are performed and the second is scheduled after
6336 loop unrolling.
6337
6338 This option is enabled by default at optimization levels @option{-O},
6339 @option{-O2}, @option{-O3}, @option{-Os}.
6340
6341 @item -ffp-contract=@var{style}
6342 @opindex ffp-contract
6343 @option{-ffp-contract=off} disables floating-point expression contraction.
6344 @option{-ffp-contract=fast} enables floating-point expression contraction
6345 such as forming of fused multiply-add operations if the target has
6346 native support for them.
6347 @option{-ffp-contract=on} enables floating-point expression contraction
6348 if allowed by the language standard.  This is currently not implemented
6349 and treated equal to @option{-ffp-contract=off}.
6350
6351 The default is @option{-ffp-contract=fast}.
6352
6353 @item -fomit-frame-pointer
6354 @opindex fomit-frame-pointer
6355 Don't keep the frame pointer in a register for functions that
6356 don't need one.  This avoids the instructions to save, set up and
6357 restore frame pointers; it also makes an extra register available
6358 in many functions.  @strong{It also makes debugging impossible on
6359 some machines.}
6360
6361 On some machines, such as the VAX, this flag has no effect, because
6362 the standard calling sequence automatically handles the frame pointer
6363 and nothing is saved by pretending it doesn't exist.  The
6364 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6365 whether a target machine supports this flag.  @xref{Registers,,Register
6366 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6367
6368 Starting with GCC version 4.6, the default setting (when not optimizing for
6369 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6370 @option{-fomit-frame-pointer}.  The default can be reverted to
6371 @option{-fno-omit-frame-pointer} by configuring GCC with the
6372 @option{--enable-frame-pointer} configure option.
6373
6374 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6375
6376 @item -foptimize-sibling-calls
6377 @opindex foptimize-sibling-calls
6378 Optimize sibling and tail recursive calls.
6379
6380 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6381
6382 @item -fno-inline
6383 @opindex fno-inline
6384 Do not expand any functions inline apart from those marked with
6385 the @code{always_inline} attribute.  This is the default when not
6386 optimizing.
6387
6388 Single functions can be exempted from inlining by marking them
6389 with the @code{noinline} attribute.
6390
6391 @item -finline-small-functions
6392 @opindex finline-small-functions
6393 Integrate functions into their callers when their body is smaller than expected
6394 function call code (so overall size of program gets smaller).  The compiler
6395 heuristically decides which functions are simple enough to be worth integrating
6396 in this way.  This inlining applies to all functions, even those not declared
6397 inline.
6398
6399 Enabled at level @option{-O2}.
6400
6401 @item -findirect-inlining
6402 @opindex findirect-inlining
6403 Inline also indirect calls that are discovered to be known at compile
6404 time thanks to previous inlining.  This option has any effect only
6405 when inlining itself is turned on by the @option{-finline-functions}
6406 or @option{-finline-small-functions} options.
6407
6408 Enabled at level @option{-O2}.
6409
6410 @item -finline-functions
6411 @opindex finline-functions
6412 Consider all functions for inlining, even if they are not declared inline.
6413 The compiler heuristically decides which functions are worth integrating
6414 in this way.
6415
6416 If all calls to a given function are integrated, and the function is
6417 declared @code{static}, then the function is normally not output as
6418 assembler code in its own right.
6419
6420 Enabled at level @option{-O3}.
6421
6422 @item -finline-functions-called-once
6423 @opindex finline-functions-called-once
6424 Consider all @code{static} functions called once for inlining into their
6425 caller even if they are not marked @code{inline}.  If a call to a given
6426 function is integrated, then the function is not output as assembler code
6427 in its own right.
6428
6429 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6430
6431 @item -fearly-inlining
6432 @opindex fearly-inlining
6433 Inline functions marked by @code{always_inline} and functions whose body seems
6434 smaller than the function call overhead early before doing
6435 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6436 makes profiling significantly cheaper and usually inlining faster on programs
6437 having large chains of nested wrapper functions.
6438
6439 Enabled by default.
6440
6441 @item -fipa-sra
6442 @opindex fipa-sra
6443 Perform interprocedural scalar replacement of aggregates, removal of
6444 unused parameters and replacement of parameters passed by reference
6445 by parameters passed by value.
6446
6447 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6448
6449 @item -finline-limit=@var{n}
6450 @opindex finline-limit
6451 By default, GCC limits the size of functions that can be inlined.  This flag
6452 allows coarse control of this limit.  @var{n} is the size of functions that
6453 can be inlined in number of pseudo instructions.
6454
6455 Inlining is actually controlled by a number of parameters, which may be
6456 specified individually by using @option{--param @var{name}=@var{value}}.
6457 The @option{-finline-limit=@var{n}} option sets some of these parameters
6458 as follows:
6459
6460 @table @gcctabopt
6461 @item max-inline-insns-single
6462 is set to @var{n}/2.
6463 @item max-inline-insns-auto
6464 is set to @var{n}/2.
6465 @end table
6466
6467 See below for a documentation of the individual
6468 parameters controlling inlining and for the defaults of these parameters.
6469
6470 @emph{Note:} there may be no value to @option{-finline-limit} that results
6471 in default behavior.
6472
6473 @emph{Note:} pseudo instruction represents, in this particular context, an
6474 abstract measurement of function's size.  In no way does it represent a count
6475 of assembly instructions and as such its exact meaning might change from one
6476 release to an another.
6477
6478 @item -fno-keep-inline-dllexport
6479 @opindex -fno-keep-inline-dllexport
6480 This is a more fine-grained version of @option{-fkeep-inline-functions},
6481 which applies only to functions that are declared using the @code{dllexport}
6482 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6483 Functions}.)
6484
6485 @item -fkeep-inline-functions
6486 @opindex fkeep-inline-functions
6487 In C, emit @code{static} functions that are declared @code{inline}
6488 into the object file, even if the function has been inlined into all
6489 of its callers.  This switch does not affect functions using the
6490 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6491 inline functions into the object file.
6492
6493 @item -fkeep-static-consts
6494 @opindex fkeep-static-consts
6495 Emit variables declared @code{static const} when optimization isn't turned
6496 on, even if the variables aren't referenced.
6497
6498 GCC enables this option by default.  If you want to force the compiler to
6499 check if a variable is referenced, regardless of whether or not
6500 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6501
6502 @item -fmerge-constants
6503 @opindex fmerge-constants
6504 Attempt to merge identical constants (string constants and floating-point
6505 constants) across compilation units.
6506
6507 This option is the default for optimized compilation if the assembler and
6508 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6509 behavior.
6510
6511 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6512
6513 @item -fmerge-all-constants
6514 @opindex fmerge-all-constants
6515 Attempt to merge identical constants and identical variables.
6516
6517 This option implies @option{-fmerge-constants}.  In addition to
6518 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6519 arrays or initialized constant variables with integral or floating-point
6520 types.  Languages like C or C++ require each variable, including multiple
6521 instances of the same variable in recursive calls, to have distinct locations,
6522 so using this option results in non-conforming
6523 behavior.
6524
6525 @item -fmodulo-sched
6526 @opindex fmodulo-sched
6527 Perform swing modulo scheduling immediately before the first scheduling
6528 pass.  This pass looks at innermost loops and reorders their
6529 instructions by overlapping different iterations.
6530
6531 @item -fmodulo-sched-allow-regmoves
6532 @opindex fmodulo-sched-allow-regmoves
6533 Perform more aggressive SMS-based modulo scheduling with register moves
6534 allowed.  By setting this flag certain anti-dependences edges are
6535 deleted, which triggers the generation of reg-moves based on the
6536 life-range analysis.  This option is effective only with
6537 @option{-fmodulo-sched} enabled.
6538
6539 @item -fno-branch-count-reg
6540 @opindex fno-branch-count-reg
6541 Do not use ``decrement and branch'' instructions on a count register,
6542 but instead generate a sequence of instructions that decrement a
6543 register, compare it against zero, then branch based upon the result.
6544 This option is only meaningful on architectures that support such
6545 instructions, which include x86, PowerPC, IA-64 and S/390.
6546
6547 The default is @option{-fbranch-count-reg}.
6548
6549 @item -fno-function-cse
6550 @opindex fno-function-cse
6551 Do not put function addresses in registers; make each instruction that
6552 calls a constant function contain the function's address explicitly.
6553
6554 This option results in less efficient code, but some strange hacks
6555 that alter the assembler output may be confused by the optimizations
6556 performed when this option is not used.
6557
6558 The default is @option{-ffunction-cse}
6559
6560 @item -fno-zero-initialized-in-bss
6561 @opindex fno-zero-initialized-in-bss
6562 If the target supports a BSS section, GCC by default puts variables that
6563 are initialized to zero into BSS@.  This can save space in the resulting
6564 code.
6565
6566 This option turns off this behavior because some programs explicitly
6567 rely on variables going to the data section.  E.g., so that the
6568 resulting executable can find the beginning of that section and/or make
6569 assumptions based on that.
6570
6571 The default is @option{-fzero-initialized-in-bss}.
6572
6573 @item -fmudflap -fmudflapth -fmudflapir
6574 @opindex fmudflap
6575 @opindex fmudflapth
6576 @opindex fmudflapir
6577 @cindex bounds checking
6578 @cindex mudflap
6579 For front-ends that support it (C and C++), instrument all risky
6580 pointer/array dereferencing operations, some standard library
6581 string/heap functions, and some other associated constructs with
6582 range/validity tests.  Modules so instrumented should be immune to
6583 buffer overflows, invalid heap use, and some other classes of C/C++
6584 programming errors.  The instrumentation relies on a separate runtime
6585 library (@file{libmudflap}), which is linked into a program if
6586 @option{-fmudflap} is given at link time.  Run-time behavior of the
6587 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6588 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6589 for its options.
6590
6591 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6592 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6593 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6594 instrumentation should ignore pointer reads.  This produces less
6595 instrumentation (and therefore faster execution) and still provides
6596 some protection against outright memory corrupting writes, but allows
6597 erroneously read data to propagate within a program.
6598
6599 @item -fthread-jumps
6600 @opindex fthread-jumps
6601 Perform optimizations where we check to see if a jump branches to a
6602 location where another comparison subsumed by the first is found.  If
6603 so, the first branch is redirected to either the destination of the
6604 second branch or a point immediately following it, depending on whether
6605 the condition is known to be true or false.
6606
6607 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6608
6609 @item -fsplit-wide-types
6610 @opindex fsplit-wide-types
6611 When using a type that occupies multiple registers, such as @code{long
6612 long} on a 32-bit system, split the registers apart and allocate them
6613 independently.  This normally generates better code for those types,
6614 but may make debugging more difficult.
6615
6616 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6617 @option{-Os}.
6618
6619 @item -fcse-follow-jumps
6620 @opindex fcse-follow-jumps
6621 In common subexpression elimination (CSE), scan through jump instructions
6622 when the target of the jump is not reached by any other path.  For
6623 example, when CSE encounters an @code{if} statement with an
6624 @code{else} clause, CSE follows the jump when the condition
6625 tested is false.
6626
6627 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6628
6629 @item -fcse-skip-blocks
6630 @opindex fcse-skip-blocks
6631 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6632 follow jumps that conditionally skip over blocks.  When CSE
6633 encounters a simple @code{if} statement with no else clause,
6634 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6635 body of the @code{if}.
6636
6637 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6638
6639 @item -frerun-cse-after-loop
6640 @opindex frerun-cse-after-loop
6641 Re-run common subexpression elimination after loop optimizations are
6642 performed.
6643
6644 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6645
6646 @item -fgcse
6647 @opindex fgcse
6648 Perform a global common subexpression elimination pass.
6649 This pass also performs global constant and copy propagation.
6650
6651 @emph{Note:} When compiling a program using computed gotos, a GCC
6652 extension, you may get better run-time performance if you disable
6653 the global common subexpression elimination pass by adding
6654 @option{-fno-gcse} to the command line.
6655
6656 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6657
6658 @item -fgcse-lm
6659 @opindex fgcse-lm
6660 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6661 attempts to move loads that are only killed by stores into themselves.  This
6662 allows a loop containing a load/store sequence to be changed to a load outside
6663 the loop, and a copy/store within the loop.
6664
6665 Enabled by default when @option{-fgcse} is enabled.
6666
6667 @item -fgcse-sm
6668 @opindex fgcse-sm
6669 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6670 global common subexpression elimination.  This pass attempts to move
6671 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6672 loops containing a load/store sequence can be changed to a load before
6673 the loop and a store after the loop.
6674
6675 Not enabled at any optimization level.
6676
6677 @item -fgcse-las
6678 @opindex fgcse-las
6679 When @option{-fgcse-las} is enabled, the global common subexpression
6680 elimination pass eliminates redundant loads that come after stores to the
6681 same memory location (both partial and full redundancies).
6682
6683 Not enabled at any optimization level.
6684
6685 @item -fgcse-after-reload
6686 @opindex fgcse-after-reload
6687 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6688 pass is performed after reload.  The purpose of this pass is to cleanup
6689 redundant spilling.
6690
6691 @item -funsafe-loop-optimizations
6692 @opindex funsafe-loop-optimizations
6693 If given, the loop optimizer assumes that loop indices do not
6694 overflow, and that the loops with nontrivial exit condition are not
6695 infinite.  This enables a wider range of loop optimizations even if
6696 the loop optimizer itself cannot prove that these assumptions are valid.
6697 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
6698 if it finds this kind of loop.
6699
6700 @item -fcrossjumping
6701 @opindex fcrossjumping
6702 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6703 resulting code may or may not perform better than without cross-jumping.
6704
6705 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6706
6707 @item -fauto-inc-dec
6708 @opindex fauto-inc-dec
6709 Combine increments or decrements of addresses with memory accesses.
6710 This pass is always skipped on architectures that do not have
6711 instructions to support this.  Enabled by default at @option{-O} and
6712 higher on architectures that support this.
6713
6714 @item -fdce
6715 @opindex fdce
6716 Perform dead code elimination (DCE) on RTL@.
6717 Enabled by default at @option{-O} and higher.
6718
6719 @item -fdse
6720 @opindex fdse
6721 Perform dead store elimination (DSE) on RTL@.
6722 Enabled by default at @option{-O} and higher.
6723
6724 @item -fif-conversion
6725 @opindex fif-conversion
6726 Attempt to transform conditional jumps into branch-less equivalents.  This
6727 include use of conditional moves, min, max, set flags and abs instructions, and
6728 some tricks doable by standard arithmetics.  The use of conditional execution
6729 on chips where it is available is controlled by @code{if-conversion2}.
6730
6731 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6732
6733 @item -fif-conversion2
6734 @opindex fif-conversion2
6735 Use conditional execution (where available) to transform conditional jumps into
6736 branch-less equivalents.
6737
6738 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6739
6740 @item -fdelete-null-pointer-checks
6741 @opindex fdelete-null-pointer-checks
6742 Assume that programs cannot safely dereference null pointers, and that
6743 no code or data element resides there.  This enables simple constant
6744 folding optimizations at all optimization levels.  In addition, other
6745 optimization passes in GCC use this flag to control global dataflow
6746 analyses that eliminate useless checks for null pointers; these assume
6747 that if a pointer is checked after it has already been dereferenced,
6748 it cannot be null.
6749
6750 Note however that in some environments this assumption is not true.
6751 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6752 for programs that depend on that behavior.
6753
6754 Some targets, especially embedded ones, disable this option at all levels.
6755 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6756 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6757 are enabled independently at different optimization levels.
6758
6759 @item -fdevirtualize
6760 @opindex fdevirtualize
6761 Attempt to convert calls to virtual functions to direct calls.  This
6762 is done both within a procedure and interprocedurally as part of
6763 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6764 propagation (@option{-fipa-cp}).
6765 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6766
6767 @item -fexpensive-optimizations
6768 @opindex fexpensive-optimizations
6769 Perform a number of minor optimizations that are relatively expensive.
6770
6771 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6772
6773 @item -free
6774 @opindex free
6775 Attempt to remove redundant extension instructions.  This is especially
6776 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
6777 registers after writing to their lower 32-bit half.
6778
6779 Enabled for x86 at levels @option{-O2}, @option{-O3}.
6780
6781 @item -foptimize-register-move
6782 @itemx -fregmove
6783 @opindex foptimize-register-move
6784 @opindex fregmove
6785 Attempt to reassign register numbers in move instructions and as
6786 operands of other simple instructions in order to maximize the amount of
6787 register tying.  This is especially helpful on machines with two-operand
6788 instructions.
6789
6790 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6791 optimization.
6792
6793 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6794
6795 @item -fira-algorithm=@var{algorithm}
6796 Use the specified coloring algorithm for the integrated register
6797 allocator.  The @var{algorithm} argument can be @samp{priority}, which
6798 specifies Chow's priority coloring, or @samp{CB}, which specifies
6799 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
6800 for all architectures, but for those targets that do support it, it is
6801 the default because it generates better code.
6802
6803 @item -fira-region=@var{region}
6804 Use specified regions for the integrated register allocator.  The
6805 @var{region} argument should be one of the following:
6806
6807 @table @samp
6808
6809 @item all
6810 Use all loops as register allocation regions.
6811 This can give the best results for machines with a small and/or
6812 irregular register set.
6813
6814 @item mixed
6815 Use all loops except for loops with small register pressure 
6816 as the regions.  This value usually gives
6817 the best results in most cases and for most architectures,
6818 and is enabled by default when compiling with optimization for speed
6819 (@option{-O}, @option{-O2}, @dots{}).
6820
6821 @item one
6822 Use all functions as a single region.  
6823 This typically results in the smallest code size, and is enabled by default for
6824 @option{-Os} or @option{-O0}.
6825
6826 @end table
6827
6828 @item -fira-loop-pressure
6829 @opindex fira-loop-pressure
6830 Use IRA to evaluate register pressure in loops for decisions to move
6831 loop invariants.  This option usually results in generation
6832 of faster and smaller code on machines with large register files (>= 32
6833 registers), but it can slow the compiler down.
6834
6835 This option is enabled at level @option{-O3} for some targets.
6836
6837 @item -fno-ira-share-save-slots
6838 @opindex fno-ira-share-save-slots
6839 Disable sharing of stack slots used for saving call-used hard
6840 registers living through a call.  Each hard register gets a
6841 separate stack slot, and as a result function stack frames are
6842 larger.
6843
6844 @item -fno-ira-share-spill-slots
6845 @opindex fno-ira-share-spill-slots
6846 Disable sharing of stack slots allocated for pseudo-registers.  Each
6847 pseudo-register that does not get a hard register gets a separate
6848 stack slot, and as a result function stack frames are larger.
6849
6850 @item -fira-verbose=@var{n}
6851 @opindex fira-verbose
6852 Control the verbosity of the dump file for the integrated register allocator.
6853 The default value is 5.  If the value @var{n} is greater or equal to 10,
6854 the dump output is sent to stderr using the same format as @var{n} minus 10.
6855
6856 @item -fdelayed-branch
6857 @opindex fdelayed-branch
6858 If supported for the target machine, attempt to reorder instructions
6859 to exploit instruction slots available after delayed branch
6860 instructions.
6861
6862 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6863
6864 @item -fschedule-insns
6865 @opindex fschedule-insns
6866 If supported for the target machine, attempt to reorder instructions to
6867 eliminate execution stalls due to required data being unavailable.  This
6868 helps machines that have slow floating point or memory load instructions
6869 by allowing other instructions to be issued until the result of the load
6870 or floating-point instruction is required.
6871
6872 Enabled at levels @option{-O2}, @option{-O3}.
6873
6874 @item -fschedule-insns2
6875 @opindex fschedule-insns2
6876 Similar to @option{-fschedule-insns}, but requests an additional pass of
6877 instruction scheduling after register allocation has been done.  This is
6878 especially useful on machines with a relatively small number of
6879 registers and where memory load instructions take more than one cycle.
6880
6881 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6882
6883 @item -fno-sched-interblock
6884 @opindex fno-sched-interblock
6885 Don't schedule instructions across basic blocks.  This is normally
6886 enabled by default when scheduling before register allocation, i.e.@:
6887 with @option{-fschedule-insns} or at @option{-O2} or higher.
6888
6889 @item -fno-sched-spec
6890 @opindex fno-sched-spec
6891 Don't allow speculative motion of non-load instructions.  This is normally
6892 enabled by default when scheduling before register allocation, i.e.@:
6893 with @option{-fschedule-insns} or at @option{-O2} or higher.
6894
6895 @item -fsched-pressure
6896 @opindex fsched-pressure
6897 Enable register pressure sensitive insn scheduling before the register
6898 allocation.  This only makes sense when scheduling before register
6899 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6900 @option{-O2} or higher.  Usage of this option can improve the
6901 generated code and decrease its size by preventing register pressure
6902 increase above the number of available hard registers and as a
6903 consequence register spills in the register allocation.
6904
6905 @item -fsched-spec-load
6906 @opindex fsched-spec-load
6907 Allow speculative motion of some load instructions.  This only makes
6908 sense when scheduling before register allocation, i.e.@: with
6909 @option{-fschedule-insns} or at @option{-O2} or higher.
6910
6911 @item -fsched-spec-load-dangerous
6912 @opindex fsched-spec-load-dangerous
6913 Allow speculative motion of more load instructions.  This only makes
6914 sense when scheduling before register allocation, i.e.@: with
6915 @option{-fschedule-insns} or at @option{-O2} or higher.
6916
6917 @item -fsched-stalled-insns
6918 @itemx -fsched-stalled-insns=@var{n}
6919 @opindex fsched-stalled-insns
6920 Define how many insns (if any) can be moved prematurely from the queue
6921 of stalled insns into the ready list during the second scheduling pass.
6922 @option{-fno-sched-stalled-insns} means that no insns are moved
6923 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6924 on how many queued insns can be moved prematurely.
6925 @option{-fsched-stalled-insns} without a value is equivalent to
6926 @option{-fsched-stalled-insns=1}.
6927
6928 @item -fsched-stalled-insns-dep
6929 @itemx -fsched-stalled-insns-dep=@var{n}
6930 @opindex fsched-stalled-insns-dep
6931 Define how many insn groups (cycles) are examined for a dependency
6932 on a stalled insn that is a candidate for premature removal from the queue
6933 of stalled insns.  This has an effect only during the second scheduling pass,
6934 and only if @option{-fsched-stalled-insns} is used.
6935 @option{-fno-sched-stalled-insns-dep} is equivalent to
6936 @option{-fsched-stalled-insns-dep=0}.
6937 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6938 @option{-fsched-stalled-insns-dep=1}.
6939
6940 @item -fsched2-use-superblocks
6941 @opindex fsched2-use-superblocks
6942 When scheduling after register allocation, do use superblock scheduling
6943 algorithm.  Superblock scheduling allows motion across basic block boundaries
6944 resulting on faster schedules.  This option is experimental, as not all machine
6945 descriptions used by GCC model the CPU closely enough to avoid unreliable
6946 results from the algorithm.
6947
6948 This only makes sense when scheduling after register allocation, i.e.@: with
6949 @option{-fschedule-insns2} or at @option{-O2} or higher.
6950
6951 @item -fsched-group-heuristic
6952 @opindex fsched-group-heuristic
6953 Enable the group heuristic in the scheduler.  This heuristic favors
6954 the instruction that belongs to a schedule group.  This is enabled
6955 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6956 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6957
6958 @item -fsched-critical-path-heuristic
6959 @opindex fsched-critical-path-heuristic
6960 Enable the critical-path heuristic in the scheduler.  This heuristic favors
6961 instructions on the critical path.  This is enabled by default when
6962 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6963 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6964
6965 @item -fsched-spec-insn-heuristic
6966 @opindex fsched-spec-insn-heuristic
6967 Enable the speculative instruction heuristic in the scheduler.  This
6968 heuristic favors speculative instructions with greater dependency weakness.
6969 This is enabled by default when scheduling is enabled, i.e.@:
6970 with @option{-fschedule-insns} or @option{-fschedule-insns2}
6971 or at @option{-O2} or higher.
6972
6973 @item -fsched-rank-heuristic
6974 @opindex fsched-rank-heuristic
6975 Enable the rank heuristic in the scheduler.  This heuristic favors
6976 the instruction belonging to a basic block with greater size or frequency.
6977 This is enabled by default when scheduling is enabled, i.e.@:
6978 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6979 at @option{-O2} or higher.
6980
6981 @item -fsched-last-insn-heuristic
6982 @opindex fsched-last-insn-heuristic
6983 Enable the last-instruction heuristic in the scheduler.  This heuristic
6984 favors the instruction that is less dependent on the last instruction
6985 scheduled.  This is enabled by default when scheduling is enabled,
6986 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6987 at @option{-O2} or higher.
6988
6989 @item -fsched-dep-count-heuristic
6990 @opindex fsched-dep-count-heuristic
6991 Enable the dependent-count heuristic in the scheduler.  This heuristic
6992 favors the instruction that has more instructions depending on it.
6993 This is enabled by default when scheduling is enabled, i.e.@:
6994 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6995 at @option{-O2} or higher.
6996
6997 @item -freschedule-modulo-scheduled-loops
6998 @opindex freschedule-modulo-scheduled-loops
6999 The modulo scheduling comes before the traditional scheduling.  If a loop
7000 is modulo scheduled you may want to prevent the later scheduling passes
7001 from changing its schedule; use this option to control that.
7002
7003 @item -fselective-scheduling
7004 @opindex fselective-scheduling
7005 Schedule instructions using selective scheduling algorithm.  Selective
7006 scheduling runs instead of the first scheduler pass.
7007
7008 @item -fselective-scheduling2
7009 @opindex fselective-scheduling2
7010 Schedule instructions using selective scheduling algorithm.  Selective
7011 scheduling runs instead of the second scheduler pass.
7012
7013 @item -fsel-sched-pipelining
7014 @opindex fsel-sched-pipelining
7015 Enable software pipelining of innermost loops during selective scheduling.
7016 This option has no effect until one of @option{-fselective-scheduling} or
7017 @option{-fselective-scheduling2} is turned on.
7018
7019 @item -fsel-sched-pipelining-outer-loops
7020 @opindex fsel-sched-pipelining-outer-loops
7021 When pipelining loops during selective scheduling, also pipeline outer loops.
7022 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
7023
7024 @item -fshrink-wrap
7025 @opindex fshrink-wrap
7026 Emit function prologues only before parts of the function that need it,
7027 rather than at the top of the function.  This flag is enabled by default at
7028 @option{-O} and higher.
7029
7030 @item -fcaller-saves
7031 @opindex fcaller-saves
7032 Enable allocation of values to registers that are clobbered by
7033 function calls, by emitting extra instructions to save and restore the
7034 registers around such calls.  Such allocation is done only when it
7035 seems to result in better code.
7036
7037 This option is always enabled by default on certain machines, usually
7038 those which have no call-preserved registers to use instead.
7039
7040 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7041
7042 @item -fcombine-stack-adjustments
7043 @opindex fcombine-stack-adjustments
7044 Tracks stack adjustments (pushes and pops) and stack memory references
7045 and then tries to find ways to combine them.
7046
7047 Enabled by default at @option{-O1} and higher.
7048
7049 @item -fconserve-stack
7050 @opindex fconserve-stack
7051 Attempt to minimize stack usage.  The compiler attempts to use less
7052 stack space, even if that makes the program slower.  This option
7053 implies setting the @option{large-stack-frame} parameter to 100
7054 and the @option{large-stack-frame-growth} parameter to 400.
7055
7056 @item -ftree-reassoc
7057 @opindex ftree-reassoc
7058 Perform reassociation on trees.  This flag is enabled by default
7059 at @option{-O} and higher.
7060
7061 @item -ftree-pre
7062 @opindex ftree-pre
7063 Perform partial redundancy elimination (PRE) on trees.  This flag is
7064 enabled by default at @option{-O2} and @option{-O3}.
7065
7066 @item -ftree-forwprop
7067 @opindex ftree-forwprop
7068 Perform forward propagation on trees.  This flag is enabled by default
7069 at @option{-O} and higher.
7070
7071 @item -ftree-fre
7072 @opindex ftree-fre
7073 Perform full redundancy elimination (FRE) on trees.  The difference
7074 between FRE and PRE is that FRE only considers expressions
7075 that are computed on all paths leading to the redundant computation.
7076 This analysis is faster than PRE, though it exposes fewer redundancies.
7077 This flag is enabled by default at @option{-O} and higher.
7078
7079 @item -ftree-phiprop
7080 @opindex ftree-phiprop
7081 Perform hoisting of loads from conditional pointers on trees.  This
7082 pass is enabled by default at @option{-O} and higher.
7083
7084 @item -ftree-copy-prop
7085 @opindex ftree-copy-prop
7086 Perform copy propagation on trees.  This pass eliminates unnecessary
7087 copy operations.  This flag is enabled by default at @option{-O} and
7088 higher.
7089
7090 @item -fipa-pure-const
7091 @opindex fipa-pure-const
7092 Discover which functions are pure or constant.
7093 Enabled by default at @option{-O} and higher.
7094
7095 @item -fipa-reference
7096 @opindex fipa-reference
7097 Discover which static variables do not escape cannot escape the
7098 compilation unit.
7099 Enabled by default at @option{-O} and higher.
7100
7101 @item -fipa-pta
7102 @opindex fipa-pta
7103 Perform interprocedural pointer analysis and interprocedural modification
7104 and reference analysis.  This option can cause excessive memory and
7105 compile-time usage on large compilation units.  It is not enabled by
7106 default at any optimization level.
7107
7108 @item -fipa-profile
7109 @opindex fipa-profile
7110 Perform interprocedural profile propagation.  The functions called only from
7111 cold functions are marked as cold. Also functions executed once (such as
7112 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7113 functions and loop less parts of functions executed once are then optimized for
7114 size.
7115 Enabled by default at @option{-O} and higher.
7116
7117 @item -fipa-cp
7118 @opindex fipa-cp
7119 Perform interprocedural constant propagation.
7120 This optimization analyzes the program to determine when values passed
7121 to functions are constants and then optimizes accordingly.
7122 This optimization can substantially increase performance
7123 if the application has constants passed to functions.
7124 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7125
7126 @item -fipa-cp-clone
7127 @opindex fipa-cp-clone
7128 Perform function cloning to make interprocedural constant propagation stronger.
7129 When enabled, interprocedural constant propagation performs function cloning
7130 when externally visible function can be called with constant arguments.
7131 Because this optimization can create multiple copies of functions,
7132 it may significantly increase code size
7133 (see @option{--param ipcp-unit-growth=@var{value}}).
7134 This flag is enabled by default at @option{-O3}.
7135
7136 @item -fipa-matrix-reorg
7137 @opindex fipa-matrix-reorg
7138 Perform matrix flattening and transposing.
7139 Matrix flattening tries to replace an @math{m}-dimensional matrix
7140 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
7141 This reduces the level of indirection needed for accessing the elements
7142 of the matrix. The second optimization is matrix transposing, which
7143 attempts to change the order of the matrix's dimensions in order to
7144 improve cache locality.
7145 Both optimizations need the @option{-fwhole-program} flag.
7146 Transposing is enabled only if profiling information is available.
7147
7148 @item -ftree-sink
7149 @opindex ftree-sink
7150 Perform forward store motion  on trees.  This flag is
7151 enabled by default at @option{-O} and higher.
7152
7153 @item -ftree-bit-ccp
7154 @opindex ftree-bit-ccp
7155 Perform sparse conditional bit constant propagation on trees and propagate
7156 pointer alignment information.
7157 This pass only operates on local scalar variables and is enabled by default
7158 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7159
7160 @item -ftree-ccp
7161 @opindex ftree-ccp
7162 Perform sparse conditional constant propagation (CCP) on trees.  This
7163 pass only operates on local scalar variables and is enabled by default
7164 at @option{-O} and higher.
7165
7166 @item -ftree-switch-conversion
7167 Perform conversion of simple initializations in a switch to
7168 initializations from a scalar array.  This flag is enabled by default
7169 at @option{-O2} and higher.
7170
7171 @item -ftree-tail-merge
7172 Look for identical code sequences.  When found, replace one with a jump to the
7173 other.  This optimization is known as tail merging or cross jumping.  This flag
7174 is enabled by default at @option{-O2} and higher.  The compilation time
7175 in this pass can
7176 be limited using @option{max-tail-merge-comparisons} parameter and
7177 @option{max-tail-merge-iterations} parameter.
7178
7179 @item -ftree-dce
7180 @opindex ftree-dce
7181 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7182 default at @option{-O} and higher.
7183
7184 @item -ftree-builtin-call-dce
7185 @opindex ftree-builtin-call-dce
7186 Perform conditional dead code elimination (DCE) for calls to builtin functions
7187 that may set @code{errno} but are otherwise side-effect free.  This flag is
7188 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7189 specified.
7190
7191 @item -ftree-dominator-opts
7192 @opindex ftree-dominator-opts
7193 Perform a variety of simple scalar cleanups (constant/copy
7194 propagation, redundancy elimination, range propagation and expression
7195 simplification) based on a dominator tree traversal.  This also
7196 performs jump threading (to reduce jumps to jumps). This flag is
7197 enabled by default at @option{-O} and higher.
7198
7199 @item -ftree-dse
7200 @opindex ftree-dse
7201 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7202 a memory location that is later overwritten by another store without
7203 any intervening loads.  In this case the earlier store can be deleted.  This
7204 flag is enabled by default at @option{-O} and higher.
7205
7206 @item -ftree-ch
7207 @opindex ftree-ch
7208 Perform loop header copying on trees.  This is beneficial since it increases
7209 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7210 is enabled by default at @option{-O} and higher.  It is not enabled
7211 for @option{-Os}, since it usually increases code size.
7212
7213 @item -ftree-loop-optimize
7214 @opindex ftree-loop-optimize
7215 Perform loop optimizations on trees.  This flag is enabled by default
7216 at @option{-O} and higher.
7217
7218 @item -ftree-loop-linear
7219 @opindex ftree-loop-linear
7220 Perform loop interchange transformations on tree.  Same as
7221 @option{-floop-interchange}.  To use this code transformation, GCC has
7222 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7223 enable the Graphite loop transformation infrastructure.
7224
7225 @item -floop-interchange
7226 @opindex floop-interchange
7227 Perform loop interchange transformations on loops.  Interchanging two
7228 nested loops switches the inner and outer loops.  For example, given a
7229 loop like:
7230 @smallexample
7231 DO J = 1, M
7232   DO I = 1, N
7233     A(J, I) = A(J, I) * C
7234   ENDDO
7235 ENDDO
7236 @end smallexample
7237 loop interchange transforms the loop as if it were written:
7238 @smallexample
7239 DO I = 1, N
7240   DO J = 1, M
7241     A(J, I) = A(J, I) * C
7242   ENDDO
7243 ENDDO
7244 @end smallexample
7245 which can be beneficial when @code{N} is larger than the caches,
7246 because in Fortran, the elements of an array are stored in memory
7247 contiguously by column, and the original loop iterates over rows,
7248 potentially creating at each access a cache miss.  This optimization
7249 applies to all the languages supported by GCC and is not limited to
7250 Fortran.  To use this code transformation, GCC has to be configured
7251 with @option{--with-ppl} and @option{--with-cloog} to enable the
7252 Graphite loop transformation infrastructure.
7253
7254 @item -floop-strip-mine
7255 @opindex floop-strip-mine
7256 Perform loop strip mining transformations on loops.  Strip mining
7257 splits a loop into two nested loops.  The outer loop has strides
7258 equal to the strip size and the inner loop has strides of the
7259 original loop within a strip.  The strip length can be changed
7260 using the @option{loop-block-tile-size} parameter.  For example,
7261 given a loop like:
7262 @smallexample
7263 DO I = 1, N
7264   A(I) = A(I) + C
7265 ENDDO
7266 @end smallexample
7267 loop strip mining transforms the loop as if it were written:
7268 @smallexample
7269 DO II = 1, N, 51
7270   DO I = II, min (II + 50, N)
7271     A(I) = A(I) + C
7272   ENDDO
7273 ENDDO
7274 @end smallexample
7275 This optimization applies to all the languages supported by GCC and is
7276 not limited to Fortran.  To use this code transformation, GCC has to
7277 be configured with @option{--with-ppl} and @option{--with-cloog} to
7278 enable the Graphite loop transformation infrastructure.
7279
7280 @item -floop-block
7281 @opindex floop-block
7282 Perform loop blocking transformations on loops.  Blocking strip mines
7283 each loop in the loop nest such that the memory accesses of the
7284 element loops fit inside caches.  The strip length can be changed
7285 using the @option{loop-block-tile-size} parameter.  For example, given
7286 a loop like:
7287 @smallexample
7288 DO I = 1, N
7289   DO J = 1, M
7290     A(J, I) = B(I) + C(J)
7291   ENDDO
7292 ENDDO
7293 @end smallexample
7294 loop blocking transforms the loop as if it were written:
7295 @smallexample
7296 DO II = 1, N, 51
7297   DO JJ = 1, M, 51
7298     DO I = II, min (II + 50, N)
7299       DO J = JJ, min (JJ + 50, M)
7300         A(J, I) = B(I) + C(J)
7301       ENDDO
7302     ENDDO
7303   ENDDO
7304 ENDDO
7305 @end smallexample
7306 which can be beneficial when @code{M} is larger than the caches,
7307 because the innermost loop iterates over a smaller amount of data
7308 which can be kept in the caches.  This optimization applies to all the
7309 languages supported by GCC and is not limited to Fortran.  To use this
7310 code transformation, GCC has to be configured with @option{--with-ppl}
7311 and @option{--with-cloog} to enable the Graphite loop transformation
7312 infrastructure.
7313
7314 @item -fgraphite-identity
7315 @opindex fgraphite-identity
7316 Enable the identity transformation for graphite.  For every SCoP we generate
7317 the polyhedral representation and transform it back to gimple.  Using
7318 @option{-fgraphite-identity} we can check the costs or benefits of the
7319 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7320 are also performed by the code generator CLooG, like index splitting and
7321 dead code elimination in loops.
7322
7323 @item -floop-parallelize-all
7324 @opindex floop-parallelize-all
7325 Use the Graphite data dependence analysis to identify loops that can
7326 be parallelized.  Parallelize all the loops that can be analyzed to
7327 not contain loop carried dependences without checking that it is
7328 profitable to parallelize the loops.
7329
7330 @item -fcheck-data-deps
7331 @opindex fcheck-data-deps
7332 Compare the results of several data dependence analyzers.  This option
7333 is used for debugging the data dependence analyzers.
7334
7335 @item -ftree-loop-if-convert
7336 Attempt to transform conditional jumps in the innermost loops to
7337 branch-less equivalents.  The intent is to remove control-flow from
7338 the innermost loops in order to improve the ability of the
7339 vectorization pass to handle these loops.  This is enabled by default
7340 if vectorization is enabled.
7341
7342 @item -ftree-loop-if-convert-stores
7343 Attempt to also if-convert conditional jumps containing memory writes.
7344 This transformation can be unsafe for multi-threaded programs as it
7345 transforms conditional memory writes into unconditional memory writes.
7346 For example,
7347 @smallexample
7348 for (i = 0; i < N; i++)
7349   if (cond)
7350     A[i] = expr;
7351 @end smallexample
7352 is transformed to
7353 @smallexample
7354 for (i = 0; i < N; i++)
7355   A[i] = cond ? expr : A[i];
7356 @end smallexample
7357 potentially producing data races.
7358
7359 @item -ftree-loop-distribution
7360 Perform loop distribution.  This flag can improve cache performance on
7361 big loop bodies and allow further loop optimizations, like
7362 parallelization or vectorization, to take place.  For example, the loop
7363 @smallexample
7364 DO I = 1, N
7365   A(I) = B(I) + C
7366   D(I) = E(I) * F
7367 ENDDO
7368 @end smallexample
7369 is transformed to
7370 @smallexample
7371 DO I = 1, N
7372    A(I) = B(I) + C
7373 ENDDO
7374 DO I = 1, N
7375    D(I) = E(I) * F
7376 ENDDO
7377 @end smallexample
7378
7379 @item -ftree-loop-distribute-patterns
7380 Perform loop distribution of patterns that can be code generated with
7381 calls to a library.  This flag is enabled by default at @option{-O3}.
7382
7383 This pass distributes the initialization loops and generates a call to
7384 memset zero.  For example, the loop
7385 @smallexample
7386 DO I = 1, N
7387   A(I) = 0
7388   B(I) = A(I) + I
7389 ENDDO
7390 @end smallexample
7391 is transformed to
7392 @smallexample
7393 DO I = 1, N
7394    A(I) = 0
7395 ENDDO
7396 DO I = 1, N
7397    B(I) = A(I) + I
7398 ENDDO
7399 @end smallexample
7400 and the initialization loop is transformed into a call to memset zero.
7401
7402 @item -ftree-loop-im
7403 @opindex ftree-loop-im
7404 Perform loop invariant motion on trees.  This pass moves only invariants that
7405 are hard to handle at RTL level (function calls, operations that expand to
7406 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7407 operands of conditions that are invariant out of the loop, so that we can use
7408 just trivial invariantness analysis in loop unswitching.  The pass also includes
7409 store motion.
7410
7411 @item -ftree-loop-ivcanon
7412 @opindex ftree-loop-ivcanon
7413 Create a canonical counter for number of iterations in loops for which
7414 determining number of iterations requires complicated analysis.  Later
7415 optimizations then may determine the number easily.  Useful especially
7416 in connection with unrolling.
7417
7418 @item -fivopts
7419 @opindex fivopts
7420 Perform induction variable optimizations (strength reduction, induction
7421 variable merging and induction variable elimination) on trees.
7422
7423 @item -ftree-parallelize-loops=n
7424 @opindex ftree-parallelize-loops
7425 Parallelize loops, i.e., split their iteration space to run in n threads.
7426 This is only possible for loops whose iterations are independent
7427 and can be arbitrarily reordered.  The optimization is only
7428 profitable on multiprocessor machines, for loops that are CPU-intensive,
7429 rather than constrained e.g.@: by memory bandwidth.  This option
7430 implies @option{-pthread}, and thus is only supported on targets
7431 that have support for @option{-pthread}.
7432
7433 @item -ftree-pta
7434 @opindex ftree-pta
7435 Perform function-local points-to analysis on trees.  This flag is
7436 enabled by default at @option{-O} and higher.
7437
7438 @item -ftree-sra
7439 @opindex ftree-sra
7440 Perform scalar replacement of aggregates.  This pass replaces structure
7441 references with scalars to prevent committing structures to memory too
7442 early.  This flag is enabled by default at @option{-O} and higher.
7443
7444 @item -ftree-copyrename
7445 @opindex ftree-copyrename
7446 Perform copy renaming on trees.  This pass attempts to rename compiler
7447 temporaries to other variables at copy locations, usually resulting in
7448 variable names which more closely resemble the original variables.  This flag
7449 is enabled by default at @option{-O} and higher.
7450
7451 @item -ftree-ter
7452 @opindex ftree-ter
7453 Perform temporary expression replacement during the SSA->normal phase.  Single
7454 use/single def temporaries are replaced at their use location with their
7455 defining expression.  This results in non-GIMPLE code, but gives the expanders
7456 much more complex trees to work on resulting in better RTL generation.  This is
7457 enabled by default at @option{-O} and higher.
7458
7459 @item -ftree-vectorize
7460 @opindex ftree-vectorize
7461 Perform loop vectorization on trees. This flag is enabled by default at
7462 @option{-O3}.
7463
7464 @item -ftree-slp-vectorize
7465 @opindex ftree-slp-vectorize
7466 Perform basic block vectorization on trees. This flag is enabled by default at
7467 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7468
7469 @item -ftree-vect-loop-version
7470 @opindex ftree-vect-loop-version
7471 Perform loop versioning when doing loop vectorization on trees.  When a loop
7472 appears to be vectorizable except that data alignment or data dependence cannot
7473 be determined at compile time, then vectorized and non-vectorized versions of
7474 the loop are generated along with run-time checks for alignment or dependence
7475 to control which version is executed.  This option is enabled by default
7476 except at level @option{-Os} where it is disabled.
7477
7478 @item -fvect-cost-model
7479 @opindex fvect-cost-model
7480 Enable cost model for vectorization.
7481
7482 @item -ftree-vrp
7483 @opindex ftree-vrp
7484 Perform Value Range Propagation on trees.  This is similar to the
7485 constant propagation pass, but instead of values, ranges of values are
7486 propagated.  This allows the optimizers to remove unnecessary range
7487 checks like array bound checks and null pointer checks.  This is
7488 enabled by default at @option{-O2} and higher.  Null pointer check
7489 elimination is only done if @option{-fdelete-null-pointer-checks} is
7490 enabled.
7491
7492 @item -ftracer
7493 @opindex ftracer
7494 Perform tail duplication to enlarge superblock size.  This transformation
7495 simplifies the control flow of the function allowing other optimizations to do
7496 better job.
7497
7498 @item -funroll-loops
7499 @opindex funroll-loops
7500 Unroll loops whose number of iterations can be determined at compile
7501 time or upon entry to the loop.  @option{-funroll-loops} implies
7502 @option{-frerun-cse-after-loop}.  This option makes code larger,
7503 and may or may not make it run faster.
7504
7505 @item -funroll-all-loops
7506 @opindex funroll-all-loops
7507 Unroll all loops, even if their number of iterations is uncertain when
7508 the loop is entered.  This usually makes programs run more slowly.
7509 @option{-funroll-all-loops} implies the same options as
7510 @option{-funroll-loops},
7511
7512 @item -fsplit-ivs-in-unroller
7513 @opindex fsplit-ivs-in-unroller
7514 Enables expressing of values of induction variables in later iterations
7515 of the unrolled loop using the value in the first iteration.  This breaks
7516 long dependency chains, thus improving efficiency of the scheduling passes.
7517
7518 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7519 same effect.  However in cases the loop body is more complicated than
7520 a single basic block, this is not reliable.  It also does not work at all
7521 on some of the architectures due to restrictions in the CSE pass.
7522
7523 This optimization is enabled by default.
7524
7525 @item -fvariable-expansion-in-unroller
7526 @opindex fvariable-expansion-in-unroller
7527 With this option, the compiler creates multiple copies of some
7528 local variables when unrolling a loop, which can result in superior code.
7529
7530 @item -fpartial-inlining
7531 @opindex fpartial-inlining
7532 Inline parts of functions.  This option has any effect only
7533 when inlining itself is turned on by the @option{-finline-functions}
7534 or @option{-finline-small-functions} options.
7535
7536 Enabled at level @option{-O2}.
7537
7538 @item -fpredictive-commoning
7539 @opindex fpredictive-commoning
7540 Perform predictive commoning optimization, i.e., reusing computations
7541 (especially memory loads and stores) performed in previous
7542 iterations of loops.
7543
7544 This option is enabled at level @option{-O3}.
7545
7546 @item -fprefetch-loop-arrays
7547 @opindex fprefetch-loop-arrays
7548 If supported by the target machine, generate instructions to prefetch
7549 memory to improve the performance of loops that access large arrays.
7550
7551 This option may generate better or worse code; results are highly
7552 dependent on the structure of loops within the source code.
7553
7554 Disabled at level @option{-Os}.
7555
7556 @item -fno-peephole
7557 @itemx -fno-peephole2
7558 @opindex fno-peephole
7559 @opindex fno-peephole2
7560 Disable any machine-specific peephole optimizations.  The difference
7561 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7562 are implemented in the compiler; some targets use one, some use the
7563 other, a few use both.
7564
7565 @option{-fpeephole} is enabled by default.
7566 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7567
7568 @item -fno-guess-branch-probability
7569 @opindex fno-guess-branch-probability
7570 Do not guess branch probabilities using heuristics.
7571
7572 GCC uses heuristics to guess branch probabilities if they are
7573 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7574 heuristics are based on the control flow graph.  If some branch probabilities
7575 are specified by @samp{__builtin_expect}, then the heuristics are
7576 used to guess branch probabilities for the rest of the control flow graph,
7577 taking the @samp{__builtin_expect} info into account.  The interactions
7578 between the heuristics and @samp{__builtin_expect} can be complex, and in
7579 some cases, it may be useful to disable the heuristics so that the effects
7580 of @samp{__builtin_expect} are easier to understand.
7581
7582 The default is @option{-fguess-branch-probability} at levels
7583 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7584
7585 @item -freorder-blocks
7586 @opindex freorder-blocks
7587 Reorder basic blocks in the compiled function in order to reduce number of
7588 taken branches and improve code locality.
7589
7590 Enabled at levels @option{-O2}, @option{-O3}.
7591
7592 @item -freorder-blocks-and-partition
7593 @opindex freorder-blocks-and-partition
7594 In addition to reordering basic blocks in the compiled function, in order
7595 to reduce number of taken branches, partitions hot and cold basic blocks
7596 into separate sections of the assembly and .o files, to improve
7597 paging and cache locality performance.
7598
7599 This optimization is automatically turned off in the presence of
7600 exception handling, for linkonce sections, for functions with a user-defined
7601 section attribute and on any architecture that does not support named
7602 sections.
7603
7604 @item -freorder-functions
7605 @opindex freorder-functions
7606 Reorder functions in the object file in order to
7607 improve code locality.  This is implemented by using special
7608 subsections @code{.text.hot} for most frequently executed functions and
7609 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7610 the linker so object file format must support named sections and linker must
7611 place them in a reasonable way.
7612
7613 Also profile feedback must be available in to make this option effective.  See
7614 @option{-fprofile-arcs} for details.
7615
7616 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7617
7618 @item -fstrict-aliasing
7619 @opindex fstrict-aliasing
7620 Allow the compiler to assume the strictest aliasing rules applicable to
7621 the language being compiled.  For C (and C++), this activates
7622 optimizations based on the type of expressions.  In particular, an
7623 object of one type is assumed never to reside at the same address as an
7624 object of a different type, unless the types are almost the same.  For
7625 example, an @code{unsigned int} can alias an @code{int}, but not a
7626 @code{void*} or a @code{double}.  A character type may alias any other
7627 type.
7628
7629 @anchor{Type-punning}Pay special attention to code like this:
7630 @smallexample
7631 union a_union @{
7632   int i;
7633   double d;
7634 @};
7635
7636 int f() @{
7637   union a_union t;
7638   t.d = 3.0;
7639   return t.i;
7640 @}
7641 @end smallexample
7642 The practice of reading from a different union member than the one most
7643 recently written to (called ``type-punning'') is common.  Even with
7644 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7645 is accessed through the union type.  So, the code above works as
7646 expected.  @xref{Structures unions enumerations and bit-fields
7647 implementation}.  However, this code might not:
7648 @smallexample
7649 int f() @{
7650   union a_union t;
7651   int* ip;
7652   t.d = 3.0;
7653   ip = &t.i;
7654   return *ip;
7655 @}
7656 @end smallexample
7657
7658 Similarly, access by taking the address, casting the resulting pointer
7659 and dereferencing the result has undefined behavior, even if the cast
7660 uses a union type, e.g.:
7661 @smallexample
7662 int f() @{
7663   double d = 3.0;
7664   return ((union a_union *) &d)->i;
7665 @}
7666 @end smallexample
7667
7668 The @option{-fstrict-aliasing} option is enabled at levels
7669 @option{-O2}, @option{-O3}, @option{-Os}.
7670
7671 @item -fstrict-overflow
7672 @opindex fstrict-overflow
7673 Allow the compiler to assume strict signed overflow rules, depending
7674 on the language being compiled.  For C (and C++) this means that
7675 overflow when doing arithmetic with signed numbers is undefined, which
7676 means that the compiler may assume that it does not happen.  This
7677 permits various optimizations.  For example, the compiler assumes
7678 that an expression like @code{i + 10 > i} is always true for
7679 signed @code{i}.  This assumption is only valid if signed overflow is
7680 undefined, as the expression is false if @code{i + 10} overflows when
7681 using twos complement arithmetic.  When this option is in effect any
7682 attempt to determine whether an operation on signed numbers 
7683 overflows must be written carefully to not actually involve overflow.
7684
7685 This option also allows the compiler to assume strict pointer
7686 semantics: given a pointer to an object, if adding an offset to that
7687 pointer does not produce a pointer to the same object, the addition is
7688 undefined.  This permits the compiler to conclude that @code{p + u >
7689 p} is always true for a pointer @code{p} and unsigned integer
7690 @code{u}.  This assumption is only valid because pointer wraparound is
7691 undefined, as the expression is false if @code{p + u} overflows using
7692 twos complement arithmetic.
7693
7694 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7695 that integer signed overflow is fully defined: it wraps.  When
7696 @option{-fwrapv} is used, there is no difference between
7697 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7698 integers.  With @option{-fwrapv} certain types of overflow are
7699 permitted.  For example, if the compiler gets an overflow when doing
7700 arithmetic on constants, the overflowed value can still be used with
7701 @option{-fwrapv}, but not otherwise.
7702
7703 The @option{-fstrict-overflow} option is enabled at levels
7704 @option{-O2}, @option{-O3}, @option{-Os}.
7705
7706 @item -falign-functions
7707 @itemx -falign-functions=@var{n}
7708 @opindex falign-functions
7709 Align the start of functions to the next power-of-two greater than
7710 @var{n}, skipping up to @var{n} bytes.  For instance,
7711 @option{-falign-functions=32} aligns functions to the next 32-byte
7712 boundary, but @option{-falign-functions=24} aligns to the next
7713 32-byte boundary only if this can be done by skipping 23 bytes or less.
7714
7715 @option{-fno-align-functions} and @option{-falign-functions=1} are
7716 equivalent and mean that functions are not aligned.
7717
7718 Some assemblers only support this flag when @var{n} is a power of two;
7719 in that case, it is rounded up.
7720
7721 If @var{n} is not specified or is zero, use a machine-dependent default.
7722
7723 Enabled at levels @option{-O2}, @option{-O3}.
7724
7725 @item -falign-labels
7726 @itemx -falign-labels=@var{n}
7727 @opindex falign-labels
7728 Align all branch targets to a power-of-two boundary, skipping up to
7729 @var{n} bytes like @option{-falign-functions}.  This option can easily
7730 make code slower, because it must insert dummy operations for when the
7731 branch target is reached in the usual flow of the code.
7732
7733 @option{-fno-align-labels} and @option{-falign-labels=1} are
7734 equivalent and mean that labels are not aligned.
7735
7736 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7737 are greater than this value, then their values are used instead.
7738
7739 If @var{n} is not specified or is zero, use a machine-dependent default
7740 which is very likely to be @samp{1}, meaning no alignment.
7741
7742 Enabled at levels @option{-O2}, @option{-O3}.
7743
7744 @item -falign-loops
7745 @itemx -falign-loops=@var{n}
7746 @opindex falign-loops
7747 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7748 like @option{-falign-functions}.  If the loops are
7749 executed many times, this makes up for any execution of the dummy
7750 operations.
7751
7752 @option{-fno-align-loops} and @option{-falign-loops=1} are
7753 equivalent and mean that loops are not aligned.
7754
7755 If @var{n} is not specified or is zero, use a machine-dependent default.
7756
7757 Enabled at levels @option{-O2}, @option{-O3}.
7758
7759 @item -falign-jumps
7760 @itemx -falign-jumps=@var{n}
7761 @opindex falign-jumps
7762 Align branch targets to a power-of-two boundary, for branch targets
7763 where the targets can only be reached by jumping, skipping up to @var{n}
7764 bytes like @option{-falign-functions}.  In this case, no dummy operations
7765 need be executed.
7766
7767 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7768 equivalent and mean that loops are not aligned.
7769
7770 If @var{n} is not specified or is zero, use a machine-dependent default.
7771
7772 Enabled at levels @option{-O2}, @option{-O3}.
7773
7774 @item -funit-at-a-time
7775 @opindex funit-at-a-time
7776 This option is left for compatibility reasons. @option{-funit-at-a-time}
7777 has no effect, while @option{-fno-unit-at-a-time} implies
7778 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7779
7780 Enabled by default.
7781
7782 @item -fno-toplevel-reorder
7783 @opindex fno-toplevel-reorder
7784 Do not reorder top-level functions, variables, and @code{asm}
7785 statements.  Output them in the same order that they appear in the
7786 input file.  When this option is used, unreferenced static variables
7787 are not removed.  This option is intended to support existing code
7788 that relies on a particular ordering.  For new code, it is better to
7789 use attributes.
7790
7791 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
7792 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
7793 targets.
7794
7795 @item -fweb
7796 @opindex fweb
7797 Constructs webs as commonly used for register allocation purposes and assign
7798 each web individual pseudo register.  This allows the register allocation pass
7799 to operate on pseudos directly, but also strengthens several other optimization
7800 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7801 however, make debugging impossible, since variables no longer stay in a
7802 ``home register''.
7803
7804 Enabled by default with @option{-funroll-loops}.
7805
7806 @item -fwhole-program
7807 @opindex fwhole-program
7808 Assume that the current compilation unit represents the whole program being
7809 compiled.  All public functions and variables with the exception of @code{main}
7810 and those merged by attribute @code{externally_visible} become static functions
7811 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.
7812 While this option is equivalent to proper use of the @code{static} keyword for
7813 programs consisting of a single file, in combination with option
7814 @option{-flto} this flag can be used to
7815 compile many smaller scale programs since the functions and variables become
7816 local for the whole combined compilation unit, not for the single source file
7817 itself.
7818
7819 This option implies @option{-fwhole-file} for Fortran programs.
7820
7821 @item -flto[=@var{n}]
7822 @opindex flto
7823 This option runs the standard link-time optimizer.  When invoked
7824 with source code, it generates GIMPLE (one of GCC's internal
7825 representations) and writes it to special ELF sections in the object
7826 file.  When the object files are linked together, all the function
7827 bodies are read from these ELF sections and instantiated as if they
7828 had been part of the same translation unit.
7829
7830 To use the link-time optimizer, @option{-flto} needs to be specified at
7831 compile time and during the final link.  For example:
7832
7833 @smallexample
7834 gcc -c -O2 -flto foo.c
7835 gcc -c -O2 -flto bar.c
7836 gcc -o myprog -flto -O2 foo.o bar.o
7837 @end smallexample
7838
7839 The first two invocations to GCC save a bytecode representation
7840 of GIMPLE into special ELF sections inside @file{foo.o} and
7841 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
7842 @file{foo.o} and @file{bar.o}, merges the two files into a single
7843 internal image, and compiles the result as usual.  Since both
7844 @file{foo.o} and @file{bar.o} are merged into a single image, this
7845 causes all the interprocedural analyses and optimizations in GCC to
7846 work across the two files as if they were a single one.  This means,
7847 for example, that the inliner is able to inline functions in
7848 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7849
7850 Another (simpler) way to enable link-time optimization is:
7851
7852 @smallexample
7853 gcc -o myprog -flto -O2 foo.c bar.c
7854 @end smallexample
7855
7856 The above generates bytecode for @file{foo.c} and @file{bar.c},
7857 merges them together into a single GIMPLE representation and optimizes
7858 them as usual to produce @file{myprog}.
7859
7860 The only important thing to keep in mind is that to enable link-time
7861 optimizations the @option{-flto} flag needs to be passed to both the
7862 compile and the link commands.
7863
7864 To make whole program optimization effective, it is necessary to make
7865 certain whole program assumptions.  The compiler needs to know
7866 what functions and variables can be accessed by libraries and runtime
7867 outside of the link-time optimized unit.  When supported by the linker,
7868 the linker plugin (see @option{-fuse-linker-plugin}) passes information
7869 to the compiler about used and externally visible symbols.  When
7870 the linker plugin is not available, @option{-fwhole-program} should be
7871 used to allow the compiler to make these assumptions, which leads
7872 to more aggressive optimization decisions.
7873
7874 Note that when a file is compiled with @option{-flto}, the generated
7875 object file is larger than a regular object file because it 
7876 contains GIMPLE bytecodes and the usual final code.  This means that
7877 object files with LTO information can be linked as normal object
7878 files; if @option{-flto} is not passed to the linker, no
7879 interprocedural optimizations are applied.
7880
7881 Additionally, the optimization flags used to compile individual files
7882 are not necessarily related to those used at link time.  For instance,
7883
7884 @smallexample
7885 gcc -c -O0 -flto foo.c
7886 gcc -c -O0 -flto bar.c
7887 gcc -o myprog -flto -O3 foo.o bar.o
7888 @end smallexample
7889
7890 This produces individual object files with unoptimized assembler
7891 code, but the resulting binary @file{myprog} is optimized at
7892 @option{-O3}.  If, instead, the final binary is generated without
7893 @option{-flto}, then @file{myprog} is not optimized.
7894
7895 When producing the final binary with @option{-flto}, GCC only
7896 applies link-time optimizations to those files that contain bytecode.
7897 Therefore, you can mix and match object files and libraries with
7898 GIMPLE bytecodes and final object code.  GCC automatically selects
7899 which files to optimize in LTO mode and which files to link without
7900 further processing.
7901
7902 There are some code generation flags preserved by GCC when
7903 generating bytecodes, as they need to be used during the final link
7904 stage.  Currently, the following options are saved into the GIMPLE
7905 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7906 @option{-m} target flags.
7907
7908 At link time, these options are read in and reapplied.  Note that the
7909 current implementation makes no attempt to recognize conflicting
7910 values for these options.  If different files have conflicting option
7911 values (e.g., one file is compiled with @option{-fPIC} and another
7912 isn't), the compiler simply uses the last value read from the
7913 bytecode files.  It is recommended, then, that you compile all the files
7914 participating in the same link with the same options.
7915
7916 If LTO encounters objects with C linkage declared with incompatible
7917 types in separate translation units to be linked together (undefined
7918 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7919 issued.  The behavior is still undefined at run time.
7920
7921 Another feature of LTO is that it is possible to apply interprocedural
7922 optimizations on files written in different languages.  This requires
7923 support in the language front end.  Currently, the C, C++ and
7924 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7925 something like this should work:
7926
7927 @smallexample
7928 gcc -c -flto foo.c
7929 g++ -c -flto bar.cc
7930 gfortran -c -flto baz.f90
7931 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7932 @end smallexample
7933
7934 Notice that the final link is done with @command{g++} to get the C++
7935 runtime libraries and @option{-lgfortran} is added to get the Fortran
7936 runtime libraries.  In general, when mixing languages in LTO mode, you
7937 should use the same link command options as when mixing languages in a
7938 regular (non-LTO) compilation; all you need to add is @option{-flto} to
7939 all the compile and link commands.
7940
7941 If object files containing GIMPLE bytecode are stored in a library archive, say
7942 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7943 are using a linker with plugin support.  To enable this feature, use
7944 the flag @option{-fuse-linker-plugin} at link time:
7945
7946 @smallexample
7947 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7948 @end smallexample
7949
7950 With the linker plugin enabled, the linker extracts the needed
7951 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
7952 to make them part of the aggregated GIMPLE image to be optimized.
7953
7954 If you are not using a linker with plugin support and/or do not
7955 enable the linker plugin, then the objects inside @file{libfoo.a}
7956 are extracted and linked as usual, but they do not participate
7957 in the LTO optimization process.
7958
7959 Link-time optimizations do not require the presence of the whole program to
7960 operate.  If the program does not require any symbols to be exported, it is
7961 possible to combine @option{-flto} and @option{-fwhole-program} to allow
7962 the interprocedural optimizers to use more aggressive assumptions which may
7963 lead to improved optimization opportunities.
7964 Use of @option{-fwhole-program} is not needed when linker plugin is
7965 active (see @option{-fuse-linker-plugin}).
7966
7967 The current implementation of LTO makes no
7968 attempt to generate bytecode that is portable between different
7969 types of hosts.  The bytecode files are versioned and there is a
7970 strict version check, so bytecode files generated in one version of
7971 GCC will not work with an older/newer version of GCC@.
7972
7973 Link-time optimization does not work well with generation of debugging
7974 information.  Combining @option{-flto} with
7975 @option{-g} is currently experimental and expected to produce wrong
7976 results.
7977
7978 If you specify the optional @var{n}, the optimization and code
7979 generation done at link time is executed in parallel using @var{n}
7980 parallel jobs by utilizing an installed @command{make} program.  The
7981 environment variable @env{MAKE} may be used to override the program
7982 used.  The default value for @var{n} is 1.
7983
7984 You can also specify @option{-flto=jobserver} to use GNU make's
7985 job server mode to determine the number of parallel jobs. This
7986 is useful when the Makefile calling GCC is already executing in parallel.
7987 You must prepend a @samp{+} to the command recipe in the parent Makefile
7988 for this to work.  This option likely only works if @env{MAKE} is
7989 GNU make.
7990
7991 This option is disabled by default
7992
7993 @item -flto-partition=@var{alg}
7994 @opindex flto-partition
7995 Specify the partitioning algorithm used by the link-time optimizer.
7996 The value is either @code{1to1} to specify a partitioning mirroring
7997 the original source files or @code{balanced} to specify partitioning
7998 into equally sized chunks (whenever possible).  Specifying @code{none}
7999 as an algorithm disables partitioning and streaming completely. The
8000 default value is @code{balanced}.
8001
8002 @item -flto-compression-level=@var{n}
8003 This option specifies the level of compression used for intermediate
8004 language written to LTO object files, and is only meaningful in
8005 conjunction with LTO mode (@option{-flto}).  Valid
8006 values are 0 (no compression) to 9 (maximum compression).  Values
8007 outside this range are clamped to either 0 or 9.  If the option is not
8008 given, a default balanced compression setting is used.
8009
8010 @item -flto-report
8011 Prints a report with internal details on the workings of the link-time
8012 optimizer.  The contents of this report vary from version to version.
8013 It is meant to be useful to GCC developers when processing object
8014 files in LTO mode (via @option{-flto}).
8015
8016 Disabled by default.
8017
8018 @item -fuse-linker-plugin
8019 Enables the use of a linker plugin during link-time optimization.  This
8020 option relies on plugin support in the linker, which is available in gold
8021 or in GNU ld 2.21 or newer.
8022
8023 This option enables the extraction of object files with GIMPLE bytecode out
8024 of library archives. This improves the quality of optimization by exposing
8025 more code to the link-time optimizer.  This information specifies what
8026 symbols can be accessed externally (by non-LTO object or during dynamic
8027 linking).  Resulting code quality improvements on binaries (and shared
8028 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8029 See @option{-flto} for a description of the effect of this flag and how to
8030 use it.
8031
8032 This option is enabled by default when LTO support in GCC is enabled
8033 and GCC was configured for use with
8034 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8035
8036 @item -ffat-lto-objects
8037 @opindex ffat-lto-objects
8038 Fat LTO objects are object files that contain both the intermediate language
8039 and the object code. This makes them usable for both LTO linking and normal
8040 linking. This option is effective only when compiling with @option{-flto}
8041 and is ignored at link time.
8042
8043 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8044 requires the complete toolchain to be aware of LTO. It requires a linker with
8045 linker plugin support for basic functionality.  Additionally,
8046 @command{nm}, @command{ar} and @command{ranlib}
8047 need to support linker plugins to allow a full-featured build environment
8048 (capable of building static libraries etc).
8049
8050 The default is @option{-ffat-lto-objects} but this default is intended to
8051 change in future releases when linker plugin enabled environments become more
8052 common.
8053
8054 @item -fcompare-elim
8055 @opindex fcompare-elim
8056 After register allocation and post-register allocation instruction splitting,
8057 identify arithmetic instructions that compute processor flags similar to a
8058 comparison operation based on that arithmetic.  If possible, eliminate the
8059 explicit comparison operation.
8060
8061 This pass only applies to certain targets that cannot explicitly represent
8062 the comparison operation before register allocation is complete.
8063
8064 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8065
8066 @item -fcprop-registers
8067 @opindex fcprop-registers
8068 After register allocation and post-register allocation instruction splitting,
8069 we perform a copy-propagation pass to try to reduce scheduling dependencies
8070 and occasionally eliminate the copy.
8071
8072 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8073
8074 @item -fprofile-correction
8075 @opindex fprofile-correction
8076 Profiles collected using an instrumented binary for multi-threaded programs may
8077 be inconsistent due to missed counter updates. When this option is specified,
8078 GCC uses heuristics to correct or smooth out such inconsistencies. By
8079 default, GCC emits an error message when an inconsistent profile is detected.
8080
8081 @item -fprofile-dir=@var{path}
8082 @opindex fprofile-dir
8083
8084 Set the directory to search for the profile data files in to @var{path}.
8085 This option affects only the profile data generated by
8086 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8087 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8088 and its related options.  Both absolute and relative paths can be used.
8089 By default, GCC uses the current directory as @var{path}, thus the
8090 profile data file appears in the same directory as the object file.
8091
8092 @item -fprofile-generate
8093 @itemx -fprofile-generate=@var{path}
8094 @opindex fprofile-generate
8095
8096 Enable options usually used for instrumenting application to produce
8097 profile useful for later recompilation with profile feedback based
8098 optimization.  You must use @option{-fprofile-generate} both when
8099 compiling and when linking your program.
8100
8101 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8102
8103 If @var{path} is specified, GCC looks at the @var{path} to find
8104 the profile feedback data files. See @option{-fprofile-dir}.
8105
8106 @item -fprofile-use
8107 @itemx -fprofile-use=@var{path}
8108 @opindex fprofile-use
8109 Enable profile feedback directed optimizations, and optimizations
8110 generally profitable only with profile feedback available.
8111
8112 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8113 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
8114
8115 By default, GCC emits an error message if the feedback profiles do not
8116 match the source code.  This error can be turned into a warning by using
8117 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8118 code.
8119
8120 If @var{path} is specified, GCC looks at the @var{path} to find
8121 the profile feedback data files. See @option{-fprofile-dir}.
8122 @end table
8123
8124 The following options control compiler behavior regarding floating-point 
8125 arithmetic.  These options trade off between speed and
8126 correctness.  All must be specifically enabled.
8127
8128 @table @gcctabopt
8129 @item -ffloat-store
8130 @opindex ffloat-store
8131 Do not store floating-point variables in registers, and inhibit other
8132 options that might change whether a floating-point value is taken from a
8133 register or memory.
8134
8135 @cindex floating-point precision
8136 This option prevents undesirable excess precision on machines such as
8137 the 68000 where the floating registers (of the 68881) keep more
8138 precision than a @code{double} is supposed to have.  Similarly for the
8139 x86 architecture.  For most programs, the excess precision does only
8140 good, but a few programs rely on the precise definition of IEEE floating
8141 point.  Use @option{-ffloat-store} for such programs, after modifying
8142 them to store all pertinent intermediate computations into variables.
8143
8144 @item -fexcess-precision=@var{style}
8145 @opindex fexcess-precision
8146 This option allows further control over excess precision on machines
8147 where floating-point registers have more precision than the IEEE
8148 @code{float} and @code{double} types and the processor does not
8149 support operations rounding to those types.  By default,
8150 @option{-fexcess-precision=fast} is in effect; this means that
8151 operations are carried out in the precision of the registers and that
8152 it is unpredictable when rounding to the types specified in the source
8153 code takes place.  When compiling C, if
8154 @option{-fexcess-precision=standard} is specified then excess
8155 precision follows the rules specified in ISO C99; in particular,
8156 both casts and assignments cause values to be rounded to their
8157 semantic types (whereas @option{-ffloat-store} only affects
8158 assignments).  This option is enabled by default for C if a strict
8159 conformance option such as @option{-std=c99} is used.
8160
8161 @opindex mfpmath
8162 @option{-fexcess-precision=standard} is not implemented for languages
8163 other than C, and has no effect if
8164 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8165 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8166 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8167 semantics apply without excess precision, and in the latter, rounding
8168 is unpredictable.
8169
8170 @item -ffast-math
8171 @opindex ffast-math
8172 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8173 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8174 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8175
8176 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8177
8178 This option is not turned on by any @option{-O} option besides
8179 @option{-Ofast} since it can result in incorrect output for programs
8180 that depend on an exact implementation of IEEE or ISO rules/specifications
8181 for math functions. It may, however, yield faster code for programs
8182 that do not require the guarantees of these specifications.
8183
8184 @item -fno-math-errno
8185 @opindex fno-math-errno
8186 Do not set @code{errno} after calling math functions that are executed
8187 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8188 IEEE exceptions for math error handling may want to use this flag
8189 for speed while maintaining IEEE arithmetic compatibility.
8190
8191 This option is not turned on by any @option{-O} option since
8192 it can result in incorrect output for programs that depend on
8193 an exact implementation of IEEE or ISO rules/specifications for
8194 math functions. It may, however, yield faster code for programs
8195 that do not require the guarantees of these specifications.
8196
8197 The default is @option{-fmath-errno}.
8198
8199 On Darwin systems, the math library never sets @code{errno}.  There is
8200 therefore no reason for the compiler to consider the possibility that
8201 it might, and @option{-fno-math-errno} is the default.
8202
8203 @item -funsafe-math-optimizations
8204 @opindex funsafe-math-optimizations
8205
8206 Allow optimizations for floating-point arithmetic that (a) assume
8207 that arguments and results are valid and (b) may violate IEEE or
8208 ANSI standards.  When used at link-time, it may include libraries
8209 or startup files that change the default FPU control word or other
8210 similar optimizations.
8211
8212 This option is not turned on by any @option{-O} option since
8213 it can result in incorrect output for programs that depend on
8214 an exact implementation of IEEE or ISO rules/specifications for
8215 math functions. It may, however, yield faster code for programs
8216 that do not require the guarantees of these specifications.
8217 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8218 @option{-fassociative-math} and @option{-freciprocal-math}.
8219
8220 The default is @option{-fno-unsafe-math-optimizations}.
8221
8222 @item -fassociative-math
8223 @opindex fassociative-math
8224
8225 Allow re-association of operands in series of floating-point operations.
8226 This violates the ISO C and C++ language standard by possibly changing
8227 computation result.  NOTE: re-ordering may change the sign of zero as
8228 well as ignore NaNs and inhibit or create underflow or overflow (and
8229 thus cannot be used on code that relies on rounding behavior like
8230 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8231 and thus may not be used when ordered comparisons are required.
8232 This option requires that both @option{-fno-signed-zeros} and
8233 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8234 much sense with @option{-frounding-math}. For Fortran the option
8235 is automatically enabled when both @option{-fno-signed-zeros} and
8236 @option{-fno-trapping-math} are in effect.
8237
8238 The default is @option{-fno-associative-math}.
8239
8240 @item -freciprocal-math
8241 @opindex freciprocal-math
8242
8243 Allow the reciprocal of a value to be used instead of dividing by
8244 the value if this enables optimizations.  For example @code{x / y}
8245 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8246 is subject to common subexpression elimination.  Note that this loses
8247 precision and increases the number of flops operating on the value.
8248
8249 The default is @option{-fno-reciprocal-math}.
8250
8251 @item -ffinite-math-only
8252 @opindex ffinite-math-only
8253 Allow optimizations for floating-point arithmetic that assume
8254 that arguments and results are not NaNs or +-Infs.
8255
8256 This option is not turned on by any @option{-O} option since
8257 it can result in incorrect output for programs that depend on
8258 an exact implementation of IEEE or ISO rules/specifications for
8259 math functions. It may, however, yield faster code for programs
8260 that do not require the guarantees of these specifications.
8261
8262 The default is @option{-fno-finite-math-only}.
8263
8264 @item -fno-signed-zeros
8265 @opindex fno-signed-zeros
8266 Allow optimizations for floating-point arithmetic that ignore the
8267 signedness of zero.  IEEE arithmetic specifies the behavior of
8268 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8269 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8270 This option implies that the sign of a zero result isn't significant.
8271
8272 The default is @option{-fsigned-zeros}.
8273
8274 @item -fno-trapping-math
8275 @opindex fno-trapping-math
8276 Compile code assuming that floating-point operations cannot generate
8277 user-visible traps.  These traps include division by zero, overflow,
8278 underflow, inexact result and invalid operation.  This option requires
8279 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8280 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8281
8282 This option should never be turned on by any @option{-O} option since
8283 it can result in incorrect output for programs that depend on
8284 an exact implementation of IEEE or ISO rules/specifications for
8285 math functions.
8286
8287 The default is @option{-ftrapping-math}.
8288
8289 @item -frounding-math
8290 @opindex frounding-math
8291 Disable transformations and optimizations that assume default floating-point
8292 rounding behavior.  This is round-to-zero for all floating point
8293 to integer conversions, and round-to-nearest for all other arithmetic
8294 truncations.  This option should be specified for programs that change
8295 the FP rounding mode dynamically, or that may be executed with a
8296 non-default rounding mode.  This option disables constant folding of
8297 floating-point expressions at compile time (which may be affected by
8298 rounding mode) and arithmetic transformations that are unsafe in the
8299 presence of sign-dependent rounding modes.
8300
8301 The default is @option{-fno-rounding-math}.
8302
8303 This option is experimental and does not currently guarantee to
8304 disable all GCC optimizations that are affected by rounding mode.
8305 Future versions of GCC may provide finer control of this setting
8306 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8307 will be used to specify the default state for @code{FENV_ACCESS}.
8308
8309 @item -fsignaling-nans
8310 @opindex fsignaling-nans
8311 Compile code assuming that IEEE signaling NaNs may generate user-visible
8312 traps during floating-point operations.  Setting this option disables
8313 optimizations that may change the number of exceptions visible with
8314 signaling NaNs.  This option implies @option{-ftrapping-math}.
8315
8316 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8317 be defined.
8318
8319 The default is @option{-fno-signaling-nans}.
8320
8321 This option is experimental and does not currently guarantee to
8322 disable all GCC optimizations that affect signaling NaN behavior.
8323
8324 @item -fsingle-precision-constant
8325 @opindex fsingle-precision-constant
8326 Treat floating-point constants as single precision instead of
8327 implicitly converting them to double-precision constants.
8328
8329 @item -fcx-limited-range
8330 @opindex fcx-limited-range
8331 When enabled, this option states that a range reduction step is not
8332 needed when performing complex division.  Also, there is no checking
8333 whether the result of a complex multiplication or division is @code{NaN
8334 + I*NaN}, with an attempt to rescue the situation in that case.  The
8335 default is @option{-fno-cx-limited-range}, but is enabled by
8336 @option{-ffast-math}.
8337
8338 This option controls the default setting of the ISO C99
8339 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8340 all languages.
8341
8342 @item -fcx-fortran-rules
8343 @opindex fcx-fortran-rules
8344 Complex multiplication and division follow Fortran rules.  Range
8345 reduction is done as part of complex division, but there is no checking
8346 whether the result of a complex multiplication or division is @code{NaN
8347 + I*NaN}, with an attempt to rescue the situation in that case.
8348
8349 The default is @option{-fno-cx-fortran-rules}.
8350
8351 @end table
8352
8353 The following options control optimizations that may improve
8354 performance, but are not enabled by any @option{-O} options.  This
8355 section includes experimental options that may produce broken code.
8356
8357 @table @gcctabopt
8358 @item -fbranch-probabilities
8359 @opindex fbranch-probabilities
8360 After running a program compiled with @option{-fprofile-arcs}
8361 (@pxref{Debugging Options,, Options for Debugging Your Program or
8362 @command{gcc}}), you can compile it a second time using
8363 @option{-fbranch-probabilities}, to improve optimizations based on
8364 the number of times each branch was taken.  When the program
8365 compiled with @option{-fprofile-arcs} exits it saves arc execution
8366 counts to a file called @file{@var{sourcename}.gcda} for each source
8367 file.  The information in this data file is very dependent on the
8368 structure of the generated code, so you must use the same source code
8369 and the same optimization options for both compilations.
8370
8371 With @option{-fbranch-probabilities}, GCC puts a
8372 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8373 These can be used to improve optimization.  Currently, they are only
8374 used in one place: in @file{reorg.c}, instead of guessing which path a
8375 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8376 exactly determine which path is taken more often.
8377
8378 @item -fprofile-values
8379 @opindex fprofile-values
8380 If combined with @option{-fprofile-arcs}, it adds code so that some
8381 data about values of expressions in the program is gathered.
8382
8383 With @option{-fbranch-probabilities}, it reads back the data gathered
8384 from profiling values of expressions for usage in optimizations.
8385
8386 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8387
8388 @item -fvpt
8389 @opindex fvpt
8390 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8391 a code to gather information about values of expressions.
8392
8393 With @option{-fbranch-probabilities}, it reads back the data gathered
8394 and actually performs the optimizations based on them.
8395 Currently the optimizations include specialization of division operation
8396 using the knowledge about the value of the denominator.
8397
8398 @item -frename-registers
8399 @opindex frename-registers
8400 Attempt to avoid false dependencies in scheduled code by making use
8401 of registers left over after register allocation.  This optimization
8402 most benefits processors with lots of registers.  Depending on the
8403 debug information format adopted by the target, however, it can
8404 make debugging impossible, since variables no longer stay in
8405 a ``home register''.
8406
8407 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8408
8409 @item -ftracer
8410 @opindex ftracer
8411 Perform tail duplication to enlarge superblock size.  This transformation
8412 simplifies the control flow of the function allowing other optimizations to do
8413 better job.
8414
8415 Enabled with @option{-fprofile-use}.
8416
8417 @item -funroll-loops
8418 @opindex funroll-loops
8419 Unroll loops whose number of iterations can be determined at compile time or
8420 upon entry to the loop.  @option{-funroll-loops} implies
8421 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8422 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8423 small constant number of iterations).  This option makes code larger, and may
8424 or may not make it run faster.
8425
8426 Enabled with @option{-fprofile-use}.
8427
8428 @item -funroll-all-loops
8429 @opindex funroll-all-loops
8430 Unroll all loops, even if their number of iterations is uncertain when
8431 the loop is entered.  This usually makes programs run more slowly.
8432 @option{-funroll-all-loops} implies the same options as
8433 @option{-funroll-loops}.
8434
8435 @item -fpeel-loops
8436 @opindex fpeel-loops
8437 Peels loops for which there is enough information that they do not
8438 roll much (from profile feedback).  It also turns on complete loop peeling
8439 (i.e.@: complete removal of loops with small constant number of iterations).
8440
8441 Enabled with @option{-fprofile-use}.
8442
8443 @item -fmove-loop-invariants
8444 @opindex fmove-loop-invariants
8445 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8446 at level @option{-O1}
8447
8448 @item -funswitch-loops
8449 @opindex funswitch-loops
8450 Move branches with loop invariant conditions out of the loop, with duplicates
8451 of the loop on both branches (modified according to result of the condition).
8452
8453 @item -ffunction-sections
8454 @itemx -fdata-sections
8455 @opindex ffunction-sections
8456 @opindex fdata-sections
8457 Place each function or data item into its own section in the output
8458 file if the target supports arbitrary sections.  The name of the
8459 function or the name of the data item determines the section's name
8460 in the output file.
8461
8462 Use these options on systems where the linker can perform optimizations
8463 to improve locality of reference in the instruction space.  Most systems
8464 using the ELF object format and SPARC processors running Solaris 2 have
8465 linkers with such optimizations.  AIX may have these optimizations in
8466 the future.
8467
8468 Only use these options when there are significant benefits from doing
8469 so.  When you specify these options, the assembler and linker
8470 create larger object and executable files and are also slower.
8471 You cannot use @code{gprof} on all systems if you
8472 specify this option, and you may have problems with debugging if
8473 you specify both this option and @option{-g}.
8474
8475 @item -fbranch-target-load-optimize
8476 @opindex fbranch-target-load-optimize
8477 Perform branch target register load optimization before prologue / epilogue
8478 threading.
8479 The use of target registers can typically be exposed only during reload,
8480 thus hoisting loads out of loops and doing inter-block scheduling needs
8481 a separate optimization pass.
8482
8483 @item -fbranch-target-load-optimize2
8484 @opindex fbranch-target-load-optimize2
8485 Perform branch target register load optimization after prologue / epilogue
8486 threading.
8487
8488 @item -fbtr-bb-exclusive
8489 @opindex fbtr-bb-exclusive
8490 When performing branch target register load optimization, don't reuse
8491 branch target registers in within any basic block.
8492
8493 @item -fstack-protector
8494 @opindex fstack-protector
8495 Emit extra code to check for buffer overflows, such as stack smashing
8496 attacks.  This is done by adding a guard variable to functions with
8497 vulnerable objects.  This includes functions that call @code{alloca}, and
8498 functions with buffers larger than 8 bytes.  The guards are initialized
8499 when a function is entered and then checked when the function exits.
8500 If a guard check fails, an error message is printed and the program exits.
8501
8502 @item -fstack-protector-all
8503 @opindex fstack-protector-all
8504 Like @option{-fstack-protector} except that all functions are protected.
8505
8506 @item -fsection-anchors
8507 @opindex fsection-anchors
8508 Try to reduce the number of symbolic address calculations by using
8509 shared ``anchor'' symbols to address nearby objects.  This transformation
8510 can help to reduce the number of GOT entries and GOT accesses on some
8511 targets.
8512
8513 For example, the implementation of the following function @code{foo}:
8514
8515 @smallexample
8516 static int a, b, c;
8517 int foo (void) @{ return a + b + c; @}
8518 @end smallexample
8519
8520 @noindent
8521 usually calculates the addresses of all three variables, but if you
8522 compile it with @option{-fsection-anchors}, it accesses the variables
8523 from a common anchor point instead.  The effect is similar to the
8524 following pseudocode (which isn't valid C):
8525
8526 @smallexample
8527 int foo (void)
8528 @{
8529   register int *xr = &x;
8530   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8531 @}
8532 @end smallexample
8533
8534 Not all targets support this option.
8535
8536 @item --param @var{name}=@var{value}
8537 @opindex param
8538 In some places, GCC uses various constants to control the amount of
8539 optimization that is done.  For example, GCC does not inline functions
8540 that contain more than a certain number of instructions.  You can
8541 control some of these constants on the command line using the
8542 @option{--param} option.
8543
8544 The names of specific parameters, and the meaning of the values, are
8545 tied to the internals of the compiler, and are subject to change
8546 without notice in future releases.
8547
8548 In each case, the @var{value} is an integer.  The allowable choices for
8549 @var{name} are given in the following table:
8550
8551 @table @gcctabopt
8552 @item predictable-branch-outcome
8553 When branch is predicted to be taken with probability lower than this threshold
8554 (in percent), then it is considered well predictable. The default is 10.
8555
8556 @item max-crossjump-edges
8557 The maximum number of incoming edges to consider for crossjumping.
8558 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8559 the number of edges incoming to each block.  Increasing values mean
8560 more aggressive optimization, making the compilation time increase with
8561 probably small improvement in executable size.
8562
8563 @item min-crossjump-insns
8564 The minimum number of instructions that must be matched at the end
8565 of two blocks before crossjumping is performed on them.  This
8566 value is ignored in the case where all instructions in the block being
8567 crossjumped from are matched.  The default value is 5.
8568
8569 @item max-grow-copy-bb-insns
8570 The maximum code size expansion factor when copying basic blocks
8571 instead of jumping.  The expansion is relative to a jump instruction.
8572 The default value is 8.
8573
8574 @item max-goto-duplication-insns
8575 The maximum number of instructions to duplicate to a block that jumps
8576 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8577 passes, GCC factors computed gotos early in the compilation process,
8578 and unfactors them as late as possible.  Only computed jumps at the
8579 end of a basic blocks with no more than max-goto-duplication-insns are
8580 unfactored.  The default value is 8.
8581
8582 @item max-delay-slot-insn-search
8583 The maximum number of instructions to consider when looking for an
8584 instruction to fill a delay slot.  If more than this arbitrary number of
8585 instructions are searched, the time savings from filling the delay slot
8586 are minimal, so stop searching.  Increasing values mean more
8587 aggressive optimization, making the compilation time increase with probably
8588 small improvement in execution time.
8589
8590 @item max-delay-slot-live-search
8591 When trying to fill delay slots, the maximum number of instructions to
8592 consider when searching for a block with valid live register
8593 information.  Increasing this arbitrarily chosen value means more
8594 aggressive optimization, increasing the compilation time.  This parameter
8595 should be removed when the delay slot code is rewritten to maintain the
8596 control-flow graph.
8597
8598 @item max-gcse-memory
8599 The approximate maximum amount of memory that can be allocated in
8600 order to perform the global common subexpression elimination
8601 optimization.  If more memory than specified is required, the
8602 optimization is not done.
8603
8604 @item max-gcse-insertion-ratio
8605 If the ratio of expression insertions to deletions is larger than this value
8606 for any expression, then RTL PRE inserts or removes the expression and thus
8607 leaves partially redundant computations in the instruction stream.  The default value is 20.
8608
8609 @item max-pending-list-length
8610 The maximum number of pending dependencies scheduling allows
8611 before flushing the current state and starting over.  Large functions
8612 with few branches or calls can create excessively large lists which
8613 needlessly consume memory and resources.
8614
8615 @item max-modulo-backtrack-attempts
8616 The maximum number of backtrack attempts the scheduler should make
8617 when modulo scheduling a loop.  Larger values can exponentially increase
8618 compilation time.
8619
8620 @item max-inline-insns-single
8621 Several parameters control the tree inliner used in GCC@.
8622 This number sets the maximum number of instructions (counted in GCC's
8623 internal representation) in a single function that the tree inliner
8624 considers for inlining.  This only affects functions declared
8625 inline and methods implemented in a class declaration (C++).
8626 The default value is 400.
8627
8628 @item max-inline-insns-auto
8629 When you use @option{-finline-functions} (included in @option{-O3}),
8630 a lot of functions that would otherwise not be considered for inlining
8631 by the compiler are investigated.  To those functions, a different
8632 (more restrictive) limit compared to functions declared inline can
8633 be applied.
8634 The default value is 40.
8635
8636 @item large-function-insns
8637 The limit specifying really large functions.  For functions larger than this
8638 limit after inlining, inlining is constrained by
8639 @option{--param large-function-growth}.  This parameter is useful primarily
8640 to avoid extreme compilation time caused by non-linear algorithms used by the
8641 back end.
8642 The default value is 2700.
8643
8644 @item large-function-growth
8645 Specifies maximal growth of large function caused by inlining in percents.
8646 The default value is 100 which limits large function growth to 2.0 times
8647 the original size.
8648
8649 @item large-unit-insns
8650 The limit specifying large translation unit.  Growth caused by inlining of
8651 units larger than this limit is limited by @option{--param inline-unit-growth}.
8652 For small units this might be too tight (consider unit consisting of function A
8653 that is inline and B that just calls A three time.  If B is small relative to
8654 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8655 large units consisting of small inlineable functions however the overall unit
8656 growth limit is needed to avoid exponential explosion of code size.  Thus for
8657 smaller units, the size is increased to @option{--param large-unit-insns}
8658 before applying @option{--param inline-unit-growth}.  The default is 10000
8659
8660 @item inline-unit-growth
8661 Specifies maximal overall growth of the compilation unit caused by inlining.
8662 The default value is 30 which limits unit growth to 1.3 times the original
8663 size.
8664
8665 @item ipcp-unit-growth
8666 Specifies maximal overall growth of the compilation unit caused by
8667 interprocedural constant propagation.  The default value is 10 which limits
8668 unit growth to 1.1 times the original size.
8669
8670 @item large-stack-frame
8671 The limit specifying large stack frames.  While inlining the algorithm is trying
8672 to not grow past this limit too much.  Default value is 256 bytes.
8673
8674 @item large-stack-frame-growth
8675 Specifies maximal growth of large stack frames caused by inlining in percents.
8676 The default value is 1000 which limits large stack frame growth to 11 times
8677 the original size.
8678
8679 @item max-inline-insns-recursive
8680 @itemx max-inline-insns-recursive-auto
8681 Specifies maximum number of instructions out-of-line copy of self recursive inline
8682 function can grow into by performing recursive inlining.
8683
8684 For functions declared inline @option{--param max-inline-insns-recursive} is
8685 taken into account.  For function not declared inline, recursive inlining
8686 happens only when @option{-finline-functions} (included in @option{-O3}) is
8687 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8688 default value is 450.
8689
8690 @item max-inline-recursive-depth
8691 @itemx max-inline-recursive-depth-auto
8692 Specifies maximum recursion depth used by the recursive inlining.
8693
8694 For functions declared inline @option{--param max-inline-recursive-depth} is
8695 taken into account.  For function not declared inline, recursive inlining
8696 happens only when @option{-finline-functions} (included in @option{-O3}) is
8697 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8698 default value is 8.
8699
8700 @item min-inline-recursive-probability
8701 Recursive inlining is profitable only for function having deep recursion
8702 in average and can hurt for function having little recursion depth by
8703 increasing the prologue size or complexity of function body to other
8704 optimizers.
8705
8706 When profile feedback is available (see @option{-fprofile-generate}) the actual
8707 recursion depth can be guessed from probability that function will recurse via
8708 given call expression.  This parameter limits inlining only to call expression
8709 whose probability exceeds given threshold (in percents).  The default value is
8710 10.
8711
8712 @item early-inlining-insns
8713 Specify growth that early inliner can make.  In effect it increases amount of
8714 inlining for code having large abstraction penalty.  The default value is 10.
8715
8716 @item max-early-inliner-iterations
8717 @itemx max-early-inliner-iterations
8718 Limit of iterations of early inliner.  This basically bounds number of nested
8719 indirect calls early inliner can resolve.  Deeper chains are still handled by
8720 late inlining.
8721
8722 @item comdat-sharing-probability
8723 @itemx comdat-sharing-probability
8724 Probability (in percent) that C++ inline function with comdat visibility
8725 are shared across multiple compilation units.  The default value is 20.
8726
8727 @item min-vect-loop-bound
8728 The minimum number of iterations under which a loop is not vectorized
8729 when @option{-ftree-vectorize} is used.  The number of iterations after
8730 vectorization needs to be greater than the value specified by this option
8731 to allow vectorization.  The default value is 0.
8732
8733 @item gcse-cost-distance-ratio
8734 Scaling factor in calculation of maximum distance an expression
8735 can be moved by GCSE optimizations.  This is currently supported only in the
8736 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8737 is with simple expressions, i.e., the expressions that have cost
8738 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
8739 hoisting of simple expressions.  The default value is 10.
8740
8741 @item gcse-unrestricted-cost
8742 Cost, roughly measured as the cost of a single typical machine
8743 instruction, at which GCSE optimizations do not constrain
8744 the distance an expression can travel.  This is currently
8745 supported only in the code hoisting pass.  The lesser the cost,
8746 the more aggressive code hoisting is.  Specifying 0 
8747 allows all expressions to travel unrestricted distances.
8748 The default value is 3.
8749
8750 @item max-hoist-depth
8751 The depth of search in the dominator tree for expressions to hoist.
8752 This is used to avoid quadratic behavior in hoisting algorithm.
8753 The value of 0 does not limit on the search, but may slow down compilation
8754 of huge functions.  The default value is 30.
8755
8756 @item max-tail-merge-comparisons
8757 The maximum amount of similar bbs to compare a bb with.  This is used to
8758 avoid quadratic behavior in tree tail merging.  The default value is 10.
8759
8760 @item max-tail-merge-iterations
8761 The maximum amount of iterations of the pass over the function.  This is used to
8762 limit compilation time in tree tail merging.  The default value is 2.
8763
8764 @item max-unrolled-insns
8765 The maximum number of instructions that a loop should have if that loop
8766 is unrolled, and if the loop is unrolled, it determines how many times
8767 the loop code is unrolled.
8768
8769 @item max-average-unrolled-insns
8770 The maximum number of instructions biased by probabilities of their execution
8771 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8772 it determines how many times the loop code is unrolled.
8773
8774 @item max-unroll-times
8775 The maximum number of unrollings of a single loop.
8776
8777 @item max-peeled-insns
8778 The maximum number of instructions that a loop should have if that loop
8779 is peeled, and if the loop is peeled, it determines how many times
8780 the loop code is peeled.
8781
8782 @item max-peel-times
8783 The maximum number of peelings of a single loop.
8784
8785 @item max-completely-peeled-insns
8786 The maximum number of insns of a completely peeled loop.
8787
8788 @item max-completely-peel-times
8789 The maximum number of iterations of a loop to be suitable for complete peeling.
8790
8791 @item max-completely-peel-loop-nest-depth
8792 The maximum depth of a loop nest suitable for complete peeling.
8793
8794 @item max-unswitch-insns
8795 The maximum number of insns of an unswitched loop.
8796
8797 @item max-unswitch-level
8798 The maximum number of branches unswitched in a single loop.
8799
8800 @item lim-expensive
8801 The minimum cost of an expensive expression in the loop invariant motion.
8802
8803 @item iv-consider-all-candidates-bound
8804 Bound on number of candidates for induction variables below that
8805 all candidates are considered for each use in induction variable
8806 optimizations.  Only the most relevant candidates are considered
8807 if there are more candidates, to avoid quadratic time complexity.
8808
8809 @item iv-max-considered-uses
8810 The induction variable optimizations give up on loops that contain more
8811 induction variable uses.
8812
8813 @item iv-always-prune-cand-set-bound
8814 If number of candidates in the set is smaller than this value,
8815 we always try to remove unnecessary ivs from the set during its
8816 optimization when a new iv is added to the set.
8817
8818 @item scev-max-expr-size
8819 Bound on size of expressions used in the scalar evolutions analyzer.
8820 Large expressions slow the analyzer.
8821
8822 @item scev-max-expr-complexity
8823 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8824 Complex expressions slow the analyzer.
8825
8826 @item omega-max-vars
8827 The maximum number of variables in an Omega constraint system.
8828 The default value is 128.
8829
8830 @item omega-max-geqs
8831 The maximum number of inequalities in an Omega constraint system.
8832 The default value is 256.
8833
8834 @item omega-max-eqs
8835 The maximum number of equalities in an Omega constraint system.
8836 The default value is 128.
8837
8838 @item omega-max-wild-cards
8839 The maximum number of wildcard variables that the Omega solver is
8840 able to insert.  The default value is 18.
8841
8842 @item omega-hash-table-size
8843 The size of the hash table in the Omega solver.  The default value is
8844 550.
8845
8846 @item omega-max-keys
8847 The maximal number of keys used by the Omega solver.  The default
8848 value is 500.
8849
8850 @item omega-eliminate-redundant-constraints
8851 When set to 1, use expensive methods to eliminate all redundant
8852 constraints.  The default value is 0.
8853
8854 @item vect-max-version-for-alignment-checks
8855 The maximum number of run-time checks that can be performed when
8856 doing loop versioning for alignment in the vectorizer.  See option
8857 @option{-ftree-vect-loop-version} for more information.
8858
8859 @item vect-max-version-for-alias-checks
8860 The maximum number of run-time checks that can be performed when
8861 doing loop versioning for alias in the vectorizer.  See option
8862 @option{-ftree-vect-loop-version} for more information.
8863
8864 @item max-iterations-to-track
8865
8866 The maximum number of iterations of a loop the brute force algorithm
8867 for analysis of # of iterations of the loop tries to evaluate.
8868
8869 @item hot-bb-count-fraction
8870 Select fraction of the maximal count of repetitions of basic block in program
8871 given basic block needs to have to be considered hot.
8872
8873 @item hot-bb-frequency-fraction
8874 Select fraction of the entry block frequency of executions of basic block in
8875 function given basic block needs to have to be considered hot.
8876
8877 @item max-predicted-iterations
8878 The maximum number of loop iterations we predict statically.  This is useful
8879 in cases where a function contains a single loop with known bound and
8880 another loop with unknown bound.
8881 The known number of iterations is predicted correctly, while
8882 the unknown number of iterations average to roughly 10.  This means that the
8883 loop without bounds appears artificially cold relative to the other one.
8884
8885 @item align-threshold
8886
8887 Select fraction of the maximal frequency of executions of a basic block in
8888 a function to align the basic block.
8889
8890 @item align-loop-iterations
8891
8892 A loop expected to iterate at least the selected number of iterations is
8893 aligned.
8894
8895 @item tracer-dynamic-coverage
8896 @itemx tracer-dynamic-coverage-feedback
8897
8898 This value is used to limit superblock formation once the given percentage of
8899 executed instructions is covered.  This limits unnecessary code size
8900 expansion.
8901
8902 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8903 feedback is available.  The real profiles (as opposed to statically estimated
8904 ones) are much less balanced allowing the threshold to be larger value.
8905
8906 @item tracer-max-code-growth
8907 Stop tail duplication once code growth has reached given percentage.  This is
8908 a rather artificial limit, as most of the duplicates are eliminated later in
8909 cross jumping, so it may be set to much higher values than is the desired code
8910 growth.
8911
8912 @item tracer-min-branch-ratio
8913
8914 Stop reverse growth when the reverse probability of best edge is less than this
8915 threshold (in percent).
8916
8917 @item tracer-min-branch-ratio
8918 @itemx tracer-min-branch-ratio-feedback
8919
8920 Stop forward growth if the best edge has probability lower than this
8921 threshold.
8922
8923 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8924 compilation for profile feedback and one for compilation without.  The value
8925 for compilation with profile feedback needs to be more conservative (higher) in
8926 order to make tracer effective.
8927
8928 @item max-cse-path-length
8929
8930 Maximum number of basic blocks on path that cse considers.  The default is 10.
8931
8932 @item max-cse-insns
8933 The maximum instructions CSE process before flushing. The default is 1000.
8934
8935 @item ggc-min-expand
8936
8937 GCC uses a garbage collector to manage its own memory allocation.  This
8938 parameter specifies the minimum percentage by which the garbage
8939 collector's heap should be allowed to expand between collections.
8940 Tuning this may improve compilation speed; it has no effect on code
8941 generation.
8942
8943 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8944 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
8945 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8946 GCC is not able to calculate RAM on a particular platform, the lower
8947 bound of 30% is used.  Setting this parameter and
8948 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8949 every opportunity.  This is extremely slow, but can be useful for
8950 debugging.
8951
8952 @item ggc-min-heapsize
8953
8954 Minimum size of the garbage collector's heap before it begins bothering
8955 to collect garbage.  The first collection occurs after the heap expands
8956 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8957 tuning this may improve compilation speed, and has no effect on code
8958 generation.
8959
8960 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
8961 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8962 with a lower bound of 4096 (four megabytes) and an upper bound of
8963 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8964 particular platform, the lower bound is used.  Setting this parameter
8965 very large effectively disables garbage collection.  Setting this
8966 parameter and @option{ggc-min-expand} to zero causes a full collection
8967 to occur at every opportunity.
8968
8969 @item max-reload-search-insns
8970 The maximum number of instruction reload should look backward for equivalent
8971 register.  Increasing values mean more aggressive optimization, making the
8972 compilation time increase with probably slightly better performance.
8973 The default value is 100.
8974
8975 @item max-cselib-memory-locations
8976 The maximum number of memory locations cselib should take into account.
8977 Increasing values mean more aggressive optimization, making the compilation time
8978 increase with probably slightly better performance.  The default value is 500.
8979
8980 @item reorder-blocks-duplicate
8981 @itemx reorder-blocks-duplicate-feedback
8982
8983 Used by basic block reordering pass to decide whether to use unconditional
8984 branch or duplicate the code on its destination.  Code is duplicated when its
8985 estimated size is smaller than this value multiplied by the estimated size of
8986 unconditional jump in the hot spots of the program.
8987
8988 The @option{reorder-block-duplicate-feedback} is used only when profile
8989 feedback is available and may be set to higher values than
8990 @option{reorder-block-duplicate} since information about the hot spots is more
8991 accurate.
8992
8993 @item max-sched-ready-insns
8994 The maximum number of instructions ready to be issued the scheduler should
8995 consider at any given time during the first scheduling pass.  Increasing
8996 values mean more thorough searches, making the compilation time increase
8997 with probably little benefit.  The default value is 100.
8998
8999 @item max-sched-region-blocks
9000 The maximum number of blocks in a region to be considered for
9001 interblock scheduling.  The default value is 10.
9002
9003 @item max-pipeline-region-blocks
9004 The maximum number of blocks in a region to be considered for
9005 pipelining in the selective scheduler.  The default value is 15.
9006
9007 @item max-sched-region-insns
9008 The maximum number of insns in a region to be considered for
9009 interblock scheduling.  The default value is 100.
9010
9011 @item max-pipeline-region-insns
9012 The maximum number of insns in a region to be considered for
9013 pipelining in the selective scheduler.  The default value is 200.
9014
9015 @item min-spec-prob
9016 The minimum probability (in percents) of reaching a source block
9017 for interblock speculative scheduling.  The default value is 40.
9018
9019 @item max-sched-extend-regions-iters
9020 The maximum number of iterations through CFG to extend regions.
9021 A value of 0 (the default) disables region extensions.
9022
9023 @item max-sched-insn-conflict-delay
9024 The maximum conflict delay for an insn to be considered for speculative motion.
9025 The default value is 3.
9026
9027 @item sched-spec-prob-cutoff
9028 The minimal probability of speculation success (in percents), so that
9029 speculative insns are scheduled.
9030 The default value is 40.
9031
9032 @item sched-mem-true-dep-cost
9033 Minimal distance (in CPU cycles) between store and load targeting same
9034 memory locations.  The default value is 1.
9035
9036 @item selsched-max-lookahead
9037 The maximum size of the lookahead window of selective scheduling.  It is a
9038 depth of search for available instructions.
9039 The default value is 50.
9040
9041 @item selsched-max-sched-times
9042 The maximum number of times that an instruction is scheduled during
9043 selective scheduling.  This is the limit on the number of iterations
9044 through which the instruction may be pipelined.  The default value is 2.
9045
9046 @item selsched-max-insns-to-rename
9047 The maximum number of best instructions in the ready list that are considered
9048 for renaming in the selective scheduler.  The default value is 2.
9049
9050 @item sms-min-sc
9051 The minimum value of stage count that swing modulo scheduler
9052 generates.  The default value is 2.
9053
9054 @item max-last-value-rtl
9055 The maximum size measured as number of RTLs that can be recorded in an expression
9056 in combiner for a pseudo register as last known value of that register.  The default
9057 is 10000.
9058
9059 @item integer-share-limit
9060 Small integer constants can use a shared data structure, reducing the
9061 compiler's memory usage and increasing its speed.  This sets the maximum
9062 value of a shared integer constant.  The default value is 256.
9063
9064 @item min-virtual-mappings
9065 Specifies the minimum number of virtual mappings in the incremental
9066 SSA updater that should be registered to trigger the virtual mappings
9067 heuristic defined by virtual-mappings-ratio.  The default value is
9068 100.
9069
9070 @item virtual-mappings-ratio
9071 If the number of virtual mappings is virtual-mappings-ratio bigger
9072 than the number of virtual symbols to be updated, then the incremental
9073 SSA updater switches to a full update for those symbols.  The default
9074 ratio is 3.
9075
9076 @item ssp-buffer-size
9077 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9078 protection when @option{-fstack-protection} is used.
9079
9080 @item max-jump-thread-duplication-stmts
9081 Maximum number of statements allowed in a block that needs to be
9082 duplicated when threading jumps.
9083
9084 @item max-fields-for-field-sensitive
9085 Maximum number of fields in a structure treated in
9086 a field sensitive manner during pointer analysis.  The default is zero
9087 for @option{-O0} and @option{-O1},
9088 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9089
9090 @item prefetch-latency
9091 Estimate on average number of instructions that are executed before
9092 prefetch finishes.  The distance we prefetch ahead is proportional
9093 to this constant.  Increasing this number may also lead to less
9094 streams being prefetched (see @option{simultaneous-prefetches}).
9095
9096 @item simultaneous-prefetches
9097 Maximum number of prefetches that can run at the same time.
9098
9099 @item l1-cache-line-size
9100 The size of cache line in L1 cache, in bytes.
9101
9102 @item l1-cache-size
9103 The size of L1 cache, in kilobytes.
9104
9105 @item l2-cache-size
9106 The size of L2 cache, in kilobytes.
9107
9108 @item min-insn-to-prefetch-ratio
9109 The minimum ratio between the number of instructions and the
9110 number of prefetches to enable prefetching in a loop.
9111
9112 @item prefetch-min-insn-to-mem-ratio
9113 The minimum ratio between the number of instructions and the
9114 number of memory references to enable prefetching in a loop.
9115
9116 @item use-canonical-types
9117 Whether the compiler should use the ``canonical'' type system.  By
9118 default, this should always be 1, which uses a more efficient internal
9119 mechanism for comparing types in C++ and Objective-C++.  However, if
9120 bugs in the canonical type system are causing compilation failures,
9121 set this value to 0 to disable canonical types.
9122
9123 @item switch-conversion-max-branch-ratio
9124 Switch initialization conversion refuses to create arrays that are
9125 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9126 branches in the switch.
9127
9128 @item max-partial-antic-length
9129 Maximum length of the partial antic set computed during the tree
9130 partial redundancy elimination optimization (@option{-ftree-pre}) when
9131 optimizing at @option{-O3} and above.  For some sorts of source code
9132 the enhanced partial redundancy elimination optimization can run away,
9133 consuming all of the memory available on the host machine.  This
9134 parameter sets a limit on the length of the sets that are computed,
9135 which prevents the runaway behavior.  Setting a value of 0 for
9136 this parameter allows an unlimited set length.
9137
9138 @item sccvn-max-scc-size
9139 Maximum size of a strongly connected component (SCC) during SCCVN
9140 processing.  If this limit is hit, SCCVN processing for the whole
9141 function is not done and optimizations depending on it are
9142 disabled.  The default maximum SCC size is 10000.
9143
9144 @item ira-max-loops-num
9145 IRA uses regional register allocation by default.  If a function
9146 contains more loops than the number given by this parameter, only at most
9147 the given number of the most frequently-executed loops form regions
9148 for regional register allocation.  The default value of the
9149 parameter is 100.
9150
9151 @item ira-max-conflict-table-size 
9152 Although IRA uses a sophisticated algorithm to compress the conflict
9153 table, the table can still require excessive amounts of memory for
9154 huge functions.  If the conflict table for a function could be more
9155 than the size in MB given by this parameter, the register allocator
9156 instead uses a faster, simpler, and lower-quality
9157 algorithm that does not require building a pseudo-register conflict table.  
9158 The default value of the parameter is 2000.
9159
9160 @item ira-loop-reserved-regs
9161 IRA can be used to evaluate more accurate register pressure in loops
9162 for decisions to move loop invariants (see @option{-O3}).  The number
9163 of available registers reserved for some other purposes is given
9164 by this parameter.  The default value of the parameter is 2, which is
9165 the minimal number of registers needed by typical instructions.
9166 This value is the best found from numerous experiments.
9167
9168 @item loop-invariant-max-bbs-in-loop
9169 Loop invariant motion can be very expensive, both in compilation time and
9170 in amount of needed compile-time memory, with very large loops.  Loops
9171 with more basic blocks than this parameter won't have loop invariant
9172 motion optimization performed on them.  The default value of the
9173 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9174
9175 @item loop-max-datarefs-for-datadeps
9176 Building data dapendencies is expensive for very large loops.  This
9177 parameter limits the number of data references in loops that are
9178 considered for data dependence analysis.  These large loops are no
9179 handled by the optimizations using loop data dependencies.
9180 The default value is 1000.
9181
9182 @item max-vartrack-size
9183 Sets a maximum number of hash table slots to use during variable
9184 tracking dataflow analysis of any function.  If this limit is exceeded
9185 with variable tracking at assignments enabled, analysis for that
9186 function is retried without it, after removing all debug insns from
9187 the function.  If the limit is exceeded even without debug insns, var
9188 tracking analysis is completely disabled for the function.  Setting
9189 the parameter to zero makes it unlimited.
9190
9191 @item max-vartrack-expr-depth
9192 Sets a maximum number of recursion levels when attempting to map
9193 variable names or debug temporaries to value expressions.  This trades
9194 compilation time for more complete debug information.  If this is set too
9195 low, value expressions that are available and could be represented in
9196 debug information may end up not being used; setting this higher may
9197 enable the compiler to find more complex debug expressions, but compile
9198 time and memory use may grow.  The default is 12.
9199
9200 @item min-nondebug-insn-uid
9201 Use uids starting at this parameter for nondebug insns.  The range below
9202 the parameter is reserved exclusively for debug insns created by
9203 @option{-fvar-tracking-assignments}, but debug insns may get
9204 (non-overlapping) uids above it if the reserved range is exhausted.
9205
9206 @item ipa-sra-ptr-growth-factor
9207 IPA-SRA replaces a pointer to an aggregate with one or more new
9208 parameters only when their cumulative size is less or equal to
9209 @option{ipa-sra-ptr-growth-factor} times the size of the original
9210 pointer parameter.
9211
9212 @item tm-max-aggregate-size
9213 When making copies of thread-local variables in a transaction, this
9214 parameter specifies the size in bytes after which variables are
9215 saved with the logging functions as opposed to save/restore code
9216 sequence pairs.  This option only applies when using
9217 @option{-fgnu-tm}.
9218
9219 @item graphite-max-nb-scop-params
9220 To avoid exponential effects in the Graphite loop transforms, the
9221 number of parameters in a Static Control Part (SCoP) is bounded.  The
9222 default value is 10 parameters.  A variable whose value is unknown at
9223 compilation time and defined outside a SCoP is a parameter of the SCoP.
9224
9225 @item graphite-max-bbs-per-function
9226 To avoid exponential effects in the detection of SCoPs, the size of
9227 the functions analyzed by Graphite is bounded.  The default value is
9228 100 basic blocks.
9229
9230 @item loop-block-tile-size
9231 Loop blocking or strip mining transforms, enabled with
9232 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9233 loop in the loop nest by a given number of iterations.  The strip
9234 length can be changed using the @option{loop-block-tile-size}
9235 parameter.  The default value is 51 iterations.
9236
9237 @item ipa-cp-value-list-size
9238 IPA-CP attempts to track all possible values and types passed to a function's
9239 parameter in order to propagate them and perform devirtualization.
9240 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9241 stores per one formal parameter of a function.
9242
9243 @item lto-partitions
9244 Specify desired number of partitions produced during WHOPR compilation.
9245 The number of partitions should exceed the number of CPUs used for compilation.
9246 The default value is 32.
9247
9248 @item lto-minpartition
9249 Size of minimal partition for WHOPR (in estimated instructions).
9250 This prevents expenses of splitting very small programs into too many
9251 partitions.
9252
9253 @item cxx-max-namespaces-for-diagnostic-help
9254 The maximum number of namespaces to consult for suggestions when C++
9255 name lookup fails for an identifier.  The default is 1000.
9256
9257 @item sink-frequency-threshold
9258 The maximum relative execution frequency (in percents) of the target block
9259 relative to a statement's original block to allow statement sinking of a
9260 statement.  Larger numbers result in more aggressive statement sinking.
9261 The default value is 75.  A small positive adjustment is applied for
9262 statements with memory operands as those are even more profitable so sink.
9263
9264 @item max-stores-to-sink
9265 The maximum number of conditional stores paires that can be sunk.  Set to 0
9266 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9267 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9268
9269 @item allow-load-data-races
9270 Allow optimizers to introduce new data races on loads.
9271 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9272 unless implicitly set by the @option{-fmemory-model=} option.
9273
9274 @item allow-store-data-races
9275 Allow optimizers to introduce new data races on stores.
9276 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9277 unless implicitly set by the @option{-fmemory-model=} option.
9278
9279 @item allow-packed-load-data-races
9280 Allow optimizers to introduce new data races on packed data loads.
9281 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9282 unless implicitly set by the @option{-fmemory-model=} option.
9283
9284 @item allow-packed-store-data-races
9285 Allow optimizers to introduce new data races on packed data stores.
9286 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9287 unless implicitly set by the @option{-fmemory-model=} option.
9288
9289 @item case-values-threshold
9290 The smallest number of different values for which it is best to use a
9291 jump-table instead of a tree of conditional branches.  If the value is
9292 0, use the default for the machine.  The default is 0.
9293
9294 @item tree-reassoc-width
9295 Set the maximum number of instructions executed in parallel in
9296 reassociated tree. This parameter overrides target dependent
9297 heuristics used by default if has non zero value.
9298
9299 @end table
9300 @end table
9301
9302 @node Preprocessor Options
9303 @section Options Controlling the Preprocessor
9304 @cindex preprocessor options
9305 @cindex options, preprocessor
9306
9307 These options control the C preprocessor, which is run on each C source
9308 file before actual compilation.
9309
9310 If you use the @option{-E} option, nothing is done except preprocessing.
9311 Some of these options make sense only together with @option{-E} because
9312 they cause the preprocessor output to be unsuitable for actual
9313 compilation.
9314
9315 @table @gcctabopt
9316 @item -Wp,@var{option}
9317 @opindex Wp
9318 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9319 and pass @var{option} directly through to the preprocessor.  If
9320 @var{option} contains commas, it is split into multiple options at the
9321 commas.  However, many options are modified, translated or interpreted
9322 by the compiler driver before being passed to the preprocessor, and
9323 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9324 interface is undocumented and subject to change, so whenever possible
9325 you should avoid using @option{-Wp} and let the driver handle the
9326 options instead.
9327
9328 @item -Xpreprocessor @var{option}
9329 @opindex Xpreprocessor
9330 Pass @var{option} as an option to the preprocessor.  You can use this to
9331 supply system-specific preprocessor options that GCC does not know how to
9332 recognize.
9333
9334 If you want to pass an option that takes an argument, you must use
9335 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9336
9337 @item -no-integrated-cpp
9338 @opindex no-integrated-cpp
9339 Perform preprocessing as a separate pass before compilation.
9340 By default, GCC performs preprocessing as an integrated part of
9341 input tokenization and parsing.
9342 If this option is provided, the appropriate language front end
9343 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9344 and Objective-C, respectively) is instead invoked twice,
9345 once for preprocessing only and once for actual compilation
9346 of the preprocessed input.
9347 This option may be useful in conjunction with the @option{-B} or
9348 @option{-wrapper} options to specify an alternate preprocessor or
9349 perform additional processing of the program source between
9350 normal preprocessing and compilation.
9351 @end table
9352
9353 @include cppopts.texi
9354
9355 @node Assembler Options
9356 @section Passing Options to the Assembler
9357
9358 @c prevent bad page break with this line
9359 You can pass options to the assembler.
9360
9361 @table @gcctabopt
9362 @item -Wa,@var{option}
9363 @opindex Wa
9364 Pass @var{option} as an option to the assembler.  If @var{option}
9365 contains commas, it is split into multiple options at the commas.
9366
9367 @item -Xassembler @var{option}
9368 @opindex Xassembler
9369 Pass @var{option} as an option to the assembler.  You can use this to
9370 supply system-specific assembler options that GCC does not know how to
9371 recognize.
9372
9373 If you want to pass an option that takes an argument, you must use
9374 @option{-Xassembler} twice, once for the option and once for the argument.
9375
9376 @end table
9377
9378 @node Link Options
9379 @section Options for Linking
9380 @cindex link options
9381 @cindex options, linking
9382
9383 These options come into play when the compiler links object files into
9384 an executable output file.  They are meaningless if the compiler is
9385 not doing a link step.
9386
9387 @table @gcctabopt
9388 @cindex file names
9389 @item @var{object-file-name}
9390 A file name that does not end in a special recognized suffix is
9391 considered to name an object file or library.  (Object files are
9392 distinguished from libraries by the linker according to the file
9393 contents.)  If linking is done, these object files are used as input
9394 to the linker.
9395
9396 @item -c
9397 @itemx -S
9398 @itemx -E
9399 @opindex c
9400 @opindex S
9401 @opindex E
9402 If any of these options is used, then the linker is not run, and
9403 object file names should not be used as arguments.  @xref{Overall
9404 Options}.
9405
9406 @cindex Libraries
9407 @item -l@var{library}
9408 @itemx -l @var{library}
9409 @opindex l
9410 Search the library named @var{library} when linking.  (The second
9411 alternative with the library as a separate argument is only for
9412 POSIX compliance and is not recommended.)
9413
9414 It makes a difference where in the command you write this option; the
9415 linker searches and processes libraries and object files in the order they
9416 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9417 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9418 to functions in @samp{z}, those functions may not be loaded.
9419
9420 The linker searches a standard list of directories for the library,
9421 which is actually a file named @file{lib@var{library}.a}.  The linker
9422 then uses this file as if it had been specified precisely by name.
9423
9424 The directories searched include several standard system directories
9425 plus any that you specify with @option{-L}.
9426
9427 Normally the files found this way are library files---archive files
9428 whose members are object files.  The linker handles an archive file by
9429 scanning through it for members which define symbols that have so far
9430 been referenced but not defined.  But if the file that is found is an
9431 ordinary object file, it is linked in the usual fashion.  The only
9432 difference between using an @option{-l} option and specifying a file name
9433 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9434 and searches several directories.
9435
9436 @item -lobjc
9437 @opindex lobjc
9438 You need this special case of the @option{-l} option in order to
9439 link an Objective-C or Objective-C++ program.
9440
9441 @item -nostartfiles
9442 @opindex nostartfiles
9443 Do not use the standard system startup files when linking.
9444 The standard system libraries are used normally, unless @option{-nostdlib}
9445 or @option{-nodefaultlibs} is used.
9446
9447 @item -nodefaultlibs
9448 @opindex nodefaultlibs
9449 Do not use the standard system libraries when linking.
9450 Only the libraries you specify are passed to the linker, and options
9451 specifying linkage of the system libraries, such as @code{-static-libgcc}
9452 or @code{-shared-libgcc}, are ignored.  
9453 The standard startup files are used normally, unless @option{-nostartfiles}
9454 is used.  The compiler may generate calls to @code{memcmp},
9455 @code{memset}, @code{memcpy} and @code{memmove}.
9456 These entries are usually resolved by entries in
9457 libc.  These entry points should be supplied through some other
9458 mechanism when this option is specified.
9459
9460 @item -nostdlib
9461 @opindex nostdlib
9462 Do not use the standard system startup files or libraries when linking.
9463 No startup files and only the libraries you specify are passed to
9464 the linker, and options specifying linkage of the system libraries, such as
9465 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
9466
9467 The compiler may generate calls to @code{memcmp}, @code{memset},
9468 @code{memcpy} and @code{memmove}.
9469 These entries are usually resolved by entries in
9470 libc.  These entry points should be supplied through some other
9471 mechanism when this option is specified.
9472
9473 @cindex @option{-lgcc}, use with @option{-nostdlib}
9474 @cindex @option{-nostdlib} and unresolved references
9475 @cindex unresolved references and @option{-nostdlib}
9476 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9477 @cindex @option{-nodefaultlibs} and unresolved references
9478 @cindex unresolved references and @option{-nodefaultlibs}
9479 One of the standard libraries bypassed by @option{-nostdlib} and
9480 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9481 which GCC uses to overcome shortcomings of particular machines, or special
9482 needs for some languages.
9483 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9484 Collection (GCC) Internals},
9485 for more discussion of @file{libgcc.a}.)
9486 In most cases, you need @file{libgcc.a} even when you want to avoid
9487 other standard libraries.  In other words, when you specify @option{-nostdlib}
9488 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9489 This ensures that you have no unresolved references to internal GCC
9490 library subroutines.
9491 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
9492 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
9493 GNU Compiler Collection (GCC) Internals}.)
9494
9495 @item -pie
9496 @opindex pie
9497 Produce a position independent executable on targets that support it.
9498 For predictable results, you must also specify the same set of options
9499 used for compilation (@option{-fpie}, @option{-fPIE},
9500 or model suboptions) when you specify this linker option.
9501
9502 @item -rdynamic
9503 @opindex rdynamic
9504 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9505 that support it. This instructs the linker to add all symbols, not
9506 only used ones, to the dynamic symbol table. This option is needed
9507 for some uses of @code{dlopen} or to allow obtaining backtraces
9508 from within a program.
9509
9510 @item -s
9511 @opindex s
9512 Remove all symbol table and relocation information from the executable.
9513
9514 @item -static
9515 @opindex static
9516 On systems that support dynamic linking, this prevents linking with the shared
9517 libraries.  On other systems, this option has no effect.
9518
9519 @item -shared
9520 @opindex shared
9521 Produce a shared object which can then be linked with other objects to
9522 form an executable.  Not all systems support this option.  For predictable
9523 results, you must also specify the same set of options used for compilation
9524 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
9525 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
9526 needs to build supplementary stub code for constructors to work.  On
9527 multi-libbed systems, @samp{gcc -shared} must select the correct support
9528 libraries to link against.  Failing to supply the correct flags may lead
9529 to subtle defects.  Supplying them in cases where they are not necessary
9530 is innocuous.}
9531
9532 @item -shared-libgcc
9533 @itemx -static-libgcc
9534 @opindex shared-libgcc
9535 @opindex static-libgcc
9536 On systems that provide @file{libgcc} as a shared library, these options
9537 force the use of either the shared or static version respectively.
9538 If no shared version of @file{libgcc} was built when the compiler was
9539 configured, these options have no effect.
9540
9541 There are several situations in which an application should use the
9542 shared @file{libgcc} instead of the static version.  The most common
9543 of these is when the application wishes to throw and catch exceptions
9544 across different shared libraries.  In that case, each of the libraries
9545 as well as the application itself should use the shared @file{libgcc}.
9546
9547 Therefore, the G++ and GCJ drivers automatically add
9548 @option{-shared-libgcc} whenever you build a shared library or a main
9549 executable, because C++ and Java programs typically use exceptions, so
9550 this is the right thing to do.
9551
9552 If, instead, you use the GCC driver to create shared libraries, you may
9553 find that they are not always linked with the shared @file{libgcc}.
9554 If GCC finds, at its configuration time, that you have a non-GNU linker
9555 or a GNU linker that does not support option @option{--eh-frame-hdr},
9556 it links the shared version of @file{libgcc} into shared libraries
9557 by default.  Otherwise, it takes advantage of the linker and optimizes
9558 away the linking with the shared version of @file{libgcc}, linking with
9559 the static version of libgcc by default.  This allows exceptions to
9560 propagate through such shared libraries, without incurring relocation
9561 costs at library load time.
9562
9563 However, if a library or main executable is supposed to throw or catch
9564 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9565 for the languages used in the program, or using the option
9566 @option{-shared-libgcc}, such that it is linked with the shared
9567 @file{libgcc}.
9568
9569 @item -static-libstdc++
9570 When the @command{g++} program is used to link a C++ program, it
9571 normally automatically links against @option{libstdc++}.  If
9572 @file{libstdc++} is available as a shared library, and the
9573 @option{-static} option is not used, then this links against the
9574 shared version of @file{libstdc++}.  That is normally fine.  However, it
9575 is sometimes useful to freeze the version of @file{libstdc++} used by
9576 the program without going all the way to a fully static link.  The
9577 @option{-static-libstdc++} option directs the @command{g++} driver to
9578 link @file{libstdc++} statically, without necessarily linking other
9579 libraries statically.
9580
9581 @item -symbolic
9582 @opindex symbolic
9583 Bind references to global symbols when building a shared object.  Warn
9584 about any unresolved references (unless overridden by the link editor
9585 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
9586 this option.
9587
9588 @item -T @var{script}
9589 @opindex T
9590 @cindex linker script
9591 Use @var{script} as the linker script.  This option is supported by most
9592 systems using the GNU linker.  On some targets, such as bare-board
9593 targets without an operating system, the @option{-T} option may be required
9594 when linking to avoid references to undefined symbols.
9595
9596 @item -Xlinker @var{option}
9597 @opindex Xlinker
9598 Pass @var{option} as an option to the linker.  You can use this to
9599 supply system-specific linker options that GCC does not recognize.
9600
9601 If you want to pass an option that takes a separate argument, you must use
9602 @option{-Xlinker} twice, once for the option and once for the argument.
9603 For example, to pass @option{-assert definitions}, you must write
9604 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9605 @option{-Xlinker "-assert definitions"}, because this passes the entire
9606 string as a single argument, which is not what the linker expects.
9607
9608 When using the GNU linker, it is usually more convenient to pass
9609 arguments to linker options using the @option{@var{option}=@var{value}}
9610 syntax than as separate arguments.  For example, you can specify
9611 @option{-Xlinker -Map=output.map} rather than
9612 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9613 this syntax for command-line options.
9614
9615 @item -Wl,@var{option}
9616 @opindex Wl
9617 Pass @var{option} as an option to the linker.  If @var{option} contains
9618 commas, it is split into multiple options at the commas.  You can use this
9619 syntax to pass an argument to the option.
9620 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
9621 linker.  When using the GNU linker, you can also get the same effect with
9622 @option{-Wl,-Map=output.map}.
9623
9624 @item -u @var{symbol}
9625 @opindex u
9626 Pretend the symbol @var{symbol} is undefined, to force linking of
9627 library modules to define it.  You can use @option{-u} multiple times with
9628 different symbols to force loading of additional library modules.
9629 @end table
9630
9631 @node Directory Options
9632 @section Options for Directory Search
9633 @cindex directory options
9634 @cindex options, directory search
9635 @cindex search path
9636
9637 These options specify directories to search for header files, for
9638 libraries and for parts of the compiler:
9639
9640 @table @gcctabopt
9641 @item -I@var{dir}
9642 @opindex I
9643 Add the directory @var{dir} to the head of the list of directories to be
9644 searched for header files.  This can be used to override a system header
9645 file, substituting your own version, since these directories are
9646 searched before the system header file directories.  However, you should
9647 not use this option to add directories that contain vendor-supplied
9648 system header files (use @option{-isystem} for that).  If you use more than
9649 one @option{-I} option, the directories are scanned in left-to-right
9650 order; the standard system directories come after.
9651
9652 If a standard system include directory, or a directory specified with
9653 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9654 option is ignored.  The directory is still searched but as a
9655 system directory at its normal position in the system include chain.
9656 This is to ensure that GCC's procedure to fix buggy system headers and
9657 the ordering for the @code{include_next} directive are not inadvertently changed.
9658 If you really need to change the search order for system directories,
9659 use the @option{-nostdinc} and/or @option{-isystem} options.
9660
9661 @item -iplugindir=@var{dir}
9662 Set the directory to search for plugins that are passed
9663 by @option{-fplugin=@var{name}} instead of
9664 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9665 to be used by the user, but only passed by the driver.
9666
9667 @item -iquote@var{dir}
9668 @opindex iquote
9669 Add the directory @var{dir} to the head of the list of directories to
9670 be searched for header files only for the case of @samp{#include
9671 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9672 otherwise just like @option{-I}.
9673
9674 @item -L@var{dir}
9675 @opindex L
9676 Add directory @var{dir} to the list of directories to be searched
9677 for @option{-l}.
9678
9679 @item -B@var{prefix}
9680 @opindex B
9681 This option specifies where to find the executables, libraries,
9682 include files, and data files of the compiler itself.
9683
9684 The compiler driver program runs one or more of the subprograms
9685 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
9686 @var{prefix} as a prefix for each program it tries to run, both with and
9687 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9688
9689 For each subprogram to be run, the compiler driver first tries the
9690 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9691 is not specified, the driver tries two standard prefixes, 
9692 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9693 those results in a file name that is found, the unmodified program
9694 name is searched for using the directories specified in your
9695 @env{PATH} environment variable.
9696
9697 The compiler checks to see if the path provided by the @option{-B}
9698 refers to a directory, and if necessary it adds a directory
9699 separator character at the end of the path.
9700
9701 @option{-B} prefixes that effectively specify directory names also apply
9702 to libraries in the linker, because the compiler translates these
9703 options into @option{-L} options for the linker.  They also apply to
9704 includes files in the preprocessor, because the compiler translates these
9705 options into @option{-isystem} options for the preprocessor.  In this case,
9706 the compiler appends @samp{include} to the prefix.
9707
9708 The runtime support file @file{libgcc.a} can also be searched for using
9709 the @option{-B} prefix, if needed.  If it is not found there, the two
9710 standard prefixes above are tried, and that is all.  The file is left
9711 out of the link if it is not found by those means.
9712
9713 Another way to specify a prefix much like the @option{-B} prefix is to use
9714 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9715 Variables}.
9716
9717 As a special kludge, if the path provided by @option{-B} is
9718 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9719 9, then it is replaced by @file{[dir/]include}.  This is to help
9720 with boot-strapping the compiler.
9721
9722 @item -specs=@var{file}
9723 @opindex specs
9724 Process @var{file} after the compiler reads in the standard @file{specs}
9725 file, in order to override the defaults which the @command{gcc} driver
9726 program uses when determining what switches to pass to @command{cc1},
9727 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
9728 @option{-specs=@var{file}} can be specified on the command line, and they
9729 are processed in order, from left to right.
9730
9731 @item --sysroot=@var{dir}
9732 @opindex sysroot
9733 Use @var{dir} as the logical root directory for headers and libraries.
9734 For example, if the compiler normally searches for headers in
9735 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
9736 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9737
9738 If you use both this option and the @option{-isysroot} option, then
9739 the @option{--sysroot} option applies to libraries, but the
9740 @option{-isysroot} option applies to header files.
9741
9742 The GNU linker (beginning with version 2.16) has the necessary support
9743 for this option.  If your linker does not support this option, the
9744 header file aspect of @option{--sysroot} still works, but the
9745 library aspect does not.
9746
9747 @item -I-
9748 @opindex I-
9749 This option has been deprecated.  Please use @option{-iquote} instead for
9750 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9751 Any directories you specify with @option{-I} options before the @option{-I-}
9752 option are searched only for the case of @samp{#include "@var{file}"};
9753 they are not searched for @samp{#include <@var{file}>}.
9754
9755 If additional directories are specified with @option{-I} options after
9756 the @option{-I-}, these directories are searched for all @samp{#include}
9757 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9758 this way.)
9759
9760 In addition, the @option{-I-} option inhibits the use of the current
9761 directory (where the current input file came from) as the first search
9762 directory for @samp{#include "@var{file}"}.  There is no way to
9763 override this effect of @option{-I-}.  With @option{-I.} you can specify
9764 searching the directory that is current when the compiler is
9765 invoked.  That is not exactly the same as what the preprocessor does
9766 by default, but it is often satisfactory.
9767
9768 @option{-I-} does not inhibit the use of the standard system directories
9769 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9770 independent.
9771 @end table
9772
9773 @c man end
9774
9775 @node Spec Files
9776 @section Specifying subprocesses and the switches to pass to them
9777 @cindex Spec Files
9778
9779 @command{gcc} is a driver program.  It performs its job by invoking a
9780 sequence of other programs to do the work of compiling, assembling and
9781 linking.  GCC interprets its command-line parameters and uses these to
9782 deduce which programs it should invoke, and which command-line options
9783 it ought to place on their command lines.  This behavior is controlled
9784 by @dfn{spec strings}.  In most cases there is one spec string for each
9785 program that GCC can invoke, but a few programs have multiple spec
9786 strings to control their behavior.  The spec strings built into GCC can
9787 be overridden by using the @option{-specs=} command-line switch to specify
9788 a spec file.
9789
9790 @dfn{Spec files} are plaintext files that are used to construct spec
9791 strings.  They consist of a sequence of directives separated by blank
9792 lines.  The type of directive is determined by the first non-whitespace
9793 character on the line, which can be one of the following:
9794
9795 @table @code
9796 @item %@var{command}
9797 Issues a @var{command} to the spec file processor.  The commands that can
9798 appear here are:
9799
9800 @table @code
9801 @item %include <@var{file}>
9802 @cindex @code{%include}
9803 Search for @var{file} and insert its text at the current point in the
9804 specs file.
9805
9806 @item %include_noerr <@var{file}>
9807 @cindex @code{%include_noerr}
9808 Just like @samp{%include}, but do not generate an error message if the include
9809 file cannot be found.
9810
9811 @item %rename @var{old_name} @var{new_name}
9812 @cindex @code{%rename}
9813 Rename the spec string @var{old_name} to @var{new_name}.
9814
9815 @end table
9816
9817 @item *[@var{spec_name}]:
9818 This tells the compiler to create, override or delete the named spec
9819 string.  All lines after this directive up to the next directive or
9820 blank line are considered to be the text for the spec string.  If this
9821 results in an empty string then the spec is deleted.  (Or, if the
9822 spec did not exist, then nothing happens.)  Otherwise, if the spec
9823 does not currently exist a new spec is created.  If the spec does
9824 exist then its contents are overridden by the text of this
9825 directive, unless the first character of that text is the @samp{+}
9826 character, in which case the text is appended to the spec.
9827
9828 @item [@var{suffix}]:
9829 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9830 and up to the next directive or blank line are considered to make up the
9831 spec string for the indicated suffix.  When the compiler encounters an
9832 input file with the named suffix, it processes the spec string in
9833 order to work out how to compile that file.  For example:
9834
9835 @smallexample
9836 .ZZ:
9837 z-compile -input %i
9838 @end smallexample
9839
9840 This says that any input file whose name ends in @samp{.ZZ} should be
9841 passed to the program @samp{z-compile}, which should be invoked with the
9842 command-line switch @option{-input} and with the result of performing the
9843 @samp{%i} substitution.  (See below.)
9844
9845 As an alternative to providing a spec string, the text that follows a
9846 suffix directive can be one of the following:
9847
9848 @table @code
9849 @item @@@var{language}
9850 This says that the suffix is an alias for a known @var{language}.  This is
9851 similar to using the @option{-x} command-line switch to GCC to specify a
9852 language explicitly.  For example:
9853
9854 @smallexample
9855 .ZZ:
9856 @@c++
9857 @end smallexample
9858
9859 Says that .ZZ files are, in fact, C++ source files.
9860
9861 @item #@var{name}
9862 This causes an error messages saying:
9863
9864 @smallexample
9865 @var{name} compiler not installed on this system.
9866 @end smallexample
9867 @end table
9868
9869 GCC already has an extensive list of suffixes built into it.
9870 This directive adds an entry to the end of the list of suffixes, but
9871 since the list is searched from the end backwards, it is effectively
9872 possible to override earlier entries using this technique.
9873
9874 @end table
9875
9876 GCC has the following spec strings built into it.  Spec files can
9877 override these strings or create their own.  Note that individual
9878 targets can also add their own spec strings to this list.
9879
9880 @smallexample
9881 asm          Options to pass to the assembler
9882 asm_final    Options to pass to the assembler post-processor
9883 cpp          Options to pass to the C preprocessor
9884 cc1          Options to pass to the C compiler
9885 cc1plus      Options to pass to the C++ compiler
9886 endfile      Object files to include at the end of the link
9887 link         Options to pass to the linker
9888 lib          Libraries to include on the command line to the linker
9889 libgcc       Decides which GCC support library to pass to the linker
9890 linker       Sets the name of the linker
9891 predefines   Defines to be passed to the C preprocessor
9892 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9893              by default
9894 startfile    Object files to include at the start of the link
9895 @end smallexample
9896
9897 Here is a small example of a spec file:
9898
9899 @smallexample
9900 %rename lib                 old_lib
9901
9902 *lib:
9903 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9904 @end smallexample
9905
9906 This example renames the spec called @samp{lib} to @samp{old_lib} and
9907 then overrides the previous definition of @samp{lib} with a new one.
9908 The new definition adds in some extra command-line options before
9909 including the text of the old definition.
9910
9911 @dfn{Spec strings} are a list of command-line options to be passed to their
9912 corresponding program.  In addition, the spec strings can contain
9913 @samp{%}-prefixed sequences to substitute variable text or to
9914 conditionally insert text into the command line.  Using these constructs
9915 it is possible to generate quite complex command lines.
9916
9917 Here is a table of all defined @samp{%}-sequences for spec
9918 strings.  Note that spaces are not generated automatically around the
9919 results of expanding these sequences.  Therefore you can concatenate them
9920 together or combine them with constant text in a single argument.
9921
9922 @table @code
9923 @item %%
9924 Substitute one @samp{%} into the program name or argument.
9925
9926 @item %i
9927 Substitute the name of the input file being processed.
9928
9929 @item %b
9930 Substitute the basename of the input file being processed.
9931 This is the substring up to (and not including) the last period
9932 and not including the directory.
9933
9934 @item %B
9935 This is the same as @samp{%b}, but include the file suffix (text after
9936 the last period).
9937
9938 @item %d
9939 Marks the argument containing or following the @samp{%d} as a
9940 temporary file name, so that that file is deleted if GCC exits
9941 successfully.  Unlike @samp{%g}, this contributes no text to the
9942 argument.
9943
9944 @item %g@var{suffix}
9945 Substitute a file name that has suffix @var{suffix} and is chosen
9946 once per compilation, and mark the argument in the same way as
9947 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9948 name is now chosen in a way that is hard to predict even when previously
9949 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9950 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9951 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9952 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9953 was simply substituted with a file name chosen once per compilation,
9954 without regard to any appended suffix (which was therefore treated
9955 just like ordinary text), making such attacks more likely to succeed.
9956
9957 @item %u@var{suffix}
9958 Like @samp{%g}, but generates a new temporary file name
9959 each time it appears instead of once per compilation.
9960
9961 @item %U@var{suffix}
9962 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9963 new one if there is no such last file name.  In the absence of any
9964 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9965 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9966 involves the generation of two distinct file names, one
9967 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9968 simply substituted with a file name chosen for the previous @samp{%u},
9969 without regard to any appended suffix.
9970
9971 @item %j@var{suffix}
9972 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9973 writable, and if @option{-save-temps} is not used; 
9974 otherwise, substitute the name
9975 of a temporary file, just like @samp{%u}.  This temporary file is not
9976 meant for communication between processes, but rather as a junk
9977 disposal mechanism.
9978
9979 @item %|@var{suffix}
9980 @itemx %m@var{suffix}
9981 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9982 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9983 all.  These are the two most common ways to instruct a program that it
9984 should read from standard input or write to standard output.  If you
9985 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9986 construct: see for example @file{f/lang-specs.h}.
9987
9988 @item %.@var{SUFFIX}
9989 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9990 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9991 terminated by the next space or %.
9992
9993 @item %w
9994 Marks the argument containing or following the @samp{%w} as the
9995 designated output file of this compilation.  This puts the argument
9996 into the sequence of arguments that @samp{%o} substitutes.
9997
9998 @item %o
9999 Substitutes the names of all the output files, with spaces
10000 automatically placed around them.  You should write spaces
10001 around the @samp{%o} as well or the results are undefined.
10002 @samp{%o} is for use in the specs for running the linker.
10003 Input files whose names have no recognized suffix are not compiled
10004 at all, but they are included among the output files, so they are
10005 linked.
10006
10007 @item %O
10008 Substitutes the suffix for object files.  Note that this is
10009 handled specially when it immediately follows @samp{%g, %u, or %U},
10010 because of the need for those to form complete file names.  The
10011 handling is such that @samp{%O} is treated exactly as if it had already
10012 been substituted, except that @samp{%g, %u, and %U} do not currently
10013 support additional @var{suffix} characters following @samp{%O} as they do
10014 following, for example, @samp{.o}.
10015
10016 @item %p
10017 Substitutes the standard macro predefinitions for the
10018 current target machine.  Use this when running @code{cpp}.
10019
10020 @item %P
10021 Like @samp{%p}, but puts @samp{__} before and after the name of each
10022 predefined macro, except for macros that start with @samp{__} or with
10023 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10024 C@.
10025
10026 @item %I
10027 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10028 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10029 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10030 and @option{-imultilib} as necessary.
10031
10032 @item %s
10033 Current argument is the name of a library or startup file of some sort.
10034 Search for that file in a standard list of directories and substitute
10035 the full name found.  The current working directory is included in the
10036 list of directories scanned.
10037
10038 @item %T
10039 Current argument is the name of a linker script.  Search for that file
10040 in the current list of directories to scan for libraries. If the file
10041 is located insert a @option{--script} option into the command line
10042 followed by the full path name found.  If the file is not found then
10043 generate an error message.  Note: the current working directory is not
10044 searched.
10045
10046 @item %e@var{str}
10047 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10048 Use this when inconsistent options are detected.
10049
10050 @item %(@var{name})
10051 Substitute the contents of spec string @var{name} at this point.
10052
10053 @item %x@{@var{option}@}
10054 Accumulate an option for @samp{%X}.
10055
10056 @item %X
10057 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10058 spec string.
10059
10060 @item %Y
10061 Output the accumulated assembler options specified by @option{-Wa}.
10062
10063 @item %Z
10064 Output the accumulated preprocessor options specified by @option{-Wp}.
10065
10066 @item %a
10067 Process the @code{asm} spec.  This is used to compute the
10068 switches to be passed to the assembler.
10069
10070 @item %A
10071 Process the @code{asm_final} spec.  This is a spec string for
10072 passing switches to an assembler post-processor, if such a program is
10073 needed.
10074
10075 @item %l
10076 Process the @code{link} spec.  This is the spec for computing the
10077 command line passed to the linker.  Typically it makes use of the
10078 @samp{%L %G %S %D and %E} sequences.
10079
10080 @item %D
10081 Dump out a @option{-L} option for each directory that GCC believes might
10082 contain startup files.  If the target supports multilibs then the
10083 current multilib directory is prepended to each of these paths.
10084
10085 @item %L
10086 Process the @code{lib} spec.  This is a spec string for deciding which
10087 libraries are included on the command line to the linker.
10088
10089 @item %G
10090 Process the @code{libgcc} spec.  This is a spec string for deciding
10091 which GCC support library is included on the command line to the linker.
10092
10093 @item %S
10094 Process the @code{startfile} spec.  This is a spec for deciding which
10095 object files are the first ones passed to the linker.  Typically
10096 this might be a file named @file{crt0.o}.
10097
10098 @item %E
10099 Process the @code{endfile} spec.  This is a spec string that specifies
10100 the last object files that are passed to the linker.
10101
10102 @item %C
10103 Process the @code{cpp} spec.  This is used to construct the arguments
10104 to be passed to the C preprocessor.
10105
10106 @item %1
10107 Process the @code{cc1} spec.  This is used to construct the options to be
10108 passed to the actual C compiler (@samp{cc1}).
10109
10110 @item %2
10111 Process the @code{cc1plus} spec.  This is used to construct the options to be
10112 passed to the actual C++ compiler (@samp{cc1plus}).
10113
10114 @item %*
10115 Substitute the variable part of a matched option.  See below.
10116 Note that each comma in the substituted string is replaced by
10117 a single space.
10118
10119 @item %<@code{S}
10120 Remove all occurrences of @code{-S} from the command line.  Note---this
10121 command is position dependent.  @samp{%} commands in the spec string
10122 before this one see @code{-S}, @samp{%} commands in the spec string
10123 after this one do not.
10124
10125 @item %:@var{function}(@var{args})
10126 Call the named function @var{function}, passing it @var{args}.
10127 @var{args} is first processed as a nested spec string, then split
10128 into an argument vector in the usual fashion.  The function returns
10129 a string which is processed as if it had appeared literally as part
10130 of the current spec.
10131
10132 The following built-in spec functions are provided:
10133
10134 @table @code
10135 @item @code{getenv}
10136 The @code{getenv} spec function takes two arguments: an environment
10137 variable name and a string.  If the environment variable is not
10138 defined, a fatal error is issued.  Otherwise, the return value is the
10139 value of the environment variable concatenated with the string.  For
10140 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10141
10142 @smallexample
10143 %:getenv(TOPDIR /include)
10144 @end smallexample
10145
10146 expands to @file{/path/to/top/include}.
10147
10148 @item @code{if-exists}
10149 The @code{if-exists} spec function takes one argument, an absolute
10150 pathname to a file.  If the file exists, @code{if-exists} returns the
10151 pathname.  Here is a small example of its usage:
10152
10153 @smallexample
10154 *startfile:
10155 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10156 @end smallexample
10157
10158 @item @code{if-exists-else}
10159 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10160 spec function, except that it takes two arguments.  The first argument is
10161 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10162 returns the pathname.  If it does not exist, it returns the second argument.
10163 This way, @code{if-exists-else} can be used to select one file or another,
10164 based on the existence of the first.  Here is a small example of its usage:
10165
10166 @smallexample
10167 *startfile:
10168 crt0%O%s %:if-exists(crti%O%s) \
10169 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10170 @end smallexample
10171
10172 @item @code{replace-outfile}
10173 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10174 first argument in the outfiles array and replaces it with the second argument.  Here
10175 is a small example of its usage:
10176
10177 @smallexample
10178 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10179 @end smallexample
10180
10181 @item @code{remove-outfile}
10182 The @code{remove-outfile} spec function takes one argument.  It looks for the
10183 first argument in the outfiles array and removes it.  Here is a small example
10184 its usage:
10185
10186 @smallexample
10187 %:remove-outfile(-lm)
10188 @end smallexample
10189
10190 @item @code{pass-through-libs}
10191 The @code{pass-through-libs} spec function takes any number of arguments.  It
10192 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10193 assumes are the names of linker input library archive files) and returns a
10194 result containing all the found arguments each prepended by
10195 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10196 intended to be passed to the LTO linker plugin.
10197
10198 @smallexample
10199 %:pass-through-libs(%G %L %G)
10200 @end smallexample
10201
10202 @item @code{print-asm-header}
10203 The @code{print-asm-header} function takes no arguments and simply
10204 prints a banner like:
10205
10206 @smallexample
10207 Assembler options
10208 =================
10209
10210 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10211 @end smallexample
10212
10213 It is used to separate compiler options from assembler options
10214 in the @option{--target-help} output.
10215 @end table
10216
10217 @item %@{@code{S}@}
10218 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10219 If that switch is not specified, this substitutes nothing.  Note that
10220 the leading dash is omitted when specifying this option, and it is
10221 automatically inserted if the substitution is performed.  Thus the spec
10222 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10223 and outputs the command-line option @option{-foo}.
10224
10225 @item %W@{@code{S}@}
10226 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10227 deleted on failure.
10228
10229 @item %@{@code{S}*@}
10230 Substitutes all the switches specified to GCC whose names start
10231 with @code{-S}, but which also take an argument.  This is used for
10232 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10233 GCC considers @option{-o foo} as being
10234 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10235 text, including the space.  Thus two arguments are generated.
10236
10237 @item %@{@code{S}*&@code{T}*@}
10238 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10239 (the order of @code{S} and @code{T} in the spec is not significant).
10240 There can be any number of ampersand-separated variables; for each the
10241 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10242
10243 @item %@{@code{S}:@code{X}@}
10244 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10245
10246 @item %@{!@code{S}:@code{X}@}
10247 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10248
10249 @item %@{@code{S}*:@code{X}@}
10250 Substitutes @code{X} if one or more switches whose names start with
10251 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10252 once, no matter how many such switches appeared.  However, if @code{%*}
10253 appears somewhere in @code{X}, then @code{X} is substituted once
10254 for each matching switch, with the @code{%*} replaced by the part of
10255 that switch matching the @code{*}.
10256
10257 @item %@{.@code{S}:@code{X}@}
10258 Substitutes @code{X}, if processing a file with suffix @code{S}.
10259
10260 @item %@{!.@code{S}:@code{X}@}
10261 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10262
10263 @item %@{,@code{S}:@code{X}@}
10264 Substitutes @code{X}, if processing a file for language @code{S}.
10265
10266 @item %@{!,@code{S}:@code{X}@}
10267 Substitutes @code{X}, if not processing a file for language @code{S}.
10268
10269 @item %@{@code{S}|@code{P}:@code{X}@}
10270 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10271 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10272 @code{*} sequences as well, although they have a stronger binding than
10273 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10274 alternatives must be starred, and only the first matching alternative
10275 is substituted.
10276
10277 For example, a spec string like this:
10278
10279 @smallexample
10280 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10281 @end smallexample
10282
10283 @noindent
10284 outputs the following command-line options from the following input
10285 command-line options:
10286
10287 @smallexample
10288 fred.c        -foo -baz
10289 jim.d         -bar -boggle
10290 -d fred.c     -foo -baz -boggle
10291 -d jim.d      -bar -baz -boggle
10292 @end smallexample
10293
10294 @item %@{S:X; T:Y; :D@}
10295
10296 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10297 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10298 be as many clauses as you need.  This may be combined with @code{.},
10299 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10300
10301
10302 @end table
10303
10304 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10305 construct may contain other nested @samp{%} constructs or spaces, or
10306 even newlines.  They are processed as usual, as described above.
10307 Trailing white space in @code{X} is ignored.  White space may also
10308 appear anywhere on the left side of the colon in these constructs,
10309 except between @code{.} or @code{*} and the corresponding word.
10310
10311 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10312 handled specifically in these constructs.  If another value of
10313 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10314 @option{-W} switch is found later in the command line, the earlier
10315 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10316 just one letter, which passes all matching options.
10317
10318 The character @samp{|} at the beginning of the predicate text is used to
10319 indicate that a command should be piped to the following command, but
10320 only if @option{-pipe} is specified.
10321
10322 It is built into GCC which switches take arguments and which do not.
10323 (You might think it would be useful to generalize this to allow each
10324 compiler's spec to say which switches take arguments.  But this cannot
10325 be done in a consistent fashion.  GCC cannot even decide which input
10326 files have been specified without knowing which switches take arguments,
10327 and it must know which input files to compile in order to tell which
10328 compilers to run).
10329
10330 GCC also knows implicitly that arguments starting in @option{-l} are to be
10331 treated as compiler output files, and passed to the linker in their
10332 proper position among the other output files.
10333
10334 @c man begin OPTIONS
10335
10336 @node Target Options
10337 @section Specifying Target Machine and Compiler Version
10338 @cindex target options
10339 @cindex cross compiling
10340 @cindex specifying machine version
10341 @cindex specifying compiler version and target machine
10342 @cindex compiler version, specifying
10343 @cindex target machine, specifying
10344
10345 The usual way to run GCC is to run the executable called @command{gcc}, or
10346 @command{@var{machine}-gcc} when cross-compiling, or
10347 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10348 one that was installed last.
10349
10350 @node Submodel Options
10351 @section Hardware Models and Configurations
10352 @cindex submodel options
10353 @cindex specifying hardware config
10354 @cindex hardware models and configurations, specifying
10355 @cindex machine dependent options
10356
10357 Each target machine types can have its own
10358 special options, starting with @samp{-m}, to choose among various
10359 hardware models or configurations---for example, 68010 vs 68020,
10360 floating coprocessor or none.  A single installed version of the
10361 compiler can compile for any model or configuration, according to the
10362 options specified.
10363
10364 Some configurations of the compiler also support additional special
10365 options, usually for compatibility with other compilers on the same
10366 platform.
10367
10368 @c This list is ordered alphanumerically by subsection name.
10369 @c It should be the same order and spelling as these options are listed
10370 @c in Machine Dependent Options
10371
10372 @menu
10373 * Adapteva Epiphany Options::
10374 * ARM Options::
10375 * AVR Options::
10376 * Blackfin Options::
10377 * C6X Options::
10378 * CRIS Options::
10379 * CR16 Options::
10380 * Darwin Options::
10381 * DEC Alpha Options::
10382 * FR30 Options::
10383 * FRV Options::
10384 * GNU/Linux Options::
10385 * H8/300 Options::
10386 * HPPA Options::
10387 * i386 and x86-64 Options::
10388 * i386 and x86-64 Windows Options::
10389 * IA-64 Options::
10390 * LM32 Options::
10391 * M32C Options::
10392 * M32R/D Options::
10393 * M680x0 Options::
10394 * MCore Options::
10395 * MeP Options::
10396 * MicroBlaze Options::
10397 * MIPS Options::
10398 * MMIX Options::
10399 * MN10300 Options::
10400 * PDP-11 Options::
10401 * picoChip Options::
10402 * PowerPC Options::
10403 * RL78 Options::
10404 * RS/6000 and PowerPC Options::
10405 * RX Options::
10406 * S/390 and zSeries Options::
10407 * Score Options::
10408 * SH Options::
10409 * Solaris 2 Options::
10410 * SPARC Options::
10411 * SPU Options::
10412 * System V Options::
10413 * TILE-Gx Options::
10414 * TILEPro Options::
10415 * V850 Options::
10416 * VAX Options::
10417 * VMS Options::
10418 * VxWorks Options::
10419 * x86-64 Options::
10420 * Xstormy16 Options::
10421 * Xtensa Options::
10422 * zSeries Options::
10423 @end menu
10424
10425 @node Adapteva Epiphany Options
10426 @subsection Adapteva Epiphany Options
10427
10428 These @samp{-m} options are defined for Adapteva Epiphany:
10429
10430 @table @gcctabopt
10431 @item -mhalf-reg-file
10432 @opindex mhalf-reg-file
10433 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
10434 That allows code to run on hardware variants that lack these registers.
10435
10436 @item -mprefer-short-insn-regs
10437 @opindex mprefer-short-insn-regs
10438 Preferrentially allocate registers that allow short instruction generation.
10439 This can result in increasesd instruction count, so if this reduces or
10440 increases code size might vary from case to case.
10441
10442 @item -mbranch-cost=@var{num}
10443 @opindex mbranch-cost
10444 Set the cost of branches to roughly @var{num} ``simple'' instructions.
10445 This cost is only a heuristic and is not guaranteed to produce
10446 consistent results across releases.
10447
10448 @item -mcmove
10449 @opindex mcmove
10450 Enable the generation of conditional moves.
10451
10452 @item -mnops=@var{num}
10453 @opindex mnops
10454 Emit @var{num} nops before every other generated instruction.
10455
10456 @item -mno-soft-cmpsf
10457 @opindex mno-soft-cmpsf
10458 For single-precision floating-point comparisons, emit an @code{fsub} instruction
10459 and test the flags.  This is faster than a software comparison, but can
10460 get incorrect results in the presence of NaNs, or when two different small
10461 numbers are compared such that their difference is calculated as zero.
10462 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
10463 software comparisons.
10464
10465 @item -mstack-offset=@var{num}
10466 @opindex mstack-offset
10467 Set the offset between the top of the stack and the stack pointer.
10468 E.g., a value of 8 means that the eight bytes in the range sp+0@dots{}sp+7
10469 can be used by leaf functions without stack allocation.
10470 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
10471 Note also that this option changes the ABI, compiling a program with a
10472 different stack offset than the libraries have been compiled with
10473 generally does not work.
10474 This option can be useful if you want to evaluate if a different stack
10475 offset would give you better code, but to actually use a different stack
10476 offset to build working programs, it is recommended to configure the
10477 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
10478
10479 @item -mno-round-nearest
10480 @opindex mno-round-nearest
10481 Make the scheduler assume that the rounding mode has been set to
10482 truncating.  The default is @option{-mround-nearest}.
10483
10484 @item -mlong-calls
10485 @opindex mlong-calls
10486 If not otherwise specified by an attribute, assume all calls might be beyond
10487 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
10488 function address into a register before performing a (otherwise direct) call.
10489 This is the default.
10490
10491 @item -mshort-calls
10492 @opindex short-calls
10493 If not otherwise specified by an attribute, assume all direct calls are
10494 in the range of the @code{b} / @code{bl} instructions, so use these instructions
10495 for direct calls.  The default is @option{-mlong-calls}.
10496
10497 @item -msmall16
10498 @opindex msmall16
10499 Assume addresses can be loaded as 16-bit unsigned values.  This does not
10500 apply to function addresses for which @option{-mlong-calls} semantics
10501 are in effect.
10502
10503 @item -mfp-mode=@var{mode}
10504 @opindex mfp-mode
10505 Set the prevailing mode of the floating-point unit.
10506 This determines the floating-point mode that is provided and expected
10507 at function call and return time.  Making this mode match the mode you
10508 predominantly need at function start can make your programs smaller and
10509 faster by avoiding unnecessary mode switches.
10510
10511 @var{mode} can be set to one the following values:
10512
10513 @table @samp
10514 @item caller
10515 Any mode at function entry is valid, and retained or restored when
10516 the function returns, and when it calls other functions.
10517 This mode is useful for compiling libraries or other compilation units
10518 you might want to incorporate into different programs with different
10519 prevailing FPU modes, and the convenience of being able to use a single
10520 object file outweighs the size and speed overhead for any extra
10521 mode switching that might be needed, compared with what would be needed
10522 with a more specific choice of prevailing FPU mode.
10523
10524 @item truncate
10525 This is the mode used for floating-point calculations with
10526 truncating (i.e.@: round towards zero) rounding mode.  That includes
10527 conversion from floating point to integer.
10528
10529 @item round-nearest
10530 This is the mode used for floating-point calculations with
10531 round-to-nearest-or-even rounding mode.
10532
10533 @item int
10534 This is the mode used to perform integer calculations in the FPU, e.g.@:
10535 integer multiply, or integer multiply-and-accumulate.
10536 @end table
10537
10538 The default is @option{-mfp-mode=caller}
10539
10540 @item -mnosplit-lohi
10541 @opindex mnosplit-lohi
10542 @item -mno-postinc
10543 @opindex mno-postinc
10544 @item -mno-postmodify
10545 @opindex mno-postmodify
10546 Code generation tweaks that disable, respectively, splitting of 32-bit
10547 loads, generation of post-increment addresses, and generation of
10548 post-modify addresses.  The defaults are @option{msplit-lohi},
10549 @option{-mpost-inc}, and @option{-mpost-modify}.
10550
10551 @item -mnovect-double
10552 @opindex mno-vect-double
10553 Change the preferred SIMD mode to SImode.  The default is
10554 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
10555
10556 @item -max-vect-align=@var{num}
10557 @opindex max-vect-align
10558 The maximum alignment for SIMD vector mode types.
10559 @var{num} may be 4 or 8.  The default is 8.
10560 Note that this is an ABI change, even though many library function
10561 interfaces are unaffected if they don't use SIMD vector modes
10562 in places that affect size and/or alignment of relevant types.
10563
10564 @item -msplit-vecmove-early
10565 @opindex msplit-vecmove-early
10566 Split vector moves into single word moves before reload.  In theory this
10567 can give better register allocation, but so far the reverse seems to be
10568 generally the case.
10569
10570 @item -m1reg-@var{reg}
10571 @opindex m1reg-
10572 Specify a register to hold the constant @minus{}1, which makes loading small negative
10573 constants and certain bitmasks faster.
10574 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
10575 which specify use of that register as a fixed register,
10576 and @samp{none}, which means that no register is used for this
10577 purpose.  The default is @option{-m1reg-none}.
10578
10579 @end table
10580
10581 @node ARM Options
10582 @subsection ARM Options
10583 @cindex ARM options
10584
10585 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10586 architectures:
10587
10588 @table @gcctabopt
10589 @item -mabi=@var{name}
10590 @opindex mabi
10591 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10592 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10593
10594 @item -mapcs-frame
10595 @opindex mapcs-frame
10596 Generate a stack frame that is compliant with the ARM Procedure Call
10597 Standard for all functions, even if this is not strictly necessary for
10598 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10599 with this option causes the stack frames not to be generated for
10600 leaf functions.  The default is @option{-mno-apcs-frame}.
10601
10602 @item -mapcs
10603 @opindex mapcs
10604 This is a synonym for @option{-mapcs-frame}.
10605
10606 @ignore
10607 @c not currently implemented
10608 @item -mapcs-stack-check
10609 @opindex mapcs-stack-check
10610 Generate code to check the amount of stack space available upon entry to
10611 every function (that actually uses some stack space).  If there is
10612 insufficient space available then either the function
10613 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
10614 called, depending upon the amount of stack space required.  The runtime
10615 system is required to provide these functions.  The default is
10616 @option{-mno-apcs-stack-check}, since this produces smaller code.
10617
10618 @c not currently implemented
10619 @item -mapcs-float
10620 @opindex mapcs-float
10621 Pass floating-point arguments using the floating-point registers.  This is
10622 one of the variants of the APCS@.  This option is recommended if the
10623 target hardware has a floating-point unit or if a lot of floating-point
10624 arithmetic is going to be performed by the code.  The default is
10625 @option{-mno-apcs-float}, since integer only code is slightly increased in
10626 size if @option{-mapcs-float} is used.
10627
10628 @c not currently implemented
10629 @item -mapcs-reentrant
10630 @opindex mapcs-reentrant
10631 Generate reentrant, position independent code.  The default is
10632 @option{-mno-apcs-reentrant}.
10633 @end ignore
10634
10635 @item -mthumb-interwork
10636 @opindex mthumb-interwork
10637 Generate code that supports calling between the ARM and Thumb
10638 instruction sets.  Without this option, on pre-v5 architectures, the
10639 two instruction sets cannot be reliably used inside one program.  The
10640 default is @option{-mno-thumb-interwork}, since slightly larger code
10641 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
10642 configurations this option is meaningless.
10643
10644 @item -mno-sched-prolog
10645 @opindex mno-sched-prolog
10646 Prevent the reordering of instructions in the function prologue, or the
10647 merging of those instruction with the instructions in the function's
10648 body.  This means that all functions start with a recognizable set
10649 of instructions (or in fact one of a choice from a small set of
10650 different function prologues), and this information can be used to
10651 locate the start of functions inside an executable piece of code.  The
10652 default is @option{-msched-prolog}.
10653
10654 @item -mfloat-abi=@var{name}
10655 @opindex mfloat-abi
10656 Specifies which floating-point ABI to use.  Permissible values
10657 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10658
10659 Specifying @samp{soft} causes GCC to generate output containing
10660 library calls for floating-point operations.
10661 @samp{softfp} allows the generation of code using hardware floating-point
10662 instructions, but still uses the soft-float calling conventions.
10663 @samp{hard} allows generation of floating-point instructions
10664 and uses FPU-specific calling conventions.
10665
10666 The default depends on the specific target configuration.  Note that
10667 the hard-float and soft-float ABIs are not link-compatible; you must
10668 compile your entire program with the same ABI, and link with a
10669 compatible set of libraries.
10670
10671 @item -mlittle-endian
10672 @opindex mlittle-endian
10673 Generate code for a processor running in little-endian mode.  This is
10674 the default for all standard configurations.
10675
10676 @item -mbig-endian
10677 @opindex mbig-endian
10678 Generate code for a processor running in big-endian mode; the default is
10679 to compile code for a little-endian processor.
10680
10681 @item -mwords-little-endian
10682 @opindex mwords-little-endian
10683 This option only applies when generating code for big-endian processors.
10684 Generate code for a little-endian word order but a big-endian byte
10685 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10686 option should only be used if you require compatibility with code for
10687 big-endian ARM processors generated by versions of the compiler prior to
10688 2.8.  This option is now deprecated.
10689
10690 @item -mcpu=@var{name}
10691 @opindex mcpu
10692 This specifies the name of the target ARM processor.  GCC uses this name
10693 to determine what kind of instructions it can emit when generating
10694 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10695 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10696 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10697 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10698 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10699 @samp{arm720},
10700 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10701 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10702 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10703 @samp{strongarm1110},
10704 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10705 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10706 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10707 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10708 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10709 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10710 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10711 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
10712 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
10713 @samp{cortex-m4}, @samp{cortex-m3},
10714 @samp{cortex-m1},
10715 @samp{cortex-m0},
10716 @samp{cortex-m0plus},
10717 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
10718 @samp{fa526}, @samp{fa626},
10719 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
10720
10721
10722 @option{-mcpu=generic-@var{arch}} is also permissible, and is
10723 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
10724 See @option{-mtune} for more information.
10725
10726 @option{-mcpu=native} causes the compiler to auto-detect the CPU
10727 of the build computer.  At present, this feature is only supported on
10728 Linux, and not all architectures are recognized.  If the auto-detect is
10729 unsuccessful the option has no effect.
10730
10731 @item -mtune=@var{name}
10732 @opindex mtune
10733 This option is very similar to the @option{-mcpu=} option, except that
10734 instead of specifying the actual target processor type, and hence
10735 restricting which instructions can be used, it specifies that GCC should
10736 tune the performance of the code as if the target were of the type
10737 specified in this option, but still choosing the instructions it
10738 generates based on the CPU specified by a @option{-mcpu=} option.
10739 For some ARM implementations better performance can be obtained by using
10740 this option.
10741
10742 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
10743 performance for a blend of processors within architecture @var{arch}.
10744 The aim is to generate code that run well on the current most popular
10745 processors, balancing between optimizations that benefit some CPUs in the
10746 range, and avoiding performance pitfalls of other CPUs.  The effects of
10747 this option may change in future GCC versions as CPU models come and go.
10748
10749 @option{-mtune=native} causes the compiler to auto-detect the CPU
10750 of the build computer.  At present, this feature is only supported on
10751 Linux, and not all architectures are recognized.  If the auto-detect is
10752 unsuccessful the option has no effect.
10753
10754 @item -march=@var{name}
10755 @opindex march
10756 This specifies the name of the target ARM architecture.  GCC uses this
10757 name to determine what kind of instructions it can emit when generating
10758 assembly code.  This option can be used in conjunction with or instead
10759 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10760 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10761 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10762 @samp{armv6}, @samp{armv6j},
10763 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10764 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10765 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10766
10767 @option{-march=native} causes the compiler to auto-detect the architecture
10768 of the build computer.  At present, this feature is only supported on
10769 Linux, and not all architectures are recognized.  If the auto-detect is
10770 unsuccessful the option has no effect.
10771
10772 @item -mfpu=@var{name}
10773 @itemx -mfpe=@var{number}
10774 @itemx -mfp=@var{number}
10775 @opindex mfpu
10776 @opindex mfpe
10777 @opindex mfp
10778 This specifies what floating-point hardware (or hardware emulation) is
10779 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10780 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10781 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10782 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10783 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10784 @option{-mfp} and @option{-mfpe} are synonyms for
10785 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10786 of GCC@.
10787
10788 If @option{-msoft-float} is specified this specifies the format of
10789 floating-point values.
10790
10791 If the selected floating-point hardware includes the NEON extension
10792 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10793 operations are not generated by GCC's auto-vectorization pass unless
10794 @option{-funsafe-math-optimizations} is also specified.  This is
10795 because NEON hardware does not fully implement the IEEE 754 standard for
10796 floating-point arithmetic (in particular denormal values are treated as
10797 zero), so the use of NEON instructions may lead to a loss of precision.
10798
10799 @item -mfp16-format=@var{name}
10800 @opindex mfp16-format
10801 Specify the format of the @code{__fp16} half-precision floating-point type.
10802 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10803 the default is @samp{none}, in which case the @code{__fp16} type is not
10804 defined.  @xref{Half-Precision}, for more information.
10805
10806 @item -mstructure-size-boundary=@var{n}
10807 @opindex mstructure-size-boundary
10808 The sizes of all structures and unions are rounded up to a multiple
10809 of the number of bits set by this option.  Permissible values are 8, 32
10810 and 64.  The default value varies for different toolchains.  For the COFF
10811 targeted toolchain the default value is 8.  A value of 64 is only allowed
10812 if the underlying ABI supports it.
10813
10814 Specifying the larger number can produce faster, more efficient code, but
10815 can also increase the size of the program.  Different values are potentially
10816 incompatible.  Code compiled with one value cannot necessarily expect to
10817 work with code or libraries compiled with another value, if they exchange
10818 information using structures or unions.
10819
10820 @item -mabort-on-noreturn
10821 @opindex mabort-on-noreturn
10822 Generate a call to the function @code{abort} at the end of a
10823 @code{noreturn} function.  It is executed if the function tries to
10824 return.
10825
10826 @item -mlong-calls
10827 @itemx -mno-long-calls
10828 @opindex mlong-calls
10829 @opindex mno-long-calls
10830 Tells the compiler to perform function calls by first loading the
10831 address of the function into a register and then performing a subroutine
10832 call on this register.  This switch is needed if the target function
10833 lies outside of the 64-megabyte addressing range of the offset-based
10834 version of subroutine call instruction.
10835
10836 Even if this switch is enabled, not all function calls are turned
10837 into long calls.  The heuristic is that static functions, functions
10838 that have the @samp{short-call} attribute, functions that are inside
10839 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
10840 definitions have already been compiled within the current compilation
10841 unit are not turned into long calls.  The exceptions to this rule are
10842 that weak function definitions, functions with the @samp{long-call}
10843 attribute or the @samp{section} attribute, and functions that are within
10844 the scope of a @samp{#pragma long_calls} directive are always
10845 turned into long calls.
10846
10847 This feature is not enabled by default.  Specifying
10848 @option{-mno-long-calls} restores the default behavior, as does
10849 placing the function calls within the scope of a @samp{#pragma
10850 long_calls_off} directive.  Note these switches have no effect on how
10851 the compiler generates code to handle function calls via function
10852 pointers.
10853
10854 @item -msingle-pic-base
10855 @opindex msingle-pic-base
10856 Treat the register used for PIC addressing as read-only, rather than
10857 loading it in the prologue for each function.  The runtime system is
10858 responsible for initializing this register with an appropriate value
10859 before execution begins.
10860
10861 @item -mpic-register=@var{reg}
10862 @opindex mpic-register
10863 Specify the register to be used for PIC addressing.  The default is R10
10864 unless stack-checking is enabled, when R9 is used.
10865
10866 @item -mcirrus-fix-invalid-insns
10867 @opindex mcirrus-fix-invalid-insns
10868 @opindex mno-cirrus-fix-invalid-insns
10869 Insert NOPs into the instruction stream to in order to work around
10870 problems with invalid Maverick instruction combinations.  This option
10871 is only valid if the @option{-mcpu=ep9312} option has been used to
10872 enable generation of instructions for the Cirrus Maverick floating-point
10873 co-processor.  This option is not enabled by default, since the
10874 problem is only present in older Maverick implementations.  The default
10875 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10876 switch.
10877
10878 @item -mpoke-function-name
10879 @opindex mpoke-function-name
10880 Write the name of each function into the text section, directly
10881 preceding the function prologue.  The generated code is similar to this:
10882
10883 @smallexample
10884      t0
10885          .ascii "arm_poke_function_name", 0
10886          .align
10887      t1
10888          .word 0xff000000 + (t1 - t0)
10889      arm_poke_function_name
10890          mov     ip, sp
10891          stmfd   sp!, @{fp, ip, lr, pc@}
10892          sub     fp, ip, #4
10893 @end smallexample
10894
10895 When performing a stack backtrace, code can inspect the value of
10896 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10897 location @code{pc - 12} and the top 8 bits are set, then we know that
10898 there is a function name embedded immediately preceding this location
10899 and has length @code{((pc[-3]) & 0xff000000)}.
10900
10901 @item -mthumb
10902 @itemx -marm
10903 @opindex marm
10904 @opindex mthumb
10905
10906 Select between generating code that executes in ARM and Thumb
10907 states.  The default for most configurations is to generate code
10908 that executes in ARM state, but the default can be changed by
10909 configuring GCC with the @option{--with-mode=}@var{state}
10910 configure option.
10911
10912 @item -mtpcs-frame
10913 @opindex mtpcs-frame
10914 Generate a stack frame that is compliant with the Thumb Procedure Call
10915 Standard for all non-leaf functions.  (A leaf function is one that does
10916 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10917
10918 @item -mtpcs-leaf-frame
10919 @opindex mtpcs-leaf-frame
10920 Generate a stack frame that is compliant with the Thumb Procedure Call
10921 Standard for all leaf functions.  (A leaf function is one that does
10922 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10923
10924 @item -mcallee-super-interworking
10925 @opindex mcallee-super-interworking
10926 Gives all externally visible functions in the file being compiled an ARM
10927 instruction set header which switches to Thumb mode before executing the
10928 rest of the function.  This allows these functions to be called from
10929 non-interworking code.  This option is not valid in AAPCS configurations
10930 because interworking is enabled by default.
10931
10932 @item -mcaller-super-interworking
10933 @opindex mcaller-super-interworking
10934 Allows calls via function pointers (including virtual functions) to
10935 execute correctly regardless of whether the target code has been
10936 compiled for interworking or not.  There is a small overhead in the cost
10937 of executing a function pointer if this option is enabled.  This option
10938 is not valid in AAPCS configurations because interworking is enabled
10939 by default.
10940
10941 @item -mtp=@var{name}
10942 @opindex mtp
10943 Specify the access model for the thread local storage pointer.  The valid
10944 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10945 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10946 (supported in the arm6k architecture), and @option{auto}, which uses the
10947 best available method for the selected processor.  The default setting is
10948 @option{auto}.
10949
10950 @item -mtls-dialect=@var{dialect}
10951 @opindex mtls-dialect
10952 Specify the dialect to use for accessing thread local storage.  Two
10953 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
10954 @samp{gnu} dialect selects the original GNU scheme for supporting
10955 local and global dynamic TLS models.  The @samp{gnu2} dialect
10956 selects the GNU descriptor scheme, which provides better performance
10957 for shared libraries.  The GNU descriptor scheme is compatible with
10958 the original scheme, but does require new assembler, linker and
10959 library support.  Initial and local exec TLS models are unaffected by
10960 this option and always use the original scheme.
10961
10962 @item -mword-relocations
10963 @opindex mword-relocations
10964 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
10965 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10966 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10967 is specified.
10968
10969 @item -mfix-cortex-m3-ldrd
10970 @opindex mfix-cortex-m3-ldrd
10971 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10972 with overlapping destination and base registers are used.  This option avoids
10973 generating these instructions.  This option is enabled by default when
10974 @option{-mcpu=cortex-m3} is specified.
10975
10976 @end table
10977
10978 @node AVR Options
10979 @subsection AVR Options
10980 @cindex AVR Options
10981
10982 These options are defined for AVR implementations:
10983
10984 @table @gcctabopt
10985 @item -mmcu=@var{mcu}
10986 @opindex mmcu
10987 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
10988
10989 For a complete list of @var{mcu} values that are supported by @command{avr-gcc},
10990 see the compiler output when called with the @option{--help=target}
10991 command line option.
10992 The default for this option is@tie{}@code{avr2}.
10993
10994 GCC supports the following AVR devices and ISAs:
10995
10996 @table @code
10997
10998 @item avr1
10999 This ISA is implemented by the minimal AVR core and supported
11000 for assembler only.
11001 @*@var{mcu}@tie{}= @code{at90s1200},
11002 @code{attiny10}, @code{attiny11}, @code{attiny12}, @code{attiny15},
11003 @code{attiny28}.
11004
11005 @item avr2
11006 ``Classic'' devices with up to 8@tie{}KiB of program memory.
11007 @*@var{mcu}@tie{}= @code{at90s2313}, @code{attiny26}, @code{at90c8534},
11008 @dots{}
11009
11010 @item avr25
11011 ``Classic'' devices with up to 8@tie{}KiB of program memory and with
11012 the @code{MOVW} instruction.
11013 @*@var{mcu}@tie{}= @code{attiny2313}, @code{attiny261}, @code{attiny24},
11014 @dots{}
11015
11016 @item avr3
11017 ``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
11018 @*@var{mcu}@tie{}= @code{at43usb355}, @code{at76c711}.
11019
11020 @item avr31
11021 ``Classic'' devices with 128@tie{}KiB of program memory.
11022 @*@var{mcu}@tie{}= @code{atmega103}, @code{at43usb320}.
11023
11024 @item avr35
11025 ``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program
11026 memory and with the @code{MOVW} instruction.
11027 @*@var{mcu}@tie{}= @code{at90usb162}, @code{atmega8u2},
11028 @code{attiny167}, @dots{}
11029
11030 @item avr4
11031 ``Enhanced'' devices with up to 8@tie{}KiB of program memory.
11032 @*@var{mcu}@tie{}= @code{atmega8}, @code{atmega88}, @code{at90pwm81},
11033 @dots{}
11034
11035 @item avr5
11036 ``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
11037 @*@var{mcu}@tie{}= @code{atmega16}, @code{atmega6490}, @code{at90can64},
11038 @dots{}
11039
11040 @item avr51
11041 ``Enhanced'' devices with 128@tie{}KiB of program memory.
11042 @*@var{mcu}@tie{}= @code{atmega128}, @code{at90can128}, @code{at90usb1287},
11043 @dots{}
11044
11045 @item avr6
11046 ``Enhanced'' devices with 3-byte PC, i.e.@: with at least 256@tie{}KiB
11047 of program memory.
11048 @*@var{mcu}@tie{}= @code{atmega2560}, @code{atmega2561}.
11049
11050 @item avrxmega2
11051 ``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB
11052 of program memory.
11053 @*@var{mcu}@tie{}= @code{atxmega16a4}, @code{atxmega16d4},
11054 @dots{}
11055
11056 @item avrxmega4
11057 ``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB
11058 of program memory.
11059 @*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64d3}.
11060
11061 @item avrxmega5
11062 ``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB
11063 of program memory and more than 64@tie{}KiB of RAM.
11064 @*@var{mcu}@tie{}= @code{atxmega64a1}, @code{atxmega64a1u}.
11065
11066 @item avrxmega6
11067 ``XMEGA'' devices with more than 128@tie{}KiB of program memory.
11068 @*@var{mcu}@tie{}= @code{atxmega128a3}, @code{atxmega192d3},
11069 @dots{}
11070
11071 @item avrxmega7
11072 ``XMEGA'' devices with more than 128@tie{}KiB of program memory and
11073 more than 64@tie{}KiB of RAM.
11074 @*@var{mcu}@tie{}= @code{atxmega128a1}, @code{atxmega128a1u}.
11075
11076 @end table
11077
11078
11079 @item -maccumulate-args
11080 @opindex maccumulate-args
11081 Accumulate outgoing function arguments and acquire/release the needed
11082 stack space for outgoing function arguments once in function
11083 prologue/epilogue.  Without this option, outgoing arguments are pushed
11084 before calling a function and popped afterwards.
11085
11086 Popping the arguments after the function call can be expensive on
11087 AVR so that accumulating the stack space might lead to smaller
11088 executables because arguments need not to be removed from the
11089 stack after such a function call.
11090
11091 This option can lead to reduced code size for functions that perform
11092 several calls to functions that get their arguments on the stack like
11093 calls to printf-like functions.
11094
11095 @item -mbranch-cost=@var{cost}
11096 @opindex mbranch-cost
11097 Set the branch costs for conditional branch instructions to
11098 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11099 integers. The default branch cost is 0.
11100
11101 @item -mcall-prologues
11102 @opindex mcall-prologues
11103 Functions prologues/epilogues are expanded as calls to appropriate
11104 subroutines.  Code size is smaller.
11105
11106 @item -mint8
11107 @opindex mint8
11108 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11109 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11110 and @code{long long} is 4 bytes.  Please note that this option does not
11111 conform to the C standards, but it results in smaller code
11112 size.
11113
11114 @item -mno-interrupts
11115 @opindex mno-interrupts
11116 Generated code is not compatible with hardware interrupts.
11117 Code size is smaller.
11118
11119 @item -mrelax
11120 @opindex mrelax
11121 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11122 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11123 Setting @code{-mrelax} just adds the @code{--relax} option to the
11124 linker command line when the linker is called.
11125
11126 Jump relaxing is performed by the linker because jump offsets are not
11127 known before code is located. Therefore, the assembler code generated by the
11128 compiler is the same, but the instructions in the executable may
11129 differ from instructions in the assembler code.
11130
11131 @item -mshort-calls
11132 @opindex mshort-calls
11133 Use @code{RCALL}/@code{RJMP} instructions even on devices with
11134 16@tie{}KiB or more of program memory, i.e.@: on devices that
11135 have the @code{CALL} and @code{JMP} instructions.
11136 See also the @code{-mrelax} command line option.
11137
11138 @item -mstrict-X
11139 @opindex mstrict-X
11140 Use address register @code{X} in a way proposed by the hardware.  This means
11141 that @code{X} is only used in indirect, post-increment or
11142 pre-decrement addressing.
11143
11144 Without this option, the @code{X} register may be used in the same way
11145 as @code{Y} or @code{Z} which then is emulated by additional
11146 instructions.  
11147 For example, loading a value with @code{X+const} addressing with a
11148 small non-negative @code{const < 64} to a register @var{Rn} is
11149 performed as
11150
11151 @example
11152 adiw r26, const   ; X += const
11153 ld   @var{Rn}, X        ; @var{Rn} = *X
11154 sbiw r26, const   ; X -= const
11155 @end example
11156
11157 @item -mtiny-stack
11158 @opindex mtiny-stack
11159 Only change the lower 8@tie{}bits of the stack pointer.
11160 @end table
11161
11162 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11163 @cindex @code{EIND}
11164 Pointers in the implementation are 16@tie{}bits wide.
11165 The address of a function or label is represented as word address so
11166 that indirect jumps and calls can target any code address in the
11167 range of 64@tie{}Ki words.
11168
11169 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11170 bytes of program memory space, there is a special function register called
11171 @code{EIND} that serves as most significant part of the target address
11172 when @code{EICALL} or @code{EIJMP} instructions are used.
11173
11174 Indirect jumps and calls on these devices are handled as follows by
11175 the compiler and are subject to some limitations:
11176
11177 @itemize @bullet
11178
11179 @item
11180 The compiler never sets @code{EIND}.
11181
11182 @item
11183 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11184 instructions or might read @code{EIND} directly in order to emulate an
11185 indirect call/jump by means of a @code{RET} instruction.
11186
11187 @item
11188 The compiler assumes that @code{EIND} never changes during the startup
11189 code or during the application. In particular, @code{EIND} is not
11190 saved/restored in function or interrupt service routine
11191 prologue/epilogue.
11192
11193 @item
11194 For indirect calls to functions and computed goto, the linker
11195 generates @emph{stubs}. Stubs are jump pads sometimes also called
11196 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11197 The stub contains a direct jump to the desired address.
11198
11199 @item
11200 The default linker script is arranged for code with @code{EIND = 0}.
11201 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11202 linker script has to be used in order to place the sections whose
11203 name start with @code{.trampolines} into the segment where @code{EIND}
11204 points to.
11205
11206 @item
11207 The startup code from libgcc never sets @code{EIND}.
11208 Notice that startup code is a blend of code from libgcc and AVR-Libc.
11209 For the impact of AVR-Libc on @code{EIND}, see the
11210 @w{@uref{http://nongnu.org/avr-libc/user-manual,AVR-Libc user manual}}.
11211
11212 @item
11213 It is legitimate for user-specific startup code to set up @code{EIND}
11214 early, for example by means of initialization code located in
11215 section @code{.init3}. Such code runs prior to general startup code
11216 that initializes RAM and calls constructors, but after the bit
11217 of startup code from AVR-Libc that sets @code{EIND} to the segment
11218 where the vector table is located.
11219 @example
11220 #include <avr/io.h>
11221
11222 static void
11223 __attribute__ ((section (".init3"), naked, used, no_instrument_function))
11224 init3_set_eind (void)
11225 @{
11226     __asm volatile ("ldi r24, pm_hh8(__trampolines_start)" "\n\t"
11227                     "out %i0, r24" :: "n" (&EIND) : "r24", "memory");
11228 @}
11229 @end example
11230
11231 @noindent
11232 The @code{__trampolines_start} symbol is defined in the linker script.
11233
11234 @item
11235 Stubs are generated automatically by the linker if
11236 the following two conditions are met:
11237 @itemize @minus
11238
11239 @item The address of a label is taken by means of the @code{gs} modifier
11240 (short for @emph{generate stubs}) like so:
11241 @example
11242 LDI r24, lo8(gs(@var{func}))
11243 LDI r25, hi8(gs(@var{func}))
11244 @end example
11245 @item The final location of that label is in a code segment
11246 @emph{outside} the segment where the stubs are located.
11247 @end itemize
11248
11249 @item
11250 The compiler emits such @code{gs} modifiers for code labels in the
11251 following situations:
11252 @itemize @minus
11253 @item Taking address of a function or code label.
11254 @item Computed goto.
11255 @item If prologue-save function is used, see @option{-mcall-prologues}
11256 command-line option.
11257 @item Switch/case dispatch tables. If you do not want such dispatch
11258 tables you can specify the @option{-fno-jump-tables} command-line option.
11259 @item C and C++ constructors/destructors called during startup/shutdown.
11260 @item If the tools hit a @code{gs()} modifier explained above.
11261 @end itemize
11262
11263 @item
11264 Jumping to non-symbolic addresses like so is @emph{not} supported:
11265
11266 @example
11267 int main (void)
11268 @{
11269     /* Call function at word address 0x2 */
11270     return ((int(*)(void)) 0x2)();
11271 @}
11272 @end example
11273
11274 Instead, a stub has to be set up, i.e.@: the function has to be called
11275 through a symbol (@code{func_4} in the example):
11276
11277 @example
11278 int main (void)
11279 @{
11280     extern int func_4 (void);
11281
11282     /* Call function at byte address 0x4 */
11283     return func_4();
11284 @}
11285 @end example
11286
11287 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11288 Alternatively, @code{func_4} can be defined in the linker script.
11289 @end itemize
11290
11291 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11292 @cindex @code{RAMPD}
11293 @cindex @code{RAMPX}
11294 @cindex @code{RAMPY}
11295 @cindex @code{RAMPZ}
11296 Some AVR devices support memories larger than the 64@tie{}KiB range
11297 that can be accessed with 16-bit pointers.  To access memory locations
11298 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11299 register is used as high part of the address:
11300 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11301 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11302 register, respectively, to get a wide address. Similarly,
11303 @code{RAMPD} is used together with direct addressing.
11304
11305 @itemize
11306 @item
11307 The startup code initializes the @code{RAMP} special function
11308 registers with zero.
11309
11310 @item
11311 If a @ref{AVR Named Address Spaces,named address space} other than
11312 generic or @code{__flash} is used, then @code{RAMPZ} is set
11313 as needed before the operation.
11314
11315 @item
11316 If the device supports RAM larger than 64@tie{KiB} and the compiler
11317 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11318 is reset to zero after the operation.
11319
11320 @item
11321 If the device comes with a specific @code{RAMP} register, the ISR
11322 prologue/epilogue saves/restores that SFR and initializes it with
11323 zero in case the ISR code might (implicitly) use it.
11324
11325 @item
11326 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
11327 If you use inline assembler to read from locations outside the
11328 16-bit address range and change one of the @code{RAMP} registers,
11329 you must reset it to zero after the access.
11330
11331 @end itemize
11332
11333 @subsubsection AVR Built-in Macros
11334
11335 GCC defines several built-in macros so that the user code can test
11336 for the presence or absence of features.  Almost any of the following
11337 built-in macros are deduced from device capabilities and thus
11338 triggered by the @code{-mmcu=} command-line option.
11339
11340 For even more AVR-specific built-in macros see
11341 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
11342
11343 @table @code
11344
11345 @item __AVR_@var{Device}__
11346 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
11347 the device's name. For example, @code{-mmcu=atmega8} defines the
11348 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
11349 @code{__AVR_ATtiny261A__}, etc.
11350
11351 The built-in macros' names follow
11352 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
11353 the device name as from the AVR user manual. The difference between
11354 @var{Device} in the built-in macro and @var{device} in
11355 @code{-mmcu=@var{device}} is that the latter is always lowercase.
11356
11357 @item __AVR_HAVE_ELPM__
11358 The device has the the @code{ELPM} instruction.
11359
11360 @item __AVR_HAVE_ELPMX__
11361 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
11362 R@var{n},Z+} instructions.
11363
11364 @item __AVR_HAVE_MOVW__
11365 The device has the @code{MOVW} instruction to perform 16-bit
11366 register-register moves.
11367
11368 @item __AVR_HAVE_LPMX__
11369 The device has the @code{LPM R@var{n},Z} and @code{LPM
11370 R@var{n},Z+} instructions.
11371
11372 @item __AVR_HAVE_MUL__
11373 The device has a hardware multiplier. 
11374
11375 @item __AVR_HAVE_JMP_CALL__
11376 The device has the @code{JMP} and @code{CALL} instructions.
11377 This is the case for devices with at least 16@tie{}KiB of program
11378 memory and if @code{-mshort-calls} is not set.
11379
11380 @item __AVR_HAVE_EIJMP_EICALL__
11381 @item __AVR_3_BYTE_PC__
11382 The device has the @code{EIJMP} and @code{EICALL} instructions.
11383 This is the case for devices with more than 128@tie{}KiB of program memory.
11384 This also means that the program counter
11385 (PC) is 3@tie{}bytes wide.
11386
11387 @item __AVR_2_BYTE_PC__
11388 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
11389 with up to 128@tie{}KiB of program memory.
11390
11391 @item __AVR_HAVE_8BIT_SP__
11392 @item __AVR_HAVE_16BIT_SP__
11393 The stack pointer (SP) is respectively 8 or 16 bits wide.
11394 The definition of these macros is affected by @code{-mtiny-stack}.
11395
11396 @item __AVR_HAVE_RAMPD__
11397 @item __AVR_HAVE_RAMPX__
11398 @item __AVR_HAVE_RAMPY__
11399 @item __AVR_HAVE_RAMPZ__
11400 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
11401 @code{RAMPZ} special function register, respectively.
11402
11403 @item __NO_INTERRUPTS__
11404 This macro reflects the @code{-mno-interrupts} command line option.
11405
11406 @item __AVR_ERRATA_SKIP__
11407 @item __AVR_ERRATA_SKIP_JMP_CALL__
11408 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
11409 instructions because of a hardware erratum.  Skip instructions are
11410 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
11411 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
11412 set.
11413
11414 @item __AVR_SFR_OFFSET__=@var{offset}
11415 Instructions that can address I/O special function registers directly
11416 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
11417 address as if addressed by an instruction to access RAM like @code{LD}
11418 or @code{STS}. This offset depends on the device architecture and has
11419 to be subtracted from the RAM address in order to get the
11420 respective I/O@tie{}address.
11421
11422 @end table
11423
11424 @node Blackfin Options
11425 @subsection Blackfin Options
11426 @cindex Blackfin Options
11427
11428 @table @gcctabopt
11429 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
11430 @opindex mcpu=
11431 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
11432 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
11433 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
11434 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
11435 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
11436 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
11437 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
11438 @samp{bf561}, @samp{bf592}.
11439 The optional @var{sirevision} specifies the silicon revision of the target
11440 Blackfin processor.  Any workarounds available for the targeted silicon revision
11441 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
11442 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
11443 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
11444 hexadecimal digits representing the major and minor numbers in the silicon
11445 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
11446 is not defined.  If @var{sirevision} is @samp{any}, the
11447 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
11448 If this optional @var{sirevision} is not used, GCC assumes the latest known
11449 silicon revision of the targeted Blackfin processor.
11450
11451 Support for @samp{bf561} is incomplete.  For @samp{bf561},
11452 Only the processor macro is defined.
11453 Without this option, @samp{bf532} is used as the processor by default.
11454 The corresponding predefined processor macros for @var{cpu} is to
11455 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
11456 provided by libgloss to be linked in if @option{-msim} is not given.
11457
11458 @item -msim
11459 @opindex msim
11460 Specifies that the program will be run on the simulator.  This causes
11461 the simulator BSP provided by libgloss to be linked in.  This option
11462 has effect only for @samp{bfin-elf} toolchain.
11463 Certain other options, such as @option{-mid-shared-library} and
11464 @option{-mfdpic}, imply @option{-msim}.
11465
11466 @item -momit-leaf-frame-pointer
11467 @opindex momit-leaf-frame-pointer
11468 Don't keep the frame pointer in a register for leaf functions.  This
11469 avoids the instructions to save, set up and restore frame pointers and
11470 makes an extra register available in leaf functions.  The option
11471 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
11472 which might make debugging harder.
11473
11474 @item -mspecld-anomaly
11475 @opindex mspecld-anomaly
11476 When enabled, the compiler ensures that the generated code does not
11477 contain speculative loads after jump instructions. If this option is used,
11478 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
11479
11480 @item -mno-specld-anomaly
11481 @opindex mno-specld-anomaly
11482 Don't generate extra code to prevent speculative loads from occurring.
11483
11484 @item -mcsync-anomaly
11485 @opindex mcsync-anomaly
11486 When enabled, the compiler ensures that the generated code does not
11487 contain CSYNC or SSYNC instructions too soon after conditional branches.
11488 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
11489
11490 @item -mno-csync-anomaly
11491 @opindex mno-csync-anomaly
11492 Don't generate extra code to prevent CSYNC or SSYNC instructions from
11493 occurring too soon after a conditional branch.
11494
11495 @item -mlow-64k
11496 @opindex mlow-64k
11497 When enabled, the compiler is free to take advantage of the knowledge that
11498 the entire program fits into the low 64k of memory.
11499
11500 @item -mno-low-64k
11501 @opindex mno-low-64k
11502 Assume that the program is arbitrarily large.  This is the default.
11503
11504 @item -mstack-check-l1
11505 @opindex mstack-check-l1
11506 Do stack checking using information placed into L1 scratchpad memory by the
11507 uClinux kernel.
11508
11509 @item -mid-shared-library
11510 @opindex mid-shared-library
11511 Generate code that supports shared libraries via the library ID method.
11512 This allows for execute in place and shared libraries in an environment
11513 without virtual memory management.  This option implies @option{-fPIC}.
11514 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11515
11516 @item -mno-id-shared-library
11517 @opindex mno-id-shared-library
11518 Generate code that doesn't assume ID based shared libraries are being used.
11519 This is the default.
11520
11521 @item -mleaf-id-shared-library
11522 @opindex mleaf-id-shared-library
11523 Generate code that supports shared libraries via the library ID method,
11524 but assumes that this library or executable won't link against any other
11525 ID shared libraries.  That allows the compiler to use faster code for jumps
11526 and calls.
11527
11528 @item -mno-leaf-id-shared-library
11529 @opindex mno-leaf-id-shared-library
11530 Do not assume that the code being compiled won't link against any ID shared
11531 libraries.  Slower code is generated for jump and call insns.
11532
11533 @item -mshared-library-id=n
11534 @opindex mshared-library-id
11535 Specifies the identification number of the ID-based shared library being
11536 compiled.  Specifying a value of 0 generates more compact code; specifying
11537 other values forces the allocation of that number to the current
11538 library but is no more space- or time-efficient than omitting this option.
11539
11540 @item -msep-data
11541 @opindex msep-data
11542 Generate code that allows the data segment to be located in a different
11543 area of memory from the text segment.  This allows for execute in place in
11544 an environment without virtual memory management by eliminating relocations
11545 against the text section.
11546
11547 @item -mno-sep-data
11548 @opindex mno-sep-data
11549 Generate code that assumes that the data segment follows the text segment.
11550 This is the default.
11551
11552 @item -mlong-calls
11553 @itemx -mno-long-calls
11554 @opindex mlong-calls
11555 @opindex mno-long-calls
11556 Tells the compiler to perform function calls by first loading the
11557 address of the function into a register and then performing a subroutine
11558 call on this register.  This switch is needed if the target function
11559 lies outside of the 24-bit addressing range of the offset-based
11560 version of subroutine call instruction.
11561
11562 This feature is not enabled by default.  Specifying
11563 @option{-mno-long-calls} restores the default behavior.  Note these
11564 switches have no effect on how the compiler generates code to handle
11565 function calls via function pointers.
11566
11567 @item -mfast-fp
11568 @opindex mfast-fp
11569 Link with the fast floating-point library. This library relaxes some of
11570 the IEEE floating-point standard's rules for checking inputs against
11571 Not-a-Number (NAN), in the interest of performance.
11572
11573 @item -minline-plt
11574 @opindex minline-plt
11575 Enable inlining of PLT entries in function calls to functions that are
11576 not known to bind locally.  It has no effect without @option{-mfdpic}.
11577
11578 @item -mmulticore
11579 @opindex mmulticore
11580 Build standalone application for multicore Blackfin processor. Proper
11581 start files and link scripts are used to support multicore.
11582 This option defines @code{__BFIN_MULTICORE}. It can only be used with
11583 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
11584 @option{-mcorea} or @option{-mcoreb}. If it's used without
11585 @option{-mcorea} or @option{-mcoreb}, single application/dual core
11586 programming model is used. In this model, the main function of Core B
11587 should be named as coreb_main. If it's used with @option{-mcorea} or
11588 @option{-mcoreb}, one application per core programming model is used.
11589 If this option is not used, single core application programming
11590 model is used.
11591
11592 @item -mcorea
11593 @opindex mcorea
11594 Build standalone application for Core A of BF561 when using
11595 one application per core programming model. Proper start files
11596 and link scripts are used to support Core A. This option
11597 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
11598
11599 @item -mcoreb
11600 @opindex mcoreb
11601 Build standalone application for Core B of BF561 when using
11602 one application per core programming model. Proper start files
11603 and link scripts are used to support Core B. This option
11604 defines @code{__BFIN_COREB}. When this option is used, coreb_main
11605 should be used instead of main. It must be used with
11606 @option{-mmulticore}.
11607
11608 @item -msdram
11609 @opindex msdram
11610 Build standalone application for SDRAM. Proper start files and
11611 link scripts are used to put the application into SDRAM.
11612 Loader should initialize SDRAM before loading the application
11613 into SDRAM. This option defines @code{__BFIN_SDRAM}.
11614
11615 @item -micplb
11616 @opindex micplb
11617 Assume that ICPLBs are enabled at run time.  This has an effect on certain
11618 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
11619 are enabled; for standalone applications the default is off.
11620 @end table
11621
11622 @node C6X Options
11623 @subsection C6X Options
11624 @cindex C6X Options
11625
11626 @table @gcctabopt
11627 @item -march=@var{name}
11628 @opindex march
11629 This specifies the name of the target architecture.  GCC uses this
11630 name to determine what kind of instructions it can emit when generating
11631 assembly code.  Permissible names are: @samp{c62x},
11632 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
11633
11634 @item -mbig-endian
11635 @opindex mbig-endian
11636 Generate code for a big-endian target.
11637
11638 @item -mlittle-endian
11639 @opindex mlittle-endian
11640 Generate code for a little-endian target.  This is the default.
11641
11642 @item -msim
11643 @opindex msim
11644 Choose startup files and linker script suitable for the simulator.
11645
11646 @item -msdata=default
11647 @opindex msdata=default
11648 Put small global and static data in the @samp{.neardata} section,
11649 which is pointed to by register @code{B14}.  Put small uninitialized
11650 global and static data in the @samp{.bss} section, which is adjacent
11651 to the @samp{.neardata} section.  Put small read-only data into the
11652 @samp{.rodata} section.  The corresponding sections used for large
11653 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
11654
11655 @item -msdata=all
11656 @opindex msdata=all
11657 Put all data, not just small objets, into the sections reserved for
11658 small data, and use addressing relative to the @code{B14} register to
11659 access them.
11660
11661 @item -msdata=none
11662 @opindex msdata=none
11663 Make no use of the sections reserved for small data, and use absolute
11664 addresses to access all data.  Put all initialized global and static
11665 data in the @samp{.fardata} section, and all uninitialized data in the
11666 @samp{.far} section.  Put all constant data into the @samp{.const}
11667 section.
11668 @end table
11669
11670 @node CRIS Options
11671 @subsection CRIS Options
11672 @cindex CRIS Options
11673
11674 These options are defined specifically for the CRIS ports.
11675
11676 @table @gcctabopt
11677 @item -march=@var{architecture-type}
11678 @itemx -mcpu=@var{architecture-type}
11679 @opindex march
11680 @opindex mcpu
11681 Generate code for the specified architecture.  The choices for
11682 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
11683 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
11684 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
11685 @samp{v10}.
11686
11687 @item -mtune=@var{architecture-type}
11688 @opindex mtune
11689 Tune to @var{architecture-type} everything applicable about the generated
11690 code, except for the ABI and the set of available instructions.  The
11691 choices for @var{architecture-type} are the same as for
11692 @option{-march=@var{architecture-type}}.
11693
11694 @item -mmax-stack-frame=@var{n}
11695 @opindex mmax-stack-frame
11696 Warn when the stack frame of a function exceeds @var{n} bytes.
11697
11698 @item -metrax4
11699 @itemx -metrax100
11700 @opindex metrax4
11701 @opindex metrax100
11702 The options @option{-metrax4} and @option{-metrax100} are synonyms for
11703 @option{-march=v3} and @option{-march=v8} respectively.
11704
11705 @item -mmul-bug-workaround
11706 @itemx -mno-mul-bug-workaround
11707 @opindex mmul-bug-workaround
11708 @opindex mno-mul-bug-workaround
11709 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
11710 models where it applies.  This option is active by default.
11711
11712 @item -mpdebug
11713 @opindex mpdebug
11714 Enable CRIS-specific verbose debug-related information in the assembly
11715 code.  This option also has the effect to turn off the @samp{#NO_APP}
11716 formatted-code indicator to the assembler at the beginning of the
11717 assembly file.
11718
11719 @item -mcc-init
11720 @opindex mcc-init
11721 Do not use condition-code results from previous instruction; always emit
11722 compare and test instructions before use of condition codes.
11723
11724 @item -mno-side-effects
11725 @opindex mno-side-effects
11726 Do not emit instructions with side-effects in addressing modes other than
11727 post-increment.
11728
11729 @item -mstack-align
11730 @itemx -mno-stack-align
11731 @itemx -mdata-align
11732 @itemx -mno-data-align
11733 @itemx -mconst-align
11734 @itemx -mno-const-align
11735 @opindex mstack-align
11736 @opindex mno-stack-align
11737 @opindex mdata-align
11738 @opindex mno-data-align
11739 @opindex mconst-align
11740 @opindex mno-const-align
11741 These options (no-options) arranges (eliminate arrangements) for the
11742 stack-frame, individual data and constants to be aligned for the maximum
11743 single data access size for the chosen CPU model.  The default is to
11744 arrange for 32-bit alignment.  ABI details such as structure layout are
11745 not affected by these options.
11746
11747 @item -m32-bit
11748 @itemx -m16-bit
11749 @itemx -m8-bit
11750 @opindex m32-bit
11751 @opindex m16-bit
11752 @opindex m8-bit
11753 Similar to the stack- data- and const-align options above, these options
11754 arrange for stack-frame, writable data and constants to all be 32-bit,
11755 16-bit or 8-bit aligned.  The default is 32-bit alignment.
11756
11757 @item -mno-prologue-epilogue
11758 @itemx -mprologue-epilogue
11759 @opindex mno-prologue-epilogue
11760 @opindex mprologue-epilogue
11761 With @option{-mno-prologue-epilogue}, the normal function prologue and
11762 epilogue which set up the stack frame are omitted and no return
11763 instructions or return sequences are generated in the code.  Use this
11764 option only together with visual inspection of the compiled code: no
11765 warnings or errors are generated when call-saved registers must be saved,
11766 or storage for local variable needs to be allocated.
11767
11768 @item -mno-gotplt
11769 @itemx -mgotplt
11770 @opindex mno-gotplt
11771 @opindex mgotplt
11772 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
11773 instruction sequences that load addresses for functions from the PLT part
11774 of the GOT rather than (traditional on other architectures) calls to the
11775 PLT@.  The default is @option{-mgotplt}.
11776
11777 @item -melf
11778 @opindex melf
11779 Legacy no-op option only recognized with the cris-axis-elf and
11780 cris-axis-linux-gnu targets.
11781
11782 @item -mlinux
11783 @opindex mlinux
11784 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
11785
11786 @item -sim
11787 @opindex sim
11788 This option, recognized for the cris-axis-elf arranges
11789 to link with input-output functions from a simulator library.  Code,
11790 initialized data and zero-initialized data are allocated consecutively.
11791
11792 @item -sim2
11793 @opindex sim2
11794 Like @option{-sim}, but pass linker options to locate initialized data at
11795 0x40000000 and zero-initialized data at 0x80000000.
11796 @end table
11797
11798 @node CR16 Options
11799 @subsection CR16 Options
11800 @cindex CR16 Options
11801
11802 These options are defined specifically for the CR16 ports.
11803
11804 @table @gcctabopt
11805
11806 @item -mmac
11807 @opindex mmac
11808 Enable the use of multiply-accumulate instructions. Disabled by default.
11809
11810 @item -mcr16cplus
11811 @itemx -mcr16c
11812 @opindex mcr16cplus
11813 @opindex mcr16c
11814 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
11815 is default.
11816
11817 @item -msim
11818 @opindex msim
11819 Links the library libsim.a which is in compatible with simulator. Applicable
11820 to ELF compiler only.
11821
11822 @item -mint32
11823 @opindex mint32
11824 Choose integer type as 32-bit wide.
11825
11826 @item -mbit-ops
11827 @opindex mbit-ops
11828 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
11829
11830 @item -mdata-model=@var{model}
11831 @opindex mdata-model
11832 Choose a data model. The choices for @var{model} are @samp{near},
11833 @samp{far} or @samp{medium}. @samp{medium} is default.
11834 However, @samp{far} is not valid with @option{-mcr16c}, as the
11835 CR16C architecture does not support the far data model.
11836 @end table
11837
11838 @node Darwin Options
11839 @subsection Darwin Options
11840 @cindex Darwin options
11841
11842 These options are defined for all architectures running the Darwin operating
11843 system.
11844
11845 FSF GCC on Darwin does not create ``fat'' object files; it creates
11846 an object file for the single architecture that GCC was built to
11847 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
11848 @option{-arch} options are used; it does so by running the compiler or
11849 linker multiple times and joining the results together with
11850 @file{lipo}.
11851
11852 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
11853 @samp{i686}) is determined by the flags that specify the ISA
11854 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
11855 @option{-force_cpusubtype_ALL} option can be used to override this.
11856
11857 The Darwin tools vary in their behavior when presented with an ISA
11858 mismatch.  The assembler, @file{as}, only permits instructions to
11859 be used that are valid for the subtype of the file it is generating,
11860 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
11861 The linker for shared libraries, @file{/usr/bin/libtool}, fails
11862 and prints an error if asked to create a shared library with a less
11863 restrictive subtype than its input files (for instance, trying to put
11864 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
11865 for executables, @command{ld}, quietly gives the executable the most
11866 restrictive subtype of any of its input files.
11867
11868 @table @gcctabopt
11869 @item -F@var{dir}
11870 @opindex F
11871 Add the framework directory @var{dir} to the head of the list of
11872 directories to be searched for header files.  These directories are
11873 interleaved with those specified by @option{-I} options and are
11874 scanned in a left-to-right order.
11875
11876 A framework directory is a directory with frameworks in it.  A
11877 framework is a directory with a @file{Headers} and/or
11878 @file{PrivateHeaders} directory contained directly in it that ends
11879 in @file{.framework}.  The name of a framework is the name of this
11880 directory excluding the @file{.framework}.  Headers associated with
11881 the framework are found in one of those two directories, with
11882 @file{Headers} being searched first.  A subframework is a framework
11883 directory that is in a framework's @file{Frameworks} directory.
11884 Includes of subframework headers can only appear in a header of a
11885 framework that contains the subframework, or in a sibling subframework
11886 header.  Two subframeworks are siblings if they occur in the same
11887 framework.  A subframework should not have the same name as a
11888 framework; a warning is issued if this is violated.  Currently a
11889 subframework cannot have subframeworks; in the future, the mechanism
11890 may be extended to support this.  The standard frameworks can be found
11891 in @file{/System/Library/Frameworks} and
11892 @file{/Library/Frameworks}.  An example include looks like
11893 @code{#include <Framework/header.h>}, where @file{Framework} denotes
11894 the name of the framework and @file{header.h} is found in the
11895 @file{PrivateHeaders} or @file{Headers} directory.
11896
11897 @item -iframework@var{dir}
11898 @opindex iframework
11899 Like @option{-F} except the directory is a treated as a system
11900 directory.  The main difference between this @option{-iframework} and
11901 @option{-F} is that with @option{-iframework} the compiler does not
11902 warn about constructs contained within header files found via
11903 @var{dir}.  This option is valid only for the C family of languages.
11904
11905 @item -gused
11906 @opindex gused
11907 Emit debugging information for symbols that are used.  For stabs
11908 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
11909 This is by default ON@.
11910
11911 @item -gfull
11912 @opindex gfull
11913 Emit debugging information for all symbols and types.
11914
11915 @item -mmacosx-version-min=@var{version}
11916 The earliest version of MacOS X that this executable will run on
11917 is @var{version}.  Typical values of @var{version} include @code{10.1},
11918 @code{10.2}, and @code{10.3.9}.
11919
11920 If the compiler was built to use the system's headers by default,
11921 then the default for this option is the system version on which the
11922 compiler is running, otherwise the default is to make choices that
11923 are compatible with as many systems and code bases as possible.
11924
11925 @item -mkernel
11926 @opindex mkernel
11927 Enable kernel development mode.  The @option{-mkernel} option sets
11928 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
11929 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
11930 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
11931 applicable.  This mode also sets @option{-mno-altivec},
11932 @option{-msoft-float}, @option{-fno-builtin} and
11933 @option{-mlong-branch} for PowerPC targets.
11934
11935 @item -mone-byte-bool
11936 @opindex mone-byte-bool
11937 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
11938 By default @samp{sizeof(bool)} is @samp{4} when compiling for
11939 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
11940 option has no effect on x86.
11941
11942 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
11943 to generate code that is not binary compatible with code generated
11944 without that switch.  Using this switch may require recompiling all
11945 other modules in a program, including system libraries.  Use this
11946 switch to conform to a non-default data model.
11947
11948 @item -mfix-and-continue
11949 @itemx -ffix-and-continue
11950 @itemx -findirect-data
11951 @opindex mfix-and-continue
11952 @opindex ffix-and-continue
11953 @opindex findirect-data
11954 Generate code suitable for fast turn around development.  Needed to
11955 enable GDB to dynamically load @code{.o} files into already running
11956 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
11957 are provided for backwards compatibility.
11958
11959 @item -all_load
11960 @opindex all_load
11961 Loads all members of static archive libraries.
11962 See man ld(1) for more information.
11963
11964 @item -arch_errors_fatal
11965 @opindex arch_errors_fatal
11966 Cause the errors having to do with files that have the wrong architecture
11967 to be fatal.
11968
11969 @item -bind_at_load
11970 @opindex bind_at_load
11971 Causes the output file to be marked such that the dynamic linker will
11972 bind all undefined references when the file is loaded or launched.
11973
11974 @item -bundle
11975 @opindex bundle
11976 Produce a Mach-o bundle format file.
11977 See man ld(1) for more information.
11978
11979 @item -bundle_loader @var{executable}
11980 @opindex bundle_loader
11981 This option specifies the @var{executable} that will load the build
11982 output file being linked.  See man ld(1) for more information.
11983
11984 @item -dynamiclib
11985 @opindex dynamiclib
11986 When passed this option, GCC produces a dynamic library instead of
11987 an executable when linking, using the Darwin @file{libtool} command.
11988
11989 @item -force_cpusubtype_ALL
11990 @opindex force_cpusubtype_ALL
11991 This causes GCC's output file to have the @var{ALL} subtype, instead of
11992 one controlled by the @option{-mcpu} or @option{-march} option.
11993
11994 @item -allowable_client  @var{client_name}
11995 @itemx -client_name
11996 @itemx -compatibility_version
11997 @itemx -current_version
11998 @itemx -dead_strip
11999 @itemx -dependency-file
12000 @itemx -dylib_file
12001 @itemx -dylinker_install_name
12002 @itemx -dynamic
12003 @itemx -exported_symbols_list
12004 @itemx -filelist
12005 @need 800
12006 @itemx -flat_namespace
12007 @itemx -force_flat_namespace
12008 @itemx -headerpad_max_install_names
12009 @itemx -image_base
12010 @itemx -init
12011 @itemx -install_name
12012 @itemx -keep_private_externs
12013 @itemx -multi_module
12014 @itemx -multiply_defined
12015 @itemx -multiply_defined_unused
12016 @need 800
12017 @itemx -noall_load
12018 @itemx -no_dead_strip_inits_and_terms
12019 @itemx -nofixprebinding
12020 @itemx -nomultidefs
12021 @itemx -noprebind
12022 @itemx -noseglinkedit
12023 @itemx -pagezero_size
12024 @itemx -prebind
12025 @itemx -prebind_all_twolevel_modules
12026 @itemx -private_bundle
12027 @need 800
12028 @itemx -read_only_relocs
12029 @itemx -sectalign
12030 @itemx -sectobjectsymbols
12031 @itemx -whyload
12032 @itemx -seg1addr
12033 @itemx -sectcreate
12034 @itemx -sectobjectsymbols
12035 @itemx -sectorder
12036 @itemx -segaddr
12037 @itemx -segs_read_only_addr
12038 @need 800
12039 @itemx -segs_read_write_addr
12040 @itemx -seg_addr_table
12041 @itemx -seg_addr_table_filename
12042 @itemx -seglinkedit
12043 @itemx -segprot
12044 @itemx -segs_read_only_addr
12045 @itemx -segs_read_write_addr
12046 @itemx -single_module
12047 @itemx -static
12048 @itemx -sub_library
12049 @need 800
12050 @itemx -sub_umbrella
12051 @itemx -twolevel_namespace
12052 @itemx -umbrella
12053 @itemx -undefined
12054 @itemx -unexported_symbols_list
12055 @itemx -weak_reference_mismatches
12056 @itemx -whatsloaded
12057 @opindex allowable_client
12058 @opindex client_name
12059 @opindex compatibility_version
12060 @opindex current_version
12061 @opindex dead_strip
12062 @opindex dependency-file
12063 @opindex dylib_file
12064 @opindex dylinker_install_name
12065 @opindex dynamic
12066 @opindex exported_symbols_list
12067 @opindex filelist
12068 @opindex flat_namespace
12069 @opindex force_flat_namespace
12070 @opindex headerpad_max_install_names
12071 @opindex image_base
12072 @opindex init
12073 @opindex install_name
12074 @opindex keep_private_externs
12075 @opindex multi_module
12076 @opindex multiply_defined
12077 @opindex multiply_defined_unused
12078 @opindex noall_load
12079 @opindex no_dead_strip_inits_and_terms
12080 @opindex nofixprebinding
12081 @opindex nomultidefs
12082 @opindex noprebind
12083 @opindex noseglinkedit
12084 @opindex pagezero_size
12085 @opindex prebind
12086 @opindex prebind_all_twolevel_modules
12087 @opindex private_bundle
12088 @opindex read_only_relocs
12089 @opindex sectalign
12090 @opindex sectobjectsymbols
12091 @opindex whyload
12092 @opindex seg1addr
12093 @opindex sectcreate
12094 @opindex sectobjectsymbols
12095 @opindex sectorder
12096 @opindex segaddr
12097 @opindex segs_read_only_addr
12098 @opindex segs_read_write_addr
12099 @opindex seg_addr_table
12100 @opindex seg_addr_table_filename
12101 @opindex seglinkedit
12102 @opindex segprot
12103 @opindex segs_read_only_addr
12104 @opindex segs_read_write_addr
12105 @opindex single_module
12106 @opindex static
12107 @opindex sub_library
12108 @opindex sub_umbrella
12109 @opindex twolevel_namespace
12110 @opindex umbrella
12111 @opindex undefined
12112 @opindex unexported_symbols_list
12113 @opindex weak_reference_mismatches
12114 @opindex whatsloaded
12115 These options are passed to the Darwin linker.  The Darwin linker man page
12116 describes them in detail.
12117 @end table
12118
12119 @node DEC Alpha Options
12120 @subsection DEC Alpha Options
12121
12122 These @samp{-m} options are defined for the DEC Alpha implementations:
12123
12124 @table @gcctabopt
12125 @item -mno-soft-float
12126 @itemx -msoft-float
12127 @opindex mno-soft-float
12128 @opindex msoft-float
12129 Use (do not use) the hardware floating-point instructions for
12130 floating-point operations.  When @option{-msoft-float} is specified,
12131 functions in @file{libgcc.a} are used to perform floating-point
12132 operations.  Unless they are replaced by routines that emulate the
12133 floating-point operations, or compiled in such a way as to call such
12134 emulations routines, these routines issue floating-point
12135 operations.   If you are compiling for an Alpha without floating-point
12136 operations, you must ensure that the library is built so as not to call
12137 them.
12138
12139 Note that Alpha implementations without floating-point operations are
12140 required to have floating-point registers.
12141
12142 @item -mfp-reg
12143 @itemx -mno-fp-regs
12144 @opindex mfp-reg
12145 @opindex mno-fp-regs
12146 Generate code that uses (does not use) the floating-point register set.
12147 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12148 register set is not used, floating-point operands are passed in integer
12149 registers as if they were integers and floating-point results are passed
12150 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12151 so any function with a floating-point argument or return value called by code
12152 compiled with @option{-mno-fp-regs} must also be compiled with that
12153 option.
12154
12155 A typical use of this option is building a kernel that does not use,
12156 and hence need not save and restore, any floating-point registers.
12157
12158 @item -mieee
12159 @opindex mieee
12160 The Alpha architecture implements floating-point hardware optimized for
12161 maximum performance.  It is mostly compliant with the IEEE floating-point
12162 standard.  However, for full compliance, software assistance is
12163 required.  This option generates code fully IEEE-compliant code
12164 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12165 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12166 defined during compilation.  The resulting code is less efficient but is
12167 able to correctly support denormalized numbers and exceptional IEEE
12168 values such as not-a-number and plus/minus infinity.  Other Alpha
12169 compilers call this option @option{-ieee_with_no_inexact}.
12170
12171 @item -mieee-with-inexact
12172 @opindex mieee-with-inexact
12173 This is like @option{-mieee} except the generated code also maintains
12174 the IEEE @var{inexact-flag}.  Turning on this option causes the
12175 generated code to implement fully-compliant IEEE math.  In addition to
12176 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12177 macro.  On some Alpha implementations the resulting code may execute
12178 significantly slower than the code generated by default.  Since there is
12179 very little code that depends on the @var{inexact-flag}, you should
12180 normally not specify this option.  Other Alpha compilers call this
12181 option @option{-ieee_with_inexact}.
12182
12183 @item -mfp-trap-mode=@var{trap-mode}
12184 @opindex mfp-trap-mode
12185 This option controls what floating-point related traps are enabled.
12186 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12187 The trap mode can be set to one of four values:
12188
12189 @table @samp
12190 @item n
12191 This is the default (normal) setting.  The only traps that are enabled
12192 are the ones that cannot be disabled in software (e.g., division by zero
12193 trap).
12194
12195 @item u
12196 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12197 as well.
12198
12199 @item su
12200 Like @samp{u}, but the instructions are marked to be safe for software
12201 completion (see Alpha architecture manual for details).
12202
12203 @item sui
12204 Like @samp{su}, but inexact traps are enabled as well.
12205 @end table
12206
12207 @item -mfp-rounding-mode=@var{rounding-mode}
12208 @opindex mfp-rounding-mode
12209 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12210 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12211 of:
12212
12213 @table @samp
12214 @item n
12215 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12216 the nearest machine number or towards the even machine number in case
12217 of a tie.
12218
12219 @item m
12220 Round towards minus infinity.
12221
12222 @item c
12223 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12224
12225 @item d
12226 Dynamic rounding mode.  A field in the floating-point control register
12227 (@var{fpcr}, see Alpha architecture reference manual) controls the
12228 rounding mode in effect.  The C library initializes this register for
12229 rounding towards plus infinity.  Thus, unless your program modifies the
12230 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12231 @end table
12232
12233 @item -mtrap-precision=@var{trap-precision}
12234 @opindex mtrap-precision
12235 In the Alpha architecture, floating-point traps are imprecise.  This
12236 means without software assistance it is impossible to recover from a
12237 floating trap and program execution normally needs to be terminated.
12238 GCC can generate code that can assist operating system trap handlers
12239 in determining the exact location that caused a floating-point trap.
12240 Depending on the requirements of an application, different levels of
12241 precisions can be selected:
12242
12243 @table @samp
12244 @item p
12245 Program precision.  This option is the default and means a trap handler
12246 can only identify which program caused a floating-point exception.
12247
12248 @item f
12249 Function precision.  The trap handler can determine the function that
12250 caused a floating-point exception.
12251
12252 @item i
12253 Instruction precision.  The trap handler can determine the exact
12254 instruction that caused a floating-point exception.
12255 @end table
12256
12257 Other Alpha compilers provide the equivalent options called
12258 @option{-scope_safe} and @option{-resumption_safe}.
12259
12260 @item -mieee-conformant
12261 @opindex mieee-conformant
12262 This option marks the generated code as IEEE conformant.  You must not
12263 use this option unless you also specify @option{-mtrap-precision=i} and either
12264 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12265 is to emit the line @samp{.eflag 48} in the function prologue of the
12266 generated assembly file.
12267
12268 @item -mbuild-constants
12269 @opindex mbuild-constants
12270 Normally GCC examines a 32- or 64-bit integer constant to
12271 see if it can construct it from smaller constants in two or three
12272 instructions.  If it cannot, it outputs the constant as a literal and
12273 generates code to load it from the data segment at run time.
12274
12275 Use this option to require GCC to construct @emph{all} integer constants
12276 using code, even if it takes more instructions (the maximum is six).
12277
12278 You typically use this option to build a shared library dynamic
12279 loader.  Itself a shared library, it must relocate itself in memory
12280 before it can find the variables and constants in its own data segment.
12281
12282 @item -mbwx
12283 @itemx -mno-bwx
12284 @itemx -mcix
12285 @itemx -mno-cix
12286 @itemx -mfix
12287 @itemx -mno-fix
12288 @itemx -mmax
12289 @itemx -mno-max
12290 @opindex mbwx
12291 @opindex mno-bwx
12292 @opindex mcix
12293 @opindex mno-cix
12294 @opindex mfix
12295 @opindex mno-fix
12296 @opindex mmax
12297 @opindex mno-max
12298 Indicate whether GCC should generate code to use the optional BWX,
12299 CIX, FIX and MAX instruction sets.  The default is to use the instruction
12300 sets supported by the CPU type specified via @option{-mcpu=} option or that
12301 of the CPU on which GCC was built if none is specified.
12302
12303 @item -mfloat-vax
12304 @itemx -mfloat-ieee
12305 @opindex mfloat-vax
12306 @opindex mfloat-ieee
12307 Generate code that uses (does not use) VAX F and G floating-point
12308 arithmetic instead of IEEE single and double precision.
12309
12310 @item -mexplicit-relocs
12311 @itemx -mno-explicit-relocs
12312 @opindex mexplicit-relocs
12313 @opindex mno-explicit-relocs
12314 Older Alpha assemblers provided no way to generate symbol relocations
12315 except via assembler macros.  Use of these macros does not allow
12316 optimal instruction scheduling.  GNU binutils as of version 2.12
12317 supports a new syntax that allows the compiler to explicitly mark
12318 which relocations should apply to which instructions.  This option
12319 is mostly useful for debugging, as GCC detects the capabilities of
12320 the assembler when it is built and sets the default accordingly.
12321
12322 @item -msmall-data
12323 @itemx -mlarge-data
12324 @opindex msmall-data
12325 @opindex mlarge-data
12326 When @option{-mexplicit-relocs} is in effect, static data is
12327 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
12328 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
12329 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
12330 16-bit relocations off of the @code{$gp} register.  This limits the
12331 size of the small data area to 64KB, but allows the variables to be
12332 directly accessed via a single instruction.
12333
12334 The default is @option{-mlarge-data}.  With this option the data area
12335 is limited to just below 2GB@.  Programs that require more than 2GB of
12336 data must use @code{malloc} or @code{mmap} to allocate the data in the
12337 heap instead of in the program's data segment.
12338
12339 When generating code for shared libraries, @option{-fpic} implies
12340 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
12341
12342 @item -msmall-text
12343 @itemx -mlarge-text
12344 @opindex msmall-text
12345 @opindex mlarge-text
12346 When @option{-msmall-text} is used, the compiler assumes that the
12347 code of the entire program (or shared library) fits in 4MB, and is
12348 thus reachable with a branch instruction.  When @option{-msmall-data}
12349 is used, the compiler can assume that all local symbols share the
12350 same @code{$gp} value, and thus reduce the number of instructions
12351 required for a function call from 4 to 1.
12352
12353 The default is @option{-mlarge-text}.
12354
12355 @item -mcpu=@var{cpu_type}
12356 @opindex mcpu
12357 Set the instruction set and instruction scheduling parameters for
12358 machine type @var{cpu_type}.  You can specify either the @samp{EV}
12359 style name or the corresponding chip number.  GCC supports scheduling
12360 parameters for the EV4, EV5 and EV6 family of processors and
12361 chooses the default values for the instruction set from the processor
12362 you specify.  If you do not specify a processor type, GCC defaults
12363 to the processor on which the compiler was built.
12364
12365 Supported values for @var{cpu_type} are
12366
12367 @table @samp
12368 @item ev4
12369 @itemx ev45
12370 @itemx 21064
12371 Schedules as an EV4 and has no instruction set extensions.
12372
12373 @item ev5
12374 @itemx 21164
12375 Schedules as an EV5 and has no instruction set extensions.
12376
12377 @item ev56
12378 @itemx 21164a
12379 Schedules as an EV5 and supports the BWX extension.
12380
12381 @item pca56
12382 @itemx 21164pc
12383 @itemx 21164PC
12384 Schedules as an EV5 and supports the BWX and MAX extensions.
12385
12386 @item ev6
12387 @itemx 21264
12388 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
12389
12390 @item ev67
12391 @itemx 21264a
12392 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
12393 @end table
12394
12395 Native toolchains also support the value @samp{native},
12396 which selects the best architecture option for the host processor.
12397 @option{-mcpu=native} has no effect if GCC does not recognize
12398 the processor.
12399
12400 @item -mtune=@var{cpu_type}
12401 @opindex mtune
12402 Set only the instruction scheduling parameters for machine type
12403 @var{cpu_type}.  The instruction set is not changed.
12404
12405 Native toolchains also support the value @samp{native},
12406 which selects the best architecture option for the host processor.
12407 @option{-mtune=native} has no effect if GCC does not recognize
12408 the processor.
12409
12410 @item -mmemory-latency=@var{time}
12411 @opindex mmemory-latency
12412 Sets the latency the scheduler should assume for typical memory
12413 references as seen by the application.  This number is highly
12414 dependent on the memory access patterns used by the application
12415 and the size of the external cache on the machine.
12416
12417 Valid options for @var{time} are
12418
12419 @table @samp
12420 @item @var{number}
12421 A decimal number representing clock cycles.
12422
12423 @item L1
12424 @itemx L2
12425 @itemx L3
12426 @itemx main
12427 The compiler contains estimates of the number of clock cycles for
12428 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
12429 (also called Dcache, Scache, and Bcache), as well as to main memory.
12430 Note that L3 is only valid for EV5.
12431
12432 @end table
12433 @end table
12434
12435 @node FR30 Options
12436 @subsection FR30 Options
12437 @cindex FR30 Options
12438
12439 These options are defined specifically for the FR30 port.
12440
12441 @table @gcctabopt
12442
12443 @item -msmall-model
12444 @opindex msmall-model
12445 Use the small address space model.  This can produce smaller code, but
12446 it does assume that all symbolic values and addresses fit into a
12447 20-bit range.
12448
12449 @item -mno-lsim
12450 @opindex mno-lsim
12451 Assume that runtime support has been provided and so there is no need
12452 to include the simulator library (@file{libsim.a}) on the linker
12453 command line.
12454
12455 @end table
12456
12457 @node FRV Options
12458 @subsection FRV Options
12459 @cindex FRV Options
12460
12461 @table @gcctabopt
12462 @item -mgpr-32
12463 @opindex mgpr-32
12464
12465 Only use the first 32 general-purpose registers.
12466
12467 @item -mgpr-64
12468 @opindex mgpr-64
12469
12470 Use all 64 general-purpose registers.
12471
12472 @item -mfpr-32
12473 @opindex mfpr-32
12474
12475 Use only the first 32 floating-point registers.
12476
12477 @item -mfpr-64
12478 @opindex mfpr-64
12479
12480 Use all 64 floating-point registers.
12481
12482 @item -mhard-float
12483 @opindex mhard-float
12484
12485 Use hardware instructions for floating-point operations.
12486
12487 @item -msoft-float
12488 @opindex msoft-float
12489
12490 Use library routines for floating-point operations.
12491
12492 @item -malloc-cc
12493 @opindex malloc-cc
12494
12495 Dynamically allocate condition code registers.
12496
12497 @item -mfixed-cc
12498 @opindex mfixed-cc
12499
12500 Do not try to dynamically allocate condition code registers, only
12501 use @code{icc0} and @code{fcc0}.
12502
12503 @item -mdword
12504 @opindex mdword
12505
12506 Change ABI to use double word insns.
12507
12508 @item -mno-dword
12509 @opindex mno-dword
12510
12511 Do not use double word instructions.
12512
12513 @item -mdouble
12514 @opindex mdouble
12515
12516 Use floating-point double instructions.
12517
12518 @item -mno-double
12519 @opindex mno-double
12520
12521 Do not use floating-point double instructions.
12522
12523 @item -mmedia
12524 @opindex mmedia
12525
12526 Use media instructions.
12527
12528 @item -mno-media
12529 @opindex mno-media
12530
12531 Do not use media instructions.
12532
12533 @item -mmuladd
12534 @opindex mmuladd
12535
12536 Use multiply and add/subtract instructions.
12537
12538 @item -mno-muladd
12539 @opindex mno-muladd
12540
12541 Do not use multiply and add/subtract instructions.
12542
12543 @item -mfdpic
12544 @opindex mfdpic
12545
12546 Select the FDPIC ABI, which uses function descriptors to represent
12547 pointers to functions.  Without any PIC/PIE-related options, it
12548 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
12549 assumes GOT entries and small data are within a 12-bit range from the
12550 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
12551 are computed with 32 bits.
12552 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12553
12554 @item -minline-plt
12555 @opindex minline-plt
12556
12557 Enable inlining of PLT entries in function calls to functions that are
12558 not known to bind locally.  It has no effect without @option{-mfdpic}.
12559 It's enabled by default if optimizing for speed and compiling for
12560 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
12561 optimization option such as @option{-O3} or above is present in the
12562 command line.
12563
12564 @item -mTLS
12565 @opindex mTLS
12566
12567 Assume a large TLS segment when generating thread-local code.
12568
12569 @item -mtls
12570 @opindex mtls
12571
12572 Do not assume a large TLS segment when generating thread-local code.
12573
12574 @item -mgprel-ro
12575 @opindex mgprel-ro
12576
12577 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
12578 that is known to be in read-only sections.  It's enabled by default,
12579 except for @option{-fpic} or @option{-fpie}: even though it may help
12580 make the global offset table smaller, it trades 1 instruction for 4.
12581 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
12582 one of which may be shared by multiple symbols, and it avoids the need
12583 for a GOT entry for the referenced symbol, so it's more likely to be a
12584 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
12585
12586 @item -multilib-library-pic
12587 @opindex multilib-library-pic
12588
12589 Link with the (library, not FD) pic libraries.  It's implied by
12590 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
12591 @option{-fpic} without @option{-mfdpic}.  You should never have to use
12592 it explicitly.
12593
12594 @item -mlinked-fp
12595 @opindex mlinked-fp
12596
12597 Follow the EABI requirement of always creating a frame pointer whenever
12598 a stack frame is allocated.  This option is enabled by default and can
12599 be disabled with @option{-mno-linked-fp}.
12600
12601 @item -mlong-calls
12602 @opindex mlong-calls
12603
12604 Use indirect addressing to call functions outside the current
12605 compilation unit.  This allows the functions to be placed anywhere
12606 within the 32-bit address space.
12607
12608 @item -malign-labels
12609 @opindex malign-labels
12610
12611 Try to align labels to an 8-byte boundary by inserting nops into the
12612 previous packet.  This option only has an effect when VLIW packing
12613 is enabled.  It doesn't create new packets; it merely adds nops to
12614 existing ones.
12615
12616 @item -mlibrary-pic
12617 @opindex mlibrary-pic
12618
12619 Generate position-independent EABI code.
12620
12621 @item -macc-4
12622 @opindex macc-4
12623
12624 Use only the first four media accumulator registers.
12625
12626 @item -macc-8
12627 @opindex macc-8
12628
12629 Use all eight media accumulator registers.
12630
12631 @item -mpack
12632 @opindex mpack
12633
12634 Pack VLIW instructions.
12635
12636 @item -mno-pack
12637 @opindex mno-pack
12638
12639 Do not pack VLIW instructions.
12640
12641 @item -mno-eflags
12642 @opindex mno-eflags
12643
12644 Do not mark ABI switches in e_flags.
12645
12646 @item -mcond-move
12647 @opindex mcond-move
12648
12649 Enable the use of conditional-move instructions (default).
12650
12651 This switch is mainly for debugging the compiler and will likely be removed
12652 in a future version.
12653
12654 @item -mno-cond-move
12655 @opindex mno-cond-move
12656
12657 Disable the use of conditional-move instructions.
12658
12659 This switch is mainly for debugging the compiler and will likely be removed
12660 in a future version.
12661
12662 @item -mscc
12663 @opindex mscc
12664
12665 Enable the use of conditional set instructions (default).
12666
12667 This switch is mainly for debugging the compiler and will likely be removed
12668 in a future version.
12669
12670 @item -mno-scc
12671 @opindex mno-scc
12672
12673 Disable the use of conditional set instructions.
12674
12675 This switch is mainly for debugging the compiler and will likely be removed
12676 in a future version.
12677
12678 @item -mcond-exec
12679 @opindex mcond-exec
12680
12681 Enable the use of conditional execution (default).
12682
12683 This switch is mainly for debugging the compiler and will likely be removed
12684 in a future version.
12685
12686 @item -mno-cond-exec
12687 @opindex mno-cond-exec
12688
12689 Disable the use of conditional execution.
12690
12691 This switch is mainly for debugging the compiler and will likely be removed
12692 in a future version.
12693
12694 @item -mvliw-branch
12695 @opindex mvliw-branch
12696
12697 Run a pass to pack branches into VLIW instructions (default).
12698
12699 This switch is mainly for debugging the compiler and will likely be removed
12700 in a future version.
12701
12702 @item -mno-vliw-branch
12703 @opindex mno-vliw-branch
12704
12705 Do not run a pass to pack branches into VLIW instructions.
12706
12707 This switch is mainly for debugging the compiler and will likely be removed
12708 in a future version.
12709
12710 @item -mmulti-cond-exec
12711 @opindex mmulti-cond-exec
12712
12713 Enable optimization of @code{&&} and @code{||} in conditional execution
12714 (default).
12715
12716 This switch is mainly for debugging the compiler and will likely be removed
12717 in a future version.
12718
12719 @item -mno-multi-cond-exec
12720 @opindex mno-multi-cond-exec
12721
12722 Disable optimization of @code{&&} and @code{||} in conditional execution.
12723
12724 This switch is mainly for debugging the compiler and will likely be removed
12725 in a future version.
12726
12727 @item -mnested-cond-exec
12728 @opindex mnested-cond-exec
12729
12730 Enable nested conditional execution optimizations (default).
12731
12732 This switch is mainly for debugging the compiler and will likely be removed
12733 in a future version.
12734
12735 @item -mno-nested-cond-exec
12736 @opindex mno-nested-cond-exec
12737
12738 Disable nested conditional execution optimizations.
12739
12740 This switch is mainly for debugging the compiler and will likely be removed
12741 in a future version.
12742
12743 @item -moptimize-membar
12744 @opindex moptimize-membar
12745
12746 This switch removes redundant @code{membar} instructions from the
12747 compiler generated code.  It is enabled by default.
12748
12749 @item -mno-optimize-membar
12750 @opindex mno-optimize-membar
12751
12752 This switch disables the automatic removal of redundant @code{membar}
12753 instructions from the generated code.
12754
12755 @item -mtomcat-stats
12756 @opindex mtomcat-stats
12757
12758 Cause gas to print out tomcat statistics.
12759
12760 @item -mcpu=@var{cpu}
12761 @opindex mcpu
12762
12763 Select the processor type for which to generate code.  Possible values are
12764 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
12765 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
12766
12767 @end table
12768
12769 @node GNU/Linux Options
12770 @subsection GNU/Linux Options
12771
12772 These @samp{-m} options are defined for GNU/Linux targets:
12773
12774 @table @gcctabopt
12775 @item -mglibc
12776 @opindex mglibc
12777 Use the GNU C library.  This is the default except
12778 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
12779
12780 @item -muclibc
12781 @opindex muclibc
12782 Use uClibc C library.  This is the default on
12783 @samp{*-*-linux-*uclibc*} targets.
12784
12785 @item -mbionic
12786 @opindex mbionic
12787 Use Bionic C library.  This is the default on
12788 @samp{*-*-linux-*android*} targets.
12789
12790 @item -mandroid
12791 @opindex mandroid
12792 Compile code compatible with Android platform.  This is the default on
12793 @samp{*-*-linux-*android*} targets.
12794
12795 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
12796 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
12797 this option makes the GCC driver pass Android-specific options to the linker.
12798 Finally, this option causes the preprocessor macro @code{__ANDROID__}
12799 to be defined.
12800
12801 @item -tno-android-cc
12802 @opindex tno-android-cc
12803 Disable compilation effects of @option{-mandroid}, i.e., do not enable
12804 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
12805 @option{-fno-rtti} by default.
12806
12807 @item -tno-android-ld
12808 @opindex tno-android-ld
12809 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
12810 linking options to the linker.
12811
12812 @end table
12813
12814 @node H8/300 Options
12815 @subsection H8/300 Options
12816
12817 These @samp{-m} options are defined for the H8/300 implementations:
12818
12819 @table @gcctabopt
12820 @item -mrelax
12821 @opindex mrelax
12822 Shorten some address references at link time, when possible; uses the
12823 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
12824 ld, Using ld}, for a fuller description.
12825
12826 @item -mh
12827 @opindex mh
12828 Generate code for the H8/300H@.
12829
12830 @item -ms
12831 @opindex ms
12832 Generate code for the H8S@.
12833
12834 @item -mn
12835 @opindex mn
12836 Generate code for the H8S and H8/300H in the normal mode.  This switch
12837 must be used either with @option{-mh} or @option{-ms}.
12838
12839 @item -ms2600
12840 @opindex ms2600
12841 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
12842
12843 @item -mexr
12844 @opindex mexr
12845 Extended registers are stored on stack before execution of function
12846 with monitor attribute. Default option is @option{-mexr}.
12847 This option is valid only for H8S targets.
12848
12849 @item -mno-exr
12850 @opindex mno-exr
12851 Extended registers are not stored on stack before execution of function 
12852 with monitor attribute. Default option is @option{-mno-exr}. 
12853 This option is valid only for H8S targets.
12854
12855 @item -mint32
12856 @opindex mint32
12857 Make @code{int} data 32 bits by default.
12858
12859 @item -malign-300
12860 @opindex malign-300
12861 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
12862 The default for the H8/300H and H8S is to align longs and floats on
12863 4-byte boundaries.
12864 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
12865 This option has no effect on the H8/300.
12866 @end table
12867
12868 @node HPPA Options
12869 @subsection HPPA Options
12870 @cindex HPPA Options
12871
12872 These @samp{-m} options are defined for the HPPA family of computers:
12873
12874 @table @gcctabopt
12875 @item -march=@var{architecture-type}
12876 @opindex march
12877 Generate code for the specified architecture.  The choices for
12878 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
12879 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
12880 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
12881 architecture option for your machine.  Code compiled for lower numbered
12882 architectures runs on higher numbered architectures, but not the
12883 other way around.
12884
12885 @item -mpa-risc-1-0
12886 @itemx -mpa-risc-1-1
12887 @itemx -mpa-risc-2-0
12888 @opindex mpa-risc-1-0
12889 @opindex mpa-risc-1-1
12890 @opindex mpa-risc-2-0
12891 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
12892
12893 @item -mbig-switch
12894 @opindex mbig-switch
12895 Generate code suitable for big switch tables.  Use this option only if
12896 the assembler/linker complain about out of range branches within a switch
12897 table.
12898
12899 @item -mjump-in-delay
12900 @opindex mjump-in-delay
12901 Fill delay slots of function calls with unconditional jump instructions
12902 by modifying the return pointer for the function call to be the target
12903 of the conditional jump.
12904
12905 @item -mdisable-fpregs
12906 @opindex mdisable-fpregs
12907 Prevent floating-point registers from being used in any manner.  This is
12908 necessary for compiling kernels that perform lazy context switching of
12909 floating-point registers.  If you use this option and attempt to perform
12910 floating-point operations, the compiler aborts.
12911
12912 @item -mdisable-indexing
12913 @opindex mdisable-indexing
12914 Prevent the compiler from using indexing address modes.  This avoids some
12915 rather obscure problems when compiling MIG generated code under MACH@.
12916
12917 @item -mno-space-regs
12918 @opindex mno-space-regs
12919 Generate code that assumes the target has no space registers.  This allows
12920 GCC to generate faster indirect calls and use unscaled index address modes.
12921
12922 Such code is suitable for level 0 PA systems and kernels.
12923
12924 @item -mfast-indirect-calls
12925 @opindex mfast-indirect-calls
12926 Generate code that assumes calls never cross space boundaries.  This
12927 allows GCC to emit code that performs faster indirect calls.
12928
12929 This option does not work in the presence of shared libraries or nested
12930 functions.
12931
12932 @item -mfixed-range=@var{register-range}
12933 @opindex mfixed-range
12934 Generate code treating the given register range as fixed registers.
12935 A fixed register is one that the register allocator can not use.  This is
12936 useful when compiling kernel code.  A register range is specified as
12937 two registers separated by a dash.  Multiple register ranges can be
12938 specified separated by a comma.
12939
12940 @item -mlong-load-store
12941 @opindex mlong-load-store
12942 Generate 3-instruction load and store sequences as sometimes required by
12943 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
12944 the HP compilers.
12945
12946 @item -mportable-runtime
12947 @opindex mportable-runtime
12948 Use the portable calling conventions proposed by HP for ELF systems.
12949
12950 @item -mgas
12951 @opindex mgas
12952 Enable the use of assembler directives only GAS understands.
12953
12954 @item -mschedule=@var{cpu-type}
12955 @opindex mschedule
12956 Schedule code according to the constraints for the machine type
12957 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
12958 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
12959 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
12960 proper scheduling option for your machine.  The default scheduling is
12961 @samp{8000}.
12962
12963 @item -mlinker-opt
12964 @opindex mlinker-opt
12965 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
12966 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
12967 linkers in which they give bogus error messages when linking some programs.
12968
12969 @item -msoft-float
12970 @opindex msoft-float
12971 Generate output containing library calls for floating point.
12972 @strong{Warning:} the requisite libraries are not available for all HPPA
12973 targets.  Normally the facilities of the machine's usual C compiler are
12974 used, but this cannot be done directly in cross-compilation.  You must make
12975 your own arrangements to provide suitable library functions for
12976 cross-compilation.
12977
12978 @option{-msoft-float} changes the calling convention in the output file;
12979 therefore, it is only useful if you compile @emph{all} of a program with
12980 this option.  In particular, you need to compile @file{libgcc.a}, the
12981 library that comes with GCC, with @option{-msoft-float} in order for
12982 this to work.
12983
12984 @item -msio
12985 @opindex msio
12986 Generate the predefine, @code{_SIO}, for server IO@.  The default is
12987 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
12988 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
12989 options are available under HP-UX and HI-UX@.
12990
12991 @item -mgnu-ld
12992 @opindex mgnu-ld
12993 Use options specific to GNU @command{ld}.
12994 This passes @option{-shared} to @command{ld} when
12995 building a shared library.  It is the default when GCC is configured,
12996 explicitly or implicitly, with the GNU linker.  This option does not
12997 affect which @command{ld} is called; it only changes what parameters
12998 are passed to that @command{ld}.
12999 The @command{ld} that is called is determined by the
13000 @option{--with-ld} configure option, GCC's program search path, and
13001 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13002 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13003 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13004
13005 @item -mhp-ld
13006 @opindex mhp-ld
13007 Use options specific to HP @command{ld}.
13008 This passes @option{-b} to @command{ld} when building
13009 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13010 links.  It is the default when GCC is configured, explicitly or
13011 implicitly, with the HP linker.  This option does not affect
13012 which @command{ld} is called; it only changes what parameters are passed to that
13013 @command{ld}.
13014 The @command{ld} that is called is determined by the @option{--with-ld}
13015 configure option, GCC's program search path, and finally by the user's
13016 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13017 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13018 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13019
13020 @item -mlong-calls
13021 @opindex mno-long-calls
13022 Generate code that uses long call sequences.  This ensures that a call
13023 is always able to reach linker generated stubs.  The default is to generate
13024 long calls only when the distance from the call site to the beginning
13025 of the function or translation unit, as the case may be, exceeds a
13026 predefined limit set by the branch type being used.  The limits for
13027 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13028 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13029 240,000 bytes.
13030
13031 Distances are measured from the beginning of functions when using the
13032 @option{-ffunction-sections} option, or when using the @option{-mgas}
13033 and @option{-mno-portable-runtime} options together under HP-UX with
13034 the SOM linker.
13035
13036 It is normally not desirable to use this option as it degrades
13037 performance.  However, it may be useful in large applications,
13038 particularly when partial linking is used to build the application.
13039
13040 The types of long calls used depends on the capabilities of the
13041 assembler and linker, and the type of code being generated.  The
13042 impact on systems that support long absolute calls, and long pic
13043 symbol-difference or pc-relative calls should be relatively small.
13044 However, an indirect call is used on 32-bit ELF systems in pic code
13045 and it is quite long.
13046
13047 @item -munix=@var{unix-std}
13048 @opindex march
13049 Generate compiler predefines and select a startfile for the specified
13050 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13051 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13052 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13053 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13054 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13055 and later.
13056
13057 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13058 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13059 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13060 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13061 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13062 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13063
13064 It is @emph{important} to note that this option changes the interfaces
13065 for various library routines.  It also affects the operational behavior
13066 of the C library.  Thus, @emph{extreme} care is needed in using this
13067 option.
13068
13069 Library code that is intended to operate with more than one UNIX
13070 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13071 as appropriate.  Most GNU software doesn't provide this capability.
13072
13073 @item -nolibdld
13074 @opindex nolibdld
13075 Suppress the generation of link options to search libdld.sl when the
13076 @option{-static} option is specified on HP-UX 10 and later.
13077
13078 @item -static
13079 @opindex static
13080 The HP-UX implementation of setlocale in libc has a dependency on
13081 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13082 when the @option{-static} option is specified, special link options
13083 are needed to resolve this dependency.
13084
13085 On HP-UX 10 and later, the GCC driver adds the necessary options to
13086 link with libdld.sl when the @option{-static} option is specified.
13087 This causes the resulting binary to be dynamic.  On the 64-bit port,
13088 the linkers generate dynamic binaries by default in any case.  The
13089 @option{-nolibdld} option can be used to prevent the GCC driver from
13090 adding these link options.
13091
13092 @item -threads
13093 @opindex threads
13094 Add support for multithreading with the @dfn{dce thread} library
13095 under HP-UX@.  This option sets flags for both the preprocessor and
13096 linker.
13097 @end table
13098
13099 @node i386 and x86-64 Options
13100 @subsection Intel 386 and AMD x86-64 Options
13101 @cindex i386 Options
13102 @cindex x86-64 Options
13103 @cindex Intel 386 Options
13104 @cindex AMD x86-64 Options
13105
13106 These @samp{-m} options are defined for the i386 and x86-64 family of
13107 computers:
13108
13109 @table @gcctabopt
13110
13111 @item -march=@var{cpu-type}
13112 @opindex march
13113 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13114 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13115 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13116 to generate code that may not run at all on processors other than the one
13117 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13118 @option{-mtune=@var{cpu-type}}.
13119
13120 The choices for @var{cpu-type} are:
13121
13122 @table @samp
13123 @item native
13124 This selects the CPU to generate code for at compilation time by determining
13125 the processor type of the compiling machine.  Using @option{-march=native}
13126 enables all instruction subsets supported by the local machine (hence
13127 the result might not run on different machines).  Using @option{-mtune=native}
13128 produces code optimized for the local machine under the constraints
13129 of the selected instruction set.  
13130
13131 @item i386
13132 Original Intel i386 CPU@.
13133
13134 @item i486
13135 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13136
13137 @item i586
13138 @itemx pentium
13139 Intel Pentium CPU with no MMX support.
13140
13141 @item pentium-mmx
13142 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13143
13144 @item pentiumpro
13145 Intel Pentium Pro CPU@.
13146
13147 @item i686
13148 When used with @option{-march}, the Pentium Pro
13149 instruction set is used, so the code runs on all i686 family chips.
13150 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13151
13152 @item pentium2
13153 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13154 support.
13155
13156 @item pentium3
13157 @itemx pentium3m
13158 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13159 set support.
13160
13161 @item pentium-m
13162 Intel Pentium M; low-power version of Intel Pentium III CPU
13163 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13164
13165 @item pentium4
13166 @itemx pentium4m
13167 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13168
13169 @item prescott
13170 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13171 set support.
13172
13173 @item nocona
13174 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13175 SSE2 and SSE3 instruction set support.
13176
13177 @item core2
13178 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13179 instruction set support.
13180
13181 @item corei7
13182 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13183 and SSE4.2 instruction set support.
13184
13185 @item corei7-avx
13186 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13187 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13188
13189 @item core-avx-i
13190 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13191 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13192 set support.
13193
13194 @item atom
13195 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13196 instruction set support.
13197
13198 @item k6
13199 AMD K6 CPU with MMX instruction set support.
13200
13201 @item k6-2
13202 @itemx k6-3
13203 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13204
13205 @item athlon
13206 @itemx athlon-tbird
13207 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13208 support.
13209
13210 @item athlon-4
13211 @itemx athlon-xp
13212 @itemx athlon-mp
13213 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13214 instruction set support.
13215
13216 @item k8
13217 @itemx opteron
13218 @itemx athlon64
13219 @itemx athlon-fx
13220 Processors based on the AMD K8 core with x86-64 instruction set support,
13221 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13222 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13223 instruction set extensions.)
13224
13225 @item k8-sse3
13226 @itemx opteron-sse3
13227 @itemx athlon64-sse3
13228 Improved versions of AMD K8 cores with SSE3 instruction set support.
13229
13230 @item amdfam10
13231 @itemx barcelona
13232 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13233 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13234 instruction set extensions.)
13235
13236 @item bdver1
13237 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13238 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13239 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13240 @item bdver2
13241 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13242 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13243 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13244 extensions.)
13245
13246 @item btver1
13247 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13248 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13249 instruction set extensions.)
13250
13251 @item winchip-c6
13252 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13253 set support.
13254
13255 @item winchip2
13256 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13257 instruction set support.
13258
13259 @item c3
13260 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13261 implemented for this chip.)
13262
13263 @item c3-2
13264 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13265 (No scheduling is
13266 implemented for this chip.)
13267
13268 @item geode
13269 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
13270 @end table
13271
13272 @item -mtune=@var{cpu-type}
13273 @opindex mtune
13274 Tune to @var{cpu-type} everything applicable about the generated code, except
13275 for the ABI and the set of available instructions.  
13276 While picking a specific @var{cpu-type} schedules things appropriately
13277 for that particular chip, the compiler does not generate any code that
13278 cannot run on the default machine type unless you use a
13279 @option{-march=@var{cpu-type}} option.
13280 For example, if GCC is configured for i686-pc-linux-gnu
13281 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
13282 but still runs on i686 machines.
13283
13284 The choices for @var{cpu-type} are the same as for @option{-march}.
13285 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
13286
13287 @table @samp
13288 @item generic
13289 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
13290 If you know the CPU on which your code will run, then you should use
13291 the corresponding @option{-mtune} or @option{-march} option instead of
13292 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
13293 of your application will have, then you should use this option.
13294
13295 As new processors are deployed in the marketplace, the behavior of this
13296 option will change.  Therefore, if you upgrade to a newer version of
13297 GCC, code generation controlled by this option will change to reflect
13298 the processors
13299 that are most common at the time that version of GCC is released.
13300
13301 There is no @option{-march=generic} option because @option{-march}
13302 indicates the instruction set the compiler can use, and there is no
13303 generic instruction set applicable to all processors.  In contrast,
13304 @option{-mtune} indicates the processor (or, in this case, collection of
13305 processors) for which the code is optimized.
13306 @end table
13307
13308 @item -mcpu=@var{cpu-type}
13309 @opindex mcpu
13310 A deprecated synonym for @option{-mtune}.
13311
13312 @item -mfpmath=@var{unit}
13313 @opindex mfpmath
13314 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
13315 for @var{unit} are:
13316
13317 @table @samp
13318 @item 387
13319 Use the standard 387 floating-point coprocessor present on the majority of chips and
13320 emulated otherwise.  Code compiled with this option runs almost everywhere.
13321 The temporary results are computed in 80-bit precision instead of the precision
13322 specified by the type, resulting in slightly different results compared to most
13323 of other chips.  See @option{-ffloat-store} for more detailed description.
13324
13325 This is the default choice for i386 compiler.
13326
13327 @item sse
13328 Use scalar floating-point instructions present in the SSE instruction set.
13329 This instruction set is supported by Pentium III and newer chips,
13330 and in the AMD line
13331 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
13332 instruction set supports only single-precision arithmetic, thus the double and
13333 extended-precision arithmetic are still done using 387.  A later version, present
13334 only in Pentium 4 and AMD x86-64 chips, supports double-precision
13335 arithmetic too.
13336
13337 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
13338 or @option{-msse2} switches to enable SSE extensions and make this option
13339 effective.  For the x86-64 compiler, these extensions are enabled by default.
13340
13341 The resulting code should be considerably faster in the majority of cases and avoid
13342 the numerical instability problems of 387 code, but may break some existing
13343 code that expects temporaries to be 80 bits.
13344
13345 This is the default choice for the x86-64 compiler.
13346
13347 @item sse,387
13348 @itemx sse+387
13349 @itemx both
13350 Attempt to utilize both instruction sets at once.  This effectively doubles the
13351 amount of available registers, and on chips with separate execution units for
13352 387 and SSE the execution resources too.  Use this option with care, as it is
13353 still experimental, because the GCC register allocator does not model separate
13354 functional units well, resulting in unstable performance.
13355 @end table
13356
13357 @item -masm=@var{dialect}
13358 @opindex masm=@var{dialect}
13359 Output assembly instructions using selected @var{dialect}.  Supported
13360 choices are @samp{intel} or @samp{att} (the default).  Darwin does
13361 not support @samp{intel}.
13362
13363 @item -mieee-fp
13364 @itemx -mno-ieee-fp
13365 @opindex mieee-fp
13366 @opindex mno-ieee-fp
13367 Control whether or not the compiler uses IEEE floating-point
13368 comparisons.  These correctly handle the case where the result of a
13369 comparison is unordered.
13370
13371 @item -msoft-float
13372 @opindex msoft-float
13373 Generate output containing library calls for floating point.
13374
13375 @strong{Warning:} the requisite libraries are not part of GCC@.
13376 Normally the facilities of the machine's usual C compiler are used, but
13377 this can't be done directly in cross-compilation.  You must make your
13378 own arrangements to provide suitable library functions for
13379 cross-compilation.
13380
13381 On machines where a function returns floating-point results in the 80387
13382 register stack, some floating-point opcodes may be emitted even if
13383 @option{-msoft-float} is used.
13384
13385 @item -mno-fp-ret-in-387
13386 @opindex mno-fp-ret-in-387
13387 Do not use the FPU registers for return values of functions.
13388
13389 The usual calling convention has functions return values of types
13390 @code{float} and @code{double} in an FPU register, even if there
13391 is no FPU@.  The idea is that the operating system should emulate
13392 an FPU@.
13393
13394 The option @option{-mno-fp-ret-in-387} causes such values to be returned
13395 in ordinary CPU registers instead.
13396
13397 @item -mno-fancy-math-387
13398 @opindex mno-fancy-math-387
13399 Some 387 emulators do not support the @code{sin}, @code{cos} and
13400 @code{sqrt} instructions for the 387.  Specify this option to avoid
13401 generating those instructions.  This option is the default on FreeBSD,
13402 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
13403 indicates that the target CPU always has an FPU and so the
13404 instruction does not need emulation.  These
13405 instructions are not generated unless you also use the
13406 @option{-funsafe-math-optimizations} switch.
13407
13408 @item -malign-double
13409 @itemx -mno-align-double
13410 @opindex malign-double
13411 @opindex mno-align-double
13412 Control whether GCC aligns @code{double}, @code{long double}, and
13413 @code{long long} variables on a two-word boundary or a one-word
13414 boundary.  Aligning @code{double} variables on a two-word boundary
13415 produces code that runs somewhat faster on a Pentium at the
13416 expense of more memory.
13417
13418 On x86-64, @option{-malign-double} is enabled by default.
13419
13420 @strong{Warning:} if you use the @option{-malign-double} switch,
13421 structures containing the above types are aligned differently than
13422 the published application binary interface specifications for the 386
13423 and are not binary compatible with structures in code compiled
13424 without that switch.
13425
13426 @item -m96bit-long-double
13427 @itemx -m128bit-long-double
13428 @opindex m96bit-long-double
13429 @opindex m128bit-long-double
13430 These switches control the size of @code{long double} type.  The i386
13431 application binary interface specifies the size to be 96 bits,
13432 so @option{-m96bit-long-double} is the default in 32-bit mode.
13433
13434 Modern architectures (Pentium and newer) prefer @code{long double}
13435 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
13436 conforming to the ABI, this is not possible.  So specifying
13437 @option{-m128bit-long-double} aligns @code{long double}
13438 to a 16-byte boundary by padding the @code{long double} with an additional
13439 32-bit zero.
13440
13441 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
13442 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
13443
13444 Notice that neither of these options enable any extra precision over the x87
13445 standard of 80 bits for a @code{long double}.
13446
13447 @strong{Warning:} if you override the default value for your target ABI, this
13448 changes the size of 
13449 structures and arrays containing @code{long double} variables,
13450 as well as modifying the function calling convention for functions taking
13451 @code{long double}.  Hence they are not binary-compatible
13452 with code compiled without that switch.
13453
13454 @item -mlarge-data-threshold=@var{threshold}
13455 @opindex mlarge-data-threshold
13456 When @option{-mcmodel=medium} is specified, data objects larger than
13457 @var{threshold} are placed in the large data section.  This value must be the
13458 same across all objects linked into the binary, and defaults to 65535.
13459
13460 @item -mrtd
13461 @opindex mrtd
13462 Use a different function-calling convention, in which functions that
13463 take a fixed number of arguments return with the @code{ret @var{num}}
13464 instruction, which pops their arguments while returning.  This saves one
13465 instruction in the caller since there is no need to pop the arguments
13466 there.
13467
13468 You can specify that an individual function is called with this calling
13469 sequence with the function attribute @samp{stdcall}.  You can also
13470 override the @option{-mrtd} option by using the function attribute
13471 @samp{cdecl}.  @xref{Function Attributes}.
13472
13473 @strong{Warning:} this calling convention is incompatible with the one
13474 normally used on Unix, so you cannot use it if you need to call
13475 libraries compiled with the Unix compiler.
13476
13477 Also, you must provide function prototypes for all functions that
13478 take variable numbers of arguments (including @code{printf});
13479 otherwise incorrect code is generated for calls to those
13480 functions.
13481
13482 In addition, seriously incorrect code results if you call a
13483 function with too many arguments.  (Normally, extra arguments are
13484 harmlessly ignored.)
13485
13486 @item -mregparm=@var{num}
13487 @opindex mregparm
13488 Control how many registers are used to pass integer arguments.  By
13489 default, no registers are used to pass arguments, and at most 3
13490 registers can be used.  You can control this behavior for a specific
13491 function by using the function attribute @samp{regparm}.
13492 @xref{Function Attributes}.
13493
13494 @strong{Warning:} if you use this switch, and
13495 @var{num} is nonzero, then you must build all modules with the same
13496 value, including any libraries.  This includes the system libraries and
13497 startup modules.
13498
13499 @item -msseregparm
13500 @opindex msseregparm
13501 Use SSE register passing conventions for float and double arguments
13502 and return values.  You can control this behavior for a specific
13503 function by using the function attribute @samp{sseregparm}.
13504 @xref{Function Attributes}.
13505
13506 @strong{Warning:} if you use this switch then you must build all
13507 modules with the same value, including any libraries.  This includes
13508 the system libraries and startup modules.
13509
13510 @item -mvect8-ret-in-mem
13511 @opindex mvect8-ret-in-mem
13512 Return 8-byte vectors in memory instead of MMX registers.  This is the
13513 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
13514 Studio compilers until version 12.  Later compiler versions (starting
13515 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
13516 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
13517 you need to remain compatible with existing code produced by those
13518 previous compiler versions or older versions of GCC@.
13519
13520 @item -mpc32
13521 @itemx -mpc64
13522 @itemx -mpc80
13523 @opindex mpc32
13524 @opindex mpc64
13525 @opindex mpc80
13526
13527 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
13528 is specified, the significands of results of floating-point operations are
13529 rounded to 24 bits (single precision); @option{-mpc64} rounds the
13530 significands of results of floating-point operations to 53 bits (double
13531 precision) and @option{-mpc80} rounds the significands of results of
13532 floating-point operations to 64 bits (extended double precision), which is
13533 the default.  When this option is used, floating-point operations in higher
13534 precisions are not available to the programmer without setting the FPU
13535 control word explicitly.
13536
13537 Setting the rounding of floating-point operations to less than the default
13538 80 bits can speed some programs by 2% or more.  Note that some mathematical
13539 libraries assume that extended-precision (80-bit) floating-point operations
13540 are enabled by default; routines in such libraries could suffer significant
13541 loss of accuracy, typically through so-called ``catastrophic cancellation'',
13542 when this option is used to set the precision to less than extended precision.
13543
13544 @item -mstackrealign
13545 @opindex mstackrealign
13546 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
13547 option generates an alternate prologue and epilogue that realigns the
13548 run-time stack if necessary.  This supports mixing legacy codes that keep
13549 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
13550 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
13551 applicable to individual functions.
13552
13553 @item -mpreferred-stack-boundary=@var{num}
13554 @opindex mpreferred-stack-boundary
13555 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
13556 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
13557 the default is 4 (16 bytes or 128 bits).
13558
13559 @item -mincoming-stack-boundary=@var{num}
13560 @opindex mincoming-stack-boundary
13561 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
13562 boundary.  If @option{-mincoming-stack-boundary} is not specified,
13563 the one specified by @option{-mpreferred-stack-boundary} is used.
13564
13565 On Pentium and Pentium Pro, @code{double} and @code{long double} values
13566 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
13567 suffer significant run time performance penalties.  On Pentium III, the
13568 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
13569 properly if it is not 16-byte aligned.
13570
13571 To ensure proper alignment of this values on the stack, the stack boundary
13572 must be as aligned as that required by any value stored on the stack.
13573 Further, every function must be generated such that it keeps the stack
13574 aligned.  Thus calling a function compiled with a higher preferred
13575 stack boundary from a function compiled with a lower preferred stack
13576 boundary most likely misaligns the stack.  It is recommended that
13577 libraries that use callbacks always use the default setting.
13578
13579 This extra alignment does consume extra stack space, and generally
13580 increases code size.  Code that is sensitive to stack space usage, such
13581 as embedded systems and operating system kernels, may want to reduce the
13582 preferred alignment to @option{-mpreferred-stack-boundary=2}.
13583
13584 @item -mmmx
13585 @itemx -mno-mmx
13586 @itemx -msse
13587 @itemx -mno-sse
13588 @itemx -msse2
13589 @itemx -mno-sse2
13590 @itemx -msse3
13591 @itemx -mno-sse3
13592 @itemx -mssse3
13593 @itemx -mno-ssse3
13594 @itemx -msse4.1
13595 @need 800
13596 @itemx -mno-sse4.1
13597 @itemx -msse4.2
13598 @itemx -mno-sse4.2
13599 @itemx -msse4
13600 @itemx -mno-sse4
13601 @itemx -mavx
13602 @itemx -mno-avx
13603 @itemx -mavx2
13604 @itemx -mno-avx2
13605 @itemx -maes
13606 @itemx -mno-aes
13607 @itemx -mpclmul
13608 @need 800
13609 @itemx -mno-pclmul
13610 @itemx -mfsgsbase
13611 @itemx -mno-fsgsbase
13612 @itemx -mrdrnd
13613 @itemx -mno-rdrnd
13614 @itemx -mf16c
13615 @itemx -mno-f16c
13616 @itemx -mfma
13617 @itemx -mno-fma
13618 @itemx -msse4a
13619 @itemx -mno-sse4a
13620 @itemx -mfma4
13621 @need 800
13622 @itemx -mno-fma4
13623 @itemx -mxop
13624 @itemx -mno-xop
13625 @itemx -mlwp
13626 @itemx -mno-lwp
13627 @itemx -m3dnow
13628 @itemx -mno-3dnow
13629 @itemx -mpopcnt
13630 @itemx -mno-popcnt
13631 @itemx -mabm
13632 @itemx -mno-abm
13633 @itemx -mbmi
13634 @itemx -mbmi2
13635 @itemx -mno-bmi
13636 @itemx -mno-bmi2
13637 @itemx -mlzcnt
13638 @itemx -mno-lzcnt
13639 @itemx -mrtm
13640 @itemx -mtbm
13641 @itemx -mno-tbm
13642 @opindex mmmx
13643 @opindex mno-mmx
13644 @opindex msse
13645 @opindex mno-sse
13646 @opindex m3dnow
13647 @opindex mno-3dnow
13648 These switches enable or disable the use of instructions in the MMX, SSE,
13649 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
13650 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT, RTM or 3DNow!@:
13651 extended instruction sets.
13652 These extensions are also available as built-in functions: see
13653 @ref{X86 Built-in Functions}, for details of the functions enabled and
13654 disabled by these switches.
13655
13656 To generate SSE/SSE2 instructions automatically from floating-point
13657 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
13658
13659 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
13660 generates new AVX instructions or AVX equivalence for all SSEx instructions
13661 when needed.
13662
13663 These options enable GCC to use these extended instructions in
13664 generated code, even without @option{-mfpmath=sse}.  Applications that
13665 perform run-time CPU detection must compile separate files for each
13666 supported architecture, using the appropriate flags.  In particular,
13667 the file containing the CPU detection code should be compiled without
13668 these options.
13669
13670 @item -mcld
13671 @opindex mcld
13672 This option instructs GCC to emit a @code{cld} instruction in the prologue
13673 of functions that use string instructions.  String instructions depend on
13674 the DF flag to select between autoincrement or autodecrement mode.  While the
13675 ABI specifies the DF flag to be cleared on function entry, some operating
13676 systems violate this specification by not clearing the DF flag in their
13677 exception dispatchers.  The exception handler can be invoked with the DF flag
13678 set, which leads to wrong direction mode when string instructions are used.
13679 This option can be enabled by default on 32-bit x86 targets by configuring
13680 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
13681 instructions can be suppressed with the @option{-mno-cld} compiler option
13682 in this case.
13683
13684 @item -mvzeroupper
13685 @opindex mvzeroupper
13686 This option instructs GCC to emit a @code{vzeroupper} instruction
13687 before a transfer of control flow out of the function to minimize
13688 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
13689 intrinsics.
13690
13691 @item -mcx16
13692 @opindex mcx16
13693 This option enables GCC to generate @code{CMPXCHG16B} instructions.
13694 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
13695 (or oword) data types.  
13696 This is useful for high-resolution counters that can be updated
13697 by multiple processors (or cores).  This instruction is generated as part of
13698 atomic built-in functions: see @ref{__sync Builtins} or
13699 @ref{__atomic Builtins} for details.
13700
13701 @item -msahf
13702 @opindex msahf
13703 This option enables generation of @code{SAHF} instructions in 64-bit code.
13704 Early Intel Pentium 4 CPUs with Intel 64 support,
13705 prior to the introduction of Pentium 4 G1 step in December 2005,
13706 lacked the @code{LAHF} and @code{SAHF} instructions
13707 which were supported by AMD64.
13708 These are load and store instructions, respectively, for certain status flags.
13709 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
13710 @code{drem}, and @code{remainder} built-in functions;
13711 see @ref{Other Builtins} for details.
13712
13713 @item -mmovbe
13714 @opindex mmovbe
13715 This option enables use of the @code{movbe} instruction to implement
13716 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
13717
13718 @item -mcrc32
13719 @opindex mcrc32
13720 This option enables built-in functions @code{__builtin_ia32_crc32qi},
13721 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
13722 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
13723
13724 @item -mrecip
13725 @opindex mrecip
13726 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
13727 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
13728 with an additional Newton-Raphson step
13729 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
13730 (and their vectorized
13731 variants) for single-precision floating-point arguments.  These instructions
13732 are generated only when @option{-funsafe-math-optimizations} is enabled
13733 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
13734 Note that while the throughput of the sequence is higher than the throughput
13735 of the non-reciprocal instruction, the precision of the sequence can be
13736 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
13737
13738 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
13739 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
13740 combination), and doesn't need @option{-mrecip}.
13741
13742 Also note that GCC emits the above sequence with additional Newton-Raphson step
13743 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
13744 already with @option{-ffast-math} (or the above option combination), and
13745 doesn't need @option{-mrecip}.
13746
13747 @item -mrecip=@var{opt}
13748 @opindex mrecip=opt
13749 This option controls which reciprocal estimate instructions
13750 may be used.  @var{opt} is a comma-separated list of options, which may
13751 be preceded by a @samp{!} to invert the option:
13752
13753 @table @samp
13754 @item all
13755 Enable all estimate instructions.
13756
13757 @item default
13758 Enable the default instructions, equivalent to @option{-mrecip}.
13759
13760 @item none
13761 Disable all estimate instructions, equivalent to @option{-mno-recip}.
13762
13763 @item div
13764 Enable the approximation for scalar division.
13765
13766 @item vec-div
13767 Enable the approximation for vectorized division.
13768
13769 @item sqrt
13770 Enable the approximation for scalar square root.
13771
13772 @item vec-sqrt
13773 Enable the approximation for vectorized square root.
13774 @end table
13775
13776 So, for example, @option{-mrecip=all,!sqrt} enables
13777 all of the reciprocal approximations, except for square root.
13778
13779 @item -mveclibabi=@var{type}
13780 @opindex mveclibabi
13781 Specifies the ABI type to use for vectorizing intrinsics using an
13782 external library.  Supported values for @var{type} are @samp{svml} 
13783 for the Intel short
13784 vector math library and @samp{acml} for the AMD math core library.
13785 To use this option, both @option{-ftree-vectorize} and
13786 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
13787 ABI-compatible library must be specified at link time.
13788
13789 GCC currently emits calls to @code{vmldExp2},
13790 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
13791 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
13792 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
13793 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
13794 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
13795 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
13796 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
13797 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
13798 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
13799 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
13800 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
13801 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
13802 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
13803 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
13804 when @option{-mveclibabi=acml} is used.  
13805
13806 @item -mabi=@var{name}
13807 @opindex mabi
13808 Generate code for the specified calling convention.  Permissible values
13809 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
13810 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
13811 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
13812 You can control this behavior for a specific function by
13813 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
13814 @xref{Function Attributes}.
13815
13816 @item -mtls-dialect=@var{type}
13817 @opindex mtls-dialect
13818 Generate code to access thread-local storage using the @samp{gnu} or
13819 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
13820 @samp{gnu2} is more efficient, but it may add compile- and run-time
13821 requirements that cannot be satisfied on all systems.
13822
13823 @item -mpush-args
13824 @itemx -mno-push-args
13825 @opindex mpush-args
13826 @opindex mno-push-args
13827 Use PUSH operations to store outgoing parameters.  This method is shorter
13828 and usually equally fast as method using SUB/MOV operations and is enabled
13829 by default.  In some cases disabling it may improve performance because of
13830 improved scheduling and reduced dependencies.
13831
13832 @item -maccumulate-outgoing-args
13833 @opindex maccumulate-outgoing-args
13834 If enabled, the maximum amount of space required for outgoing arguments is
13835 computed in the function prologue.  This is faster on most modern CPUs
13836 because of reduced dependencies, improved scheduling and reduced stack usage
13837 when the preferred stack boundary is not equal to 2.  The drawback is a notable
13838 increase in code size.  This switch implies @option{-mno-push-args}.
13839
13840 @item -mthreads
13841 @opindex mthreads
13842 Support thread-safe exception handling on MinGW.  Programs that rely
13843 on thread-safe exception handling must compile and link all code with the
13844 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
13845 @code{-D_MT}; when linking, it links in a special thread helper library
13846 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
13847
13848 @item -mno-align-stringops
13849 @opindex mno-align-stringops
13850 Do not align the destination of inlined string operations.  This switch reduces
13851 code size and improves performance in case the destination is already aligned,
13852 but GCC doesn't know about it.
13853
13854 @item -minline-all-stringops
13855 @opindex minline-all-stringops
13856 By default GCC inlines string operations only when the destination is 
13857 known to be aligned to least a 4-byte boundary.  
13858 This enables more inlining and increases code
13859 size, but may improve performance of code that depends on fast
13860 @code{memcpy}, @code{strlen},
13861 and @code{memset} for short lengths.
13862
13863 @item -minline-stringops-dynamically
13864 @opindex minline-stringops-dynamically
13865 For string operations of unknown size, use run-time checks with
13866 inline code for small blocks and a library call for large blocks.
13867
13868 @item -mstringop-strategy=@var{alg}
13869 @opindex mstringop-strategy=@var{alg}
13870 Override the internal decision heuristic for the particular algorithm to use
13871 for inlining string operations.  The allowed values for @var{alg} are:
13872
13873 @table @samp
13874 @item rep_byte
13875 @itemx rep_4byte
13876 @itemx rep_8byte
13877 Expand using i386 @code{rep} prefix of the specified size.
13878
13879 @item byte_loop
13880 @itemx loop
13881 @itemx unrolled_loop
13882 Expand into an inline loop.
13883
13884 @item libcall
13885 Always use a library call.
13886 @end table
13887
13888 @item -momit-leaf-frame-pointer
13889 @opindex momit-leaf-frame-pointer
13890 Don't keep the frame pointer in a register for leaf functions.  This
13891 avoids the instructions to save, set up, and restore frame pointers and
13892 makes an extra register available in leaf functions.  The option
13893 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
13894 which might make debugging harder.
13895
13896 @item -mtls-direct-seg-refs
13897 @itemx -mno-tls-direct-seg-refs
13898 @opindex mtls-direct-seg-refs
13899 Controls whether TLS variables may be accessed with offsets from the
13900 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
13901 or whether the thread base pointer must be added.  Whether or not this
13902 is valid depends on the operating system, and whether it maps the
13903 segment to cover the entire TLS area.
13904
13905 For systems that use the GNU C Library, the default is on.
13906
13907 @item -msse2avx
13908 @itemx -mno-sse2avx
13909 @opindex msse2avx
13910 Specify that the assembler should encode SSE instructions with VEX
13911 prefix.  The option @option{-mavx} turns this on by default.
13912
13913 @item -mfentry
13914 @itemx -mno-fentry
13915 @opindex mfentry
13916 If profiling is active (@option{-pg}), put the profiling
13917 counter call before the prologue.
13918 Note: On x86 architectures the attribute @code{ms_hook_prologue}
13919 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
13920
13921 @item -m8bit-idiv
13922 @itemx -mno-8bit-idiv
13923 @opindex 8bit-idiv
13924 On some processors, like Intel Atom, 8-bit unsigned integer divide is
13925 much faster than 32-bit/64-bit integer divide.  This option generates a
13926 run-time check.  If both dividend and divisor are within range of 0
13927 to 255, 8-bit unsigned integer divide is used instead of
13928 32-bit/64-bit integer divide.
13929
13930 @item -mavx256-split-unaligned-load
13931 @itemx -mavx256-split-unaligned-store
13932 @opindex avx256-split-unaligned-load
13933 @opindex avx256-split-unaligned-store
13934 Split 32-byte AVX unaligned load and store.
13935
13936 @end table
13937
13938 These @samp{-m} switches are supported in addition to the above
13939 on x86-64 processors in 64-bit environments.
13940
13941 @table @gcctabopt
13942 @item -m32
13943 @itemx -m64
13944 @itemx -mx32
13945 @opindex m32
13946 @opindex m64
13947 @opindex mx32
13948 Generate code for a 32-bit or 64-bit environment.
13949 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
13950 to 32 bits, and
13951 generates code that runs on any i386 system.
13952
13953 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
13954 types to 64 bits, and generates code for the x86-64 architecture.
13955 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
13956 and @option{-mdynamic-no-pic} options.
13957
13958 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
13959 to 32 bits, and
13960 generates code for the x86-64 architecture.
13961
13962 @item -mno-red-zone
13963 @opindex mno-red-zone
13964 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
13965 by the x86-64 ABI; it is a 128-byte area beyond the location of the
13966 stack pointer that is not modified by signal or interrupt handlers
13967 and therefore can be used for temporary data without adjusting the stack
13968 pointer.  The flag @option{-mno-red-zone} disables this red zone.
13969
13970 @item -mcmodel=small
13971 @opindex mcmodel=small
13972 Generate code for the small code model: the program and its symbols must
13973 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
13974 Programs can be statically or dynamically linked.  This is the default
13975 code model.
13976
13977 @item -mcmodel=kernel
13978 @opindex mcmodel=kernel
13979 Generate code for the kernel code model.  The kernel runs in the
13980 negative 2 GB of the address space.
13981 This model has to be used for Linux kernel code.
13982
13983 @item -mcmodel=medium
13984 @opindex mcmodel=medium
13985 Generate code for the medium model: the program is linked in the lower 2
13986 GB of the address space.  Small symbols are also placed there.  Symbols
13987 with sizes larger than @option{-mlarge-data-threshold} are put into
13988 large data or BSS sections and can be located above 2GB.  Programs can
13989 be statically or dynamically linked.
13990
13991 @item -mcmodel=large
13992 @opindex mcmodel=large
13993 Generate code for the large model.  This model makes no assumptions
13994 about addresses and sizes of sections.
13995
13996 @item -maddress-mode=long
13997 @opindex maddress-mode=long
13998 Generate code for long address mode.  This is only supported for 64-bit
13999 and x32 environments.  It is the default address mode for 64-bit
14000 environments.
14001
14002 @item -maddress-mode=short
14003 @opindex maddress-mode=short
14004 Generate code for short address mode.  This is only supported for 32-bit
14005 and x32 environments.  It is the default address mode for 32-bit and
14006 x32 environments.
14007 @end table
14008
14009 @node i386 and x86-64 Windows Options
14010 @subsection i386 and x86-64 Windows Options
14011 @cindex i386 and x86-64 Windows Options
14012
14013 These additional options are available for Microsoft Windows targets:
14014
14015 @table @gcctabopt
14016 @item -mconsole
14017 @opindex mconsole
14018 This option
14019 specifies that a console application is to be generated, by
14020 instructing the linker to set the PE header subsystem type
14021 required for console applications.
14022 This option is available for Cygwin and MinGW targets and is
14023 enabled by default on those targets.
14024
14025 @item -mdll
14026 @opindex mdll
14027 This option is available for Cygwin and MinGW targets.  It
14028 specifies that a DLL---a dynamic link library---is to be
14029 generated, enabling the selection of the required runtime
14030 startup object and entry point.
14031
14032 @item -mnop-fun-dllimport
14033 @opindex mnop-fun-dllimport
14034 This option is available for Cygwin and MinGW targets.  It
14035 specifies that the @code{dllimport} attribute should be ignored.
14036
14037 @item -mthread
14038 @opindex mthread
14039 This option is available for MinGW targets. It specifies
14040 that MinGW-specific thread support is to be used.
14041
14042 @item -municode
14043 @opindex municode
14044 This option is available for MinGW-w64 targets.  It causes
14045 the @code{UNICODE} preprocessor macro to be predefined, and
14046 chooses Unicode-capable runtime startup code.
14047
14048 @item -mwin32
14049 @opindex mwin32
14050 This option is available for Cygwin and MinGW targets.  It
14051 specifies that the typical Microsoft Windows predefined macros are to
14052 be set in the pre-processor, but does not influence the choice
14053 of runtime library/startup code.
14054
14055 @item -mwindows
14056 @opindex mwindows
14057 This option is available for Cygwin and MinGW targets.  It
14058 specifies that a GUI application is to be generated by
14059 instructing the linker to set the PE header subsystem type
14060 appropriately.
14061
14062 @item -fno-set-stack-executable
14063 @opindex fno-set-stack-executable
14064 This option is available for MinGW targets. It specifies that
14065 the executable flag for the stack used by nested functions isn't
14066 set. This is necessary for binaries running in kernel mode of
14067 Microsoft Windows, as there the User32 API, which is used to set executable
14068 privileges, isn't available.
14069
14070 @item -fwritable-relocated-rdata
14071 @opindex fno-writable-relocated-rdata
14072 This option is available for MinGW and Cygwin targets.  It specifies
14073 that relocated-data in read-only section is put into .data
14074 section.  This is a necessary for older runtimes not supporting
14075 modification of .rdata sections for pseudo-relocation.
14076
14077 @item -mpe-aligned-commons
14078 @opindex mpe-aligned-commons
14079 This option is available for Cygwin and MinGW targets.  It
14080 specifies that the GNU extension to the PE file format that
14081 permits the correct alignment of COMMON variables should be
14082 used when generating code.  It is enabled by default if
14083 GCC detects that the target assembler found during configuration
14084 supports the feature.
14085 @end table
14086
14087 See also under @ref{i386 and x86-64 Options} for standard options.
14088
14089 @node IA-64 Options
14090 @subsection IA-64 Options
14091 @cindex IA-64 Options
14092
14093 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14094
14095 @table @gcctabopt
14096 @item -mbig-endian
14097 @opindex mbig-endian
14098 Generate code for a big-endian target.  This is the default for HP-UX@.
14099
14100 @item -mlittle-endian
14101 @opindex mlittle-endian
14102 Generate code for a little-endian target.  This is the default for AIX5
14103 and GNU/Linux.
14104
14105 @item -mgnu-as
14106 @itemx -mno-gnu-as
14107 @opindex mgnu-as
14108 @opindex mno-gnu-as
14109 Generate (or don't) code for the GNU assembler.  This is the default.
14110 @c Also, this is the default if the configure option @option{--with-gnu-as}
14111 @c is used.
14112
14113 @item -mgnu-ld
14114 @itemx -mno-gnu-ld
14115 @opindex mgnu-ld
14116 @opindex mno-gnu-ld
14117 Generate (or don't) code for the GNU linker.  This is the default.
14118 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14119 @c is used.
14120
14121 @item -mno-pic
14122 @opindex mno-pic
14123 Generate code that does not use a global pointer register.  The result
14124 is not position independent code, and violates the IA-64 ABI@.
14125
14126 @item -mvolatile-asm-stop
14127 @itemx -mno-volatile-asm-stop
14128 @opindex mvolatile-asm-stop
14129 @opindex mno-volatile-asm-stop
14130 Generate (or don't) a stop bit immediately before and after volatile asm
14131 statements.
14132
14133 @item -mregister-names
14134 @itemx -mno-register-names
14135 @opindex mregister-names
14136 @opindex mno-register-names
14137 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14138 the stacked registers.  This may make assembler output more readable.
14139
14140 @item -mno-sdata
14141 @itemx -msdata
14142 @opindex mno-sdata
14143 @opindex msdata
14144 Disable (or enable) optimizations that use the small data section.  This may
14145 be useful for working around optimizer bugs.
14146
14147 @item -mconstant-gp
14148 @opindex mconstant-gp
14149 Generate code that uses a single constant global pointer value.  This is
14150 useful when compiling kernel code.
14151
14152 @item -mauto-pic
14153 @opindex mauto-pic
14154 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14155 This is useful when compiling firmware code.
14156
14157 @item -minline-float-divide-min-latency
14158 @opindex minline-float-divide-min-latency
14159 Generate code for inline divides of floating-point values
14160 using the minimum latency algorithm.
14161
14162 @item -minline-float-divide-max-throughput
14163 @opindex minline-float-divide-max-throughput
14164 Generate code for inline divides of floating-point values
14165 using the maximum throughput algorithm.
14166
14167 @item -mno-inline-float-divide
14168 @opindex mno-inline-float-divide
14169 Do not generate inline code for divides of floating-point values.
14170
14171 @item -minline-int-divide-min-latency
14172 @opindex minline-int-divide-min-latency
14173 Generate code for inline divides of integer values
14174 using the minimum latency algorithm.
14175
14176 @item -minline-int-divide-max-throughput
14177 @opindex minline-int-divide-max-throughput
14178 Generate code for inline divides of integer values
14179 using the maximum throughput algorithm.
14180
14181 @item -mno-inline-int-divide
14182 @opindex mno-inline-int-divide
14183 Do not generate inline code for divides of integer values.
14184
14185 @item -minline-sqrt-min-latency
14186 @opindex minline-sqrt-min-latency
14187 Generate code for inline square roots
14188 using the minimum latency algorithm.
14189
14190 @item -minline-sqrt-max-throughput
14191 @opindex minline-sqrt-max-throughput
14192 Generate code for inline square roots
14193 using the maximum throughput algorithm.
14194
14195 @item -mno-inline-sqrt
14196 @opindex mno-inline-sqrt
14197 Do not generate inline code for @code{sqrt}.
14198
14199 @item -mfused-madd
14200 @itemx -mno-fused-madd
14201 @opindex mfused-madd
14202 @opindex mno-fused-madd
14203 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14204 instructions.  The default is to use these instructions.
14205
14206 @item -mno-dwarf2-asm
14207 @itemx -mdwarf2-asm
14208 @opindex mno-dwarf2-asm
14209 @opindex mdwarf2-asm
14210 Don't (or do) generate assembler code for the DWARF 2 line number debugging
14211 info.  This may be useful when not using the GNU assembler.
14212
14213 @item -mearly-stop-bits
14214 @itemx -mno-early-stop-bits
14215 @opindex mearly-stop-bits
14216 @opindex mno-early-stop-bits
14217 Allow stop bits to be placed earlier than immediately preceding the
14218 instruction that triggered the stop bit.  This can improve instruction
14219 scheduling, but does not always do so.
14220
14221 @item -mfixed-range=@var{register-range}
14222 @opindex mfixed-range
14223 Generate code treating the given register range as fixed registers.
14224 A fixed register is one that the register allocator cannot use.  This is
14225 useful when compiling kernel code.  A register range is specified as
14226 two registers separated by a dash.  Multiple register ranges can be
14227 specified separated by a comma.
14228
14229 @item -mtls-size=@var{tls-size}
14230 @opindex mtls-size
14231 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
14232 64.
14233
14234 @item -mtune=@var{cpu-type}
14235 @opindex mtune
14236 Tune the instruction scheduling for a particular CPU, Valid values are
14237 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
14238 and @samp{mckinley}.
14239
14240 @item -milp32
14241 @itemx -mlp64
14242 @opindex milp32
14243 @opindex mlp64
14244 Generate code for a 32-bit or 64-bit environment.
14245 The 32-bit environment sets int, long and pointer to 32 bits.
14246 The 64-bit environment sets int to 32 bits and long and pointer
14247 to 64 bits.  These are HP-UX specific flags.
14248
14249 @item -mno-sched-br-data-spec
14250 @itemx -msched-br-data-spec
14251 @opindex mno-sched-br-data-spec
14252 @opindex msched-br-data-spec
14253 (Dis/En)able data speculative scheduling before reload.
14254 This results in generation of @code{ld.a} instructions and
14255 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14256 The default is 'disable'.
14257
14258 @item -msched-ar-data-spec
14259 @itemx -mno-sched-ar-data-spec
14260 @opindex msched-ar-data-spec
14261 @opindex mno-sched-ar-data-spec
14262 (En/Dis)able data speculative scheduling after reload.
14263 This results in generation of @code{ld.a} instructions and
14264 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14265 The default is 'enable'.
14266
14267 @item -mno-sched-control-spec
14268 @itemx -msched-control-spec
14269 @opindex mno-sched-control-spec
14270 @opindex msched-control-spec
14271 (Dis/En)able control speculative scheduling.  This feature is
14272 available only during region scheduling (i.e.@: before reload).
14273 This results in generation of the @code{ld.s} instructions and
14274 the corresponding check instructions @code{chk.s}.
14275 The default is 'disable'.
14276
14277 @item -msched-br-in-data-spec
14278 @itemx -mno-sched-br-in-data-spec
14279 @opindex msched-br-in-data-spec
14280 @opindex mno-sched-br-in-data-spec
14281 (En/Dis)able speculative scheduling of the instructions that
14282 are dependent on the data speculative loads before reload.
14283 This is effective only with @option{-msched-br-data-spec} enabled.
14284 The default is 'enable'.
14285
14286 @item -msched-ar-in-data-spec
14287 @itemx -mno-sched-ar-in-data-spec
14288 @opindex msched-ar-in-data-spec
14289 @opindex mno-sched-ar-in-data-spec
14290 (En/Dis)able speculative scheduling of the instructions that
14291 are dependent on the data speculative loads after reload.
14292 This is effective only with @option{-msched-ar-data-spec} enabled.
14293 The default is 'enable'.
14294
14295 @item -msched-in-control-spec
14296 @itemx -mno-sched-in-control-spec
14297 @opindex msched-in-control-spec
14298 @opindex mno-sched-in-control-spec
14299 (En/Dis)able speculative scheduling of the instructions that
14300 are dependent on the control speculative loads.
14301 This is effective only with @option{-msched-control-spec} enabled.
14302 The default is 'enable'.
14303
14304 @item -mno-sched-prefer-non-data-spec-insns
14305 @itemx -msched-prefer-non-data-spec-insns
14306 @opindex mno-sched-prefer-non-data-spec-insns
14307 @opindex msched-prefer-non-data-spec-insns
14308 If enabled, data-speculative instructions are chosen for schedule
14309 only if there are no other choices at the moment.  This makes
14310 the use of the data speculation much more conservative.
14311 The default is 'disable'.
14312
14313 @item -mno-sched-prefer-non-control-spec-insns
14314 @itemx -msched-prefer-non-control-spec-insns
14315 @opindex mno-sched-prefer-non-control-spec-insns
14316 @opindex msched-prefer-non-control-spec-insns
14317 If enabled, control-speculative instructions are chosen for schedule
14318 only if there are no other choices at the moment.  This makes
14319 the use of the control speculation much more conservative.
14320 The default is 'disable'.
14321
14322 @item -mno-sched-count-spec-in-critical-path
14323 @itemx -msched-count-spec-in-critical-path
14324 @opindex mno-sched-count-spec-in-critical-path
14325 @opindex msched-count-spec-in-critical-path
14326 If enabled, speculative dependencies are considered during
14327 computation of the instructions priorities.  This makes the use of the
14328 speculation a bit more conservative.
14329 The default is 'disable'.
14330
14331 @item -msched-spec-ldc
14332 @opindex msched-spec-ldc
14333 Use a simple data speculation check.  This option is on by default.
14334
14335 @item -msched-control-spec-ldc
14336 @opindex msched-spec-ldc
14337 Use a simple check for control speculation.  This option is on by default.
14338
14339 @item -msched-stop-bits-after-every-cycle
14340 @opindex msched-stop-bits-after-every-cycle
14341 Place a stop bit after every cycle when scheduling.  This option is on
14342 by default.
14343
14344 @item -msched-fp-mem-deps-zero-cost
14345 @opindex msched-fp-mem-deps-zero-cost
14346 Assume that floating-point stores and loads are not likely to cause a conflict
14347 when placed into the same instruction group.  This option is disabled by
14348 default.
14349
14350 @item -msel-sched-dont-check-control-spec
14351 @opindex msel-sched-dont-check-control-spec
14352 Generate checks for control speculation in selective scheduling.
14353 This flag is disabled by default.
14354
14355 @item -msched-max-memory-insns=@var{max-insns}
14356 @opindex msched-max-memory-insns
14357 Limit on the number of memory insns per instruction group, giving lower
14358 priority to subsequent memory insns attempting to schedule in the same
14359 instruction group. Frequently useful to prevent cache bank conflicts.
14360 The default value is 1.
14361
14362 @item -msched-max-memory-insns-hard-limit
14363 @opindex msched-max-memory-insns-hard-limit
14364 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
14365 disallowing more than that number in an instruction group.
14366 Otherwise, the limit is ``soft'', meaning that non-memory operations
14367 are preferred when the limit is reached, but memory operations may still
14368 be scheduled.
14369
14370 @end table
14371
14372 @node LM32 Options
14373 @subsection LM32 Options
14374 @cindex LM32 options
14375
14376 These @option{-m} options are defined for the Lattice Mico32 architecture:
14377
14378 @table @gcctabopt
14379 @item -mbarrel-shift-enabled
14380 @opindex mbarrel-shift-enabled
14381 Enable barrel-shift instructions.
14382
14383 @item -mdivide-enabled
14384 @opindex mdivide-enabled
14385 Enable divide and modulus instructions.
14386
14387 @item -mmultiply-enabled
14388 @opindex multiply-enabled
14389 Enable multiply instructions.
14390
14391 @item -msign-extend-enabled
14392 @opindex msign-extend-enabled
14393 Enable sign extend instructions.
14394
14395 @item -muser-enabled
14396 @opindex muser-enabled
14397 Enable user-defined instructions.
14398
14399 @end table
14400
14401 @node M32C Options
14402 @subsection M32C Options
14403 @cindex M32C options
14404
14405 @table @gcctabopt
14406 @item -mcpu=@var{name}
14407 @opindex mcpu=
14408 Select the CPU for which code is generated.  @var{name} may be one of
14409 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
14410 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
14411 the M32C/80 series.
14412
14413 @item -msim
14414 @opindex msim
14415 Specifies that the program will be run on the simulator.  This causes
14416 an alternate runtime library to be linked in which supports, for
14417 example, file I/O@.  You must not use this option when generating
14418 programs that will run on real hardware; you must provide your own
14419 runtime library for whatever I/O functions are needed.
14420
14421 @item -memregs=@var{number}
14422 @opindex memregs=
14423 Specifies the number of memory-based pseudo-registers GCC uses
14424 during code generation.  These pseudo-registers are used like real
14425 registers, so there is a tradeoff between GCC's ability to fit the
14426 code into available registers, and the performance penalty of using
14427 memory instead of registers.  Note that all modules in a program must
14428 be compiled with the same value for this option.  Because of that, you
14429 must not use this option with the default runtime libraries gcc
14430 builds.
14431
14432 @end table
14433
14434 @node M32R/D Options
14435 @subsection M32R/D Options
14436 @cindex M32R/D options
14437
14438 These @option{-m} options are defined for Renesas M32R/D architectures:
14439
14440 @table @gcctabopt
14441 @item -m32r2
14442 @opindex m32r2
14443 Generate code for the M32R/2@.
14444
14445 @item -m32rx
14446 @opindex m32rx
14447 Generate code for the M32R/X@.
14448
14449 @item -m32r
14450 @opindex m32r
14451 Generate code for the M32R@.  This is the default.
14452
14453 @item -mmodel=small
14454 @opindex mmodel=small
14455 Assume all objects live in the lower 16MB of memory (so that their addresses
14456 can be loaded with the @code{ld24} instruction), and assume all subroutines
14457 are reachable with the @code{bl} instruction.
14458 This is the default.
14459
14460 The addressability of a particular object can be set with the
14461 @code{model} attribute.
14462
14463 @item -mmodel=medium
14464 @opindex mmodel=medium
14465 Assume objects may be anywhere in the 32-bit address space (the compiler
14466 generates @code{seth/add3} instructions to load their addresses), and
14467 assume all subroutines are reachable with the @code{bl} instruction.
14468
14469 @item -mmodel=large
14470 @opindex mmodel=large
14471 Assume objects may be anywhere in the 32-bit address space (the compiler
14472 generates @code{seth/add3} instructions to load their addresses), and
14473 assume subroutines may not be reachable with the @code{bl} instruction
14474 (the compiler generates the much slower @code{seth/add3/jl}
14475 instruction sequence).
14476
14477 @item -msdata=none
14478 @opindex msdata=none
14479 Disable use of the small data area.  Variables are put into
14480 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
14481 @code{section} attribute has been specified).
14482 This is the default.
14483
14484 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
14485 Objects may be explicitly put in the small data area with the
14486 @code{section} attribute using one of these sections.
14487
14488 @item -msdata=sdata
14489 @opindex msdata=sdata
14490 Put small global and static data in the small data area, but do not
14491 generate special code to reference them.
14492
14493 @item -msdata=use
14494 @opindex msdata=use
14495 Put small global and static data in the small data area, and generate
14496 special instructions to reference them.
14497
14498 @item -G @var{num}
14499 @opindex G
14500 @cindex smaller data references
14501 Put global and static objects less than or equal to @var{num} bytes
14502 into the small data or bss sections instead of the normal data or bss
14503 sections.  The default value of @var{num} is 8.
14504 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
14505 for this option to have any effect.
14506
14507 All modules should be compiled with the same @option{-G @var{num}} value.
14508 Compiling with different values of @var{num} may or may not work; if it
14509 doesn't the linker gives an error message---incorrect code is not
14510 generated.
14511
14512 @item -mdebug
14513 @opindex mdebug
14514 Makes the M32R specific code in the compiler display some statistics
14515 that might help in debugging programs.
14516
14517 @item -malign-loops
14518 @opindex malign-loops
14519 Align all loops to a 32-byte boundary.
14520
14521 @item -mno-align-loops
14522 @opindex mno-align-loops
14523 Do not enforce a 32-byte alignment for loops.  This is the default.
14524
14525 @item -missue-rate=@var{number}
14526 @opindex missue-rate=@var{number}
14527 Issue @var{number} instructions per cycle.  @var{number} can only be 1
14528 or 2.
14529
14530 @item -mbranch-cost=@var{number}
14531 @opindex mbranch-cost=@var{number}
14532 @var{number} can only be 1 or 2.  If it is 1 then branches are
14533 preferred over conditional code, if it is 2, then the opposite applies.
14534
14535 @item -mflush-trap=@var{number}
14536 @opindex mflush-trap=@var{number}
14537 Specifies the trap number to use to flush the cache.  The default is
14538 12.  Valid numbers are between 0 and 15 inclusive.
14539
14540 @item -mno-flush-trap
14541 @opindex mno-flush-trap
14542 Specifies that the cache cannot be flushed by using a trap.
14543
14544 @item -mflush-func=@var{name}
14545 @opindex mflush-func=@var{name}
14546 Specifies the name of the operating system function to call to flush
14547 the cache.  The default is @emph{_flush_cache}, but a function call
14548 is only used if a trap is not available.
14549
14550 @item -mno-flush-func
14551 @opindex mno-flush-func
14552 Indicates that there is no OS function for flushing the cache.
14553
14554 @end table
14555
14556 @node M680x0 Options
14557 @subsection M680x0 Options
14558 @cindex M680x0 options
14559
14560 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
14561 The default settings depend on which architecture was selected when
14562 the compiler was configured; the defaults for the most common choices
14563 are given below.
14564
14565 @table @gcctabopt
14566 @item -march=@var{arch}
14567 @opindex march
14568 Generate code for a specific M680x0 or ColdFire instruction set
14569 architecture.  Permissible values of @var{arch} for M680x0
14570 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
14571 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
14572 architectures are selected according to Freescale's ISA classification
14573 and the permissible values are: @samp{isaa}, @samp{isaaplus},
14574 @samp{isab} and @samp{isac}.
14575
14576 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
14577 code for a ColdFire target.  The @var{arch} in this macro is one of the
14578 @option{-march} arguments given above.
14579
14580 When used together, @option{-march} and @option{-mtune} select code
14581 that runs on a family of similar processors but that is optimized
14582 for a particular microarchitecture.
14583
14584 @item -mcpu=@var{cpu}
14585 @opindex mcpu
14586 Generate code for a specific M680x0 or ColdFire processor.
14587 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
14588 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
14589 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
14590 below, which also classifies the CPUs into families:
14591
14592 @multitable @columnfractions 0.20 0.80
14593 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
14594 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
14595 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
14596 @item @samp{5206e} @tab @samp{5206e}
14597 @item @samp{5208} @tab @samp{5207} @samp{5208}
14598 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
14599 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
14600 @item @samp{5216} @tab @samp{5214} @samp{5216}
14601 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
14602 @item @samp{5225} @tab @samp{5224} @samp{5225}
14603 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
14604 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
14605 @item @samp{5249} @tab @samp{5249}
14606 @item @samp{5250} @tab @samp{5250}
14607 @item @samp{5271} @tab @samp{5270} @samp{5271}
14608 @item @samp{5272} @tab @samp{5272}
14609 @item @samp{5275} @tab @samp{5274} @samp{5275}
14610 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
14611 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
14612 @item @samp{5307} @tab @samp{5307}
14613 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
14614 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
14615 @item @samp{5407} @tab @samp{5407}
14616 @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}
14617 @end multitable
14618
14619 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
14620 @var{arch} is compatible with @var{cpu}.  Other combinations of
14621 @option{-mcpu} and @option{-march} are rejected.
14622
14623 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
14624 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
14625 where the value of @var{family} is given by the table above.
14626
14627 @item -mtune=@var{tune}
14628 @opindex mtune
14629 Tune the code for a particular microarchitecture, within the
14630 constraints set by @option{-march} and @option{-mcpu}.
14631 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
14632 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
14633 and @samp{cpu32}.  The ColdFire microarchitectures
14634 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
14635
14636 You can also use @option{-mtune=68020-40} for code that needs
14637 to run relatively well on 68020, 68030 and 68040 targets.
14638 @option{-mtune=68020-60} is similar but includes 68060 targets
14639 as well.  These two options select the same tuning decisions as
14640 @option{-m68020-40} and @option{-m68020-60} respectively.
14641
14642 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
14643 when tuning for 680x0 architecture @var{arch}.  It also defines
14644 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
14645 option is used.  If GCC is tuning for a range of architectures,
14646 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
14647 it defines the macros for every architecture in the range.
14648
14649 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
14650 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
14651 of the arguments given above.
14652
14653 @item -m68000
14654 @itemx -mc68000
14655 @opindex m68000
14656 @opindex mc68000
14657 Generate output for a 68000.  This is the default
14658 when the compiler is configured for 68000-based systems.
14659 It is equivalent to @option{-march=68000}.
14660
14661 Use this option for microcontrollers with a 68000 or EC000 core,
14662 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
14663
14664 @item -m68010
14665 @opindex m68010
14666 Generate output for a 68010.  This is the default
14667 when the compiler is configured for 68010-based systems.
14668 It is equivalent to @option{-march=68010}.
14669
14670 @item -m68020
14671 @itemx -mc68020
14672 @opindex m68020
14673 @opindex mc68020
14674 Generate output for a 68020.  This is the default
14675 when the compiler is configured for 68020-based systems.
14676 It is equivalent to @option{-march=68020}.
14677
14678 @item -m68030
14679 @opindex m68030
14680 Generate output for a 68030.  This is the default when the compiler is
14681 configured for 68030-based systems.  It is equivalent to
14682 @option{-march=68030}.
14683
14684 @item -m68040
14685 @opindex m68040
14686 Generate output for a 68040.  This is the default when the compiler is
14687 configured for 68040-based systems.  It is equivalent to
14688 @option{-march=68040}.
14689
14690 This option inhibits the use of 68881/68882 instructions that have to be
14691 emulated by software on the 68040.  Use this option if your 68040 does not
14692 have code to emulate those instructions.
14693
14694 @item -m68060
14695 @opindex m68060
14696 Generate output for a 68060.  This is the default when the compiler is
14697 configured for 68060-based systems.  It is equivalent to
14698 @option{-march=68060}.
14699
14700 This option inhibits the use of 68020 and 68881/68882 instructions that
14701 have to be emulated by software on the 68060.  Use this option if your 68060
14702 does not have code to emulate those instructions.
14703
14704 @item -mcpu32
14705 @opindex mcpu32
14706 Generate output for a CPU32.  This is the default
14707 when the compiler is configured for CPU32-based systems.
14708 It is equivalent to @option{-march=cpu32}.
14709
14710 Use this option for microcontrollers with a
14711 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
14712 68336, 68340, 68341, 68349 and 68360.
14713
14714 @item -m5200
14715 @opindex m5200
14716 Generate output for a 520X ColdFire CPU@.  This is the default
14717 when the compiler is configured for 520X-based systems.
14718 It is equivalent to @option{-mcpu=5206}, and is now deprecated
14719 in favor of that option.
14720
14721 Use this option for microcontroller with a 5200 core, including
14722 the MCF5202, MCF5203, MCF5204 and MCF5206.
14723
14724 @item -m5206e
14725 @opindex m5206e
14726 Generate output for a 5206e ColdFire CPU@.  The option is now
14727 deprecated in favor of the equivalent @option{-mcpu=5206e}.
14728
14729 @item -m528x
14730 @opindex m528x
14731 Generate output for a member of the ColdFire 528X family.
14732 The option is now deprecated in favor of the equivalent
14733 @option{-mcpu=528x}.
14734
14735 @item -m5307
14736 @opindex m5307
14737 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
14738 in favor of the equivalent @option{-mcpu=5307}.
14739
14740 @item -m5407
14741 @opindex m5407
14742 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
14743 in favor of the equivalent @option{-mcpu=5407}.
14744
14745 @item -mcfv4e
14746 @opindex mcfv4e
14747 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
14748 This includes use of hardware floating-point instructions.
14749 The option is equivalent to @option{-mcpu=547x}, and is now
14750 deprecated in favor of that option.
14751
14752 @item -m68020-40
14753 @opindex m68020-40
14754 Generate output for a 68040, without using any of the new instructions.
14755 This results in code that can run relatively efficiently on either a
14756 68020/68881 or a 68030 or a 68040.  The generated code does use the
14757 68881 instructions that are emulated on the 68040.
14758
14759 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
14760
14761 @item -m68020-60
14762 @opindex m68020-60
14763 Generate output for a 68060, without using any of the new instructions.
14764 This results in code that can run relatively efficiently on either a
14765 68020/68881 or a 68030 or a 68040.  The generated code does use the
14766 68881 instructions that are emulated on the 68060.
14767
14768 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
14769
14770 @item -mhard-float
14771 @itemx -m68881
14772 @opindex mhard-float
14773 @opindex m68881
14774 Generate floating-point instructions.  This is the default for 68020
14775 and above, and for ColdFire devices that have an FPU@.  It defines the
14776 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
14777 on ColdFire targets.
14778
14779 @item -msoft-float
14780 @opindex msoft-float
14781 Do not generate floating-point instructions; use library calls instead.
14782 This is the default for 68000, 68010, and 68832 targets.  It is also
14783 the default for ColdFire devices that have no FPU.
14784
14785 @item -mdiv
14786 @itemx -mno-div
14787 @opindex mdiv
14788 @opindex mno-div
14789 Generate (do not generate) ColdFire hardware divide and remainder
14790 instructions.  If @option{-march} is used without @option{-mcpu},
14791 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
14792 architectures.  Otherwise, the default is taken from the target CPU
14793 (either the default CPU, or the one specified by @option{-mcpu}).  For
14794 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
14795 @option{-mcpu=5206e}.
14796
14797 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
14798
14799 @item -mshort
14800 @opindex mshort
14801 Consider type @code{int} to be 16 bits wide, like @code{short int}.
14802 Additionally, parameters passed on the stack are also aligned to a
14803 16-bit boundary even on targets whose API mandates promotion to 32-bit.
14804
14805 @item -mno-short
14806 @opindex mno-short
14807 Do not consider type @code{int} to be 16 bits wide.  This is the default.
14808
14809 @item -mnobitfield
14810 @itemx -mno-bitfield
14811 @opindex mnobitfield
14812 @opindex mno-bitfield
14813 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
14814 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
14815
14816 @item -mbitfield
14817 @opindex mbitfield
14818 Do use the bit-field instructions.  The @option{-m68020} option implies
14819 @option{-mbitfield}.  This is the default if you use a configuration
14820 designed for a 68020.
14821
14822 @item -mrtd
14823 @opindex mrtd
14824 Use a different function-calling convention, in which functions
14825 that take a fixed number of arguments return with the @code{rtd}
14826 instruction, which pops their arguments while returning.  This
14827 saves one instruction in the caller since there is no need to pop
14828 the arguments there.
14829
14830 This calling convention is incompatible with the one normally
14831 used on Unix, so you cannot use it if you need to call libraries
14832 compiled with the Unix compiler.
14833
14834 Also, you must provide function prototypes for all functions that
14835 take variable numbers of arguments (including @code{printf});
14836 otherwise incorrect code is generated for calls to those
14837 functions.
14838
14839 In addition, seriously incorrect code results if you call a
14840 function with too many arguments.  (Normally, extra arguments are
14841 harmlessly ignored.)
14842
14843 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
14844 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
14845
14846 @item -mno-rtd
14847 @opindex mno-rtd
14848 Do not use the calling conventions selected by @option{-mrtd}.
14849 This is the default.
14850
14851 @item -malign-int
14852 @itemx -mno-align-int
14853 @opindex malign-int
14854 @opindex mno-align-int
14855 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
14856 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
14857 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
14858 Aligning variables on 32-bit boundaries produces code that runs somewhat
14859 faster on processors with 32-bit busses at the expense of more memory.
14860
14861 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
14862 aligns structures containing the above types differently than
14863 most published application binary interface specifications for the m68k.
14864
14865 @item -mpcrel
14866 @opindex mpcrel
14867 Use the pc-relative addressing mode of the 68000 directly, instead of
14868 using a global offset table.  At present, this option implies @option{-fpic},
14869 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
14870 not presently supported with @option{-mpcrel}, though this could be supported for
14871 68020 and higher processors.
14872
14873 @item -mno-strict-align
14874 @itemx -mstrict-align
14875 @opindex mno-strict-align
14876 @opindex mstrict-align
14877 Do not (do) assume that unaligned memory references are handled by
14878 the system.
14879
14880 @item -msep-data
14881 Generate code that allows the data segment to be located in a different
14882 area of memory from the text segment.  This allows for execute in place in
14883 an environment without virtual memory management.  This option implies
14884 @option{-fPIC}.
14885
14886 @item -mno-sep-data
14887 Generate code that assumes that the data segment follows the text segment.
14888 This is the default.
14889
14890 @item -mid-shared-library
14891 Generate code that supports shared libraries via the library ID method.
14892 This allows for execute in place and shared libraries in an environment
14893 without virtual memory management.  This option implies @option{-fPIC}.
14894
14895 @item -mno-id-shared-library
14896 Generate code that doesn't assume ID based shared libraries are being used.
14897 This is the default.
14898
14899 @item -mshared-library-id=n
14900 Specifies the identification number of the ID-based shared library being
14901 compiled.  Specifying a value of 0 generates more compact code; specifying
14902 other values forces the allocation of that number to the current
14903 library, but is no more space- or time-efficient than omitting this option.
14904
14905 @item -mxgot
14906 @itemx -mno-xgot
14907 @opindex mxgot
14908 @opindex mno-xgot
14909 When generating position-independent code for ColdFire, generate code
14910 that works if the GOT has more than 8192 entries.  This code is
14911 larger and slower than code generated without this option.  On M680x0
14912 processors, this option is not needed; @option{-fPIC} suffices.
14913
14914 GCC normally uses a single instruction to load values from the GOT@.
14915 While this is relatively efficient, it only works if the GOT
14916 is smaller than about 64k.  Anything larger causes the linker
14917 to report an error such as:
14918
14919 @cindex relocation truncated to fit (ColdFire)
14920 @smallexample
14921 relocation truncated to fit: R_68K_GOT16O foobar
14922 @end smallexample
14923
14924 If this happens, you should recompile your code with @option{-mxgot}.
14925 It should then work with very large GOTs.  However, code generated with
14926 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
14927 the value of a global symbol.
14928
14929 Note that some linkers, including newer versions of the GNU linker,
14930 can create multiple GOTs and sort GOT entries.  If you have such a linker,
14931 you should only need to use @option{-mxgot} when compiling a single
14932 object file that accesses more than 8192 GOT entries.  Very few do.
14933
14934 These options have no effect unless GCC is generating
14935 position-independent code.
14936
14937 @end table
14938
14939 @node MCore Options
14940 @subsection MCore Options
14941 @cindex MCore options
14942
14943 These are the @samp{-m} options defined for the Motorola M*Core
14944 processors.
14945
14946 @table @gcctabopt
14947
14948 @item -mhardlit
14949 @itemx -mno-hardlit
14950 @opindex mhardlit
14951 @opindex mno-hardlit
14952 Inline constants into the code stream if it can be done in two
14953 instructions or less.
14954
14955 @item -mdiv
14956 @itemx -mno-div
14957 @opindex mdiv
14958 @opindex mno-div
14959 Use the divide instruction.  (Enabled by default).
14960
14961 @item -mrelax-immediate
14962 @itemx -mno-relax-immediate
14963 @opindex mrelax-immediate
14964 @opindex mno-relax-immediate
14965 Allow arbitrary sized immediates in bit operations.
14966
14967 @item -mwide-bitfields
14968 @itemx -mno-wide-bitfields
14969 @opindex mwide-bitfields
14970 @opindex mno-wide-bitfields
14971 Always treat bit-fields as int-sized.
14972
14973 @item -m4byte-functions
14974 @itemx -mno-4byte-functions
14975 @opindex m4byte-functions
14976 @opindex mno-4byte-functions
14977 Force all functions to be aligned to a 4-byte boundary.
14978
14979 @item -mcallgraph-data
14980 @itemx -mno-callgraph-data
14981 @opindex mcallgraph-data
14982 @opindex mno-callgraph-data
14983 Emit callgraph information.
14984
14985 @item -mslow-bytes
14986 @itemx -mno-slow-bytes
14987 @opindex mslow-bytes
14988 @opindex mno-slow-bytes
14989 Prefer word access when reading byte quantities.
14990
14991 @item -mlittle-endian
14992 @itemx -mbig-endian
14993 @opindex mlittle-endian
14994 @opindex mbig-endian
14995 Generate code for a little-endian target.
14996
14997 @item -m210
14998 @itemx -m340
14999 @opindex m210
15000 @opindex m340
15001 Generate code for the 210 processor.
15002
15003 @item -mno-lsim
15004 @opindex mno-lsim
15005 Assume that runtime support has been provided and so omit the
15006 simulator library (@file{libsim.a)} from the linker command line.
15007
15008 @item -mstack-increment=@var{size}
15009 @opindex mstack-increment
15010 Set the maximum amount for a single stack increment operation.  Large
15011 values can increase the speed of programs that contain functions
15012 that need a large amount of stack space, but they can also trigger a
15013 segmentation fault if the stack is extended too much.  The default
15014 value is 0x1000.
15015
15016 @end table
15017
15018 @node MeP Options
15019 @subsection MeP Options
15020 @cindex MeP options
15021
15022 @table @gcctabopt
15023
15024 @item -mabsdiff
15025 @opindex mabsdiff
15026 Enables the @code{abs} instruction, which is the absolute difference
15027 between two registers.
15028
15029 @item -mall-opts
15030 @opindex mall-opts
15031 Enables all the optional instructions---average, multiply, divide, bit
15032 operations, leading zero, absolute difference, min/max, clip, and
15033 saturation.
15034
15035
15036 @item -maverage
15037 @opindex maverage
15038 Enables the @code{ave} instruction, which computes the average of two
15039 registers.
15040
15041 @item -mbased=@var{n}
15042 @opindex mbased=
15043 Variables of size @var{n} bytes or smaller are placed in the
15044 @code{.based} section by default.  Based variables use the @code{$tp}
15045 register as a base register, and there is a 128-byte limit to the
15046 @code{.based} section.
15047
15048 @item -mbitops
15049 @opindex mbitops
15050 Enables the bit operation instructions---bit test (@code{btstm}), set
15051 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15052 test-and-set (@code{tas}).
15053
15054 @item -mc=@var{name}
15055 @opindex mc=
15056 Selects which section constant data is placed in.  @var{name} may
15057 be @code{tiny}, @code{near}, or @code{far}.
15058
15059 @item -mclip
15060 @opindex mclip
15061 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15062 useful unless you also provide @code{-mminmax}.
15063
15064 @item -mconfig=@var{name}
15065 @opindex mconfig=
15066 Selects one of the build-in core configurations.  Each MeP chip has
15067 one or more modules in it; each module has a core CPU and a variety of
15068 coprocessors, optional instructions, and peripherals.  The
15069 @code{MeP-Integrator} tool, not part of GCC, provides these
15070 configurations through this option; using this option is the same as
15071 using all the corresponding command-line options.  The default
15072 configuration is @code{default}.
15073
15074 @item -mcop
15075 @opindex mcop
15076 Enables the coprocessor instructions.  By default, this is a 32-bit
15077 coprocessor.  Note that the coprocessor is normally enabled via the
15078 @code{-mconfig=} option.
15079
15080 @item -mcop32
15081 @opindex mcop32
15082 Enables the 32-bit coprocessor's instructions.
15083
15084 @item -mcop64
15085 @opindex mcop64
15086 Enables the 64-bit coprocessor's instructions.
15087
15088 @item -mivc2
15089 @opindex mivc2
15090 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15091
15092 @item -mdc
15093 @opindex mdc
15094 Causes constant variables to be placed in the @code{.near} section.
15095
15096 @item -mdiv
15097 @opindex mdiv
15098 Enables the @code{div} and @code{divu} instructions.
15099
15100 @item -meb
15101 @opindex meb
15102 Generate big-endian code.
15103
15104 @item -mel
15105 @opindex mel
15106 Generate little-endian code.
15107
15108 @item -mio-volatile
15109 @opindex mio-volatile
15110 Tells the compiler that any variable marked with the @code{io}
15111 attribute is to be considered volatile.
15112
15113 @item -ml
15114 @opindex ml
15115 Causes variables to be assigned to the @code{.far} section by default.
15116
15117 @item -mleadz
15118 @opindex mleadz
15119 Enables the @code{leadz} (leading zero) instruction.
15120
15121 @item -mm
15122 @opindex mm
15123 Causes variables to be assigned to the @code{.near} section by default.
15124
15125 @item -mminmax
15126 @opindex mminmax
15127 Enables the @code{min} and @code{max} instructions.
15128
15129 @item -mmult
15130 @opindex mmult
15131 Enables the multiplication and multiply-accumulate instructions.
15132
15133 @item -mno-opts
15134 @opindex mno-opts
15135 Disables all the optional instructions enabled by @code{-mall-opts}.
15136
15137 @item -mrepeat
15138 @opindex mrepeat
15139 Enables the @code{repeat} and @code{erepeat} instructions, used for
15140 low-overhead looping.
15141
15142 @item -ms
15143 @opindex ms
15144 Causes all variables to default to the @code{.tiny} section.  Note
15145 that there is a 65536-byte limit to this section.  Accesses to these
15146 variables use the @code{%gp} base register.
15147
15148 @item -msatur
15149 @opindex msatur
15150 Enables the saturation instructions.  Note that the compiler does not
15151 currently generate these itself, but this option is included for
15152 compatibility with other tools, like @code{as}.
15153
15154 @item -msdram
15155 @opindex msdram
15156 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15157
15158 @item -msim
15159 @opindex msim
15160 Link the simulator runtime libraries.
15161
15162 @item -msimnovec
15163 @opindex msimnovec
15164 Link the simulator runtime libraries, excluding built-in support
15165 for reset and exception vectors and tables.
15166
15167 @item -mtf
15168 @opindex mtf
15169 Causes all functions to default to the @code{.far} section.  Without
15170 this option, functions default to the @code{.near} section.
15171
15172 @item -mtiny=@var{n}
15173 @opindex mtiny=
15174 Variables that are @var{n} bytes or smaller are allocated to the
15175 @code{.tiny} section.  These variables use the @code{$gp} base
15176 register.  The default for this option is 4, but note that there's a
15177 65536-byte limit to the @code{.tiny} section.
15178
15179 @end table
15180
15181 @node MicroBlaze Options
15182 @subsection MicroBlaze Options
15183 @cindex MicroBlaze Options
15184
15185 @table @gcctabopt
15186
15187 @item -msoft-float
15188 @opindex msoft-float
15189 Use software emulation for floating point (default).
15190
15191 @item -mhard-float
15192 @opindex mhard-float
15193 Use hardware floating-point instructions.
15194
15195 @item -mmemcpy
15196 @opindex mmemcpy
15197 Do not optimize block moves, use @code{memcpy}.
15198
15199 @item -mno-clearbss
15200 @opindex mno-clearbss
15201 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15202
15203 @item -mcpu=@var{cpu-type}
15204 @opindex mcpu=
15205 Use features of and schedule code for given CPU.
15206 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15207 where @var{X} is a major version, @var{YY} is the minor version, and
15208 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
15209 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
15210
15211 @item -mxl-soft-mul
15212 @opindex mxl-soft-mul
15213 Use software multiply emulation (default).
15214
15215 @item -mxl-soft-div
15216 @opindex mxl-soft-div
15217 Use software emulation for divides (default).
15218
15219 @item -mxl-barrel-shift
15220 @opindex mxl-barrel-shift
15221 Use the hardware barrel shifter.
15222
15223 @item -mxl-pattern-compare
15224 @opindex mxl-pattern-compare
15225 Use pattern compare instructions.
15226
15227 @item -msmall-divides
15228 @opindex msmall-divides
15229 Use table lookup optimization for small signed integer divisions.
15230
15231 @item -mxl-stack-check
15232 @opindex mxl-stack-check
15233 This option is deprecated.  Use @option{-fstack-check} instead.
15234
15235 @item -mxl-gp-opt
15236 @opindex mxl-gp-opt
15237 Use GP-relative @code{.sdata}/@code{.sbss} sections.
15238
15239 @item -mxl-multiply-high
15240 @opindex mxl-multiply-high
15241 Use multiply high instructions for high part of 32x32 multiply.
15242
15243 @item -mxl-float-convert
15244 @opindex mxl-float-convert
15245 Use hardware floating-point conversion instructions.
15246
15247 @item -mxl-float-sqrt
15248 @opindex mxl-float-sqrt
15249 Use hardware floating-point square root instruction.
15250
15251 @item -mxl-mode-@var{app-model}
15252 Select application model @var{app-model}.  Valid models are
15253 @table @samp
15254 @item executable
15255 normal executable (default), uses startup code @file{crt0.o}.
15256
15257 @item xmdstub
15258 for use with Xilinx Microprocessor Debugger (XMD) based
15259 software intrusive debug agent called xmdstub. This uses startup file
15260 @file{crt1.o} and sets the start address of the program to be 0x800.
15261
15262 @item bootstrap
15263 for applications that are loaded using a bootloader.
15264 This model uses startup file @file{crt2.o} which does not contain a processor
15265 reset vector handler. This is suitable for transferring control on a
15266 processor reset to the bootloader rather than the application.
15267
15268 @item novectors
15269 for applications that do not require any of the
15270 MicroBlaze vectors. This option may be useful for applications running
15271 within a monitoring application. This model uses @file{crt3.o} as a startup file.
15272 @end table
15273
15274 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
15275 @option{-mxl-mode-@var{app-model}}.
15276
15277 @end table
15278
15279 @node MIPS Options
15280 @subsection MIPS Options
15281 @cindex MIPS options
15282
15283 @table @gcctabopt
15284
15285 @item -EB
15286 @opindex EB
15287 Generate big-endian code.
15288
15289 @item -EL
15290 @opindex EL
15291 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
15292 configurations.
15293
15294 @item -march=@var{arch}
15295 @opindex march
15296 Generate code that runs on @var{arch}, which can be the name of a
15297 generic MIPS ISA, or the name of a particular processor.
15298 The ISA names are:
15299 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
15300 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
15301 The processor names are:
15302 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
15303 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
15304 @samp{5kc}, @samp{5kf},
15305 @samp{20kc},
15306 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
15307 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
15308 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
15309 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
15310 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
15311 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
15312 @samp{m4k},
15313 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
15314 @samp{orion},
15315 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
15316 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
15317 @samp{rm7000}, @samp{rm9000},
15318 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
15319 @samp{sb1},
15320 @samp{sr71000},
15321 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
15322 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
15323 @samp{xlr} and @samp{xlp}.
15324 The special value @samp{from-abi} selects the
15325 most compatible architecture for the selected ABI (that is,
15326 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
15327
15328 The native Linux/GNU toolchain also supports the value @samp{native},
15329 which selects the best architecture option for the host processor.
15330 @option{-march=native} has no effect if GCC does not recognize
15331 the processor.
15332
15333 In processor names, a final @samp{000} can be abbreviated as @samp{k}
15334 (for example, @option{-march=r2k}).  Prefixes are optional, and
15335 @samp{vr} may be written @samp{r}.
15336
15337 Names of the form @samp{@var{n}f2_1} refer to processors with
15338 FPUs clocked at half the rate of the core, names of the form
15339 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
15340 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
15341 processors with FPUs clocked a ratio of 3:2 with respect to the core.
15342 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
15343 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
15344 accepted as synonyms for @samp{@var{n}f1_1}.
15345
15346 GCC defines two macros based on the value of this option.  The first
15347 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
15348 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
15349 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
15350 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
15351 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
15352
15353 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
15354 above.  In other words, it has the full prefix and does not
15355 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
15356 the macro names the resolved architecture (either @samp{"mips1"} or
15357 @samp{"mips3"}).  It names the default architecture when no
15358 @option{-march} option is given.
15359
15360 @item -mtune=@var{arch}
15361 @opindex mtune
15362 Optimize for @var{arch}.  Among other things, this option controls
15363 the way instructions are scheduled, and the perceived cost of arithmetic
15364 operations.  The list of @var{arch} values is the same as for
15365 @option{-march}.
15366
15367 When this option is not used, GCC optimizes for the processor
15368 specified by @option{-march}.  By using @option{-march} and
15369 @option{-mtune} together, it is possible to generate code that
15370 runs on a family of processors, but optimize the code for one
15371 particular member of that family.
15372
15373 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
15374 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
15375 @option{-march} ones described above.
15376
15377 @item -mips1
15378 @opindex mips1
15379 Equivalent to @option{-march=mips1}.
15380
15381 @item -mips2
15382 @opindex mips2
15383 Equivalent to @option{-march=mips2}.
15384
15385 @item -mips3
15386 @opindex mips3
15387 Equivalent to @option{-march=mips3}.
15388
15389 @item -mips4
15390 @opindex mips4
15391 Equivalent to @option{-march=mips4}.
15392
15393 @item -mips32
15394 @opindex mips32
15395 Equivalent to @option{-march=mips32}.
15396
15397 @item -mips32r2
15398 @opindex mips32r2
15399 Equivalent to @option{-march=mips32r2}.
15400
15401 @item -mips64
15402 @opindex mips64
15403 Equivalent to @option{-march=mips64}.
15404
15405 @item -mips64r2
15406 @opindex mips64r2
15407 Equivalent to @option{-march=mips64r2}.
15408
15409 @item -mips16
15410 @itemx -mno-mips16
15411 @opindex mips16
15412 @opindex mno-mips16
15413 Generate (do not generate) MIPS16 code.  If GCC is targetting a
15414 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
15415
15416 MIPS16 code generation can also be controlled on a per-function basis
15417 by means of @code{mips16} and @code{nomips16} attributes.
15418 @xref{Function Attributes}, for more information.
15419
15420 @item -mflip-mips16
15421 @opindex mflip-mips16
15422 Generate MIPS16 code on alternating functions.  This option is provided
15423 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
15424 not intended for ordinary use in compiling user code.
15425
15426 @item -minterlink-mips16
15427 @itemx -mno-interlink-mips16
15428 @opindex minterlink-mips16
15429 @opindex mno-interlink-mips16
15430 Require (do not require) that non-MIPS16 code be link-compatible with
15431 MIPS16 code.
15432
15433 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
15434 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
15435 therefore disables direct jumps unless GCC knows that the target of the
15436 jump is not MIPS16.
15437
15438 @item -mabi=32
15439 @itemx -mabi=o64
15440 @itemx -mabi=n32
15441 @itemx -mabi=64
15442 @itemx -mabi=eabi
15443 @opindex mabi=32
15444 @opindex mabi=o64
15445 @opindex mabi=n32
15446 @opindex mabi=64
15447 @opindex mabi=eabi
15448 Generate code for the given ABI@.
15449
15450 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
15451 generates 64-bit code when you select a 64-bit architecture, but you
15452 can use @option{-mgp32} to get 32-bit code instead.
15453
15454 For information about the O64 ABI, see
15455 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
15456
15457 GCC supports a variant of the o32 ABI in which floating-point registers
15458 are 64 rather than 32 bits wide.  You can select this combination with
15459 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
15460 and @code{mfhc1} instructions and is therefore only supported for
15461 MIPS32R2 processors.
15462
15463 The register assignments for arguments and return values remain the
15464 same, but each scalar value is passed in a single 64-bit register
15465 rather than a pair of 32-bit registers.  For example, scalar
15466 floating-point values are returned in @samp{$f0} only, not a
15467 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
15468 remains the same, but all 64 bits are saved.
15469
15470 @item -mabicalls
15471 @itemx -mno-abicalls
15472 @opindex mabicalls
15473 @opindex mno-abicalls
15474 Generate (do not generate) code that is suitable for SVR4-style
15475 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
15476 systems.
15477
15478 @item -mshared
15479 @itemx -mno-shared
15480 Generate (do not generate) code that is fully position-independent,
15481 and that can therefore be linked into shared libraries.  This option
15482 only affects @option{-mabicalls}.
15483
15484 All @option{-mabicalls} code has traditionally been position-independent,
15485 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
15486 as an extension, the GNU toolchain allows executables to use absolute
15487 accesses for locally-binding symbols.  It can also use shorter GP
15488 initialization sequences and generate direct calls to locally-defined
15489 functions.  This mode is selected by @option{-mno-shared}.
15490
15491 @option{-mno-shared} depends on binutils 2.16 or higher and generates
15492 objects that can only be linked by the GNU linker.  However, the option
15493 does not affect the ABI of the final executable; it only affects the ABI
15494 of relocatable objects.  Using @option{-mno-shared} generally makes
15495 executables both smaller and quicker.
15496
15497 @option{-mshared} is the default.
15498
15499 @item -mplt
15500 @itemx -mno-plt
15501 @opindex mplt
15502 @opindex mno-plt
15503 Assume (do not assume) that the static and dynamic linkers
15504 support PLTs and copy relocations.  This option only affects
15505 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
15506 has no effect without @option{-msym32}.
15507
15508 You can make @option{-mplt} the default by configuring
15509 GCC with @option{--with-mips-plt}.  The default is
15510 @option{-mno-plt} otherwise.
15511
15512 @item -mxgot
15513 @itemx -mno-xgot
15514 @opindex mxgot
15515 @opindex mno-xgot
15516 Lift (do not lift) the usual restrictions on the size of the global
15517 offset table.
15518
15519 GCC normally uses a single instruction to load values from the GOT@.
15520 While this is relatively efficient, it only works if the GOT
15521 is smaller than about 64k.  Anything larger causes the linker
15522 to report an error such as:
15523
15524 @cindex relocation truncated to fit (MIPS)
15525 @smallexample
15526 relocation truncated to fit: R_MIPS_GOT16 foobar
15527 @end smallexample
15528
15529 If this happens, you should recompile your code with @option{-mxgot}.
15530 This works with very large GOTs, although the code is also
15531 less efficient, since it takes three instructions to fetch the
15532 value of a global symbol.
15533
15534 Note that some linkers can create multiple GOTs.  If you have such a
15535 linker, you should only need to use @option{-mxgot} when a single object
15536 file accesses more than 64k's worth of GOT entries.  Very few do.
15537
15538 These options have no effect unless GCC is generating position
15539 independent code.
15540
15541 @item -mgp32
15542 @opindex mgp32
15543 Assume that general-purpose registers are 32 bits wide.
15544
15545 @item -mgp64
15546 @opindex mgp64
15547 Assume that general-purpose registers are 64 bits wide.
15548
15549 @item -mfp32
15550 @opindex mfp32
15551 Assume that floating-point registers are 32 bits wide.
15552
15553 @item -mfp64
15554 @opindex mfp64
15555 Assume that floating-point registers are 64 bits wide.
15556
15557 @item -mhard-float
15558 @opindex mhard-float
15559 Use floating-point coprocessor instructions.
15560
15561 @item -msoft-float
15562 @opindex msoft-float
15563 Do not use floating-point coprocessor instructions.  Implement
15564 floating-point calculations using library calls instead.
15565
15566 @item -msingle-float
15567 @opindex msingle-float
15568 Assume that the floating-point coprocessor only supports single-precision
15569 operations.
15570
15571 @item -mdouble-float
15572 @opindex mdouble-float
15573 Assume that the floating-point coprocessor supports double-precision
15574 operations.  This is the default.
15575
15576 @item -mllsc
15577 @itemx -mno-llsc
15578 @opindex mllsc
15579 @opindex mno-llsc
15580 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
15581 implement atomic memory built-in functions.  When neither option is
15582 specified, GCC uses the instructions if the target architecture
15583 supports them.
15584
15585 @option{-mllsc} is useful if the runtime environment can emulate the
15586 instructions and @option{-mno-llsc} can be useful when compiling for
15587 nonstandard ISAs.  You can make either option the default by
15588 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
15589 respectively.  @option{--with-llsc} is the default for some
15590 configurations; see the installation documentation for details.
15591
15592 @item -mdsp
15593 @itemx -mno-dsp
15594 @opindex mdsp
15595 @opindex mno-dsp
15596 Use (do not use) revision 1 of the MIPS DSP ASE@.
15597 @xref{MIPS DSP Built-in Functions}.  This option defines the
15598 preprocessor macro @samp{__mips_dsp}.  It also defines
15599 @samp{__mips_dsp_rev} to 1.
15600
15601 @item -mdspr2
15602 @itemx -mno-dspr2
15603 @opindex mdspr2
15604 @opindex mno-dspr2
15605 Use (do not use) revision 2 of the MIPS DSP ASE@.
15606 @xref{MIPS DSP Built-in Functions}.  This option defines the
15607 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
15608 It also defines @samp{__mips_dsp_rev} to 2.
15609
15610 @item -msmartmips
15611 @itemx -mno-smartmips
15612 @opindex msmartmips
15613 @opindex mno-smartmips
15614 Use (do not use) the MIPS SmartMIPS ASE.
15615
15616 @item -mpaired-single
15617 @itemx -mno-paired-single
15618 @opindex mpaired-single
15619 @opindex mno-paired-single
15620 Use (do not use) paired-single floating-point instructions.
15621 @xref{MIPS Paired-Single Support}.  This option requires
15622 hardware floating-point support to be enabled.
15623
15624 @item -mdmx
15625 @itemx -mno-mdmx
15626 @opindex mdmx
15627 @opindex mno-mdmx
15628 Use (do not use) MIPS Digital Media Extension instructions.
15629 This option can only be used when generating 64-bit code and requires
15630 hardware floating-point support to be enabled.
15631
15632 @item -mips3d
15633 @itemx -mno-mips3d
15634 @opindex mips3d
15635 @opindex mno-mips3d
15636 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
15637 The option @option{-mips3d} implies @option{-mpaired-single}.
15638
15639 @item -mmt
15640 @itemx -mno-mt
15641 @opindex mmt
15642 @opindex mno-mt
15643 Use (do not use) MT Multithreading instructions.
15644
15645 @item -mlong64
15646 @opindex mlong64
15647 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
15648 an explanation of the default and the way that the pointer size is
15649 determined.
15650
15651 @item -mlong32
15652 @opindex mlong32
15653 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
15654
15655 The default size of @code{int}s, @code{long}s and pointers depends on
15656 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
15657 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
15658 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
15659 or the same size as integer registers, whichever is smaller.
15660
15661 @item -msym32
15662 @itemx -mno-sym32
15663 @opindex msym32
15664 @opindex mno-sym32
15665 Assume (do not assume) that all symbols have 32-bit values, regardless
15666 of the selected ABI@.  This option is useful in combination with
15667 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
15668 to generate shorter and faster references to symbolic addresses.
15669
15670 @item -G @var{num}
15671 @opindex G
15672 Put definitions of externally-visible data in a small data section
15673 if that data is no bigger than @var{num} bytes.  GCC can then access
15674 the data more efficiently; see @option{-mgpopt} for details.
15675
15676 The default @option{-G} option depends on the configuration.
15677
15678 @item -mlocal-sdata
15679 @itemx -mno-local-sdata
15680 @opindex mlocal-sdata
15681 @opindex mno-local-sdata
15682 Extend (do not extend) the @option{-G} behavior to local data too,
15683 such as to static variables in C@.  @option{-mlocal-sdata} is the
15684 default for all configurations.
15685
15686 If the linker complains that an application is using too much small data,
15687 you might want to try rebuilding the less performance-critical parts with
15688 @option{-mno-local-sdata}.  You might also want to build large
15689 libraries with @option{-mno-local-sdata}, so that the libraries leave
15690 more room for the main program.
15691
15692 @item -mextern-sdata
15693 @itemx -mno-extern-sdata
15694 @opindex mextern-sdata
15695 @opindex mno-extern-sdata
15696 Assume (do not assume) that externally-defined data is in
15697 a small data section if the size of that data is within the @option{-G} limit.
15698 @option{-mextern-sdata} is the default for all configurations.
15699
15700 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
15701 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
15702 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
15703 is placed in a small data section.  If @var{Var} is defined by another
15704 module, you must either compile that module with a high-enough
15705 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
15706 definition.  If @var{Var} is common, you must link the application
15707 with a high-enough @option{-G} setting.
15708
15709 The easiest way of satisfying these restrictions is to compile
15710 and link every module with the same @option{-G} option.  However,
15711 you may wish to build a library that supports several different
15712 small data limits.  You can do this by compiling the library with
15713 the highest supported @option{-G} setting and additionally using
15714 @option{-mno-extern-sdata} to stop the library from making assumptions
15715 about externally-defined data.
15716
15717 @item -mgpopt
15718 @itemx -mno-gpopt
15719 @opindex mgpopt
15720 @opindex mno-gpopt
15721 Use (do not use) GP-relative accesses for symbols that are known to be
15722 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
15723 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
15724 configurations.
15725
15726 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
15727 might not hold the value of @code{_gp}.  For example, if the code is
15728 part of a library that might be used in a boot monitor, programs that
15729 call boot monitor routines pass an unknown value in @code{$gp}.
15730 (In such situations, the boot monitor itself is usually compiled
15731 with @option{-G0}.)
15732
15733 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
15734 @option{-mno-extern-sdata}.
15735
15736 @item -membedded-data
15737 @itemx -mno-embedded-data
15738 @opindex membedded-data
15739 @opindex mno-embedded-data
15740 Allocate variables to the read-only data section first if possible, then
15741 next in the small data section if possible, otherwise in data.  This gives
15742 slightly slower code than the default, but reduces the amount of RAM required
15743 when executing, and thus may be preferred for some embedded systems.
15744
15745 @item -muninit-const-in-rodata
15746 @itemx -mno-uninit-const-in-rodata
15747 @opindex muninit-const-in-rodata
15748 @opindex mno-uninit-const-in-rodata
15749 Put uninitialized @code{const} variables in the read-only data section.
15750 This option is only meaningful in conjunction with @option{-membedded-data}.
15751
15752 @item -mcode-readable=@var{setting}
15753 @opindex mcode-readable
15754 Specify whether GCC may generate code that reads from executable sections.
15755 There are three possible settings:
15756
15757 @table @gcctabopt
15758 @item -mcode-readable=yes
15759 Instructions may freely access executable sections.  This is the
15760 default setting.
15761
15762 @item -mcode-readable=pcrel
15763 MIPS16 PC-relative load instructions can access executable sections,
15764 but other instructions must not do so.  This option is useful on 4KSc
15765 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
15766 It is also useful on processors that can be configured to have a dual
15767 instruction/data SRAM interface and that, like the M4K, automatically
15768 redirect PC-relative loads to the instruction RAM.
15769
15770 @item -mcode-readable=no
15771 Instructions must not access executable sections.  This option can be
15772 useful on targets that are configured to have a dual instruction/data
15773 SRAM interface but that (unlike the M4K) do not automatically redirect
15774 PC-relative loads to the instruction RAM.
15775 @end table
15776
15777 @item -msplit-addresses
15778 @itemx -mno-split-addresses
15779 @opindex msplit-addresses
15780 @opindex mno-split-addresses
15781 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
15782 relocation operators.  This option has been superseded by
15783 @option{-mexplicit-relocs} but is retained for backwards compatibility.
15784
15785 @item -mexplicit-relocs
15786 @itemx -mno-explicit-relocs
15787 @opindex mexplicit-relocs
15788 @opindex mno-explicit-relocs
15789 Use (do not use) assembler relocation operators when dealing with symbolic
15790 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
15791 is to use assembler macros instead.
15792
15793 @option{-mexplicit-relocs} is the default if GCC was configured
15794 to use an assembler that supports relocation operators.
15795
15796 @item -mcheck-zero-division
15797 @itemx -mno-check-zero-division
15798 @opindex mcheck-zero-division
15799 @opindex mno-check-zero-division
15800 Trap (do not trap) on integer division by zero.
15801
15802 The default is @option{-mcheck-zero-division}.
15803
15804 @item -mdivide-traps
15805 @itemx -mdivide-breaks
15806 @opindex mdivide-traps
15807 @opindex mdivide-breaks
15808 MIPS systems check for division by zero by generating either a
15809 conditional trap or a break instruction.  Using traps results in
15810 smaller code, but is only supported on MIPS II and later.  Also, some
15811 versions of the Linux kernel have a bug that prevents trap from
15812 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
15813 allow conditional traps on architectures that support them and
15814 @option{-mdivide-breaks} to force the use of breaks.
15815
15816 The default is usually @option{-mdivide-traps}, but this can be
15817 overridden at configure time using @option{--with-divide=breaks}.
15818 Divide-by-zero checks can be completely disabled using
15819 @option{-mno-check-zero-division}.
15820
15821 @item -mmemcpy
15822 @itemx -mno-memcpy
15823 @opindex mmemcpy
15824 @opindex mno-memcpy
15825 Force (do not force) the use of @code{memcpy()} for non-trivial block
15826 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
15827 most constant-sized copies.
15828
15829 @item -mlong-calls
15830 @itemx -mno-long-calls
15831 @opindex mlong-calls
15832 @opindex mno-long-calls
15833 Disable (do not disable) use of the @code{jal} instruction.  Calling
15834 functions using @code{jal} is more efficient but requires the caller
15835 and callee to be in the same 256 megabyte segment.
15836
15837 This option has no effect on abicalls code.  The default is
15838 @option{-mno-long-calls}.
15839
15840 @item -mmad
15841 @itemx -mno-mad
15842 @opindex mmad
15843 @opindex mno-mad
15844 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
15845 instructions, as provided by the R4650 ISA@.
15846
15847 @item -mfused-madd
15848 @itemx -mno-fused-madd
15849 @opindex mfused-madd
15850 @opindex mno-fused-madd
15851 Enable (disable) use of the floating-point multiply-accumulate
15852 instructions, when they are available.  The default is
15853 @option{-mfused-madd}.
15854
15855 When multiply-accumulate instructions are used, the intermediate
15856 product is calculated to infinite precision and is not subject to
15857 the FCSR Flush to Zero bit.  This may be undesirable in some
15858 circumstances.
15859
15860 @item -nocpp
15861 @opindex nocpp
15862 Tell the MIPS assembler to not run its preprocessor over user
15863 assembler files (with a @samp{.s} suffix) when assembling them.
15864
15865 @item -mfix-24k
15866 @item -mno-fix-24k
15867 @opindex mfix-24k
15868 @opindex mno-fix-24k
15869 Work around the 24K E48 (lost data on stores during refill) errata.
15870 The workarounds are implemented by the assembler rather than by GCC@.
15871
15872 @item -mfix-r4000
15873 @itemx -mno-fix-r4000
15874 @opindex mfix-r4000
15875 @opindex mno-fix-r4000
15876 Work around certain R4000 CPU errata:
15877 @itemize @minus
15878 @item
15879 A double-word or a variable shift may give an incorrect result if executed
15880 immediately after starting an integer division.
15881 @item
15882 A double-word or a variable shift may give an incorrect result if executed
15883 while an integer multiplication is in progress.
15884 @item
15885 An integer division may give an incorrect result if started in a delay slot
15886 of a taken branch or a jump.
15887 @end itemize
15888
15889 @item -mfix-r4400
15890 @itemx -mno-fix-r4400
15891 @opindex mfix-r4400
15892 @opindex mno-fix-r4400
15893 Work around certain R4400 CPU errata:
15894 @itemize @minus
15895 @item
15896 A double-word or a variable shift may give an incorrect result if executed
15897 immediately after starting an integer division.
15898 @end itemize
15899
15900 @item -mfix-r10000
15901 @itemx -mno-fix-r10000
15902 @opindex mfix-r10000
15903 @opindex mno-fix-r10000
15904 Work around certain R10000 errata:
15905 @itemize @minus
15906 @item
15907 @code{ll}/@code{sc} sequences may not behave atomically on revisions
15908 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
15909 @end itemize
15910
15911 This option can only be used if the target architecture supports
15912 branch-likely instructions.  @option{-mfix-r10000} is the default when
15913 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
15914 otherwise.
15915
15916 @item -mfix-vr4120
15917 @itemx -mno-fix-vr4120
15918 @opindex mfix-vr4120
15919 Work around certain VR4120 errata:
15920 @itemize @minus
15921 @item
15922 @code{dmultu} does not always produce the correct result.
15923 @item
15924 @code{div} and @code{ddiv} do not always produce the correct result if one
15925 of the operands is negative.
15926 @end itemize
15927 The workarounds for the division errata rely on special functions in
15928 @file{libgcc.a}.  At present, these functions are only provided by
15929 the @code{mips64vr*-elf} configurations.
15930
15931 Other VR4120 errata require a nop to be inserted between certain pairs of
15932 instructions.  These errata are handled by the assembler, not by GCC itself.
15933
15934 @item -mfix-vr4130
15935 @opindex mfix-vr4130
15936 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
15937 workarounds are implemented by the assembler rather than by GCC,
15938 although GCC avoids using @code{mflo} and @code{mfhi} if the
15939 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
15940 instructions are available instead.
15941
15942 @item -mfix-sb1
15943 @itemx -mno-fix-sb1
15944 @opindex mfix-sb1
15945 Work around certain SB-1 CPU core errata.
15946 (This flag currently works around the SB-1 revision 2
15947 ``F1'' and ``F2'' floating-point errata.)
15948
15949 @item -mr10k-cache-barrier=@var{setting}
15950 @opindex mr10k-cache-barrier
15951 Specify whether GCC should insert cache barriers to avoid the
15952 side-effects of speculation on R10K processors.
15953
15954 In common with many processors, the R10K tries to predict the outcome
15955 of a conditional branch and speculatively executes instructions from
15956 the ``taken'' branch.  It later aborts these instructions if the
15957 predicted outcome is wrong.  However, on the R10K, even aborted
15958 instructions can have side effects.
15959
15960 This problem only affects kernel stores and, depending on the system,
15961 kernel loads.  As an example, a speculatively-executed store may load
15962 the target memory into cache and mark the cache line as dirty, even if
15963 the store itself is later aborted.  If a DMA operation writes to the
15964 same area of memory before the ``dirty'' line is flushed, the cached
15965 data overwrites the DMA-ed data.  See the R10K processor manual
15966 for a full description, including other potential problems.
15967
15968 One workaround is to insert cache barrier instructions before every memory
15969 access that might be speculatively executed and that might have side
15970 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
15971 controls GCC's implementation of this workaround.  It assumes that
15972 aborted accesses to any byte in the following regions does not have
15973 side effects:
15974
15975 @enumerate
15976 @item
15977 the memory occupied by the current function's stack frame;
15978
15979 @item
15980 the memory occupied by an incoming stack argument;
15981
15982 @item
15983 the memory occupied by an object with a link-time-constant address.
15984 @end enumerate
15985
15986 It is the kernel's responsibility to ensure that speculative
15987 accesses to these regions are indeed safe.
15988
15989 If the input program contains a function declaration such as:
15990
15991 @smallexample
15992 void foo (void);
15993 @end smallexample
15994
15995 then the implementation of @code{foo} must allow @code{j foo} and
15996 @code{jal foo} to be executed speculatively.  GCC honors this
15997 restriction for functions it compiles itself.  It expects non-GCC
15998 functions (such as hand-written assembly code) to do the same.
15999
16000 The option has three forms:
16001
16002 @table @gcctabopt
16003 @item -mr10k-cache-barrier=load-store
16004 Insert a cache barrier before a load or store that might be
16005 speculatively executed and that might have side effects even
16006 if aborted.
16007
16008 @item -mr10k-cache-barrier=store
16009 Insert a cache barrier before a store that might be speculatively
16010 executed and that might have side effects even if aborted.
16011
16012 @item -mr10k-cache-barrier=none
16013 Disable the insertion of cache barriers.  This is the default setting.
16014 @end table
16015
16016 @item -mflush-func=@var{func}
16017 @itemx -mno-flush-func
16018 @opindex mflush-func
16019 Specifies the function to call to flush the I and D caches, or to not
16020 call any such function.  If called, the function must take the same
16021 arguments as the common @code{_flush_func()}, that is, the address of the
16022 memory range for which the cache is being flushed, the size of the
16023 memory range, and the number 3 (to flush both caches).  The default
16024 depends on the target GCC was configured for, but commonly is either
16025 @samp{_flush_func} or @samp{__cpu_flush}.
16026
16027 @item mbranch-cost=@var{num}
16028 @opindex mbranch-cost
16029 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16030 This cost is only a heuristic and is not guaranteed to produce
16031 consistent results across releases.  A zero cost redundantly selects
16032 the default, which is based on the @option{-mtune} setting.
16033
16034 @item -mbranch-likely
16035 @itemx -mno-branch-likely
16036 @opindex mbranch-likely
16037 @opindex mno-branch-likely
16038 Enable or disable use of Branch Likely instructions, regardless of the
16039 default for the selected architecture.  By default, Branch Likely
16040 instructions may be generated if they are supported by the selected
16041 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16042 and processors that implement those architectures; for those, Branch
16043 Likely instructions are not be generated by default because the MIPS32
16044 and MIPS64 architectures specifically deprecate their use.
16045
16046 @item -mfp-exceptions
16047 @itemx -mno-fp-exceptions
16048 @opindex mfp-exceptions
16049 Specifies whether FP exceptions are enabled.  This affects how
16050 FP instructions are scheduled for some processors.
16051 The default is that FP exceptions are
16052 enabled.
16053
16054 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16055 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16056 FP pipe.
16057
16058 @item -mvr4130-align
16059 @itemx -mno-vr4130-align
16060 @opindex mvr4130-align
16061 The VR4130 pipeline is two-way superscalar, but can only issue two
16062 instructions together if the first one is 8-byte aligned.  When this
16063 option is enabled, GCC aligns pairs of instructions that it
16064 thinks should execute in parallel.
16065
16066 This option only has an effect when optimizing for the VR4130.
16067 It normally makes code faster, but at the expense of making it bigger.
16068 It is enabled by default at optimization level @option{-O3}.
16069
16070 @item -msynci
16071 @itemx -mno-synci
16072 @opindex msynci
16073 Enable (disable) generation of @code{synci} instructions on
16074 architectures that support it.  The @code{synci} instructions (if
16075 enabled) are generated when @code{__builtin___clear_cache()} is
16076 compiled.
16077
16078 This option defaults to @code{-mno-synci}, but the default can be
16079 overridden by configuring with @code{--with-synci}.
16080
16081 When compiling code for single processor systems, it is generally safe
16082 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16083 does not invalidate the instruction caches on all cores and may lead
16084 to undefined behavior.
16085
16086 @item -mrelax-pic-calls
16087 @itemx -mno-relax-pic-calls
16088 @opindex mrelax-pic-calls
16089 Try to turn PIC calls that are normally dispatched via register
16090 @code{$25} into direct calls.  This is only possible if the linker can
16091 resolve the destination at link-time and if the destination is within
16092 range for a direct call.
16093
16094 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16095 an assembler and a linker that supports the @code{.reloc} assembly
16096 directive and @code{-mexplicit-relocs} is in effect.  With
16097 @code{-mno-explicit-relocs}, this optimization can be performed by the
16098 assembler and the linker alone without help from the compiler.
16099
16100 @item -mmcount-ra-address
16101 @itemx -mno-mcount-ra-address
16102 @opindex mmcount-ra-address
16103 @opindex mno-mcount-ra-address
16104 Emit (do not emit) code that allows @code{_mcount} to modify the
16105 calling function's return address.  When enabled, this option extends
16106 the usual @code{_mcount} interface with a new @var{ra-address}
16107 parameter, which has type @code{intptr_t *} and is passed in register
16108 @code{$12}.  @code{_mcount} can then modify the return address by
16109 doing both of the following:
16110 @itemize
16111 @item
16112 Returning the new address in register @code{$31}.
16113 @item
16114 Storing the new address in @code{*@var{ra-address}},
16115 if @var{ra-address} is nonnull.
16116 @end itemize
16117
16118 The default is @option{-mno-mcount-ra-address}.
16119
16120 @end table
16121
16122 @node MMIX Options
16123 @subsection MMIX Options
16124 @cindex MMIX Options
16125
16126 These options are defined for the MMIX:
16127
16128 @table @gcctabopt
16129 @item -mlibfuncs
16130 @itemx -mno-libfuncs
16131 @opindex mlibfuncs
16132 @opindex mno-libfuncs
16133 Specify that intrinsic library functions are being compiled, passing all
16134 values in registers, no matter the size.
16135
16136 @item -mepsilon
16137 @itemx -mno-epsilon
16138 @opindex mepsilon
16139 @opindex mno-epsilon
16140 Generate floating-point comparison instructions that compare with respect
16141 to the @code{rE} epsilon register.
16142
16143 @item -mabi=mmixware
16144 @itemx -mabi=gnu
16145 @opindex mabi=mmixware
16146 @opindex mabi=gnu
16147 Generate code that passes function parameters and return values that (in
16148 the called function) are seen as registers @code{$0} and up, as opposed to
16149 the GNU ABI which uses global registers @code{$231} and up.
16150
16151 @item -mzero-extend
16152 @itemx -mno-zero-extend
16153 @opindex mzero-extend
16154 @opindex mno-zero-extend
16155 When reading data from memory in sizes shorter than 64 bits, use (do not
16156 use) zero-extending load instructions by default, rather than
16157 sign-extending ones.
16158
16159 @item -mknuthdiv
16160 @itemx -mno-knuthdiv
16161 @opindex mknuthdiv
16162 @opindex mno-knuthdiv
16163 Make the result of a division yielding a remainder have the same sign as
16164 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
16165 remainder follows the sign of the dividend.  Both methods are
16166 arithmetically valid, the latter being almost exclusively used.
16167
16168 @item -mtoplevel-symbols
16169 @itemx -mno-toplevel-symbols
16170 @opindex mtoplevel-symbols
16171 @opindex mno-toplevel-symbols
16172 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
16173 code can be used with the @code{PREFIX} assembly directive.
16174
16175 @item -melf
16176 @opindex melf
16177 Generate an executable in the ELF format, rather than the default
16178 @samp{mmo} format used by the @command{mmix} simulator.
16179
16180 @item -mbranch-predict
16181 @itemx -mno-branch-predict
16182 @opindex mbranch-predict
16183 @opindex mno-branch-predict
16184 Use (do not use) the probable-branch instructions, when static branch
16185 prediction indicates a probable branch.
16186
16187 @item -mbase-addresses
16188 @itemx -mno-base-addresses
16189 @opindex mbase-addresses
16190 @opindex mno-base-addresses
16191 Generate (do not generate) code that uses @emph{base addresses}.  Using a
16192 base address automatically generates a request (handled by the assembler
16193 and the linker) for a constant to be set up in a global register.  The
16194 register is used for one or more base address requests within the range 0
16195 to 255 from the value held in the register.  The generally leads to short
16196 and fast code, but the number of different data items that can be
16197 addressed is limited.  This means that a program that uses lots of static
16198 data may require @option{-mno-base-addresses}.
16199
16200 @item -msingle-exit
16201 @itemx -mno-single-exit
16202 @opindex msingle-exit
16203 @opindex mno-single-exit
16204 Force (do not force) generated code to have a single exit point in each
16205 function.
16206 @end table
16207
16208 @node MN10300 Options
16209 @subsection MN10300 Options
16210 @cindex MN10300 options
16211
16212 These @option{-m} options are defined for Matsushita MN10300 architectures:
16213
16214 @table @gcctabopt
16215 @item -mmult-bug
16216 @opindex mmult-bug
16217 Generate code to avoid bugs in the multiply instructions for the MN10300
16218 processors.  This is the default.
16219
16220 @item -mno-mult-bug
16221 @opindex mno-mult-bug
16222 Do not generate code to avoid bugs in the multiply instructions for the
16223 MN10300 processors.
16224
16225 @item -mam33
16226 @opindex mam33
16227 Generate code using features specific to the AM33 processor.
16228
16229 @item -mno-am33
16230 @opindex mno-am33
16231 Do not generate code using features specific to the AM33 processor.  This
16232 is the default.
16233
16234 @item -mam33-2
16235 @opindex mam33-2
16236 Generate code using features specific to the AM33/2.0 processor.
16237
16238 @item -mam34
16239 @opindex mam34
16240 Generate code using features specific to the AM34 processor.
16241
16242 @item -mtune=@var{cpu-type}
16243 @opindex mtune
16244 Use the timing characteristics of the indicated CPU type when
16245 scheduling instructions.  This does not change the targeted processor
16246 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
16247 @samp{am33-2} or @samp{am34}.
16248
16249 @item -mreturn-pointer-on-d0
16250 @opindex mreturn-pointer-on-d0
16251 When generating a function that returns a pointer, return the pointer
16252 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
16253 only in @code{a0}, and attempts to call such functions without a prototype
16254 result in errors.  Note that this option is on by default; use
16255 @option{-mno-return-pointer-on-d0} to disable it.
16256
16257 @item -mno-crt0
16258 @opindex mno-crt0
16259 Do not link in the C run-time initialization object file.
16260
16261 @item -mrelax
16262 @opindex mrelax
16263 Indicate to the linker that it should perform a relaxation optimization pass
16264 to shorten branches, calls and absolute memory addresses.  This option only
16265 has an effect when used on the command line for the final link step.
16266
16267 This option makes symbolic debugging impossible.
16268
16269 @item -mliw
16270 @opindex mliw
16271 Allow the compiler to generate @emph{Long Instruction Word}
16272 instructions if the target is the @samp{AM33} or later.  This is the
16273 default.  This option defines the preprocessor macro @samp{__LIW__}.
16274
16275 @item -mnoliw
16276 @opindex mnoliw
16277 Do not allow the compiler to generate @emph{Long Instruction Word}
16278 instructions.  This option defines the preprocessor macro
16279 @samp{__NO_LIW__}.
16280
16281 @item -msetlb
16282 @opindex msetlb
16283 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
16284 instructions if the target is the @samp{AM33} or later.  This is the
16285 default.  This option defines the preprocessor macro @samp{__SETLB__}.
16286
16287 @item -mnosetlb
16288 @opindex mnosetlb
16289 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
16290 instructions.  This option defines the preprocessor macro
16291 @samp{__NO_SETLB__}.
16292
16293 @end table
16294
16295 @node PDP-11 Options
16296 @subsection PDP-11 Options
16297 @cindex PDP-11 Options
16298
16299 These options are defined for the PDP-11:
16300
16301 @table @gcctabopt
16302 @item -mfpu
16303 @opindex mfpu
16304 Use hardware FPP floating point.  This is the default.  (FIS floating
16305 point on the PDP-11/40 is not supported.)
16306
16307 @item -msoft-float
16308 @opindex msoft-float
16309 Do not use hardware floating point.
16310
16311 @item -mac0
16312 @opindex mac0
16313 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
16314
16315 @item -mno-ac0
16316 @opindex mno-ac0
16317 Return floating-point results in memory.  This is the default.
16318
16319 @item -m40
16320 @opindex m40
16321 Generate code for a PDP-11/40.
16322
16323 @item -m45
16324 @opindex m45
16325 Generate code for a PDP-11/45.  This is the default.
16326
16327 @item -m10
16328 @opindex m10
16329 Generate code for a PDP-11/10.
16330
16331 @item -mbcopy-builtin
16332 @opindex mbcopy-builtin
16333 Use inline @code{movmemhi} patterns for copying memory.  This is the
16334 default.
16335
16336 @item -mbcopy
16337 @opindex mbcopy
16338 Do not use inline @code{movmemhi} patterns for copying memory.
16339
16340 @item -mint16
16341 @itemx -mno-int32
16342 @opindex mint16
16343 @opindex mno-int32
16344 Use 16-bit @code{int}.  This is the default.
16345
16346 @item -mint32
16347 @itemx -mno-int16
16348 @opindex mint32
16349 @opindex mno-int16
16350 Use 32-bit @code{int}.
16351
16352 @item -mfloat64
16353 @itemx -mno-float32
16354 @opindex mfloat64
16355 @opindex mno-float32
16356 Use 64-bit @code{float}.  This is the default.
16357
16358 @item -mfloat32
16359 @itemx -mno-float64
16360 @opindex mfloat32
16361 @opindex mno-float64
16362 Use 32-bit @code{float}.
16363
16364 @item -mabshi
16365 @opindex mabshi
16366 Use @code{abshi2} pattern.  This is the default.
16367
16368 @item -mno-abshi
16369 @opindex mno-abshi
16370 Do not use @code{abshi2} pattern.
16371
16372 @item -mbranch-expensive
16373 @opindex mbranch-expensive
16374 Pretend that branches are expensive.  This is for experimenting with
16375 code generation only.
16376
16377 @item -mbranch-cheap
16378 @opindex mbranch-cheap
16379 Do not pretend that branches are expensive.  This is the default.
16380
16381 @item -munix-asm
16382 @opindex munix-asm
16383 Use Unix assembler syntax.  This is the default when configured for
16384 @samp{pdp11-*-bsd}.
16385
16386 @item -mdec-asm
16387 @opindex mdec-asm
16388 Use DEC assembler syntax.  This is the default when configured for any
16389 PDP-11 target other than @samp{pdp11-*-bsd}.
16390 @end table
16391
16392 @node picoChip Options
16393 @subsection picoChip Options
16394 @cindex picoChip options
16395
16396 These @samp{-m} options are defined for picoChip implementations:
16397
16398 @table @gcctabopt
16399
16400 @item -mae=@var{ae_type}
16401 @opindex mcpu
16402 Set the instruction set, register set, and instruction scheduling
16403 parameters for array element type @var{ae_type}.  Supported values
16404 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
16405
16406 @option{-mae=ANY} selects a completely generic AE type.  Code
16407 generated with this option runs on any of the other AE types.  The
16408 code is not as efficient as it would be if compiled for a specific
16409 AE type, and some types of operation (e.g., multiplication) do not
16410 work properly on all types of AE.
16411
16412 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
16413 for compiled code, and is the default.
16414
16415 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
16416 option may suffer from poor performance of byte (char) manipulation,
16417 since the DSP AE does not provide hardware support for byte load/stores.
16418
16419 @item -msymbol-as-address
16420 Enable the compiler to directly use a symbol name as an address in a
16421 load/store instruction, without first loading it into a
16422 register.  Typically, the use of this option generates larger
16423 programs, which run faster than when the option isn't used.  However, the
16424 results vary from program to program, so it is left as a user option,
16425 rather than being permanently enabled.
16426
16427 @item -mno-inefficient-warnings
16428 Disables warnings about the generation of inefficient code.  These
16429 warnings can be generated, for example, when compiling code that
16430 performs byte-level memory operations on the MAC AE type.  The MAC AE has
16431 no hardware support for byte-level memory operations, so all byte
16432 load/stores must be synthesized from word load/store operations.  This is
16433 inefficient and a warning is generated to indicate
16434 that you should rewrite the code to avoid byte operations, or to target
16435 an AE type that has the necessary hardware support.  This option disables
16436 these warnings.
16437
16438 @end table
16439
16440 @node PowerPC Options
16441 @subsection PowerPC Options
16442 @cindex PowerPC options
16443
16444 These are listed under @xref{RS/6000 and PowerPC Options}.
16445
16446 @node RL78 Options
16447 @subsection RL78 Options
16448 @cindex RL78 Options
16449
16450 @table @gcctabopt
16451
16452 @item -msim
16453 @opindex msim
16454 Links in additional target libraries to support operation within a
16455 simulator.
16456
16457 @item -mmul=none
16458 @itemx -mmul=g13
16459 @itemx -mmul=rl78
16460 @opindex mmul
16461 Specifies the type of hardware multiplication support to be used.  The
16462 default is @code{none}, which uses software multiplication functions.
16463 The @code{g13} option is for the hardware multiply/divide peripheral
16464 only on the RL78/G13 targets.  The @code{rl78} option is for the
16465 standard hardware multiplication defined in the RL78 software manual.
16466
16467 @end table
16468
16469 @node RS/6000 and PowerPC Options
16470 @subsection IBM RS/6000 and PowerPC Options
16471 @cindex RS/6000 and PowerPC Options
16472 @cindex IBM RS/6000 and PowerPC Options
16473
16474 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
16475 @table @gcctabopt
16476 @item -mpower
16477 @itemx -mno-power
16478 @itemx -mpower2
16479 @itemx -mno-power2
16480 @itemx -mpowerpc
16481 @itemx -mno-powerpc
16482 @itemx -mpowerpc-gpopt
16483 @itemx -mno-powerpc-gpopt
16484 @itemx -mpowerpc-gfxopt
16485 @itemx -mno-powerpc-gfxopt
16486 @need 800
16487 @itemx -mpowerpc64
16488 @itemx -mno-powerpc64
16489 @itemx -mmfcrf
16490 @itemx -mno-mfcrf
16491 @itemx -mpopcntb
16492 @itemx -mno-popcntb
16493 @itemx -mpopcntd
16494 @itemx -mno-popcntd
16495 @itemx -mfprnd
16496 @itemx -mno-fprnd
16497 @need 800
16498 @itemx -mcmpb
16499 @itemx -mno-cmpb
16500 @itemx -mmfpgpr
16501 @itemx -mno-mfpgpr
16502 @itemx -mhard-dfp
16503 @itemx -mno-hard-dfp
16504 @opindex mpower
16505 @opindex mno-power
16506 @opindex mpower2
16507 @opindex mno-power2
16508 @opindex mpowerpc
16509 @opindex mno-powerpc
16510 @opindex mpowerpc-gpopt
16511 @opindex mno-powerpc-gpopt
16512 @opindex mpowerpc-gfxopt
16513 @opindex mno-powerpc-gfxopt
16514 @opindex mpowerpc64
16515 @opindex mno-powerpc64
16516 @opindex mmfcrf
16517 @opindex mno-mfcrf
16518 @opindex mpopcntb
16519 @opindex mno-popcntb
16520 @opindex mpopcntd
16521 @opindex mno-popcntd
16522 @opindex mfprnd
16523 @opindex mno-fprnd
16524 @opindex mcmpb
16525 @opindex mno-cmpb
16526 @opindex mmfpgpr
16527 @opindex mno-mfpgpr
16528 @opindex mhard-dfp
16529 @opindex mno-hard-dfp
16530 GCC supports two related instruction set architectures for the
16531 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
16532 instructions supported by the @samp{rios} chip set used in the original
16533 RS/6000 systems and the @dfn{PowerPC} instruction set is the
16534 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
16535 the IBM 4xx, 6xx, and follow-on microprocessors.
16536
16537 Neither architecture is a subset of the other.  However there is a
16538 large common subset of instructions supported by both.  An MQ
16539 register is included in processors supporting the POWER architecture.
16540
16541 You use these options to specify which instructions are available on the
16542 processor you are using.  The default value of these options is
16543 determined when configuring GCC@.  Specifying the
16544 @option{-mcpu=@var{cpu_type}} overrides the specification of these
16545 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
16546 rather than the options listed above.
16547
16548 The @option{-mpower} option allows GCC to generate instructions that
16549 are found only in the POWER architecture and to use the MQ register.
16550 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
16551 to generate instructions that are present in the POWER2 architecture but
16552 not the original POWER architecture.
16553
16554 The @option{-mpowerpc} option allows GCC to generate instructions that
16555 are found only in the 32-bit subset of the PowerPC architecture.
16556 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
16557 GCC to use the optional PowerPC architecture instructions in the
16558 General Purpose group, including floating-point square root.  Specifying
16559 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
16560 use the optional PowerPC architecture instructions in the Graphics
16561 group, including floating-point select.
16562
16563 The @option{-mmfcrf} option allows GCC to generate the move from
16564 condition register field instruction implemented on the POWER4
16565 processor and other processors that support the PowerPC V2.01
16566 architecture.
16567 The @option{-mpopcntb} option allows GCC to generate the popcount and
16568 double-precision FP reciprocal estimate instruction implemented on the
16569 POWER5 processor and other processors that support the PowerPC V2.02
16570 architecture.
16571 The @option{-mpopcntd} option allows GCC to generate the popcount
16572 instruction implemented on the POWER7 processor and other processors
16573 that support the PowerPC V2.06 architecture.
16574 The @option{-mfprnd} option allows GCC to generate the FP round to
16575 integer instructions implemented on the POWER5+ processor and other
16576 processors that support the PowerPC V2.03 architecture.
16577 The @option{-mcmpb} option allows GCC to generate the compare bytes
16578 instruction implemented on the POWER6 processor and other processors
16579 that support the PowerPC V2.05 architecture.
16580 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
16581 general-purpose register instructions implemented on the POWER6X
16582 processor and other processors that support the extended PowerPC V2.05
16583 architecture.
16584 The @option{-mhard-dfp} option allows GCC to generate the decimal
16585 floating-point instructions implemented on some POWER processors.
16586
16587 The @option{-mpowerpc64} option allows GCC to generate the additional
16588 64-bit instructions that are found in the full PowerPC64 architecture
16589 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
16590 @option{-mno-powerpc64}.
16591
16592 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
16593 uses only the instructions in the common subset of both
16594 architectures plus some special AIX common-mode calls, and does not use
16595 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
16596 permits GCC to use any instruction from either architecture and to
16597 allow use of the MQ register; specify this for the Motorola MPC601.
16598
16599 @item -mnew-mnemonics
16600 @itemx -mold-mnemonics
16601 @opindex mnew-mnemonics
16602 @opindex mold-mnemonics
16603 Select which mnemonics to use in the generated assembler code.  With
16604 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
16605 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
16606 assembler mnemonics defined for the POWER architecture.  Instructions
16607 defined in only one architecture have only one mnemonic; GCC uses that
16608 mnemonic irrespective of which of these options is specified.
16609
16610 GCC defaults to the mnemonics appropriate for the architecture in
16611 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
16612 value of these option.  Unless you are building a cross-compiler, you
16613 should normally not specify either @option{-mnew-mnemonics} or
16614 @option{-mold-mnemonics}, but should instead accept the default.
16615
16616 @item -mcpu=@var{cpu_type}
16617 @opindex mcpu
16618 Set architecture type, register usage, choice of mnemonics, and
16619 instruction scheduling parameters for machine type @var{cpu_type}.
16620 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
16621 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
16622 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
16623 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
16624 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
16625 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
16626 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
16627 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
16628 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
16629 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
16630 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
16631
16632 @option{-mcpu=common} selects a completely generic processor.  Code
16633 generated under this option runs on any POWER or PowerPC processor.
16634 GCC uses only the instructions in the common subset of both
16635 architectures, and does not use the MQ register.  GCC assumes a generic
16636 processor model for scheduling purposes.
16637
16638 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
16639 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
16640 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
16641 types, with an appropriate, generic processor model assumed for
16642 scheduling purposes.
16643
16644 The other options specify a specific processor.  Code generated under
16645 those options runs best on that processor, and may not run at all on
16646 others.
16647
16648 The @option{-mcpu} options automatically enable or disable the
16649 following options:
16650
16651 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
16652 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
16653 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
16654 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
16655
16656 The particular options set for any particular CPU varies between
16657 compiler versions, depending on what setting seems to produce optimal
16658 code for that CPU; it doesn't necessarily reflect the actual hardware's
16659 capabilities.  If you wish to set an individual option to a particular
16660 value, you may specify it after the @option{-mcpu} option, like
16661 @option{-mcpu=970 -mno-altivec}.
16662
16663 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
16664 not enabled or disabled by the @option{-mcpu} option at present because
16665 AIX does not have full support for these options.  You may still
16666 enable or disable them individually if you're sure it'll work in your
16667 environment.
16668
16669 @item -mtune=@var{cpu_type}
16670 @opindex mtune
16671 Set the instruction scheduling parameters for machine type
16672 @var{cpu_type}, but do not set the architecture type, register usage, or
16673 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} does.  The same
16674 values for @var{cpu_type} are used for @option{-mtune} as for
16675 @option{-mcpu}.  If both are specified, the code generated uses the
16676 architecture, registers, and mnemonics set by @option{-mcpu}, but the
16677 scheduling parameters set by @option{-mtune}.
16678
16679 @item -mcmodel=small
16680 @opindex mcmodel=small
16681 Generate PowerPC64 code for the small model: The TOC is limited to
16682 64k.
16683
16684 @item -mcmodel=medium
16685 @opindex mcmodel=medium
16686 Generate PowerPC64 code for the medium model: The TOC and other static
16687 data may be up to a total of 4G in size.
16688
16689 @item -mcmodel=large
16690 @opindex mcmodel=large
16691 Generate PowerPC64 code for the large model: The TOC may be up to 4G
16692 in size.  Other data and code is only limited by the 64-bit address
16693 space.
16694
16695 @item -maltivec
16696 @itemx -mno-altivec
16697 @opindex maltivec
16698 @opindex mno-altivec
16699 Generate code that uses (does not use) AltiVec instructions, and also
16700 enable the use of built-in functions that allow more direct access to
16701 the AltiVec instruction set.  You may also need to set
16702 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
16703 enhancements.
16704
16705 @item -mvrsave
16706 @itemx -mno-vrsave
16707 @opindex mvrsave
16708 @opindex mno-vrsave
16709 Generate VRSAVE instructions when generating AltiVec code.
16710
16711 @item -mgen-cell-microcode
16712 @opindex mgen-cell-microcode
16713 Generate Cell microcode instructions
16714
16715 @item -mwarn-cell-microcode
16716 @opindex mwarn-cell-microcode
16717 Warning when a Cell microcode instruction is going to emitted.  An example
16718 of a Cell microcode instruction is a variable shift.
16719
16720 @item -msecure-plt
16721 @opindex msecure-plt
16722 Generate code that allows @command{ld} and @command{ld.so}
16723 to build executables and shared
16724 libraries with non-executable @code{.plt} and @code{.got} sections.
16725 This is a PowerPC
16726 32-bit SYSV ABI option.
16727
16728 @item -mbss-plt
16729 @opindex mbss-plt
16730 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
16731 fills in, and
16732 requires @code{.plt} and @code{.got}
16733 sections that are both writable and executable.
16734 This is a PowerPC 32-bit SYSV ABI option.
16735
16736 @item -misel
16737 @itemx -mno-isel
16738 @opindex misel
16739 @opindex mno-isel
16740 This switch enables or disables the generation of ISEL instructions.
16741
16742 @item -misel=@var{yes/no}
16743 This switch has been deprecated.  Use @option{-misel} and
16744 @option{-mno-isel} instead.
16745
16746 @item -mspe
16747 @itemx -mno-spe
16748 @opindex mspe
16749 @opindex mno-spe
16750 This switch enables or disables the generation of SPE simd
16751 instructions.
16752
16753 @item -mpaired
16754 @itemx -mno-paired
16755 @opindex mpaired
16756 @opindex mno-paired
16757 This switch enables or disables the generation of PAIRED simd
16758 instructions.
16759
16760 @item -mspe=@var{yes/no}
16761 This option has been deprecated.  Use @option{-mspe} and
16762 @option{-mno-spe} instead.
16763
16764 @item -mvsx
16765 @itemx -mno-vsx
16766 @opindex mvsx
16767 @opindex mno-vsx
16768 Generate code that uses (does not use) vector/scalar (VSX)
16769 instructions, and also enable the use of built-in functions that allow
16770 more direct access to the VSX instruction set.
16771
16772 @item -mfloat-gprs=@var{yes/single/double/no}
16773 @itemx -mfloat-gprs
16774 @opindex mfloat-gprs
16775 This switch enables or disables the generation of floating-point
16776 operations on the general-purpose registers for architectures that
16777 support it.
16778
16779 The argument @var{yes} or @var{single} enables the use of
16780 single-precision floating-point operations.
16781
16782 The argument @var{double} enables the use of single and
16783 double-precision floating-point operations.
16784
16785 The argument @var{no} disables floating-point operations on the
16786 general-purpose registers.
16787
16788 This option is currently only available on the MPC854x.
16789
16790 @item -m32
16791 @itemx -m64
16792 @opindex m32
16793 @opindex m64
16794 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
16795 targets (including GNU/Linux).  The 32-bit environment sets int, long
16796 and pointer to 32 bits and generates code that runs on any PowerPC
16797 variant.  The 64-bit environment sets int to 32 bits and long and
16798 pointer to 64 bits, and generates code for PowerPC64, as for
16799 @option{-mpowerpc64}.
16800
16801 @item -mfull-toc
16802 @itemx -mno-fp-in-toc
16803 @itemx -mno-sum-in-toc
16804 @itemx -mminimal-toc
16805 @opindex mfull-toc
16806 @opindex mno-fp-in-toc
16807 @opindex mno-sum-in-toc
16808 @opindex mminimal-toc
16809 Modify generation of the TOC (Table Of Contents), which is created for
16810 every executable file.  The @option{-mfull-toc} option is selected by
16811 default.  In that case, GCC allocates at least one TOC entry for
16812 each unique non-automatic variable reference in your program.  GCC
16813 also places floating-point constants in the TOC@.  However, only
16814 16,384 entries are available in the TOC@.
16815
16816 If you receive a linker error message that saying you have overflowed
16817 the available TOC space, you can reduce the amount of TOC space used
16818 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
16819 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
16820 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
16821 generate code to calculate the sum of an address and a constant at
16822 run time instead of putting that sum into the TOC@.  You may specify one
16823 or both of these options.  Each causes GCC to produce very slightly
16824 slower and larger code at the expense of conserving TOC space.
16825
16826 If you still run out of space in the TOC even when you specify both of
16827 these options, specify @option{-mminimal-toc} instead.  This option causes
16828 GCC to make only one TOC entry for every file.  When you specify this
16829 option, GCC produces code that is slower and larger but which
16830 uses extremely little TOC space.  You may wish to use this option
16831 only on files that contain less frequently-executed code.
16832
16833 @item -maix64
16834 @itemx -maix32
16835 @opindex maix64
16836 @opindex maix32
16837 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
16838 @code{long} type, and the infrastructure needed to support them.
16839 Specifying @option{-maix64} implies @option{-mpowerpc64} and
16840 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
16841 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
16842
16843 @item -mxl-compat
16844 @itemx -mno-xl-compat
16845 @opindex mxl-compat
16846 @opindex mno-xl-compat
16847 Produce code that conforms more closely to IBM XL compiler semantics
16848 when using AIX-compatible ABI@.  Pass floating-point arguments to
16849 prototyped functions beyond the register save area (RSA) on the stack
16850 in addition to argument FPRs.  Do not assume that most significant
16851 double in 128-bit long double value is properly rounded when comparing
16852 values and converting to double.  Use XL symbol names for long double
16853 support routines.
16854
16855 The AIX calling convention was extended but not initially documented to
16856 handle an obscure K&R C case of calling a function that takes the
16857 address of its arguments with fewer arguments than declared.  IBM XL
16858 compilers access floating-point arguments that do not fit in the
16859 RSA from the stack when a subroutine is compiled without
16860 optimization.  Because always storing floating-point arguments on the
16861 stack is inefficient and rarely needed, this option is not enabled by
16862 default and only is necessary when calling subroutines compiled by IBM
16863 XL compilers without optimization.
16864
16865 @item -mpe
16866 @opindex mpe
16867 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
16868 application written to use message passing with special startup code to
16869 enable the application to run.  The system must have PE installed in the
16870 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
16871 must be overridden with the @option{-specs=} option to specify the
16872 appropriate directory location.  The Parallel Environment does not
16873 support threads, so the @option{-mpe} option and the @option{-pthread}
16874 option are incompatible.
16875
16876 @item -malign-natural
16877 @itemx -malign-power
16878 @opindex malign-natural
16879 @opindex malign-power
16880 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
16881 @option{-malign-natural} overrides the ABI-defined alignment of larger
16882 types, such as floating-point doubles, on their natural size-based boundary.
16883 The option @option{-malign-power} instructs GCC to follow the ABI-specified
16884 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
16885
16886 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
16887 is not supported.
16888
16889 @item -msoft-float
16890 @itemx -mhard-float
16891 @opindex msoft-float
16892 @opindex mhard-float
16893 Generate code that does not use (uses) the floating-point register set.
16894 Software floating-point emulation is provided if you use the
16895 @option{-msoft-float} option, and pass the option to GCC when linking.
16896
16897 @item -msingle-float
16898 @itemx -mdouble-float
16899 @opindex msingle-float
16900 @opindex mdouble-float
16901 Generate code for single- or double-precision floating-point operations.
16902 @option{-mdouble-float} implies @option{-msingle-float}.
16903
16904 @item -msimple-fpu
16905 @opindex msimple-fpu
16906 Do not generate @code{sqrt} and @code{div} instructions for hardware
16907 floating-point unit.
16908
16909 @item -mfpu=@var{name}
16910 @opindex mfpu
16911 Specify type of floating-point unit.  Valid values for @var{name} are
16912 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
16913 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
16914 @samp{sp_full} (equivalent to @option{-msingle-float}),
16915 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
16916
16917 @item -mxilinx-fpu
16918 @opindex mxilinx-fpu
16919 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
16920
16921 @item -mmultiple
16922 @itemx -mno-multiple
16923 @opindex mmultiple
16924 @opindex mno-multiple
16925 Generate code that uses (does not use) the load multiple word
16926 instructions and the store multiple word instructions.  These
16927 instructions are generated by default on POWER systems, and not
16928 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
16929 PowerPC systems, since those instructions do not work when the
16930 processor is in little-endian mode.  The exceptions are PPC740 and
16931 PPC750 which permit these instructions in little-endian mode.
16932
16933 @item -mstring
16934 @itemx -mno-string
16935 @opindex mstring
16936 @opindex mno-string
16937 Generate code that uses (does not use) the load string instructions
16938 and the store string word instructions to save multiple registers and
16939 do small block moves.  These instructions are generated by default on
16940 POWER systems, and not generated on PowerPC systems.  Do not use
16941 @option{-mstring} on little-endian PowerPC systems, since those
16942 instructions do not work when the processor is in little-endian mode.
16943 The exceptions are PPC740 and PPC750 which permit these instructions
16944 in little-endian mode.
16945
16946 @item -mupdate
16947 @itemx -mno-update
16948 @opindex mupdate
16949 @opindex mno-update
16950 Generate code that uses (does not use) the load or store instructions
16951 that update the base register to the address of the calculated memory
16952 location.  These instructions are generated by default.  If you use
16953 @option{-mno-update}, there is a small window between the time that the
16954 stack pointer is updated and the address of the previous frame is
16955 stored, which means code that walks the stack frame across interrupts or
16956 signals may get corrupted data.
16957
16958 @item -mavoid-indexed-addresses
16959 @itemx -mno-avoid-indexed-addresses
16960 @opindex mavoid-indexed-addresses
16961 @opindex mno-avoid-indexed-addresses
16962 Generate code that tries to avoid (not avoid) the use of indexed load
16963 or store instructions. These instructions can incur a performance
16964 penalty on Power6 processors in certain situations, such as when
16965 stepping through large arrays that cross a 16M boundary.  This option
16966 is enabled by default when targetting Power6 and disabled otherwise.
16967
16968 @item -mfused-madd
16969 @itemx -mno-fused-madd
16970 @opindex mfused-madd
16971 @opindex mno-fused-madd
16972 Generate code that uses (does not use) the floating-point multiply and
16973 accumulate instructions.  These instructions are generated by default
16974 if hardware floating point is used.  The machine-dependent
16975 @option{-mfused-madd} option is now mapped to the machine-independent
16976 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
16977 mapped to @option{-ffp-contract=off}.
16978
16979 @item -mmulhw
16980 @itemx -mno-mulhw
16981 @opindex mmulhw
16982 @opindex mno-mulhw
16983 Generate code that uses (does not use) the half-word multiply and
16984 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
16985 These instructions are generated by default when targetting those
16986 processors.
16987
16988 @item -mdlmzb
16989 @itemx -mno-dlmzb
16990 @opindex mdlmzb
16991 @opindex mno-dlmzb
16992 Generate code that uses (does not use) the string-search @samp{dlmzb}
16993 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
16994 generated by default when targetting those processors.
16995
16996 @item -mno-bit-align
16997 @itemx -mbit-align
16998 @opindex mno-bit-align
16999 @opindex mbit-align
17000 On System V.4 and embedded PowerPC systems do not (do) force structures
17001 and unions that contain bit-fields to be aligned to the base type of the
17002 bit-field.
17003
17004 For example, by default a structure containing nothing but 8
17005 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17006 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17007 the structure is aligned to a 1-byte boundary and is 1 byte in
17008 size.
17009
17010 @item -mno-strict-align
17011 @itemx -mstrict-align
17012 @opindex mno-strict-align
17013 @opindex mstrict-align
17014 On System V.4 and embedded PowerPC systems do not (do) assume that
17015 unaligned memory references are handled by the system.
17016
17017 @item -mrelocatable
17018 @itemx -mno-relocatable
17019 @opindex mrelocatable
17020 @opindex mno-relocatable
17021 Generate code that allows (does not allow) a static executable to be
17022 relocated to a different address at run time.  A simple embedded
17023 PowerPC system loader should relocate the entire contents of
17024 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17025 a table of 32-bit addresses generated by this option.  For this to
17026 work, all objects linked together must be compiled with
17027 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17028 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17029
17030 @item -mrelocatable-lib
17031 @itemx -mno-relocatable-lib
17032 @opindex mrelocatable-lib
17033 @opindex mno-relocatable-lib
17034 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
17035 @code{.fixup} section to allow static executables to be relocated at
17036 run time, but @option{-mrelocatable-lib} does not use the smaller stack
17037 alignment of @option{-mrelocatable}.  Objects compiled with
17038 @option{-mrelocatable-lib} may be linked with objects compiled with
17039 any combination of the @option{-mrelocatable} options.
17040
17041 @item -mno-toc
17042 @itemx -mtoc
17043 @opindex mno-toc
17044 @opindex mtoc
17045 On System V.4 and embedded PowerPC systems do not (do) assume that
17046 register 2 contains a pointer to a global area pointing to the addresses
17047 used in the program.
17048
17049 @item -mlittle
17050 @itemx -mlittle-endian
17051 @opindex mlittle
17052 @opindex mlittle-endian
17053 On System V.4 and embedded PowerPC systems compile code for the
17054 processor in little-endian mode.  The @option{-mlittle-endian} option is
17055 the same as @option{-mlittle}.
17056
17057 @item -mbig
17058 @itemx -mbig-endian
17059 @opindex mbig
17060 @opindex mbig-endian
17061 On System V.4 and embedded PowerPC systems compile code for the
17062 processor in big-endian mode.  The @option{-mbig-endian} option is
17063 the same as @option{-mbig}.
17064
17065 @item -mdynamic-no-pic
17066 @opindex mdynamic-no-pic
17067 On Darwin and Mac OS X systems, compile code so that it is not
17068 relocatable, but that its external references are relocatable.  The
17069 resulting code is suitable for applications, but not shared
17070 libraries.
17071
17072 @item -msingle-pic-base
17073 @opindex msingle-pic-base
17074 Treat the register used for PIC addressing as read-only, rather than
17075 loading it in the prologue for each function.  The runtime system is
17076 responsible for initializing this register with an appropriate value
17077 before execution begins.
17078
17079 @item -mprioritize-restricted-insns=@var{priority}
17080 @opindex mprioritize-restricted-insns
17081 This option controls the priority that is assigned to
17082 dispatch-slot restricted instructions during the second scheduling
17083 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
17084 or @samp{2} to assign no, highest, or second-highest (respectively) 
17085 priority to dispatch-slot restricted
17086 instructions.
17087
17088 @item -msched-costly-dep=@var{dependence_type}
17089 @opindex msched-costly-dep
17090 This option controls which dependences are considered costly
17091 by the target during instruction scheduling.  The argument
17092 @var{dependence_type} takes one of the following values:
17093
17094 @table @asis
17095 @item @samp{no}
17096 No dependence is costly.
17097
17098 @item @samp{all}
17099 All dependences are costly.
17100
17101 @item @samp{true_store_to_load}
17102 A true dependence from store to load is costly.
17103
17104 @item @samp{store_to_load}
17105 Any dependence from store to load is costly.
17106
17107 @item @var{number}
17108 Any dependence for which the latency is greater than or equal to 
17109 @var{number} is costly.
17110 @end table
17111
17112 @item -minsert-sched-nops=@var{scheme}
17113 @opindex minsert-sched-nops
17114 This option controls which NOP insertion scheme is used during
17115 the second scheduling pass.  The argument @var{scheme} takes one of the
17116 following values:
17117
17118 @table @asis
17119 @item @samp{no}
17120 Don't insert NOPs.
17121
17122 @item @samp{pad}
17123 Pad with NOPs any dispatch group that has vacant issue slots,
17124 according to the scheduler's grouping.
17125
17126 @item @samp{regroup_exact}
17127 Insert NOPs to force costly dependent insns into
17128 separate groups.  Insert exactly as many NOPs as needed to force an insn
17129 to a new group, according to the estimated processor grouping.
17130
17131 @item @var{number}
17132 Insert NOPs to force costly dependent insns into
17133 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
17134 @end table
17135
17136 @item -mcall-sysv
17137 @opindex mcall-sysv
17138 On System V.4 and embedded PowerPC systems compile code using calling
17139 conventions that adheres to the March 1995 draft of the System V
17140 Application Binary Interface, PowerPC processor supplement.  This is the
17141 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
17142
17143 @item -mcall-sysv-eabi
17144 @itemx -mcall-eabi
17145 @opindex mcall-sysv-eabi
17146 @opindex mcall-eabi
17147 Specify both @option{-mcall-sysv} and @option{-meabi} options.
17148
17149 @item -mcall-sysv-noeabi
17150 @opindex mcall-sysv-noeabi
17151 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
17152
17153 @item -mcall-aixdesc
17154 @opindex m
17155 On System V.4 and embedded PowerPC systems compile code for the AIX
17156 operating system.
17157
17158 @item -mcall-linux
17159 @opindex mcall-linux
17160 On System V.4 and embedded PowerPC systems compile code for the
17161 Linux-based GNU system.
17162
17163 @item -mcall-freebsd
17164 @opindex mcall-freebsd
17165 On System V.4 and embedded PowerPC systems compile code for the
17166 FreeBSD operating system.
17167
17168 @item -mcall-netbsd
17169 @opindex mcall-netbsd
17170 On System V.4 and embedded PowerPC systems compile code for the
17171 NetBSD operating system.
17172
17173 @item -mcall-openbsd
17174 @opindex mcall-netbsd
17175 On System V.4 and embedded PowerPC systems compile code for the
17176 OpenBSD operating system.
17177
17178 @item -maix-struct-return
17179 @opindex maix-struct-return
17180 Return all structures in memory (as specified by the AIX ABI)@.
17181
17182 @item -msvr4-struct-return
17183 @opindex msvr4-struct-return
17184 Return structures smaller than 8 bytes in registers (as specified by the
17185 SVR4 ABI)@.
17186
17187 @item -mabi=@var{abi-type}
17188 @opindex mabi
17189 Extend the current ABI with a particular extension, or remove such extension.
17190 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
17191 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
17192
17193 @item -mabi=spe
17194 @opindex mabi=spe
17195 Extend the current ABI with SPE ABI extensions.  This does not change
17196 the default ABI, instead it adds the SPE ABI extensions to the current
17197 ABI@.
17198
17199 @item -mabi=no-spe
17200 @opindex mabi=no-spe
17201 Disable Booke SPE ABI extensions for the current ABI@.
17202
17203 @item -mabi=ibmlongdouble
17204 @opindex mabi=ibmlongdouble
17205 Change the current ABI to use IBM extended-precision long double.
17206 This is a PowerPC 32-bit SYSV ABI option.
17207
17208 @item -mabi=ieeelongdouble
17209 @opindex mabi=ieeelongdouble
17210 Change the current ABI to use IEEE extended-precision long double.
17211 This is a PowerPC 32-bit Linux ABI option.
17212
17213 @item -mprototype
17214 @itemx -mno-prototype
17215 @opindex mprototype
17216 @opindex mno-prototype
17217 On System V.4 and embedded PowerPC systems assume that all calls to
17218 variable argument functions are properly prototyped.  Otherwise, the
17219 compiler must insert an instruction before every non prototyped call to
17220 set or clear bit 6 of the condition code register (@var{CR}) to
17221 indicate whether floating-point values are passed in the floating-point
17222 registers in case the function takes variable arguments.  With
17223 @option{-mprototype}, only calls to prototyped variable argument functions
17224 set or clear the bit.
17225
17226 @item -msim
17227 @opindex msim
17228 On embedded PowerPC systems, assume that the startup module is called
17229 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
17230 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
17231 configurations.
17232
17233 @item -mmvme
17234 @opindex mmvme
17235 On embedded PowerPC systems, assume that the startup module is called
17236 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
17237 @file{libc.a}.
17238
17239 @item -mads
17240 @opindex mads
17241 On embedded PowerPC systems, assume that the startup module is called
17242 @file{crt0.o} and the standard C libraries are @file{libads.a} and
17243 @file{libc.a}.
17244
17245 @item -myellowknife
17246 @opindex myellowknife
17247 On embedded PowerPC systems, assume that the startup module is called
17248 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
17249 @file{libc.a}.
17250
17251 @item -mvxworks
17252 @opindex mvxworks
17253 On System V.4 and embedded PowerPC systems, specify that you are
17254 compiling for a VxWorks system.
17255
17256 @item -memb
17257 @opindex memb
17258 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
17259 header to indicate that @samp{eabi} extended relocations are used.
17260
17261 @item -meabi
17262 @itemx -mno-eabi
17263 @opindex meabi
17264 @opindex mno-eabi
17265 On System V.4 and embedded PowerPC systems do (do not) adhere to the
17266 Embedded Applications Binary Interface (eabi) which is a set of
17267 modifications to the System V.4 specifications.  Selecting @option{-meabi}
17268 means that the stack is aligned to an 8-byte boundary, a function
17269 @code{__eabi} is called to from @code{main} to set up the eabi
17270 environment, and the @option{-msdata} option can use both @code{r2} and
17271 @code{r13} to point to two separate small data areas.  Selecting
17272 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
17273 do not call an initialization function from @code{main}, and the
17274 @option{-msdata} option only uses @code{r13} to point to a single
17275 small data area.  The @option{-meabi} option is on by default if you
17276 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
17277
17278 @item -msdata=eabi
17279 @opindex msdata=eabi
17280 On System V.4 and embedded PowerPC systems, put small initialized
17281 @code{const} global and static data in the @samp{.sdata2} section, which
17282 is pointed to by register @code{r2}.  Put small initialized
17283 non-@code{const} global and static data in the @samp{.sdata} section,
17284 which is pointed to by register @code{r13}.  Put small uninitialized
17285 global and static data in the @samp{.sbss} section, which is adjacent to
17286 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
17287 incompatible with the @option{-mrelocatable} option.  The
17288 @option{-msdata=eabi} option also sets the @option{-memb} option.
17289
17290 @item -msdata=sysv
17291 @opindex msdata=sysv
17292 On System V.4 and embedded PowerPC systems, put small global and static
17293 data in the @samp{.sdata} section, which is pointed to by register
17294 @code{r13}.  Put small uninitialized global and static data in the
17295 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
17296 The @option{-msdata=sysv} option is incompatible with the
17297 @option{-mrelocatable} option.
17298
17299 @item -msdata=default
17300 @itemx -msdata
17301 @opindex msdata=default
17302 @opindex msdata
17303 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
17304 compile code the same as @option{-msdata=eabi}, otherwise compile code the
17305 same as @option{-msdata=sysv}.
17306
17307 @item -msdata=data
17308 @opindex msdata=data
17309 On System V.4 and embedded PowerPC systems, put small global
17310 data in the @samp{.sdata} section.  Put small uninitialized global
17311 data in the @samp{.sbss} section.  Do not use register @code{r13}
17312 to address small data however.  This is the default behavior unless
17313 other @option{-msdata} options are used.
17314
17315 @item -msdata=none
17316 @itemx -mno-sdata
17317 @opindex msdata=none
17318 @opindex mno-sdata
17319 On embedded PowerPC systems, put all initialized global and static data
17320 in the @samp{.data} section, and all uninitialized data in the
17321 @samp{.bss} section.
17322
17323 @item -mblock-move-inline-limit=@var{num}
17324 @opindex mblock-move-inline-limit
17325 Inline all block moves (such as calls to @code{memcpy} or structure
17326 copies) less than or equal to @var{num} bytes.  The minimum value for
17327 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
17328 targets.  The default value is target-specific.
17329
17330 @item -G @var{num}
17331 @opindex G
17332 @cindex smaller data references (PowerPC)
17333 @cindex .sdata/.sdata2 references (PowerPC)
17334 On embedded PowerPC systems, put global and static items less than or
17335 equal to @var{num} bytes into the small data or bss sections instead of
17336 the normal data or bss section.  By default, @var{num} is 8.  The
17337 @option{-G @var{num}} switch is also passed to the linker.
17338 All modules should be compiled with the same @option{-G @var{num}} value.
17339
17340 @item -mregnames
17341 @itemx -mno-regnames
17342 @opindex mregnames
17343 @opindex mno-regnames
17344 On System V.4 and embedded PowerPC systems do (do not) emit register
17345 names in the assembly language output using symbolic forms.
17346
17347 @item -mlongcall
17348 @itemx -mno-longcall
17349 @opindex mlongcall
17350 @opindex mno-longcall
17351 By default assume that all calls are far away so that a longer more
17352 expensive calling sequence is required.  This is required for calls
17353 further than 32 megabytes (33,554,432 bytes) from the current location.
17354 A short call is generated if the compiler knows
17355 the call cannot be that far away.  This setting can be overridden by
17356 the @code{shortcall} function attribute, or by @code{#pragma
17357 longcall(0)}.
17358
17359 Some linkers are capable of detecting out-of-range calls and generating
17360 glue code on the fly.  On these systems, long calls are unnecessary and
17361 generate slower code.  As of this writing, the AIX linker can do this,
17362 as can the GNU linker for PowerPC/64.  It is planned to add this feature
17363 to the GNU linker for 32-bit PowerPC systems as well.
17364
17365 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
17366 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
17367 addresses represent the callee and the branch island.  The
17368 Darwin/PPC linker prefers the first address and generates a @code{bl
17369 callee} if the PPC @code{bl} instruction reaches the callee directly;
17370 otherwise, the linker generates @code{bl L42} to call the branch
17371 island.  The branch island is appended to the body of the
17372 calling function; it computes the full 32-bit address of the callee
17373 and jumps to it.
17374
17375 On Mach-O (Darwin) systems, this option directs the compiler emit to
17376 the glue for every direct call, and the Darwin linker decides whether
17377 to use or discard it.
17378
17379 In the future, GCC may ignore all longcall specifications
17380 when the linker is known to generate glue.
17381
17382 @item -mtls-markers
17383 @itemx -mno-tls-markers
17384 @opindex mtls-markers
17385 @opindex mno-tls-markers
17386 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
17387 specifying the function argument.  The relocation allows the linker to
17388 reliably associate function call with argument setup instructions for
17389 TLS optimization, which in turn allows GCC to better schedule the
17390 sequence.
17391
17392 @item -pthread
17393 @opindex pthread
17394 Adds support for multithreading with the @dfn{pthreads} library.
17395 This option sets flags for both the preprocessor and linker.
17396
17397 @item -mrecip
17398 @itemx -mno-recip
17399 @opindex mrecip
17400 This option enables use of the reciprocal estimate and
17401 reciprocal square root estimate instructions with additional
17402 Newton-Raphson steps to increase precision instead of doing a divide or
17403 square root and divide for floating-point arguments.  You should use
17404 the @option{-ffast-math} option when using @option{-mrecip} (or at
17405 least @option{-funsafe-math-optimizations},
17406 @option{-finite-math-only}, @option{-freciprocal-math} and
17407 @option{-fno-trapping-math}).  Note that while the throughput of the
17408 sequence is generally higher than the throughput of the non-reciprocal
17409 instruction, the precision of the sequence can be decreased by up to 2
17410 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
17411 roots.
17412
17413 @item -mrecip=@var{opt}
17414 @opindex mrecip=opt
17415 This option allows to control which reciprocal estimate instructions
17416 may be used.  @var{opt} is a comma separated list of options, which may
17417 be preceded by a @code{!} to invert the option:
17418 @code{all}: enable all estimate instructions,
17419 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
17420 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
17421 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
17422 @code{divf}: enable the single-precision reciprocal approximation instructions;
17423 @code{divd}: enable the double-precision reciprocal approximation instructions;
17424 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
17425 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
17426 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
17427
17428 So, for example, @option{-mrecip=all,!rsqrtd} enables
17429 all of the reciprocal estimate instructions, except for the
17430 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
17431 which handle the double-precision reciprocal square root calculations.
17432
17433 @item -mrecip-precision
17434 @itemx -mno-recip-precision
17435 @opindex mrecip-precision
17436 Assume (do not assume) that the reciprocal estimate instructions
17437 provide higher-precision estimates than is mandated by the PowerPC
17438 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
17439 automatically selects @option{-mrecip-precision}.  The double-precision 
17440 square root estimate instructions are not generated by
17441 default on low-precision machines, since they do not provide an
17442 estimate that converges after three steps.
17443
17444 @item -mveclibabi=@var{type}
17445 @opindex mveclibabi
17446 Specifies the ABI type to use for vectorizing intrinsics using an
17447 external library.  The only type supported at present is @code{mass},
17448 which specifies to use IBM's Mathematical Acceleration Subsystem
17449 (MASS) libraries for vectorizing intrinsics using external libraries.
17450 GCC currently emits calls to @code{acosd2}, @code{acosf4},
17451 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
17452 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
17453 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
17454 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
17455 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
17456 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
17457 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
17458 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
17459 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
17460 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
17461 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
17462 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
17463 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
17464 for power7.  Both @option{-ftree-vectorize} and
17465 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
17466 libraries must be specified at link time.
17467
17468 @item -mfriz
17469 @itemx -mno-friz
17470 @opindex mfriz
17471 Generate (do not generate) the @code{friz} instruction when the
17472 @option{-funsafe-math-optimizations} option is used to optimize
17473 rounding of floating-point values to 64-bit integer and back to floating
17474 point.  The @code{friz} instruction does not return the same value if
17475 the floating-point number is too large to fit in an integer.
17476
17477 @item -mpointers-to-nested-functions
17478 @itemx -mno-pointers-to-nested-functions
17479 @opindex mpointers-to-nested-functions
17480 Generate (do not generate) code to load up the static chain register
17481 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
17482 systems where a function pointer points to a 3-word descriptor giving
17483 the function address, TOC value to be loaded in register @var{r2}, and
17484 static chain value to be loaded in register @var{r11}.  The
17485 @option{-mpointers-to-nested-functions} is on by default.  You cannot
17486 call through pointers to nested functions or pointers
17487 to functions compiled in other languages that use the static chain if
17488 you use the @option{-mno-pointers-to-nested-functions}.
17489
17490 @item -msave-toc-indirect
17491 @itemx -mno-save-toc-indirect
17492 @opindex msave-toc-indirect
17493 Generate (do not generate) code to save the TOC value in the reserved
17494 stack location in the function prologue if the function calls through
17495 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
17496 saved in the prologue, it is saved just before the call through the
17497 pointer.  The @option{-mno-save-toc-indirect} option is the default.
17498 @end table
17499
17500 @node RX Options
17501 @subsection RX Options
17502 @cindex RX Options
17503
17504 These command-line options are defined for RX targets:
17505
17506 @table @gcctabopt
17507 @item -m64bit-doubles
17508 @itemx -m32bit-doubles
17509 @opindex m64bit-doubles
17510 @opindex m32bit-doubles
17511 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
17512 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
17513 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
17514 works on 32-bit values, which is why the default is
17515 @option{-m32bit-doubles}.
17516
17517 @item -fpu
17518 @itemx -nofpu
17519 @opindex fpu
17520 @opindex nofpu
17521 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
17522 floating-point hardware.  The default is enabled for the @var{RX600}
17523 series and disabled for the @var{RX200} series.
17524
17525 Floating-point instructions are only generated for 32-bit floating-point 
17526 values, however, so the FPU hardware is not used for doubles if the
17527 @option{-m64bit-doubles} option is used.
17528
17529 @emph{Note} If the @option{-fpu} option is enabled then
17530 @option{-funsafe-math-optimizations} is also enabled automatically.
17531 This is because the RX FPU instructions are themselves unsafe.
17532
17533 @item -mcpu=@var{name}
17534 @opindex -mcpu
17535 Selects the type of RX CPU to be targeted.  Currently three types are
17536 supported, the generic @var{RX600} and @var{RX200} series hardware and
17537 the specific @var{RX610} CPU.  The default is @var{RX600}.
17538
17539 The only difference between @var{RX600} and @var{RX610} is that the
17540 @var{RX610} does not support the @code{MVTIPL} instruction.
17541
17542 The @var{RX200} series does not have a hardware floating-point unit
17543 and so @option{-nofpu} is enabled by default when this type is
17544 selected.
17545
17546 @item -mbig-endian-data
17547 @itemx -mlittle-endian-data
17548 @opindex mbig-endian-data
17549 @opindex mlittle-endian-data
17550 Store data (but not code) in the big-endian format.  The default is
17551 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
17552 format.
17553
17554 @item -msmall-data-limit=@var{N}
17555 @opindex msmall-data-limit
17556 Specifies the maximum size in bytes of global and static variables
17557 which can be placed into the small data area.  Using the small data
17558 area can lead to smaller and faster code, but the size of area is
17559 limited and it is up to the programmer to ensure that the area does
17560 not overflow.  Also when the small data area is used one of the RX's
17561 registers (usually @code{r13}) is reserved for use pointing to this
17562 area, so it is no longer available for use by the compiler.  This
17563 could result in slower and/or larger code if variables are pushed onto
17564 the stack instead of being held in this register.
17565
17566 Note, common variables (variables that have not been initialized) and
17567 constants are not placed into the small data area as they are assigned
17568 to other sections in the output executable.
17569
17570 The default value is zero, which disables this feature.  Note, this
17571 feature is not enabled by default with higher optimization levels
17572 (@option{-O2} etc) because of the potentially detrimental effects of
17573 reserving a register.  It is up to the programmer to experiment and
17574 discover whether this feature is of benefit to their program.  See the
17575 description of the @option{-mpid} option for a description of how the
17576 actual register to hold the small data area pointer is chosen.
17577
17578 @item -msim
17579 @itemx -mno-sim
17580 @opindex msim
17581 @opindex mno-sim
17582 Use the simulator runtime.  The default is to use the libgloss board
17583 specific runtime.
17584
17585 @item -mas100-syntax
17586 @itemx -mno-as100-syntax
17587 @opindex mas100-syntax
17588 @opindex mno-as100-syntax
17589 When generating assembler output use a syntax that is compatible with
17590 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
17591 assembler but it has some restrictions so generating it is not the
17592 default option.
17593
17594 @item -mmax-constant-size=@var{N}
17595 @opindex mmax-constant-size
17596 Specifies the maximum size, in bytes, of a constant that can be used as
17597 an operand in a RX instruction.  Although the RX instruction set does
17598 allow constants of up to 4 bytes in length to be used in instructions,
17599 a longer value equates to a longer instruction.  Thus in some
17600 circumstances it can be beneficial to restrict the size of constants
17601 that are used in instructions.  Constants that are too big are instead
17602 placed into a constant pool and referenced via register indirection.
17603
17604 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
17605 or 4 means that constants of any size are allowed.
17606
17607 @item -mrelax
17608 @opindex mrelax
17609 Enable linker relaxation.  Linker relaxation is a process whereby the
17610 linker attempts to reduce the size of a program by finding shorter
17611 versions of various instructions.  Disabled by default.
17612
17613 @item -mint-register=@var{N}
17614 @opindex mint-register
17615 Specify the number of registers to reserve for fast interrupt handler
17616 functions.  The value @var{N} can be between 0 and 4.  A value of 1
17617 means that register @code{r13} is reserved for the exclusive use
17618 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
17619 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
17620 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
17621 A value of 0, the default, does not reserve any registers.
17622
17623 @item -msave-acc-in-interrupts
17624 @opindex msave-acc-in-interrupts
17625 Specifies that interrupt handler functions should preserve the
17626 accumulator register.  This is only necessary if normal code might use
17627 the accumulator register, for example because it performs 64-bit
17628 multiplications.  The default is to ignore the accumulator as this
17629 makes the interrupt handlers faster.
17630
17631 @item -mpid
17632 @itemx -mno-pid
17633 @opindex mpid
17634 @opindex mno-pid
17635 Enables the generation of position independent data.  When enabled any
17636 access to constant data is done via an offset from a base address
17637 held in a register.  This allows the location of constant data to be
17638 determined at run time without requiring the executable to be
17639 relocated, which is a benefit to embedded applications with tight
17640 memory constraints.  Data that can be modified is not affected by this
17641 option.
17642
17643 Note, using this feature reserves a register, usually @code{r13}, for
17644 the constant data base address.  This can result in slower and/or
17645 larger code, especially in complicated functions.
17646
17647 The actual register chosen to hold the constant data base address
17648 depends upon whether the @option{-msmall-data-limit} and/or the
17649 @option{-mint-register} command-line options are enabled.  Starting
17650 with register @code{r13} and proceeding downwards, registers are
17651 allocated first to satisfy the requirements of @option{-mint-register},
17652 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
17653 is possible for the small data area register to be @code{r8} if both
17654 @option{-mint-register=4} and @option{-mpid} are specified on the
17655 command line.
17656
17657 By default this feature is not enabled.  The default can be restored
17658 via the @option{-mno-pid} command-line option.
17659
17660 @end table
17661
17662 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
17663 has special significance to the RX port when used with the
17664 @code{interrupt} function attribute.  This attribute indicates a
17665 function intended to process fast interrupts.  GCC ensures
17666 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
17667 and/or @code{r13} and only provided that the normal use of the
17668 corresponding registers have been restricted via the
17669 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
17670 options.
17671
17672 @node S/390 and zSeries Options
17673 @subsection S/390 and zSeries Options
17674 @cindex S/390 and zSeries Options
17675
17676 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
17677
17678 @table @gcctabopt
17679 @item -mhard-float
17680 @itemx -msoft-float
17681 @opindex mhard-float
17682 @opindex msoft-float
17683 Use (do not use) the hardware floating-point instructions and registers
17684 for floating-point operations.  When @option{-msoft-float} is specified,
17685 functions in @file{libgcc.a} are used to perform floating-point
17686 operations.  When @option{-mhard-float} is specified, the compiler
17687 generates IEEE floating-point instructions.  This is the default.
17688
17689 @item -mhard-dfp
17690 @itemx -mno-hard-dfp
17691 @opindex mhard-dfp
17692 @opindex mno-hard-dfp
17693 Use (do not use) the hardware decimal-floating-point instructions for
17694 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
17695 specified, functions in @file{libgcc.a} are used to perform
17696 decimal-floating-point operations.  When @option{-mhard-dfp} is
17697 specified, the compiler generates decimal-floating-point hardware
17698 instructions.  This is the default for @option{-march=z9-ec} or higher.
17699
17700 @item -mlong-double-64
17701 @itemx -mlong-double-128
17702 @opindex mlong-double-64
17703 @opindex mlong-double-128
17704 These switches control the size of @code{long double} type. A size
17705 of 64 bits makes the @code{long double} type equivalent to the @code{double}
17706 type. This is the default.
17707
17708 @item -mbackchain
17709 @itemx -mno-backchain
17710 @opindex mbackchain
17711 @opindex mno-backchain
17712 Store (do not store) the address of the caller's frame as backchain pointer
17713 into the callee's stack frame.
17714 A backchain may be needed to allow debugging using tools that do not understand
17715 DWARF 2 call frame information.
17716 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
17717 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
17718 the backchain is placed into the topmost word of the 96/160 byte register
17719 save area.
17720
17721 In general, code compiled with @option{-mbackchain} is call-compatible with
17722 code compiled with @option{-mmo-backchain}; however, use of the backchain
17723 for debugging purposes usually requires that the whole binary is built with
17724 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
17725 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17726 to build a linux kernel use @option{-msoft-float}.
17727
17728 The default is to not maintain the backchain.
17729
17730 @item -mpacked-stack
17731 @itemx -mno-packed-stack
17732 @opindex mpacked-stack
17733 @opindex mno-packed-stack
17734 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
17735 specified, the compiler uses the all fields of the 96/160 byte register save
17736 area only for their default purpose; unused fields still take up stack space.
17737 When @option{-mpacked-stack} is specified, register save slots are densely
17738 packed at the top of the register save area; unused space is reused for other
17739 purposes, allowing for more efficient use of the available stack space.
17740 However, when @option{-mbackchain} is also in effect, the topmost word of
17741 the save area is always used to store the backchain, and the return address
17742 register is always saved two words below the backchain.
17743
17744 As long as the stack frame backchain is not used, code generated with
17745 @option{-mpacked-stack} is call-compatible with code generated with
17746 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
17747 S/390 or zSeries generated code that uses the stack frame backchain at run
17748 time, not just for debugging purposes.  Such code is not call-compatible
17749 with code compiled with @option{-mpacked-stack}.  Also, note that the
17750 combination of @option{-mbackchain},
17751 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17752 to build a linux kernel use @option{-msoft-float}.
17753
17754 The default is to not use the packed stack layout.
17755
17756 @item -msmall-exec
17757 @itemx -mno-small-exec
17758 @opindex msmall-exec
17759 @opindex mno-small-exec
17760 Generate (or do not generate) code using the @code{bras} instruction
17761 to do subroutine calls.
17762 This only works reliably if the total executable size does not
17763 exceed 64k.  The default is to use the @code{basr} instruction instead,
17764 which does not have this limitation.
17765
17766 @item -m64
17767 @itemx -m31
17768 @opindex m64
17769 @opindex m31
17770 When @option{-m31} is specified, generate code compliant to the
17771 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
17772 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
17773 particular to generate 64-bit instructions.  For the @samp{s390}
17774 targets, the default is @option{-m31}, while the @samp{s390x}
17775 targets default to @option{-m64}.
17776
17777 @item -mzarch
17778 @itemx -mesa
17779 @opindex mzarch
17780 @opindex mesa
17781 When @option{-mzarch} is specified, generate code using the
17782 instructions available on z/Architecture.
17783 When @option{-mesa} is specified, generate code using the
17784 instructions available on ESA/390.  Note that @option{-mesa} is
17785 not possible with @option{-m64}.
17786 When generating code compliant to the GNU/Linux for S/390 ABI,
17787 the default is @option{-mesa}.  When generating code compliant
17788 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
17789
17790 @item -mmvcle
17791 @itemx -mno-mvcle
17792 @opindex mmvcle
17793 @opindex mno-mvcle
17794 Generate (or do not generate) code using the @code{mvcle} instruction
17795 to perform block moves.  When @option{-mno-mvcle} is specified,
17796 use a @code{mvc} loop instead.  This is the default unless optimizing for
17797 size.
17798
17799 @item -mdebug
17800 @itemx -mno-debug
17801 @opindex mdebug
17802 @opindex mno-debug
17803 Print (or do not print) additional debug information when compiling.
17804 The default is to not print debug information.
17805
17806 @item -march=@var{cpu-type}
17807 @opindex march
17808 Generate code that runs on @var{cpu-type}, which is the name of a system
17809 representing a certain processor type.  Possible values for
17810 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
17811 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
17812 When generating code using the instructions available on z/Architecture,
17813 the default is @option{-march=z900}.  Otherwise, the default is
17814 @option{-march=g5}.
17815
17816 @item -mtune=@var{cpu-type}
17817 @opindex mtune
17818 Tune to @var{cpu-type} everything applicable about the generated code,
17819 except for the ABI and the set of available instructions.
17820 The list of @var{cpu-type} values is the same as for @option{-march}.
17821 The default is the value used for @option{-march}.
17822
17823 @item -mtpf-trace
17824 @itemx -mno-tpf-trace
17825 @opindex mtpf-trace
17826 @opindex mno-tpf-trace
17827 Generate code that adds (does not add) in TPF OS specific branches to trace
17828 routines in the operating system.  This option is off by default, even
17829 when compiling for the TPF OS@.
17830
17831 @item -mfused-madd
17832 @itemx -mno-fused-madd
17833 @opindex mfused-madd
17834 @opindex mno-fused-madd
17835 Generate code that uses (does not use) the floating-point multiply and
17836 accumulate instructions.  These instructions are generated by default if
17837 hardware floating point is used.
17838
17839 @item -mwarn-framesize=@var{framesize}
17840 @opindex mwarn-framesize
17841 Emit a warning if the current function exceeds the given frame size.  Because
17842 this is a compile-time check it doesn't need to be a real problem when the program
17843 runs.  It is intended to identify functions that most probably cause
17844 a stack overflow.  It is useful to be used in an environment with limited stack
17845 size e.g.@: the linux kernel.
17846
17847 @item -mwarn-dynamicstack
17848 @opindex mwarn-dynamicstack
17849 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
17850 arrays.  This is generally a bad idea with a limited stack size.
17851
17852 @item -mstack-guard=@var{stack-guard}
17853 @itemx -mstack-size=@var{stack-size}
17854 @opindex mstack-guard
17855 @opindex mstack-size
17856 If these options are provided the s390 back end emits additional instructions in
17857 the function prologue which trigger a trap if the stack size is @var{stack-guard}
17858 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
17859 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
17860 the frame size of the compiled function is chosen.
17861 These options are intended to be used to help debugging stack overflow problems.
17862 The additionally emitted code causes only little overhead and hence can also be
17863 used in production like systems without greater performance degradation.  The given
17864 values have to be exact powers of 2 and @var{stack-size} has to be greater than
17865 @var{stack-guard} without exceeding 64k.
17866 In order to be efficient the extra code makes the assumption that the stack starts
17867 at an address aligned to the value given by @var{stack-size}.
17868 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
17869 @end table
17870
17871 @node Score Options
17872 @subsection Score Options
17873 @cindex Score Options
17874
17875 These options are defined for Score implementations:
17876
17877 @table @gcctabopt
17878 @item -meb
17879 @opindex meb
17880 Compile code for big-endian mode.  This is the default.
17881
17882 @item -mel
17883 @opindex mel
17884 Compile code for little-endian mode.
17885
17886 @item -mnhwloop
17887 @opindex mnhwloop
17888 Disable generate bcnz instruction.
17889
17890 @item -muls
17891 @opindex muls
17892 Enable generate unaligned load and store instruction.
17893
17894 @item -mmac
17895 @opindex mmac
17896 Enable the use of multiply-accumulate instructions. Disabled by default.
17897
17898 @item -mscore5
17899 @opindex mscore5
17900 Specify the SCORE5 as the target architecture.
17901
17902 @item -mscore5u
17903 @opindex mscore5u
17904 Specify the SCORE5U of the target architecture.
17905
17906 @item -mscore7
17907 @opindex mscore7
17908 Specify the SCORE7 as the target architecture. This is the default.
17909
17910 @item -mscore7d
17911 @opindex mscore7d
17912 Specify the SCORE7D as the target architecture.
17913 @end table
17914
17915 @node SH Options
17916 @subsection SH Options
17917
17918 These @samp{-m} options are defined for the SH implementations:
17919
17920 @table @gcctabopt
17921 @item -m1
17922 @opindex m1
17923 Generate code for the SH1.
17924
17925 @item -m2
17926 @opindex m2
17927 Generate code for the SH2.
17928
17929 @item -m2e
17930 Generate code for the SH2e.
17931
17932 @item -m2a-nofpu
17933 @opindex m2a-nofpu
17934 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
17935 that the floating-point unit is not used.
17936
17937 @item -m2a-single-only
17938 @opindex m2a-single-only
17939 Generate code for the SH2a-FPU, in such a way that no double-precision
17940 floating-point operations are used.
17941
17942 @item -m2a-single
17943 @opindex m2a-single
17944 Generate code for the SH2a-FPU assuming the floating-point unit is in
17945 single-precision mode by default.
17946
17947 @item -m2a
17948 @opindex m2a
17949 Generate code for the SH2a-FPU assuming the floating-point unit is in
17950 double-precision mode by default.
17951
17952 @item -m3
17953 @opindex m3
17954 Generate code for the SH3.
17955
17956 @item -m3e
17957 @opindex m3e
17958 Generate code for the SH3e.
17959
17960 @item -m4-nofpu
17961 @opindex m4-nofpu
17962 Generate code for the SH4 without a floating-point unit.
17963
17964 @item -m4-single-only
17965 @opindex m4-single-only
17966 Generate code for the SH4 with a floating-point unit that only
17967 supports single-precision arithmetic.
17968
17969 @item -m4-single
17970 @opindex m4-single
17971 Generate code for the SH4 assuming the floating-point unit is in
17972 single-precision mode by default.
17973
17974 @item -m4
17975 @opindex m4
17976 Generate code for the SH4.
17977
17978 @item -m4a-nofpu
17979 @opindex m4a-nofpu
17980 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
17981 floating-point unit is not used.
17982
17983 @item -m4a-single-only
17984 @opindex m4a-single-only
17985 Generate code for the SH4a, in such a way that no double-precision
17986 floating-point operations are used.
17987
17988 @item -m4a-single
17989 @opindex m4a-single
17990 Generate code for the SH4a assuming the floating-point unit is in
17991 single-precision mode by default.
17992
17993 @item -m4a
17994 @opindex m4a
17995 Generate code for the SH4a.
17996
17997 @item -m4al
17998 @opindex m4al
17999 Same as @option{-m4a-nofpu}, except that it implicitly passes
18000 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18001 instructions at the moment.
18002
18003 @item -mb
18004 @opindex mb
18005 Compile code for the processor in big-endian mode.
18006
18007 @item -ml
18008 @opindex ml
18009 Compile code for the processor in little-endian mode.
18010
18011 @item -mdalign
18012 @opindex mdalign
18013 Align doubles at 64-bit boundaries.  Note that this changes the calling
18014 conventions, and thus some functions from the standard C library do
18015 not work unless you recompile it first with @option{-mdalign}.
18016
18017 @item -mrelax
18018 @opindex mrelax
18019 Shorten some address references at link time, when possible; uses the
18020 linker option @option{-relax}.
18021
18022 @item -mbigtable
18023 @opindex mbigtable
18024 Use 32-bit offsets in @code{switch} tables.  The default is to use
18025 16-bit offsets.
18026
18027 @item -mbitops
18028 @opindex mbitops
18029 Enable the use of bit manipulation instructions on SH2A.
18030
18031 @item -mfmovd
18032 @opindex mfmovd
18033 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
18034 alignment constraints.
18035
18036 @item -mhitachi
18037 @opindex mhitachi
18038 Comply with the calling conventions defined by Renesas.
18039
18040 @item -mrenesas
18041 @opindex mhitachi
18042 Comply with the calling conventions defined by Renesas.
18043
18044 @item -mno-renesas
18045 @opindex mhitachi
18046 Comply with the calling conventions defined for GCC before the Renesas
18047 conventions were available.  This option is the default for all
18048 targets of the SH toolchain.
18049
18050 @item -mnomacsave
18051 @opindex mnomacsave
18052 Mark the @code{MAC} register as call-clobbered, even if
18053 @option{-mhitachi} is given.
18054
18055 @item -mieee
18056 @opindex mieee
18057 Increase IEEE compliance of floating-point code.
18058 At the moment, this is equivalent to @option{-fno-finite-math-only}.
18059 When generating 16-bit SH opcodes, getting IEEE-conforming results for
18060 comparisons of NANs / infinities incurs extra overhead in every
18061 floating-point comparison, therefore the default is set to
18062 @option{-ffinite-math-only}.
18063
18064 @item -minline-ic_invalidate
18065 @opindex minline-ic_invalidate
18066 Inline code to invalidate instruction cache entries after setting up
18067 nested function trampolines.
18068 This option has no effect if @option{-musermode} is in effect and the selected
18069 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
18070 instruction.
18071 If the selected code generation option does not allow the use of the @code{icbi}
18072 instruction, and @option{-musermode} is not in effect, the inlined code
18073 manipulates the instruction cache address array directly with an associative
18074 write.  This not only requires privileged mode at run time, but it also
18075 fails if the cache line had been mapped via the TLB and has become unmapped.
18076
18077 @item -misize
18078 @opindex misize
18079 Dump instruction size and location in the assembly code.
18080
18081 @item -mpadstruct
18082 @opindex mpadstruct
18083 This option is deprecated.  It pads structures to multiple of 4 bytes,
18084 which is incompatible with the SH ABI@.
18085
18086 @item -msoft-atomic
18087 @opindex msoft-atomic
18088 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
18089 built-in functions.  The generated atomic sequences require support from the 
18090 interrupt / exception handling code of the system and are only suitable for
18091 single-core systems.  They will not perform correctly on multi-core systems.
18092 This option is enabled by default when the target is @code{sh-*-linux*}.
18093 For details on the atomic built-in functions see @ref{__atomic Builtins}.
18094
18095 @item -menable-tas
18096 @opindex menable-tas
18097 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
18098 Notice that depending on the particular hardware and software configuration
18099 this can degrade overall performance due to the operand cache line flushes
18100 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
18101 processors the @code{tas.b} instruction must be used with caution since it
18102 can result in data corruption for certain cache configurations.
18103
18104 @item -mspace
18105 @opindex mspace
18106 Optimize for space instead of speed.  Implied by @option{-Os}.
18107
18108 @item -mprefergot
18109 @opindex mprefergot
18110 When generating position-independent code, emit function calls using
18111 the Global Offset Table instead of the Procedure Linkage Table.
18112
18113 @item -musermode
18114 @opindex musermode
18115 Don't generate privileged mode only code.  This option
18116 implies @option{-mno-inline-ic_invalidate}
18117 if the inlined code would not work in user mode.
18118 This is the default when the target is @code{sh-*-linux*}.
18119
18120 @item -multcost=@var{number}
18121 @opindex multcost=@var{number}
18122 Set the cost to assume for a multiply insn.
18123
18124 @item -mdiv=@var{strategy}
18125 @opindex mdiv=@var{strategy}
18126 Set the division strategy to use for SHmedia code.  @var{strategy} must be
18127 one of: 
18128
18129 @table @samp
18130
18131 @item fp 
18132 Performs the operation in floating point.  This has a very high latency,
18133 but needs only a few instructions, so it might be a good choice if
18134 your code has enough easily-exploitable ILP to allow the compiler to
18135 schedule the floating-point instructions together with other instructions.
18136 Division by zero causes a floating-point exception.
18137
18138 @item inv
18139 Uses integer operations to calculate the inverse of the divisor,
18140 and then multiplies the dividend with the inverse.  This strategy allows
18141 CSE and hoisting of the inverse calculation.  Division by zero calculates
18142 an unspecified result, but does not trap.
18143
18144 @item inv:minlat
18145 A variant of @samp{inv} where, if no CSE or hoisting opportunities
18146 have been found, or if the entire operation has been hoisted to the same
18147 place, the last stages of the inverse calculation are intertwined with the
18148 final multiply to reduce the overall latency, at the expense of using a few
18149 more instructions, and thus offering fewer scheduling opportunities with
18150 other code.
18151
18152 @item call
18153 Calls a library function that usually implements the @samp{inv:minlat}
18154 strategy.
18155 This gives high code density for @code{m5-*media-nofpu} compilations.
18156
18157 @item call2
18158 Uses a different entry point of the same library function, where it
18159 assumes that a pointer to a lookup table has already been set up, which
18160 exposes the pointer load to CSE and code hoisting optimizations.
18161
18162 @item inv:call
18163 @itemx inv:call2
18164 @itemx inv:fp
18165 Use the @samp{inv} algorithm for initial
18166 code generation, but if the code stays unoptimized, revert to the @samp{call},
18167 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
18168 potentially-trapping side effect of division by zero is carried by a
18169 separate instruction, so it is possible that all the integer instructions
18170 are hoisted out, but the marker for the side effect stays where it is.
18171 A recombination to floating-point operations or a call is not possible
18172 in that case.
18173
18174 @item inv20u
18175 @itemx inv20l
18176 Variants of the @samp{inv:minlat} strategy.  In the case
18177 that the inverse calculation is not separated from the multiply, they speed
18178 up division where the dividend fits into 20 bits (plus sign where applicable)
18179 by inserting a test to skip a number of operations in this case; this test
18180 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
18181 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
18182
18183 @end table
18184
18185 @item -maccumulate-outgoing-args
18186 @opindex maccumulate-outgoing-args
18187 Reserve space once for outgoing arguments in the function prologue rather
18188 than around each call.  Generally beneficial for performance and size.  Also
18189 needed for unwinding to avoid changing the stack frame around conditional code.
18190
18191 @item -mdivsi3_libfunc=@var{name}
18192 @opindex mdivsi3_libfunc=@var{name}
18193 Set the name of the library function used for 32-bit signed division to
18194 @var{name}.
18195 This only affects the name used in the @samp{call} and @samp{inv:call}
18196 division strategies, and the compiler still expects the same
18197 sets of input/output/clobbered registers as if this option were not present.
18198
18199 @item -mfixed-range=@var{register-range}
18200 @opindex mfixed-range
18201 Generate code treating the given register range as fixed registers.
18202 A fixed register is one that the register allocator can not use.  This is
18203 useful when compiling kernel code.  A register range is specified as
18204 two registers separated by a dash.  Multiple register ranges can be
18205 specified separated by a comma.
18206
18207 @item -mindexed-addressing
18208 @opindex mindexed-addressing
18209 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
18210 This is only safe if the hardware and/or OS implement 32-bit wrap-around
18211 semantics for the indexed addressing mode.  The architecture allows the
18212 implementation of processors with 64-bit MMU, which the OS could use to
18213 get 32-bit addressing, but since no current hardware implementation supports
18214 this or any other way to make the indexed addressing mode safe to use in
18215 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
18216
18217 @item -mgettrcost=@var{number}
18218 @opindex mgettrcost=@var{number}
18219 Set the cost assumed for the @code{gettr} instruction to @var{number}.
18220 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
18221
18222 @item -mpt-fixed
18223 @opindex mpt-fixed
18224 Assume @code{pt*} instructions won't trap.  This generally generates
18225 better-scheduled code, but is unsafe on current hardware.
18226 The current architecture
18227 definition says that @code{ptabs} and @code{ptrel} trap when the target 
18228 anded with 3 is 3.
18229 This has the unintentional effect of making it unsafe to schedule these
18230 instructions before a branch, or hoist them out of a loop.  For example,
18231 @code{__do_global_ctors}, a part of @file{libgcc}
18232 that runs constructors at program
18233 startup, calls functions in a list which is delimited by @minus{}1.  With the
18234 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
18235 That means that all the constructors run a bit more quickly, but when
18236 the loop comes to the end of the list, the program crashes because @code{ptabs}
18237 loads @minus{}1 into a target register.  
18238
18239 Since this option is unsafe for any
18240 hardware implementing the current architecture specification, the default
18241 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
18242 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
18243 this deters register allocation from using target registers for storing
18244 ordinary integers.
18245
18246 @item -minvalid-symbols
18247 @opindex minvalid-symbols
18248 Assume symbols might be invalid.  Ordinary function symbols generated by
18249 the compiler are always valid to load with
18250 @code{movi}/@code{shori}/@code{ptabs} or
18251 @code{movi}/@code{shori}/@code{ptrel},
18252 but with assembler and/or linker tricks it is possible
18253 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
18254 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
18255 It prevents cross-basic-block CSE, hoisting and most scheduling
18256 of symbol loads.  The default is @option{-mno-invalid-symbols}.
18257
18258 @item -mbranch-cost=@var{num}
18259 @opindex mbranch-cost=@var{num}
18260 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
18261 make the compiler try to generate more branch-free code if possible.  
18262 If not specified the value is selected depending on the processor type that
18263 is being compiled for.
18264
18265 @item -mcbranchdi
18266 @opindex mcbranchdi
18267 Enable the @code{cbranchdi4} instruction pattern.
18268
18269 @item -mcmpeqdi
18270 @opindex mcmpeqdi
18271 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
18272 is in effect.
18273
18274 @item -mfused-madd
18275 @opindex mfused-madd
18276 Allow the usage of the @code{fmac} instruction (floating-point
18277 multiply-accumulate) if the processor type supports it.  Enabling this
18278 option might generate code that produces different numeric floating-point
18279 results compared to strict IEEE 754 arithmetic.
18280
18281 @item -mpretend-cmove
18282 @opindex mpretend-cmove
18283 Prefer zero-displacement conditional branches for conditional move instruction
18284 patterns.  This can result in faster code on the SH4 processor.
18285
18286 @end table
18287
18288 @node Solaris 2 Options
18289 @subsection Solaris 2 Options
18290 @cindex Solaris 2 options
18291
18292 These @samp{-m} options are supported on Solaris 2:
18293
18294 @table @gcctabopt
18295 @item -mimpure-text
18296 @opindex mimpure-text
18297 @option{-mimpure-text}, used in addition to @option{-shared}, tells
18298 the compiler to not pass @option{-z text} to the linker when linking a
18299 shared object.  Using this option, you can link position-dependent
18300 code into a shared object.
18301
18302 @option{-mimpure-text} suppresses the ``relocations remain against
18303 allocatable but non-writable sections'' linker error message.
18304 However, the necessary relocations trigger copy-on-write, and the
18305 shared object is not actually shared across processes.  Instead of
18306 using @option{-mimpure-text}, you should compile all source code with
18307 @option{-fpic} or @option{-fPIC}.
18308
18309 @end table
18310
18311 These switches are supported in addition to the above on Solaris 2:
18312
18313 @table @gcctabopt
18314 @item -pthreads
18315 @opindex pthreads
18316 Add support for multithreading using the POSIX threads library.  This
18317 option sets flags for both the preprocessor and linker.  This option does
18318 not affect the thread safety of object code produced  by the compiler or
18319 that of libraries supplied with it.
18320
18321 @item -pthread
18322 @opindex pthread
18323 This is a synonym for @option{-pthreads}.
18324 @end table
18325
18326 @node SPARC Options
18327 @subsection SPARC Options
18328 @cindex SPARC options
18329
18330 These @samp{-m} options are supported on the SPARC:
18331
18332 @table @gcctabopt
18333 @item -mno-app-regs
18334 @itemx -mapp-regs
18335 @opindex mno-app-regs
18336 @opindex mapp-regs
18337 Specify @option{-mapp-regs} to generate output using the global registers
18338 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
18339 is the default.
18340
18341 To be fully SVR4 ABI compliant at the cost of some performance loss,
18342 specify @option{-mno-app-regs}.  You should compile libraries and system
18343 software with this option.
18344
18345 @item -mflat
18346 @itemx -mno-flat
18347 @opindex mflat
18348 @opindex mno-flat
18349 With @option{-mflat}, the compiler does not generate save/restore instructions
18350 and uses a ``flat'' or single register window model.  This model is compatible
18351 with the regular register window model.  The local registers and the input
18352 registers (0--5) are still treated as ``call-saved'' registers and are
18353 saved on the stack as needed.
18354
18355 With @option{-mno-flat} (the default), the compiler generates save/restore
18356 instructions (except for leaf functions).  This is the normal operating mode.
18357
18358 @item -mfpu
18359 @itemx -mhard-float
18360 @opindex mfpu
18361 @opindex mhard-float
18362 Generate output containing floating-point instructions.  This is the
18363 default.
18364
18365 @item -mno-fpu
18366 @itemx -msoft-float
18367 @opindex mno-fpu
18368 @opindex msoft-float
18369 Generate output containing library calls for floating point.
18370 @strong{Warning:} the requisite libraries are not available for all SPARC
18371 targets.  Normally the facilities of the machine's usual C compiler are
18372 used, but this cannot be done directly in cross-compilation.  You must make
18373 your own arrangements to provide suitable library functions for
18374 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
18375 @samp{sparclite-*-*} do provide software floating-point support.
18376
18377 @option{-msoft-float} changes the calling convention in the output file;
18378 therefore, it is only useful if you compile @emph{all} of a program with
18379 this option.  In particular, you need to compile @file{libgcc.a}, the
18380 library that comes with GCC, with @option{-msoft-float} in order for
18381 this to work.
18382
18383 @item -mhard-quad-float
18384 @opindex mhard-quad-float
18385 Generate output containing quad-word (long double) floating-point
18386 instructions.
18387
18388 @item -msoft-quad-float
18389 @opindex msoft-quad-float
18390 Generate output containing library calls for quad-word (long double)
18391 floating-point instructions.  The functions called are those specified
18392 in the SPARC ABI@.  This is the default.
18393
18394 As of this writing, there are no SPARC implementations that have hardware
18395 support for the quad-word floating-point instructions.  They all invoke
18396 a trap handler for one of these instructions, and then the trap handler
18397 emulates the effect of the instruction.  Because of the trap handler overhead,
18398 this is much slower than calling the ABI library routines.  Thus the
18399 @option{-msoft-quad-float} option is the default.
18400
18401 @item -mno-unaligned-doubles
18402 @itemx -munaligned-doubles
18403 @opindex mno-unaligned-doubles
18404 @opindex munaligned-doubles
18405 Assume that doubles have 8-byte alignment.  This is the default.
18406
18407 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
18408 alignment only if they are contained in another type, or if they have an
18409 absolute address.  Otherwise, it assumes they have 4-byte alignment.
18410 Specifying this option avoids some rare compatibility problems with code
18411 generated by other compilers.  It is not the default because it results
18412 in a performance loss, especially for floating-point code.
18413
18414 @item -mno-faster-structs
18415 @itemx -mfaster-structs
18416 @opindex mno-faster-structs
18417 @opindex mfaster-structs
18418 With @option{-mfaster-structs}, the compiler assumes that structures
18419 should have 8-byte alignment.  This enables the use of pairs of
18420 @code{ldd} and @code{std} instructions for copies in structure
18421 assignment, in place of twice as many @code{ld} and @code{st} pairs.
18422 However, the use of this changed alignment directly violates the SPARC
18423 ABI@.  Thus, it's intended only for use on targets where the developer
18424 acknowledges that their resulting code is not directly in line with
18425 the rules of the ABI@.
18426
18427 @item -mcpu=@var{cpu_type}
18428 @opindex mcpu
18429 Set the instruction set, register set, and instruction scheduling parameters
18430 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
18431 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
18432 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
18433 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
18434 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
18435 and @samp{niagara4}.
18436
18437 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
18438 which selects the best architecture option for the host processor.
18439 @option{-mcpu=native} has no effect if GCC does not recognize
18440 the processor.
18441
18442 Default instruction scheduling parameters are used for values that select
18443 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
18444 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
18445
18446 Here is a list of each supported architecture and their supported
18447 implementations.
18448
18449 @table @asis
18450 @item v7
18451 cypress
18452
18453 @item v8
18454 supersparc, hypersparc, leon
18455
18456 @item sparclite
18457 f930, f934, sparclite86x
18458
18459 @item sparclet
18460 tsc701
18461
18462 @item v9
18463 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
18464 @end table
18465
18466 By default (unless configured otherwise), GCC generates code for the V7
18467 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
18468 additionally optimizes it for the Cypress CY7C602 chip, as used in the
18469 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
18470 SPARCStation 1, 2, IPX etc.
18471
18472 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
18473 architecture.  The only difference from V7 code is that the compiler emits
18474 the integer multiply and integer divide instructions which exist in SPARC-V8
18475 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
18476 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
18477 2000 series.
18478
18479 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
18480 the SPARC architecture.  This adds the integer multiply, integer divide step
18481 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
18482 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
18483 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
18484 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
18485 MB86934 chip, which is the more recent SPARClite with FPU@.
18486
18487 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
18488 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
18489 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
18490 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
18491 optimizes it for the TEMIC SPARClet chip.
18492
18493 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
18494 architecture.  This adds 64-bit integer and floating-point move instructions,
18495 3 additional floating-point condition code registers and conditional move
18496 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
18497 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
18498 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
18499 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
18500 @option{-mcpu=niagara}, the compiler additionally optimizes it for
18501 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
18502 additionally optimizes it for Sun UltraSPARC T2 chips. With
18503 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
18504 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
18505 additionally optimizes it for Sun UltraSPARC T4 chips.
18506
18507 @item -mtune=@var{cpu_type}
18508 @opindex mtune
18509 Set the instruction scheduling parameters for machine type
18510 @var{cpu_type}, but do not set the instruction set or register set that the
18511 option @option{-mcpu=@var{cpu_type}} does.
18512
18513 The same values for @option{-mcpu=@var{cpu_type}} can be used for
18514 @option{-mtune=@var{cpu_type}}, but the only useful values are those
18515 that select a particular CPU implementation.  Those are @samp{cypress},
18516 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
18517 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
18518 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
18519 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
18520
18521 @item -mv8plus
18522 @itemx -mno-v8plus
18523 @opindex mv8plus
18524 @opindex mno-v8plus
18525 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
18526 difference from the V8 ABI is that the global and out registers are
18527 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
18528 mode for all SPARC-V9 processors.
18529
18530 @item -mvis
18531 @itemx -mno-vis
18532 @opindex mvis
18533 @opindex mno-vis
18534 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
18535 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
18536
18537 @item -mvis2
18538 @itemx -mno-vis2
18539 @opindex mvis2
18540 @opindex mno-vis2
18541 With @option{-mvis2}, GCC generates code that takes advantage of
18542 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
18543 default is @option{-mvis2} when targetting a cpu that supports such
18544 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
18545 also sets @option{-mvis}.
18546
18547 @item -mvis3
18548 @itemx -mno-vis3
18549 @opindex mvis3
18550 @opindex mno-vis3
18551 With @option{-mvis3}, GCC generates code that takes advantage of
18552 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
18553 default is @option{-mvis3} when targetting a cpu that supports such
18554 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
18555 also sets @option{-mvis2} and @option{-mvis}.
18556
18557 @item -mpopc
18558 @itemx -mno-popc
18559 @opindex mpopc
18560 @opindex mno-popc
18561 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
18562 population count instruction.  The default is @option{-mpopc}
18563 when targetting a cpu that supports such instructions, such as Niagara-2 and
18564 later.
18565
18566 @item -mfmaf
18567 @itemx -mno-fmaf
18568 @opindex mfmaf
18569 @opindex mno-fmaf
18570 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
18571 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
18572 when targetting a cpu that supports such instructions, such as Niagara-3 and
18573 later.
18574
18575 @item -mfix-at697f
18576 @opindex mfix-at697f
18577 Enable the documented workaround for the single erratum of the Atmel AT697F
18578 processor (which corresponds to erratum #13 of the AT697E processor).
18579 @end table
18580
18581 These @samp{-m} options are supported in addition to the above
18582 on SPARC-V9 processors in 64-bit environments:
18583
18584 @table @gcctabopt
18585 @item -mlittle-endian
18586 @opindex mlittle-endian
18587 Generate code for a processor running in little-endian mode.  It is only
18588 available for a few configurations and most notably not on Solaris and Linux.
18589
18590 @item -m32
18591 @itemx -m64
18592 @opindex m32
18593 @opindex m64
18594 Generate code for a 32-bit or 64-bit environment.
18595 The 32-bit environment sets int, long and pointer to 32 bits.
18596 The 64-bit environment sets int to 32 bits and long and pointer
18597 to 64 bits.
18598
18599 @item -mcmodel=@var{which}
18600 @opindex mcmodel
18601 Set the code model to one of
18602
18603 @table @samp
18604 @item medlow
18605 The Medium/Low code model: 64-bit addresses, programs
18606 must be linked in the low 32 bits of memory.  Programs can be statically
18607 or dynamically linked.
18608
18609 @item medmid
18610 The Medium/Middle code model: 64-bit addresses, programs
18611 must be linked in the low 44 bits of memory, the text and data segments must
18612 be less than 2GB in size and the data segment must be located within 2GB of
18613 the text segment.
18614
18615 @item medany
18616 The Medium/Anywhere code model: 64-bit addresses, programs
18617 may be linked anywhere in memory, the text and data segments must be less
18618 than 2GB in size and the data segment must be located within 2GB of the
18619 text segment.
18620
18621 @item embmedany
18622 The Medium/Anywhere code model for embedded systems:
18623 64-bit addresses, the text and data segments must be less than 2GB in
18624 size, both starting anywhere in memory (determined at link time).  The
18625 global register %g4 points to the base of the data segment.  Programs
18626 are statically linked and PIC is not supported.
18627 @end table
18628
18629 @item -mmemory-model=@var{mem-model}
18630 @opindex mmemory-model
18631 Set the memory model in force on the processor to one of
18632
18633 @table @samp
18634 @item default
18635 The default memory model for the processor and operating system.
18636
18637 @item rmo
18638 Relaxed Memory Order
18639
18640 @item pso
18641 Partial Store Order
18642
18643 @item tso
18644 Total Store Order
18645
18646 @item sc
18647 Sequential Consistency
18648 @end table
18649
18650 These memory models are formally defined in Appendix D of the Sparc V9
18651 architecture manual, as set in the processor's @code{PSTATE.MM} field.
18652
18653 @item -mstack-bias
18654 @itemx -mno-stack-bias
18655 @opindex mstack-bias
18656 @opindex mno-stack-bias
18657 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
18658 frame pointer if present, are offset by @minus{}2047 which must be added back
18659 when making stack frame references.  This is the default in 64-bit mode.
18660 Otherwise, assume no such offset is present.
18661 @end table
18662
18663 @node SPU Options
18664 @subsection SPU Options
18665 @cindex SPU options
18666
18667 These @samp{-m} options are supported on the SPU:
18668
18669 @table @gcctabopt
18670 @item -mwarn-reloc
18671 @itemx -merror-reloc
18672 @opindex mwarn-reloc
18673 @opindex merror-reloc
18674
18675 The loader for SPU does not handle dynamic relocations.  By default, GCC
18676 gives an error when it generates code that requires a dynamic
18677 relocation.  @option{-mno-error-reloc} disables the error,
18678 @option{-mwarn-reloc} generates a warning instead.
18679
18680 @item -msafe-dma
18681 @itemx -munsafe-dma
18682 @opindex msafe-dma
18683 @opindex munsafe-dma
18684
18685 Instructions that initiate or test completion of DMA must not be
18686 reordered with respect to loads and stores of the memory that is being
18687 accessed.
18688 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
18689 memory accesses, but that can lead to inefficient code in places where the
18690 memory is known to not change.  Rather than mark the memory as volatile,
18691 you can use @option{-msafe-dma} to tell the compiler to treat
18692 the DMA instructions as potentially affecting all memory.  
18693
18694 @item -mbranch-hints
18695 @opindex mbranch-hints
18696
18697 By default, GCC generates a branch hint instruction to avoid
18698 pipeline stalls for always-taken or probably-taken branches.  A hint
18699 is not generated closer than 8 instructions away from its branch.
18700 There is little reason to disable them, except for debugging purposes,
18701 or to make an object a little bit smaller.
18702
18703 @item -msmall-mem
18704 @itemx -mlarge-mem
18705 @opindex msmall-mem
18706 @opindex mlarge-mem
18707
18708 By default, GCC generates code assuming that addresses are never larger
18709 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
18710 a full 32-bit address.
18711
18712 @item -mstdmain
18713 @opindex mstdmain
18714
18715 By default, GCC links against startup code that assumes the SPU-style
18716 main function interface (which has an unconventional parameter list).
18717 With @option{-mstdmain}, GCC links your program against startup
18718 code that assumes a C99-style interface to @code{main}, including a
18719 local copy of @code{argv} strings.
18720
18721 @item -mfixed-range=@var{register-range}
18722 @opindex mfixed-range
18723 Generate code treating the given register range as fixed registers.
18724 A fixed register is one that the register allocator can not use.  This is
18725 useful when compiling kernel code.  A register range is specified as
18726 two registers separated by a dash.  Multiple register ranges can be
18727 specified separated by a comma.
18728
18729 @item -mea32
18730 @itemx -mea64
18731 @opindex mea32
18732 @opindex mea64
18733 Compile code assuming that pointers to the PPU address space accessed
18734 via the @code{__ea} named address space qualifier are either 32 or 64
18735 bits wide.  The default is 32 bits.  As this is an ABI changing option,
18736 all object code in an executable must be compiled with the same setting.
18737
18738 @item -maddress-space-conversion
18739 @itemx -mno-address-space-conversion
18740 @opindex maddress-space-conversion
18741 @opindex mno-address-space-conversion
18742 Allow/disallow treating the @code{__ea} address space as superset
18743 of the generic address space.  This enables explicit type casts
18744 between @code{__ea} and generic pointer as well as implicit
18745 conversions of generic pointers to @code{__ea} pointers.  The
18746 default is to allow address space pointer conversions.
18747
18748 @item -mcache-size=@var{cache-size}
18749 @opindex mcache-size
18750 This option controls the version of libgcc that the compiler links to an
18751 executable and selects a software-managed cache for accessing variables
18752 in the @code{__ea} address space with a particular cache size.  Possible
18753 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
18754 and @samp{128}.  The default cache size is 64KB.
18755
18756 @item -matomic-updates
18757 @itemx -mno-atomic-updates
18758 @opindex matomic-updates
18759 @opindex mno-atomic-updates
18760 This option controls the version of libgcc that the compiler links to an
18761 executable and selects whether atomic updates to the software-managed
18762 cache of PPU-side variables are used.  If you use atomic updates, changes
18763 to a PPU variable from SPU code using the @code{__ea} named address space
18764 qualifier do not interfere with changes to other PPU variables residing
18765 in the same cache line from PPU code.  If you do not use atomic updates,
18766 such interference may occur; however, writing back cache lines is
18767 more efficient.  The default behavior is to use atomic updates.
18768
18769 @item -mdual-nops
18770 @itemx -mdual-nops=@var{n}
18771 @opindex mdual-nops
18772 By default, GCC inserts nops to increase dual issue when it expects
18773 it to increase performance.  @var{n} can be a value from 0 to 10.  A
18774 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
18775 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
18776
18777 @item -mhint-max-nops=@var{n}
18778 @opindex mhint-max-nops
18779 Maximum number of nops to insert for a branch hint.  A branch hint must
18780 be at least 8 instructions away from the branch it is affecting.  GCC
18781 inserts up to @var{n} nops to enforce this, otherwise it does not
18782 generate the branch hint.
18783
18784 @item -mhint-max-distance=@var{n}
18785 @opindex mhint-max-distance
18786 The encoding of the branch hint instruction limits the hint to be within
18787 256 instructions of the branch it is affecting.  By default, GCC makes
18788 sure it is within 125.
18789
18790 @item -msafe-hints
18791 @opindex msafe-hints
18792 Work around a hardware bug that causes the SPU to stall indefinitely.
18793 By default, GCC inserts the @code{hbrp} instruction to make sure
18794 this stall won't happen.
18795
18796 @end table
18797
18798 @node System V Options
18799 @subsection Options for System V
18800
18801 These additional options are available on System V Release 4 for
18802 compatibility with other compilers on those systems:
18803
18804 @table @gcctabopt
18805 @item -G
18806 @opindex G
18807 Create a shared object.
18808 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
18809
18810 @item -Qy
18811 @opindex Qy
18812 Identify the versions of each tool used by the compiler, in a
18813 @code{.ident} assembler directive in the output.
18814
18815 @item -Qn
18816 @opindex Qn
18817 Refrain from adding @code{.ident} directives to the output file (this is
18818 the default).
18819
18820 @item -YP,@var{dirs}
18821 @opindex YP
18822 Search the directories @var{dirs}, and no others, for libraries
18823 specified with @option{-l}.
18824
18825 @item -Ym,@var{dir}
18826 @opindex Ym
18827 Look in the directory @var{dir} to find the M4 preprocessor.
18828 The assembler uses this option.
18829 @c This is supposed to go with a -Yd for predefined M4 macro files, but
18830 @c the generic assembler that comes with Solaris takes just -Ym.
18831 @end table
18832
18833 @node TILE-Gx Options
18834 @subsection TILE-Gx Options
18835 @cindex TILE-Gx options
18836
18837 These @samp{-m} options are supported on the TILE-Gx:
18838
18839 @table @gcctabopt
18840 @item -mcpu=@var{name}
18841 @opindex mcpu
18842 Selects the type of CPU to be targeted.  Currently the only supported
18843 type is @samp{tilegx}.
18844
18845 @item -m32
18846 @itemx -m64
18847 @opindex m32
18848 @opindex m64
18849 Generate code for a 32-bit or 64-bit environment.  The 32-bit
18850 environment sets int, long, and pointer to 32 bits.  The 64-bit
18851 environment sets int to 32 bits and long and pointer to 64 bits.
18852 @end table
18853
18854 @node TILEPro Options
18855 @subsection TILEPro Options
18856 @cindex TILEPro options
18857
18858 These @samp{-m} options are supported on the TILEPro:
18859
18860 @table @gcctabopt
18861 @item -mcpu=@var{name}
18862 @opindex mcpu
18863 Selects the type of CPU to be targeted.  Currently the only supported
18864 type is @samp{tilepro}.
18865
18866 @item -m32
18867 @opindex m32
18868 Generate code for a 32-bit environment, which sets int, long, and
18869 pointer to 32 bits.  This is the only supported behavior so the flag
18870 is essentially ignored.
18871 @end table
18872
18873 @node V850 Options
18874 @subsection V850 Options
18875 @cindex V850 Options
18876
18877 These @samp{-m} options are defined for V850 implementations:
18878
18879 @table @gcctabopt
18880 @item -mlong-calls
18881 @itemx -mno-long-calls
18882 @opindex mlong-calls
18883 @opindex mno-long-calls
18884 Treat all calls as being far away (near).  If calls are assumed to be
18885 far away, the compiler always loads the function's address into a
18886 register, and calls indirect through the pointer.
18887
18888 @item -mno-ep
18889 @itemx -mep
18890 @opindex mno-ep
18891 @opindex mep
18892 Do not optimize (do optimize) basic blocks that use the same index
18893 pointer 4 or more times to copy pointer into the @code{ep} register, and
18894 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
18895 option is on by default if you optimize.
18896
18897 @item -mno-prolog-function
18898 @itemx -mprolog-function
18899 @opindex mno-prolog-function
18900 @opindex mprolog-function
18901 Do not use (do use) external functions to save and restore registers
18902 at the prologue and epilogue of a function.  The external functions
18903 are slower, but use less code space if more than one function saves
18904 the same number of registers.  The @option{-mprolog-function} option
18905 is on by default if you optimize.
18906
18907 @item -mspace
18908 @opindex mspace
18909 Try to make the code as small as possible.  At present, this just turns
18910 on the @option{-mep} and @option{-mprolog-function} options.
18911
18912 @item -mtda=@var{n}
18913 @opindex mtda
18914 Put static or global variables whose size is @var{n} bytes or less into
18915 the tiny data area that register @code{ep} points to.  The tiny data
18916 area can hold up to 256 bytes in total (128 bytes for byte references).
18917
18918 @item -msda=@var{n}
18919 @opindex msda
18920 Put static or global variables whose size is @var{n} bytes or less into
18921 the small data area that register @code{gp} points to.  The small data
18922 area can hold up to 64 kilobytes.
18923
18924 @item -mzda=@var{n}
18925 @opindex mzda
18926 Put static or global variables whose size is @var{n} bytes or less into
18927 the first 32 kilobytes of memory.
18928
18929 @item -mv850
18930 @opindex mv850
18931 Specify that the target processor is the V850.
18932
18933 @item -mbig-switch
18934 @opindex mbig-switch
18935 Generate code suitable for big switch tables.  Use this option only if
18936 the assembler/linker complain about out of range branches within a switch
18937 table.
18938
18939 @item -mapp-regs
18940 @opindex mapp-regs
18941 This option causes r2 and r5 to be used in the code generated by
18942 the compiler.  This setting is the default.
18943
18944 @item -mno-app-regs
18945 @opindex mno-app-regs
18946 This option causes r2 and r5 to be treated as fixed registers.
18947
18948 @item -mv850e2v3
18949 @opindex mv850e2v3
18950 Specify that the target processor is the V850E2V3.  The preprocessor
18951 constant @samp{__v850e2v3__} is defined if
18952 this option is used.
18953
18954 @item -mv850e2
18955 @opindex mv850e2
18956 Specify that the target processor is the V850E2.  The preprocessor
18957 constant @samp{__v850e2__} is defined if this option is used.
18958
18959 @item -mv850e1
18960 @opindex mv850e1
18961 Specify that the target processor is the V850E1.  The preprocessor
18962 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
18963 this option is used.
18964
18965 @item -mv850es
18966 @opindex mv850es
18967 Specify that the target processor is the V850ES.  This is an alias for
18968 the @option{-mv850e1} option.
18969
18970 @item -mv850e
18971 @opindex mv850e
18972 Specify that the target processor is the V850E@.  The preprocessor
18973 constant @samp{__v850e__} is defined if this option is used.
18974
18975 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
18976 nor @option{-mv850e2} nor @option{-mv850e2v3}
18977 are defined then a default target processor is chosen and the
18978 relevant @samp{__v850*__} preprocessor constant is defined.
18979
18980 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
18981 defined, regardless of which processor variant is the target.
18982
18983 @item -mdisable-callt
18984 @opindex mdisable-callt
18985 This option suppresses generation of the @code{CALLT} instruction for the
18986 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
18987 @option{-mno-disable-callt} which allows the @code{CALLT} instruction to be used.
18988
18989 @end table
18990
18991 @node VAX Options
18992 @subsection VAX Options
18993 @cindex VAX options
18994
18995 These @samp{-m} options are defined for the VAX:
18996
18997 @table @gcctabopt
18998 @item -munix
18999 @opindex munix
19000 Do not output certain jump instructions (@code{aobleq} and so on)
19001 that the Unix assembler for the VAX cannot handle across long
19002 ranges.
19003
19004 @item -mgnu
19005 @opindex mgnu
19006 Do output those jump instructions, on the assumption that the
19007 GNU assembler is being used.
19008
19009 @item -mg
19010 @opindex mg
19011 Output code for G-format floating-point numbers instead of D-format.
19012 @end table
19013
19014 @node VMS Options
19015 @subsection VMS Options
19016
19017 These @samp{-m} options are defined for the VMS implementations:
19018
19019 @table @gcctabopt
19020 @item -mvms-return-codes
19021 @opindex mvms-return-codes
19022 Return VMS condition codes from @code{main}. The default is to return POSIX-style
19023 condition (e.g.@ error) codes.
19024
19025 @item -mdebug-main=@var{prefix}
19026 @opindex mdebug-main=@var{prefix}
19027 Flag the first routine whose name starts with @var{prefix} as the main
19028 routine for the debugger.
19029
19030 @item -mmalloc64
19031 @opindex mmalloc64
19032 Default to 64-bit memory allocation routines.
19033
19034 @item -mpointer-size=@var{size}
19035 @opindex -mpointer-size=@var{size}
19036 Set the default size of pointers. Possible options for @var{size} are
19037 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
19038 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
19039 The later option disables @code{pragma pointer_size}.
19040 @end table
19041
19042 @node VxWorks Options
19043 @subsection VxWorks Options
19044 @cindex VxWorks Options
19045
19046 The options in this section are defined for all VxWorks targets.
19047 Options specific to the target hardware are listed with the other
19048 options for that target.
19049
19050 @table @gcctabopt
19051 @item -mrtp
19052 @opindex mrtp
19053 GCC can generate code for both VxWorks kernels and real time processes
19054 (RTPs).  This option switches from the former to the latter.  It also
19055 defines the preprocessor macro @code{__RTP__}.
19056
19057 @item -non-static
19058 @opindex non-static
19059 Link an RTP executable against shared libraries rather than static
19060 libraries.  The options @option{-static} and @option{-shared} can
19061 also be used for RTPs (@pxref{Link Options}); @option{-static}
19062 is the default.
19063
19064 @item -Bstatic
19065 @itemx -Bdynamic
19066 @opindex Bstatic
19067 @opindex Bdynamic
19068 These options are passed down to the linker.  They are defined for
19069 compatibility with Diab.
19070
19071 @item -Xbind-lazy
19072 @opindex Xbind-lazy
19073 Enable lazy binding of function calls.  This option is equivalent to
19074 @option{-Wl,-z,now} and is defined for compatibility with Diab.
19075
19076 @item -Xbind-now
19077 @opindex Xbind-now
19078 Disable lazy binding of function calls.  This option is the default and
19079 is defined for compatibility with Diab.
19080 @end table
19081
19082 @node x86-64 Options
19083 @subsection x86-64 Options
19084 @cindex x86-64 options
19085
19086 These are listed under @xref{i386 and x86-64 Options}.
19087
19088 @node Xstormy16 Options
19089 @subsection Xstormy16 Options
19090 @cindex Xstormy16 Options
19091
19092 These options are defined for Xstormy16:
19093
19094 @table @gcctabopt
19095 @item -msim
19096 @opindex msim
19097 Choose startup files and linker script suitable for the simulator.
19098 @end table
19099
19100 @node Xtensa Options
19101 @subsection Xtensa Options
19102 @cindex Xtensa Options
19103
19104 These options are supported for Xtensa targets:
19105
19106 @table @gcctabopt
19107 @item -mconst16
19108 @itemx -mno-const16
19109 @opindex mconst16
19110 @opindex mno-const16
19111 Enable or disable use of @code{CONST16} instructions for loading
19112 constant values.  The @code{CONST16} instruction is currently not a
19113 standard option from Tensilica.  When enabled, @code{CONST16}
19114 instructions are always used in place of the standard @code{L32R}
19115 instructions.  The use of @code{CONST16} is enabled by default only if
19116 the @code{L32R} instruction is not available.
19117
19118 @item -mfused-madd
19119 @itemx -mno-fused-madd
19120 @opindex mfused-madd
19121 @opindex mno-fused-madd
19122 Enable or disable use of fused multiply/add and multiply/subtract
19123 instructions in the floating-point option.  This has no effect if the
19124 floating-point option is not also enabled.  Disabling fused multiply/add
19125 and multiply/subtract instructions forces the compiler to use separate
19126 instructions for the multiply and add/subtract operations.  This may be
19127 desirable in some cases where strict IEEE 754-compliant results are
19128 required: the fused multiply add/subtract instructions do not round the
19129 intermediate result, thereby producing results with @emph{more} bits of
19130 precision than specified by the IEEE standard.  Disabling fused multiply
19131 add/subtract instructions also ensures that the program output is not
19132 sensitive to the compiler's ability to combine multiply and add/subtract
19133 operations.
19134
19135 @item -mserialize-volatile
19136 @itemx -mno-serialize-volatile
19137 @opindex mserialize-volatile
19138 @opindex mno-serialize-volatile
19139 When this option is enabled, GCC inserts @code{MEMW} instructions before
19140 @code{volatile} memory references to guarantee sequential consistency.
19141 The default is @option{-mserialize-volatile}.  Use
19142 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
19143
19144 @item -mforce-no-pic
19145 @opindex mforce-no-pic
19146 For targets, like GNU/Linux, where all user-mode Xtensa code must be
19147 position-independent code (PIC), this option disables PIC for compiling
19148 kernel code.
19149
19150 @item -mtext-section-literals
19151 @itemx -mno-text-section-literals
19152 @opindex mtext-section-literals
19153 @opindex mno-text-section-literals
19154 Control the treatment of literal pools.  The default is
19155 @option{-mno-text-section-literals}, which places literals in a separate
19156 section in the output file.  This allows the literal pool to be placed
19157 in a data RAM/ROM, and it also allows the linker to combine literal
19158 pools from separate object files to remove redundant literals and
19159 improve code size.  With @option{-mtext-section-literals}, the literals
19160 are interspersed in the text section in order to keep them as close as
19161 possible to their references.  This may be necessary for large assembly
19162 files.
19163
19164 @item -mtarget-align
19165 @itemx -mno-target-align
19166 @opindex mtarget-align
19167 @opindex mno-target-align
19168 When this option is enabled, GCC instructs the assembler to
19169 automatically align instructions to reduce branch penalties at the
19170 expense of some code density.  The assembler attempts to widen density
19171 instructions to align branch targets and the instructions following call
19172 instructions.  If there are not enough preceding safe density
19173 instructions to align a target, no widening is performed.  The
19174 default is @option{-mtarget-align}.  These options do not affect the
19175 treatment of auto-aligned instructions like @code{LOOP}, which the
19176 assembler always aligns, either by widening density instructions or
19177 by inserting NOP instructions.
19178
19179 @item -mlongcalls
19180 @itemx -mno-longcalls
19181 @opindex mlongcalls
19182 @opindex mno-longcalls
19183 When this option is enabled, GCC instructs the assembler to translate
19184 direct calls to indirect calls unless it can determine that the target
19185 of a direct call is in the range allowed by the call instruction.  This
19186 translation typically occurs for calls to functions in other source
19187 files.  Specifically, the assembler translates a direct @code{CALL}
19188 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
19189 The default is @option{-mno-longcalls}.  This option should be used in
19190 programs where the call target can potentially be out of range.  This
19191 option is implemented in the assembler, not the compiler, so the
19192 assembly code generated by GCC still shows direct call
19193 instructions---look at the disassembled object code to see the actual
19194 instructions.  Note that the assembler uses an indirect call for
19195 every cross-file call, not just those that really are out of range.
19196 @end table
19197
19198 @node zSeries Options
19199 @subsection zSeries Options
19200 @cindex zSeries options
19201
19202 These are listed under @xref{S/390 and zSeries Options}.
19203
19204 @node Code Gen Options
19205 @section Options for Code Generation Conventions
19206 @cindex code generation conventions
19207 @cindex options, code generation
19208 @cindex run-time options
19209
19210 These machine-independent options control the interface conventions
19211 used in code generation.
19212
19213 Most of them have both positive and negative forms; the negative form
19214 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
19215 one of the forms is listed---the one that is not the default.  You
19216 can figure out the other form by either removing @samp{no-} or adding
19217 it.
19218
19219 @table @gcctabopt
19220 @item -fbounds-check
19221 @opindex fbounds-check
19222 For front ends that support it, generate additional code to check that
19223 indices used to access arrays are within the declared range.  This is
19224 currently only supported by the Java and Fortran front ends, where
19225 this option defaults to true and false respectively.
19226
19227 @item -ftrapv
19228 @opindex ftrapv
19229 This option generates traps for signed overflow on addition, subtraction,
19230 multiplication operations.
19231
19232 @item -fwrapv
19233 @opindex fwrapv
19234 This option instructs the compiler to assume that signed arithmetic
19235 overflow of addition, subtraction and multiplication wraps around
19236 using twos-complement representation.  This flag enables some optimizations
19237 and disables others.  This option is enabled by default for the Java
19238 front end, as required by the Java language specification.
19239
19240 @item -fexceptions
19241 @opindex fexceptions
19242 Enable exception handling.  Generates extra code needed to propagate
19243 exceptions.  For some targets, this implies GCC generates frame
19244 unwind information for all functions, which can produce significant data
19245 size overhead, although it does not affect execution.  If you do not
19246 specify this option, GCC enables it by default for languages like
19247 C++ that normally require exception handling, and disables it for
19248 languages like C that do not normally require it.  However, you may need
19249 to enable this option when compiling C code that needs to interoperate
19250 properly with exception handlers written in C++.  You may also wish to
19251 disable this option if you are compiling older C++ programs that don't
19252 use exception handling.
19253
19254 @item -fnon-call-exceptions
19255 @opindex fnon-call-exceptions
19256 Generate code that allows trapping instructions to throw exceptions.
19257 Note that this requires platform-specific runtime support that does
19258 not exist everywhere.  Moreover, it only allows @emph{trapping}
19259 instructions to throw exceptions, i.e.@: memory references or floating-point
19260 instructions.  It does not allow exceptions to be thrown from
19261 arbitrary signal handlers such as @code{SIGALRM}.
19262
19263 @item -funwind-tables
19264 @opindex funwind-tables
19265 Similar to @option{-fexceptions}, except that it just generates any needed
19266 static data, but does not affect the generated code in any other way.
19267 You normally do not need to enable this option; instead, a language processor
19268 that needs this handling enables it on your behalf.
19269
19270 @item -fasynchronous-unwind-tables
19271 @opindex fasynchronous-unwind-tables
19272 Generate unwind table in DWARF 2 format, if supported by target machine.  The
19273 table is exact at each instruction boundary, so it can be used for stack
19274 unwinding from asynchronous events (such as debugger or garbage collector).
19275
19276 @item -fpcc-struct-return
19277 @opindex fpcc-struct-return
19278 Return ``short'' @code{struct} and @code{union} values in memory like
19279 longer ones, rather than in registers.  This convention is less
19280 efficient, but it has the advantage of allowing intercallability between
19281 GCC-compiled files and files compiled with other compilers, particularly
19282 the Portable C Compiler (pcc).
19283
19284 The precise convention for returning structures in memory depends
19285 on the target configuration macros.
19286
19287 Short structures and unions are those whose size and alignment match
19288 that of some integer type.
19289
19290 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
19291 switch is not binary compatible with code compiled with the
19292 @option{-freg-struct-return} switch.
19293 Use it to conform to a non-default application binary interface.
19294
19295 @item -freg-struct-return
19296 @opindex freg-struct-return
19297 Return @code{struct} and @code{union} values in registers when possible.
19298 This is more efficient for small structures than
19299 @option{-fpcc-struct-return}.
19300
19301 If you specify neither @option{-fpcc-struct-return} nor
19302 @option{-freg-struct-return}, GCC defaults to whichever convention is
19303 standard for the target.  If there is no standard convention, GCC
19304 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
19305 the principal compiler.  In those cases, we can choose the standard, and
19306 we chose the more efficient register return alternative.
19307
19308 @strong{Warning:} code compiled with the @option{-freg-struct-return}
19309 switch is not binary compatible with code compiled with the
19310 @option{-fpcc-struct-return} switch.
19311 Use it to conform to a non-default application binary interface.
19312
19313 @item -fshort-enums
19314 @opindex fshort-enums
19315 Allocate to an @code{enum} type only as many bytes as it needs for the
19316 declared range of possible values.  Specifically, the @code{enum} type
19317 is equivalent to the smallest integer type that has enough room.
19318
19319 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
19320 code that is not binary compatible with code generated without that switch.
19321 Use it to conform to a non-default application binary interface.
19322
19323 @item -fshort-double
19324 @opindex fshort-double
19325 Use the same size for @code{double} as for @code{float}.
19326
19327 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
19328 code that is not binary compatible with code generated without that switch.
19329 Use it to conform to a non-default application binary interface.
19330
19331 @item -fshort-wchar
19332 @opindex fshort-wchar
19333 Override the underlying type for @samp{wchar_t} to be @samp{short
19334 unsigned int} instead of the default for the target.  This option is
19335 useful for building programs to run under WINE@.
19336
19337 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
19338 code that is not binary compatible with code generated without that switch.
19339 Use it to conform to a non-default application binary interface.
19340
19341 @item -fno-common
19342 @opindex fno-common
19343 In C code, controls the placement of uninitialized global variables.
19344 Unix C compilers have traditionally permitted multiple definitions of
19345 such variables in different compilation units by placing the variables
19346 in a common block.
19347 This is the behavior specified by @option{-fcommon}, and is the default
19348 for GCC on most targets.
19349 On the other hand, this behavior is not required by ISO C, and on some
19350 targets may carry a speed or code size penalty on variable references.
19351 The @option{-fno-common} option specifies that the compiler should place
19352 uninitialized global variables in the data section of the object file,
19353 rather than generating them as common blocks.
19354 This has the effect that if the same variable is declared
19355 (without @code{extern}) in two different compilations,
19356 you get a multiple-definition error when you link them.
19357 In this case, you must compile with @option{-fcommon} instead.
19358 Compiling with @option{-fno-common} is useful on targets for which
19359 it provides better performance, or if you wish to verify that the
19360 program will work on other systems that always treat uninitialized
19361 variable declarations this way.
19362
19363 @item -fno-ident
19364 @opindex fno-ident
19365 Ignore the @samp{#ident} directive.
19366
19367 @item -finhibit-size-directive
19368 @opindex finhibit-size-directive
19369 Don't output a @code{.size} assembler directive, or anything else that
19370 would cause trouble if the function is split in the middle, and the
19371 two halves are placed at locations far apart in memory.  This option is
19372 used when compiling @file{crtstuff.c}; you should not need to use it
19373 for anything else.
19374
19375 @item -fverbose-asm
19376 @opindex fverbose-asm
19377 Put extra commentary information in the generated assembly code to
19378 make it more readable.  This option is generally only of use to those
19379 who actually need to read the generated assembly code (perhaps while
19380 debugging the compiler itself).
19381
19382 @option{-fno-verbose-asm}, the default, causes the
19383 extra information to be omitted and is useful when comparing two assembler
19384 files.
19385
19386 @item -frecord-gcc-switches
19387 @opindex frecord-gcc-switches
19388 This switch causes the command line used to invoke the
19389 compiler to be recorded into the object file that is being created.
19390 This switch is only implemented on some targets and the exact format
19391 of the recording is target and binary file format dependent, but it
19392 usually takes the form of a section containing ASCII text.  This
19393 switch is related to the @option{-fverbose-asm} switch, but that
19394 switch only records information in the assembler output file as
19395 comments, so it never reaches the object file.
19396 See also @option{-grecord-gcc-switches} for another
19397 way of storing compiler options into the object file.
19398
19399 @item -fpic
19400 @opindex fpic
19401 @cindex global offset table
19402 @cindex PIC
19403 Generate position-independent code (PIC) suitable for use in a shared
19404 library, if supported for the target machine.  Such code accesses all
19405 constant addresses through a global offset table (GOT)@.  The dynamic
19406 loader resolves the GOT entries when the program starts (the dynamic
19407 loader is not part of GCC; it is part of the operating system).  If
19408 the GOT size for the linked executable exceeds a machine-specific
19409 maximum size, you get an error message from the linker indicating that
19410 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
19411 instead.  (These maximums are 8k on the SPARC and 32k
19412 on the m68k and RS/6000.  The 386 has no such limit.)
19413
19414 Position-independent code requires special support, and therefore works
19415 only on certain machines.  For the 386, GCC supports PIC for System V
19416 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
19417 position-independent.
19418
19419 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
19420 are defined to 1.
19421
19422 @item -fPIC
19423 @opindex fPIC
19424 If supported for the target machine, emit position-independent code,
19425 suitable for dynamic linking and avoiding any limit on the size of the
19426 global offset table.  This option makes a difference on the m68k,
19427 PowerPC and SPARC@.
19428
19429 Position-independent code requires special support, and therefore works
19430 only on certain machines.
19431
19432 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
19433 are defined to 2.
19434
19435 @item -fpie
19436 @itemx -fPIE
19437 @opindex fpie
19438 @opindex fPIE
19439 These options are similar to @option{-fpic} and @option{-fPIC}, but
19440 generated position independent code can be only linked into executables.
19441 Usually these options are used when @option{-pie} GCC option is
19442 used during linking.
19443
19444 @option{-fpie} and @option{-fPIE} both define the macros
19445 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
19446 for @option{-fpie} and 2 for @option{-fPIE}.
19447
19448 @item -fno-jump-tables
19449 @opindex fno-jump-tables
19450 Do not use jump tables for switch statements even where it would be
19451 more efficient than other code generation strategies.  This option is
19452 of use in conjunction with @option{-fpic} or @option{-fPIC} for
19453 building code that forms part of a dynamic linker and cannot
19454 reference the address of a jump table.  On some targets, jump tables
19455 do not require a GOT and this option is not needed.
19456
19457 @item -ffixed-@var{reg}
19458 @opindex ffixed
19459 Treat the register named @var{reg} as a fixed register; generated code
19460 should never refer to it (except perhaps as a stack pointer, frame
19461 pointer or in some other fixed role).
19462
19463 @var{reg} must be the name of a register.  The register names accepted
19464 are machine-specific and are defined in the @code{REGISTER_NAMES}
19465 macro in the machine description macro file.
19466
19467 This flag does not have a negative form, because it specifies a
19468 three-way choice.
19469
19470 @item -fcall-used-@var{reg}
19471 @opindex fcall-used
19472 Treat the register named @var{reg} as an allocable register that is
19473 clobbered by function calls.  It may be allocated for temporaries or
19474 variables that do not live across a call.  Functions compiled this way
19475 do not save and restore the register @var{reg}.
19476
19477 It is an error to use this flag with the frame pointer or stack pointer.
19478 Use of this flag for other registers that have fixed pervasive roles in
19479 the machine's execution model produces disastrous results.
19480
19481 This flag does not have a negative form, because it specifies a
19482 three-way choice.
19483
19484 @item -fcall-saved-@var{reg}
19485 @opindex fcall-saved
19486 Treat the register named @var{reg} as an allocable register saved by
19487 functions.  It may be allocated even for temporaries or variables that
19488 live across a call.  Functions compiled this way save and restore
19489 the register @var{reg} if they use it.
19490
19491 It is an error to use this flag with the frame pointer or stack pointer.
19492 Use of this flag for other registers that have fixed pervasive roles in
19493 the machine's execution model produces disastrous results.
19494
19495 A different sort of disaster results from the use of this flag for
19496 a register in which function values may be returned.
19497
19498 This flag does not have a negative form, because it specifies a
19499 three-way choice.
19500
19501 @item -fpack-struct[=@var{n}]
19502 @opindex fpack-struct
19503 Without a value specified, pack all structure members together without
19504 holes.  When a value is specified (which must be a small power of two), pack
19505 structure members according to this value, representing the maximum
19506 alignment (that is, objects with default alignment requirements larger than
19507 this are output potentially unaligned at the next fitting location.
19508
19509 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
19510 code that is not binary compatible with code generated without that switch.
19511 Additionally, it makes the code suboptimal.
19512 Use it to conform to a non-default application binary interface.
19513
19514 @item -finstrument-functions
19515 @opindex finstrument-functions
19516 Generate instrumentation calls for entry and exit to functions.  Just
19517 after function entry and just before function exit, the following
19518 profiling functions are called with the address of the current
19519 function and its call site.  (On some platforms,
19520 @code{__builtin_return_address} does not work beyond the current
19521 function, so the call site information may not be available to the
19522 profiling functions otherwise.)
19523
19524 @smallexample
19525 void __cyg_profile_func_enter (void *this_fn,
19526                                void *call_site);
19527 void __cyg_profile_func_exit  (void *this_fn,
19528                                void *call_site);
19529 @end smallexample
19530
19531 The first argument is the address of the start of the current function,
19532 which may be looked up exactly in the symbol table.
19533
19534 This instrumentation is also done for functions expanded inline in other
19535 functions.  The profiling calls indicate where, conceptually, the
19536 inline function is entered and exited.  This means that addressable
19537 versions of such functions must be available.  If all your uses of a
19538 function are expanded inline, this may mean an additional expansion of
19539 code size.  If you use @samp{extern inline} in your C code, an
19540 addressable version of such functions must be provided.  (This is
19541 normally the case anyway, but if you get lucky and the optimizer always
19542 expands the functions inline, you might have gotten away without
19543 providing static copies.)
19544
19545 A function may be given the attribute @code{no_instrument_function}, in
19546 which case this instrumentation is not done.  This can be used, for
19547 example, for the profiling functions listed above, high-priority
19548 interrupt routines, and any functions from which the profiling functions
19549 cannot safely be called (perhaps signal handlers, if the profiling
19550 routines generate output or allocate memory).
19551
19552 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
19553 @opindex finstrument-functions-exclude-file-list
19554
19555 Set the list of functions that are excluded from instrumentation (see
19556 the description of @code{-finstrument-functions}).  If the file that
19557 contains a function definition matches with one of @var{file}, then
19558 that function is not instrumented.  The match is done on substrings:
19559 if the @var{file} parameter is a substring of the file name, it is
19560 considered to be a match.
19561
19562 For example:
19563
19564 @smallexample
19565 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
19566 @end smallexample
19567
19568 @noindent
19569 excludes any inline function defined in files whose pathnames
19570 contain @code{/bits/stl} or @code{include/sys}.
19571
19572 If, for some reason, you want to include letter @code{','} in one of
19573 @var{sym}, write @code{'\,'}. For example,
19574 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
19575 (note the single quote surrounding the option).
19576
19577 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
19578 @opindex finstrument-functions-exclude-function-list
19579
19580 This is similar to @code{-finstrument-functions-exclude-file-list},
19581 but this option sets the list of function names to be excluded from
19582 instrumentation.  The function name to be matched is its user-visible
19583 name, such as @code{vector<int> blah(const vector<int> &)}, not the
19584 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
19585 match is done on substrings: if the @var{sym} parameter is a substring
19586 of the function name, it is considered to be a match.  For C99 and C++
19587 extended identifiers, the function name must be given in UTF-8, not
19588 using universal character names.
19589
19590 @item -fstack-check
19591 @opindex fstack-check
19592 Generate code to verify that you do not go beyond the boundary of the
19593 stack.  You should specify this flag if you are running in an
19594 environment with multiple threads, but only rarely need to specify it in
19595 a single-threaded environment since stack overflow is automatically
19596 detected on nearly all systems if there is only one stack.
19597
19598 Note that this switch does not actually cause checking to be done; the
19599 operating system or the language runtime must do that.  The switch causes
19600 generation of code to ensure that they see the stack being extended.
19601
19602 You can additionally specify a string parameter: @code{no} means no
19603 checking, @code{generic} means force the use of old-style checking,
19604 @code{specific} means use the best checking method and is equivalent
19605 to bare @option{-fstack-check}.
19606
19607 Old-style checking is a generic mechanism that requires no specific
19608 target support in the compiler but comes with the following drawbacks:
19609
19610 @enumerate
19611 @item
19612 Modified allocation strategy for large objects: they are always
19613 allocated dynamically if their size exceeds a fixed threshold.
19614
19615 @item
19616 Fixed limit on the size of the static frame of functions: when it is
19617 topped by a particular function, stack checking is not reliable and
19618 a warning is issued by the compiler.
19619
19620 @item
19621 Inefficiency: because of both the modified allocation strategy and the
19622 generic implementation, the performances of the code are hampered.
19623 @end enumerate
19624
19625 Note that old-style stack checking is also the fallback method for
19626 @code{specific} if no target support has been added in the compiler.
19627
19628 @item -fstack-limit-register=@var{reg}
19629 @itemx -fstack-limit-symbol=@var{sym}
19630 @itemx -fno-stack-limit
19631 @opindex fstack-limit-register
19632 @opindex fstack-limit-symbol
19633 @opindex fno-stack-limit
19634 Generate code to ensure that the stack does not grow beyond a certain value,
19635 either the value of a register or the address of a symbol.  If a larger
19636 stack is required, a signal is raised at run time.  For most targets,
19637 the signal is raised before the stack overruns the boundary, so
19638 it is possible to catch the signal without taking special precautions.
19639
19640 For instance, if the stack starts at absolute address @samp{0x80000000}
19641 and grows downwards, you can use the flags
19642 @option{-fstack-limit-symbol=__stack_limit} and
19643 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
19644 of 128KB@.  Note that this may only work with the GNU linker.
19645
19646 @item -fsplit-stack
19647 @opindex fsplit-stack
19648 Generate code to automatically split the stack before it overflows.
19649 The resulting program has a discontiguous stack which can only
19650 overflow if the program is unable to allocate any more memory.  This
19651 is most useful when running threaded programs, as it is no longer
19652 necessary to calculate a good stack size to use for each thread.  This
19653 is currently only implemented for the i386 and x86_64 back ends running
19654 GNU/Linux.
19655
19656 When code compiled with @option{-fsplit-stack} calls code compiled
19657 without @option{-fsplit-stack}, there may not be much stack space
19658 available for the latter code to run.  If compiling all code,
19659 including library code, with @option{-fsplit-stack} is not an option,
19660 then the linker can fix up these calls so that the code compiled
19661 without @option{-fsplit-stack} always has a large stack.  Support for
19662 this is implemented in the gold linker in GNU binutils release 2.21
19663 and later.
19664
19665 @item -fleading-underscore
19666 @opindex fleading-underscore
19667 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
19668 change the way C symbols are represented in the object file.  One use
19669 is to help link with legacy assembly code.
19670
19671 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
19672 generate code that is not binary compatible with code generated without that
19673 switch.  Use it to conform to a non-default application binary interface.
19674 Not all targets provide complete support for this switch.
19675
19676 @item -ftls-model=@var{model}
19677 @opindex ftls-model
19678 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
19679 The @var{model} argument should be one of @code{global-dynamic},
19680 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
19681
19682 The default without @option{-fpic} is @code{initial-exec}; with
19683 @option{-fpic} the default is @code{global-dynamic}.
19684
19685 @item -fvisibility=@var{default|internal|hidden|protected}
19686 @opindex fvisibility
19687 Set the default ELF image symbol visibility to the specified option---all
19688 symbols are marked with this unless overridden within the code.
19689 Using this feature can very substantially improve linking and
19690 load times of shared object libraries, produce more optimized
19691 code, provide near-perfect API export and prevent symbol clashes.
19692 It is @strong{strongly} recommended that you use this in any shared objects
19693 you distribute.
19694
19695 Despite the nomenclature, @code{default} always means public; i.e.,
19696 available to be linked against from outside the shared object.
19697 @code{protected} and @code{internal} are pretty useless in real-world
19698 usage so the only other commonly used option is @code{hidden}.
19699 The default if @option{-fvisibility} isn't specified is
19700 @code{default}, i.e., make every
19701 symbol public---this causes the same behavior as previous versions of
19702 GCC@.
19703
19704 A good explanation of the benefits offered by ensuring ELF
19705 symbols have the correct visibility is given by ``How To Write
19706 Shared Libraries'' by Ulrich Drepper (which can be found at
19707 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
19708 solution made possible by this option to marking things hidden when
19709 the default is public is to make the default hidden and mark things
19710 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
19711 and @code{__attribute__ ((visibility("default")))} instead of
19712 @code{__declspec(dllexport)} you get almost identical semantics with
19713 identical syntax.  This is a great boon to those working with
19714 cross-platform projects.
19715
19716 For those adding visibility support to existing code, you may find
19717 @samp{#pragma GCC visibility} of use.  This works by you enclosing
19718 the declarations you wish to set visibility for with (for example)
19719 @samp{#pragma GCC visibility push(hidden)} and
19720 @samp{#pragma GCC visibility pop}.
19721 Bear in mind that symbol visibility should be viewed @strong{as
19722 part of the API interface contract} and thus all new code should
19723 always specify visibility when it is not the default; i.e., declarations
19724 only for use within the local DSO should @strong{always} be marked explicitly
19725 as hidden as so to avoid PLT indirection overheads---making this
19726 abundantly clear also aids readability and self-documentation of the code.
19727 Note that due to ISO C++ specification requirements, @code{operator new} and
19728 @code{operator delete} must always be of default visibility.
19729
19730 Be aware that headers from outside your project, in particular system
19731 headers and headers from any other library you use, may not be
19732 expecting to be compiled with visibility other than the default.  You
19733 may need to explicitly say @samp{#pragma GCC visibility push(default)}
19734 before including any such headers.
19735
19736 @samp{extern} declarations are not affected by @option{-fvisibility}, so
19737 a lot of code can be recompiled with @option{-fvisibility=hidden} with
19738 no modifications.  However, this means that calls to @code{extern}
19739 functions with no explicit visibility use the PLT, so it is more
19740 effective to use @code{__attribute ((visibility))} and/or
19741 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
19742 declarations should be treated as hidden.
19743
19744 Note that @option{-fvisibility} does affect C++ vague linkage
19745 entities. This means that, for instance, an exception class that is
19746 be thrown between DSOs must be explicitly marked with default
19747 visibility so that the @samp{type_info} nodes are unified between
19748 the DSOs.
19749
19750 An overview of these techniques, their benefits and how to use them
19751 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
19752
19753 @item -fstrict-volatile-bitfields
19754 @opindex fstrict-volatile-bitfields
19755 This option should be used if accesses to volatile bit-fields (or other
19756 structure fields, although the compiler usually honors those types
19757 anyway) should use a single access of the width of the
19758 field's type, aligned to a natural alignment if possible.  For
19759 example, targets with memory-mapped peripheral registers might require
19760 all such accesses to be 16 bits wide; with this flag the user could
19761 declare all peripheral bit-fields as @code{unsigned short} (assuming short
19762 is 16 bits on these targets) to force GCC to use 16-bit accesses
19763 instead of, perhaps, a more efficient 32-bit access.
19764
19765 If this option is disabled, the compiler uses the most efficient
19766 instruction.  In the previous example, that might be a 32-bit load
19767 instruction, even though that accesses bytes that do not contain
19768 any portion of the bit-field, or memory-mapped registers unrelated to
19769 the one being updated.
19770
19771 If the target requires strict alignment, and honoring the field
19772 type would require violating this alignment, a warning is issued.
19773 If the field has @code{packed} attribute, the access is done without
19774 honoring the field type.  If the field doesn't have @code{packed}
19775 attribute, the access is done honoring the field type.  In both cases,
19776 GCC assumes that the user knows something about the target hardware
19777 that it is unaware of.
19778
19779 The default value of this option is determined by the application binary
19780 interface for the target processor.
19781
19782 @end table
19783
19784 @c man end
19785
19786 @node Environment Variables
19787 @section Environment Variables Affecting GCC
19788 @cindex environment variables
19789
19790 @c man begin ENVIRONMENT
19791 This section describes several environment variables that affect how GCC
19792 operates.  Some of them work by specifying directories or prefixes to use
19793 when searching for various kinds of files.  Some are used to specify other
19794 aspects of the compilation environment.
19795
19796 Note that you can also specify places to search using options such as
19797 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
19798 take precedence over places specified using environment variables, which
19799 in turn take precedence over those specified by the configuration of GCC@.
19800 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
19801 GNU Compiler Collection (GCC) Internals}.
19802
19803 @table @env
19804 @item LANG
19805 @itemx LC_CTYPE
19806 @c @itemx LC_COLLATE
19807 @itemx LC_MESSAGES
19808 @c @itemx LC_MONETARY
19809 @c @itemx LC_NUMERIC
19810 @c @itemx LC_TIME
19811 @itemx LC_ALL
19812 @findex LANG
19813 @findex LC_CTYPE
19814 @c @findex LC_COLLATE
19815 @findex LC_MESSAGES
19816 @c @findex LC_MONETARY
19817 @c @findex LC_NUMERIC
19818 @c @findex LC_TIME
19819 @findex LC_ALL
19820 @cindex locale
19821 These environment variables control the way that GCC uses
19822 localization information which allows GCC to work with different
19823 national conventions.  GCC inspects the locale categories
19824 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
19825 so.  These locale categories can be set to any value supported by your
19826 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
19827 Kingdom encoded in UTF-8.
19828
19829 The @env{LC_CTYPE} environment variable specifies character
19830 classification.  GCC uses it to determine the character boundaries in
19831 a string; this is needed for some multibyte encodings that contain quote
19832 and escape characters that are otherwise interpreted as a string
19833 end or escape.
19834
19835 The @env{LC_MESSAGES} environment variable specifies the language to
19836 use in diagnostic messages.
19837
19838 If the @env{LC_ALL} environment variable is set, it overrides the value
19839 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
19840 and @env{LC_MESSAGES} default to the value of the @env{LANG}
19841 environment variable.  If none of these variables are set, GCC
19842 defaults to traditional C English behavior.
19843
19844 @item TMPDIR
19845 @findex TMPDIR
19846 If @env{TMPDIR} is set, it specifies the directory to use for temporary
19847 files.  GCC uses temporary files to hold the output of one stage of
19848 compilation which is to be used as input to the next stage: for example,
19849 the output of the preprocessor, which is the input to the compiler
19850 proper.
19851
19852 @item GCC_COMPARE_DEBUG
19853 @findex GCC_COMPARE_DEBUG
19854 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
19855 @option{-fcompare-debug} to the compiler driver.  See the documentation
19856 of this option for more details.
19857
19858 @item GCC_EXEC_PREFIX
19859 @findex GCC_EXEC_PREFIX
19860 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
19861 names of the subprograms executed by the compiler.  No slash is added
19862 when this prefix is combined with the name of a subprogram, but you can
19863 specify a prefix that ends with a slash if you wish.
19864
19865 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
19866 an appropriate prefix to use based on the pathname it is invoked with.
19867
19868 If GCC cannot find the subprogram using the specified prefix, it
19869 tries looking in the usual places for the subprogram.
19870
19871 The default value of @env{GCC_EXEC_PREFIX} is
19872 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
19873 the installed compiler. In many cases @var{prefix} is the value
19874 of @code{prefix} when you ran the @file{configure} script.
19875
19876 Other prefixes specified with @option{-B} take precedence over this prefix.
19877
19878 This prefix is also used for finding files such as @file{crt0.o} that are
19879 used for linking.
19880
19881 In addition, the prefix is used in an unusual way in finding the
19882 directories to search for header files.  For each of the standard
19883 directories whose name normally begins with @samp{/usr/local/lib/gcc}
19884 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
19885 replacing that beginning with the specified prefix to produce an
19886 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
19887 @file{foo/bar} just before it searches the standard directory 
19888 @file{/usr/local/lib/bar}.
19889 If a standard directory begins with the configured
19890 @var{prefix} then the value of @var{prefix} is replaced by
19891 @env{GCC_EXEC_PREFIX} when looking for header files.
19892
19893 @item COMPILER_PATH
19894 @findex COMPILER_PATH
19895 The value of @env{COMPILER_PATH} is a colon-separated list of
19896 directories, much like @env{PATH}.  GCC tries the directories thus
19897 specified when searching for subprograms, if it can't find the
19898 subprograms using @env{GCC_EXEC_PREFIX}.
19899
19900 @item LIBRARY_PATH
19901 @findex LIBRARY_PATH
19902 The value of @env{LIBRARY_PATH} is a colon-separated list of
19903 directories, much like @env{PATH}.  When configured as a native compiler,
19904 GCC tries the directories thus specified when searching for special
19905 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
19906 using GCC also uses these directories when searching for ordinary
19907 libraries for the @option{-l} option (but directories specified with
19908 @option{-L} come first).
19909
19910 @item LANG
19911 @findex LANG
19912 @cindex locale definition
19913 This variable is used to pass locale information to the compiler.  One way in
19914 which this information is used is to determine the character set to be used
19915 when character literals, string literals and comments are parsed in C and C++.
19916 When the compiler is configured to allow multibyte characters,
19917 the following values for @env{LANG} are recognized:
19918
19919 @table @samp
19920 @item C-JIS
19921 Recognize JIS characters.
19922 @item C-SJIS
19923 Recognize SJIS characters.
19924 @item C-EUCJP
19925 Recognize EUCJP characters.
19926 @end table
19927
19928 If @env{LANG} is not defined, or if it has some other value, then the
19929 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
19930 recognize and translate multibyte characters.
19931 @end table
19932
19933 @noindent
19934 Some additional environment variables affect the behavior of the
19935 preprocessor.
19936
19937 @include cppenv.texi
19938
19939 @c man end
19940
19941 @node Precompiled Headers
19942 @section Using Precompiled Headers
19943 @cindex precompiled headers
19944 @cindex speed of compilation
19945
19946 Often large projects have many header files that are included in every
19947 source file.  The time the compiler takes to process these header files
19948 over and over again can account for nearly all of the time required to
19949 build the project.  To make builds faster, GCC allows you to
19950 @dfn{precompile} a header file.
19951
19952 To create a precompiled header file, simply compile it as you would any
19953 other file, if necessary using the @option{-x} option to make the driver
19954 treat it as a C or C++ header file.  You may want to use a
19955 tool like @command{make} to keep the precompiled header up-to-date when
19956 the headers it contains change.
19957
19958 A precompiled header file is searched for when @code{#include} is
19959 seen in the compilation.  As it searches for the included file
19960 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
19961 compiler looks for a precompiled header in each directory just before it
19962 looks for the include file in that directory.  The name searched for is
19963 the name specified in the @code{#include} with @samp{.gch} appended.  If
19964 the precompiled header file can't be used, it is ignored.
19965
19966 For instance, if you have @code{#include "all.h"}, and you have
19967 @file{all.h.gch} in the same directory as @file{all.h}, then the
19968 precompiled header file is used if possible, and the original
19969 header is used otherwise.
19970
19971 Alternatively, you might decide to put the precompiled header file in a
19972 directory and use @option{-I} to ensure that directory is searched
19973 before (or instead of) the directory containing the original header.
19974 Then, if you want to check that the precompiled header file is always
19975 used, you can put a file of the same name as the original header in this
19976 directory containing an @code{#error} command.
19977
19978 This also works with @option{-include}.  So yet another way to use
19979 precompiled headers, good for projects not designed with precompiled
19980 header files in mind, is to simply take most of the header files used by
19981 a project, include them from another header file, precompile that header
19982 file, and @option{-include} the precompiled header.  If the header files
19983 have guards against multiple inclusion, they are skipped because
19984 they've already been included (in the precompiled header).
19985
19986 If you need to precompile the same header file for different
19987 languages, targets, or compiler options, you can instead make a
19988 @emph{directory} named like @file{all.h.gch}, and put each precompiled
19989 header in the directory, perhaps using @option{-o}.  It doesn't matter
19990 what you call the files in the directory; every precompiled header in
19991 the directory is considered.  The first precompiled header
19992 encountered in the directory that is valid for this compilation is
19993 used; they're searched in no particular order.
19994
19995 There are many other possibilities, limited only by your imagination,
19996 good sense, and the constraints of your build system.
19997
19998 A precompiled header file can be used only when these conditions apply:
19999
20000 @itemize
20001 @item
20002 Only one precompiled header can be used in a particular compilation.
20003
20004 @item
20005 A precompiled header can't be used once the first C token is seen.  You
20006 can have preprocessor directives before a precompiled header; you cannot
20007 include a precompiled header from inside another header.
20008
20009 @item
20010 The precompiled header file must be produced for the same language as
20011 the current compilation.  You can't use a C precompiled header for a C++
20012 compilation.
20013
20014 @item
20015 The precompiled header file must have been produced by the same compiler
20016 binary as the current compilation is using.
20017
20018 @item
20019 Any macros defined before the precompiled header is included must
20020 either be defined in the same way as when the precompiled header was
20021 generated, or must not affect the precompiled header, which usually
20022 means that they don't appear in the precompiled header at all.
20023
20024 The @option{-D} option is one way to define a macro before a
20025 precompiled header is included; using a @code{#define} can also do it.
20026 There are also some options that define macros implicitly, like
20027 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
20028 defined this way.
20029
20030 @item If debugging information is output when using the precompiled
20031 header, using @option{-g} or similar, the same kind of debugging information
20032 must have been output when building the precompiled header.  However,
20033 a precompiled header built using @option{-g} can be used in a compilation
20034 when no debugging information is being output.
20035
20036 @item The same @option{-m} options must generally be used when building
20037 and using the precompiled header.  @xref{Submodel Options},
20038 for any cases where this rule is relaxed.
20039
20040 @item Each of the following options must be the same when building and using
20041 the precompiled header:
20042
20043 @gccoptlist{-fexceptions}
20044
20045 @item
20046 Some other command-line options starting with @option{-f},
20047 @option{-p}, or @option{-O} must be defined in the same way as when
20048 the precompiled header was generated.  At present, it's not clear
20049 which options are safe to change and which are not; the safest choice
20050 is to use exactly the same options when generating and using the
20051 precompiled header.  The following are known to be safe:
20052
20053 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
20054 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
20055 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
20056 -pedantic-errors}
20057
20058 @end itemize
20059
20060 For all of these except the last, the compiler automatically
20061 ignores the precompiled header if the conditions aren't met.  If you
20062 find an option combination that doesn't work and doesn't cause the
20063 precompiled header to be ignored, please consider filing a bug report,
20064 see @ref{Bugs}.
20065
20066 If you do use differing options when generating and using the
20067 precompiled header, the actual behavior is a mixture of the
20068 behavior for the options.  For instance, if you use @option{-g} to
20069 generate the precompiled header but not when using it, you may or may
20070 not get debugging information for routines in the precompiled header.