OSDN Git Service

sparc: Add -mmemory-model command-line option.
[pf3gnuchains/gcc-fork.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
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 Free Software Foundation, Inc.
16
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.3 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``GNU General Public License'' and ``Funding
21 Free Software'', the Front-Cover texts being (a) (see below), and with
22 the Back-Cover Texts being (b) (see below).  A copy of the license is
23 included in the gfdl(7) man page.
24
25 (a) The FSF's Front-Cover Text is:
26
27      A GNU Manual
28
29 (b) The FSF's Back-Cover Text is:
30
31      You have freedom to copy and modify this GNU Manual, like GNU
32      software.  Copies published by the Free Software Foundation raise
33      funds for GNU development.
34 @c man end
35 @c Set file name and title for the man page.
36 @setfilename gcc
37 @settitle GNU project C and C++ compiler
38 @c man begin SYNOPSIS
39 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
40     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
41     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
42     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
43     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
44     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
45     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
46
47 Only the most useful options are listed here; see below for the
48 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
49 @c man end
50 @c man begin SEEALSO
51 gpl(7), gfdl(7), fsf-funding(7),
52 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
53 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
54 @file{ld}, @file{binutils} and @file{gdb}.
55 @c man end
56 @c man begin BUGS
57 For instructions on reporting bugs, see
58 @w{@value{BUGURL}}.
59 @c man end
60 @c man begin AUTHOR
61 See the Info entry for @command{gcc}, or
62 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
63 for contributors to GCC@.
64 @c man end
65 @end ignore
66
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
72
73 @c man begin DESCRIPTION
74 When you invoke GCC, it normally does preprocessing, compilation,
75 assembly and linking.  The ``overall options'' allow you to stop this
76 process at an intermediate stage.  For example, the @option{-c} option
77 says not to run the linker.  Then the output consists of object files
78 output by the assembler.
79
80 Other options are passed on to one stage of processing.  Some options
81 control the preprocessor and others the compiler itself.  Yet other
82 options control the assembler and linker; most of these are not
83 documented here, since you rarely need to use any of them.
84
85 @cindex C compilation options
86 Most of the command line options that you can use with GCC are useful
87 for C programs; when an option is only useful with another language
88 (usually C++), the explanation says so explicitly.  If the description
89 for a particular option does not mention a source language, you can use
90 that option with all supported languages.
91
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
95
96 @cindex grouping options
97 @cindex options, grouping
98 The @command{gcc} program accepts options and file names as operands.  Many
99 options have multi-letter names; therefore multiple single-letter options
100 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
101 -v}}.
102
103 @cindex order of options
104 @cindex options, order
105 You can mix options and other arguments.  For the most part, the order
106 you use doesn't matter.  Order does matter when you use several
107 options of the same kind; for example, if you specify @option{-L} more
108 than once, the directories are searched in the order specified.  Also,
109 the placement of the @option{-l} option is significant.
110
111 Many options have long names starting with @samp{-f} or with
112 @samp{-W}---for example,
113 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
114 these have both positive and negative forms; the negative form of
115 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
116 only one of these two forms, whichever one is not the default.
117
118 @c man end
119
120 @xref{Option Index}, for an index to GCC's options.
121
122 @menu
123 * Option Summary::      Brief list of all options, without explanations.
124 * Overall Options::     Controlling the kind of output:
125                         an executable, object files, assembler files,
126                         or preprocessed source.
127 * Invoking G++::        Compiling C++ programs.
128 * C Dialect Options::   Controlling the variant of C language compiled.
129 * C++ Dialect Options:: Variations on C++.
130 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
131                         and Objective-C++.
132 * Language Independent Options:: Controlling how diagnostics should be
133                         formatted.
134 * Warning Options::     How picky should the compiler be?
135 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
136 * Optimize Options::    How much optimization?
137 * Preprocessor Options:: Controlling header files and macro definitions.
138                          Also, getting dependency information for Make.
139 * Assembler Options::   Passing options to the assembler.
140 * Link Options::        Specifying libraries and so on.
141 * Directory Options::   Where to find header files and libraries.
142                         Where to find the compiler executable files.
143 * Spec Files::          How to pass switches to sub-processes.
144 * Target Options::      Running a cross-compiler, or an old version of GCC.
145 * Submodel Options::    Specifying minor hardware or convention variations,
146                         such as 68010 vs 68020.
147 * Code Gen Options::    Specifying conventions for function calls, data layout
148                         and register usage.
149 * Environment Variables:: Env vars that affect GCC.
150 * Precompiled Headers:: Compiling a header once, and using it many times.
151 @end menu
152
153 @c man begin OPTIONS
154
155 @node Option Summary
156 @section Option Summary
157
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
160
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
165 -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
167 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
168 -fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}
169
170 @item C Language Options
171 @xref{C Dialect Options,,Options Controlling C Dialect}.
172 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
173 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
174 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
175 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
176 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
177 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
178 -fsigned-bitfields  -fsigned-char @gol
179 -funsigned-bitfields  -funsigned-char}
180
181 @item C++ Language Options
182 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
183 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
184 -fconserve-space  -fconstexpr-depth=@var{n}  -ffriend-injection @gol
185 -fno-elide-constructors @gol
186 -fno-enforce-eh-specs @gol
187 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
188 -fno-implicit-templates @gol
189 -fno-implicit-inline-templates @gol
190 -fno-implement-inlines  -fms-extensions @gol
191 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
192 -fno-optional-diags  -fpermissive @gol
193 -fno-pretty-templates @gol
194 -frepo  -fno-rtti  -fstats  -ftemplate-depth=@var{n} @gol
195 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
196 -fno-default-inline  -fvisibility-inlines-hidden @gol
197 -fvisibility-ms-compat @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
200 -Weffc++  -Wstrict-null-sentinel @gol
201 -Wno-non-template-friend  -Wold-style-cast @gol
202 -Woverloaded-virtual  -Wno-pmf-conversions @gol
203 -Wsign-promo -Wzero-as-null-pointer-constant}
204
205 @item Objective-C and Objective-C++ Language Options
206 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
207 Objective-C and Objective-C++ Dialects}.
208 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
209 -fgnu-runtime  -fnext-runtime @gol
210 -fno-nil-receivers @gol
211 -fobjc-abi-version=@var{n} @gol
212 -fobjc-call-cxx-cdtors @gol
213 -fobjc-direct-dispatch @gol
214 -fobjc-exceptions @gol
215 -fobjc-gc @gol
216 -fobjc-nilcheck @gol
217 -fobjc-std=objc1 @gol
218 -freplace-objc-classes @gol
219 -fzero-link @gol
220 -gen-decls @gol
221 -Wassign-intercept @gol
222 -Wno-protocol  -Wselector @gol
223 -Wstrict-selector-match @gol
224 -Wundeclared-selector}
225
226 @item Language Independent Options
227 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
228 @gccoptlist{-fmessage-length=@var{n}  @gol
229 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
230 -fno-diagnostics-show-option}
231
232 @item Warning Options
233 @xref{Warning Options,,Options to Request or Suppress Warnings}.
234 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -pedantic @gol
235 -pedantic-errors @gol
236 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
237 -Wno-attributes -Wno-builtin-macro-redefined @gol
238 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
239 -Wchar-subscripts -Wclobbered  -Wcomment @gol
240 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
241 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
242 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
243 -Wno-endif-labels -Werror  -Werror=* @gol
244 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
245 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
246 -Wformat-security  -Wformat-y2k @gol
247 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
248 -Wignored-qualifiers @gol
249 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
250 -Winit-self  -Winline -Wmaybe-uninitialized @gol
251 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
252 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
253 -Wlogical-op -Wlong-long @gol
254 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
255 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
256 -Wno-mudflap @gol
257 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
258 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
259 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
260 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
261 -Wredundant-decls @gol
262 -Wreturn-type  -Wsequence-point  -Wshadow @gol
263 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
264 -Wstack-usage=@var{len} -Wstrict-aliasing -Wstrict-aliasing=n @gol
265 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
266 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
267 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
268 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
269 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
270 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
271 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
272 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
273 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
274 -Wvariadic-macros -Wvector-operation-performance -Wvla 
275 -Wvolatile-register-var  -Wwrite-strings}
276
277 @item C and Objective-C-only Warning Options
278 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
279 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
280 -Wold-style-declaration  -Wold-style-definition @gol
281 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
282 -Wdeclaration-after-statement -Wpointer-sign}
283
284 @item Debugging Options
285 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
286 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
287 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
288 -fdisable-ipa-@var{pass_name} @gol
289 -fdisable-rtl-@var{pass_name} @gol
290 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
291 -fdisable-tree-@var{pass_name} @gol
292 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
293 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
294 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
295 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
296 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
297 -fdump-passes @gol
298 -fdump-statistics @gol
299 -fdump-tree-all @gol
300 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
301 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
303 -fdump-tree-ch @gol
304 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
306 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-nrv -fdump-tree-vect @gol
314 -fdump-tree-sink @gol
315 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
319 -ftree-vectorizer-verbose=@var{n} @gol
320 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
321 -fdump-final-insns=@var{file} @gol
322 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
323 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
324 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
325 -fenable-@var{kind}-@var{pass} @gol
326 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
327 -fdebug-types-section @gol
328 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
329 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
330 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
331 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
332 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
333 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
334 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
335 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
336 -gvms  -gxcoff  -gxcoff+ @gol
337 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
338 -fdebug-prefix-map=@var{old}=@var{new} @gol
339 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
340 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
341 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
342 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
343 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
344 -print-sysroot -print-sysroot-headers-suffix @gol
345 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
346
347 @item Optimization Options
348 @xref{Optimize Options,,Options that Control Optimization}.
349 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
350 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
351 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
352 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
353 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
354 -fcompare-elim -fcprop-registers -fcrossjumping @gol
355 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
356 -fcx-limited-range @gol
357 -fdata-sections -fdce -fdce -fdelayed-branch @gol
358 -fdelete-null-pointer-checks -fdse -fdevirtualize -fdse @gol
359 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
360 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
361 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
362 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
363 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
364 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
365 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
366 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
367 -fira-algorithm=@var{algorithm} @gol
368 -fira-region=@var{region} @gol
369 -fira-loop-pressure -fno-ira-share-save-slots @gol
370 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
371 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
372 -floop-block -floop-flatten -floop-interchange -floop-strip-mine @gol
373 -floop-parallelize-all -flto -flto-compression-level @gol
374 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
375 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
376 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
377 -fno-default-inline @gol
378 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
379 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
380 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
381 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
382 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
383 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
384 -fprefetch-loop-arrays @gol
385 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
386 -fprofile-generate=@var{path} @gol
387 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
388 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
389 -freorder-blocks-and-partition -freorder-functions @gol
390 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
391 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
392 -fsched-spec-load -fsched-spec-load-dangerous @gol
393 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
394 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
395 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
396 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
397 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
398 -fselective-scheduling -fselective-scheduling2 @gol
399 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
400 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
401 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
402 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
403 -fthread-jumps -ftracer -ftree-bit-ccp @gol
404 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
405 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
406 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
407 -ftree-loop-if-convert-stores -ftree-loop-im @gol
408 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
409 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
410 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
411 -ftree-sink -ftree-sra -ftree-switch-conversion -ftree-tail-merge @gol
412 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
413 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
414 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
415 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
416 -fwhole-program -fwpa -fuse-linker-plugin @gol
417 --param @var{name}=@var{value}
418 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
419
420 @item Preprocessor Options
421 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
422 @gccoptlist{-A@var{question}=@var{answer} @gol
423 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
424 -C  -dD  -dI  -dM  -dN @gol
425 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
426 -idirafter @var{dir} @gol
427 -include @var{file}  -imacros @var{file} @gol
428 -iprefix @var{file}  -iwithprefix @var{dir} @gol
429 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
430 -imultilib @var{dir} -isysroot @var{dir} @gol
431 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
432 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
433 -remap -trigraphs  -undef  -U@var{macro}  @gol
434 -Wp,@var{option} -Xpreprocessor @var{option}}
435
436 @item Assembler Option
437 @xref{Assembler Options,,Passing Options to the Assembler}.
438 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
439
440 @item Linker Options
441 @xref{Link Options,,Options for Linking}.
442 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
443 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
444 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
445 -shared-libgcc  -symbolic @gol
446 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
447 -u @var{symbol}}
448
449 @item Directory Options
450 @xref{Directory Options,,Options for Directory Search}.
451 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
452 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
453 --sysroot=@var{dir}}
454
455 @item Machine Dependent Options
456 @xref{Submodel Options,,Hardware Models and Configurations}.
457 @c This list is ordered alphanumerically by subsection name.
458 @c Try and put the significant identifier (CPU or system) first,
459 @c so users have a clue at guessing where the ones they want will be.
460
461 @emph{Adapteva Epiphany Options}
462 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
463 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
464 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
465 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
466 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
467 -msplit-vecmove-early -m1reg-@var{reg}}
468
469 @emph{ARM Options}
470 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
471 -mabi=@var{name} @gol
472 -mapcs-stack-check  -mno-apcs-stack-check @gol
473 -mapcs-float  -mno-apcs-float @gol
474 -mapcs-reentrant  -mno-apcs-reentrant @gol
475 -msched-prolog  -mno-sched-prolog @gol
476 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
477 -mfloat-abi=@var{name}  -mfpe @gol
478 -mfp16-format=@var{name}
479 -mthumb-interwork  -mno-thumb-interwork @gol
480 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
481 -mstructure-size-boundary=@var{n} @gol
482 -mabort-on-noreturn @gol
483 -mlong-calls  -mno-long-calls @gol
484 -msingle-pic-base  -mno-single-pic-base @gol
485 -mpic-register=@var{reg} @gol
486 -mnop-fun-dllimport @gol
487 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
488 -mpoke-function-name @gol
489 -mthumb  -marm @gol
490 -mtpcs-frame  -mtpcs-leaf-frame @gol
491 -mcaller-super-interworking  -mcallee-super-interworking @gol
492 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
493 -mword-relocations @gol
494 -mfix-cortex-m3-ldrd}
495
496 @emph{AVR Options}
497 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
498 -mcall-prologues  -mtiny-stack  -mint8  -mstrict-X}
499
500 @emph{Blackfin Options}
501 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
502 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
503 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
504 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
505 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
506 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
507 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
508 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
509 -micplb}
510
511 @emph{C6X Options}
512 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
513 -msim -msdata=@var{sdata-type}}
514
515 @emph{CRIS Options}
516 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
517 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
518 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
519 -mstack-align  -mdata-align  -mconst-align @gol
520 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
521 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
522 -mmul-bug-workaround  -mno-mul-bug-workaround}
523
524 @emph{Darwin Options}
525 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
526 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
527 -client_name  -compatibility_version  -current_version @gol
528 -dead_strip @gol
529 -dependency-file  -dylib_file  -dylinker_install_name @gol
530 -dynamic  -dynamiclib  -exported_symbols_list @gol
531 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
532 -force_flat_namespace  -headerpad_max_install_names @gol
533 -iframework @gol
534 -image_base  -init  -install_name  -keep_private_externs @gol
535 -multi_module  -multiply_defined  -multiply_defined_unused @gol
536 -noall_load   -no_dead_strip_inits_and_terms @gol
537 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
538 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
539 -private_bundle  -read_only_relocs  -sectalign @gol
540 -sectobjectsymbols  -whyload  -seg1addr @gol
541 -sectcreate  -sectobjectsymbols  -sectorder @gol
542 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
543 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
544 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
545 -single_module  -static  -sub_library  -sub_umbrella @gol
546 -twolevel_namespace  -umbrella  -undefined @gol
547 -unexported_symbols_list  -weak_reference_mismatches @gol
548 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
549 -mkernel -mone-byte-bool}
550
551 @emph{DEC Alpha Options}
552 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
553 -mieee  -mieee-with-inexact  -mieee-conformant @gol
554 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
555 -mtrap-precision=@var{mode}  -mbuild-constants @gol
556 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
557 -mbwx  -mmax  -mfix  -mcix @gol
558 -mfloat-vax  -mfloat-ieee @gol
559 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
560 -msmall-text  -mlarge-text @gol
561 -mmemory-latency=@var{time}}
562
563 @emph{DEC Alpha/VMS Options}
564 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
565
566 @emph{FR30 Options}
567 @gccoptlist{-msmall-model -mno-lsim}
568
569 @emph{FRV Options}
570 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
571 -mhard-float  -msoft-float @gol
572 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
573 -mdouble  -mno-double @gol
574 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
575 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
576 -mlinked-fp  -mlong-calls  -malign-labels @gol
577 -mlibrary-pic  -macc-4  -macc-8 @gol
578 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
579 -moptimize-membar -mno-optimize-membar @gol
580 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
581 -mvliw-branch  -mno-vliw-branch @gol
582 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
583 -mno-nested-cond-exec  -mtomcat-stats @gol
584 -mTLS -mtls @gol
585 -mcpu=@var{cpu}}
586
587 @emph{GNU/Linux Options}
588 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
589 -tno-android-cc -tno-android-ld}
590
591 @emph{H8/300 Options}
592 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
593
594 @emph{HPPA Options}
595 @gccoptlist{-march=@var{architecture-type} @gol
596 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
597 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
598 -mfixed-range=@var{register-range} @gol
599 -mjump-in-delay -mlinker-opt -mlong-calls @gol
600 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
601 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
602 -mno-jump-in-delay  -mno-long-load-store @gol
603 -mno-portable-runtime  -mno-soft-float @gol
604 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
605 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
606 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
607 -munix=@var{unix-std}  -nolibdld  -static  -threads}
608
609 @emph{i386 and x86-64 Options}
610 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
611 -mfpmath=@var{unit} @gol
612 -masm=@var{dialect}  -mno-fancy-math-387 @gol
613 -mno-fp-ret-in-387  -msoft-float @gol
614 -mno-wide-multiply  -mrtd  -malign-double @gol
615 -mpreferred-stack-boundary=@var{num} @gol
616 -mincoming-stack-boundary=@var{num} @gol
617 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
618 -mrecip -mrecip=@var{opt} @gol
619 -mvzeroupper @gol
620 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
621 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
622 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
623 -mbmi2 -mlwp -mthreads  -mno-align-stringops  -minline-all-stringops @gol
624 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
625 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
626 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
627 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
628 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
629 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
630 -mcmodel=@var{code-model} -mabi=@var{name} @gol
631 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
632 -msse2avx -mfentry -m8bit-idiv @gol
633 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
634
635 @emph{i386 and x86-64 Windows Options}
636 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
637 -mnop-fun-dllimport -mthread @gol
638 -municode -mwin32 -mwindows -fno-set-stack-executable}
639
640 @emph{IA-64 Options}
641 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
642 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
643 -mconstant-gp  -mauto-pic  -mfused-madd @gol
644 -minline-float-divide-min-latency @gol
645 -minline-float-divide-max-throughput @gol
646 -mno-inline-float-divide @gol
647 -minline-int-divide-min-latency @gol
648 -minline-int-divide-max-throughput  @gol
649 -mno-inline-int-divide @gol
650 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
651 -mno-inline-sqrt @gol
652 -mdwarf2-asm -mearly-stop-bits @gol
653 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
654 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
655 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
656 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
657 -msched-spec-ldc -msched-spec-control-ldc @gol
658 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
659 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
660 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
661 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
662
663 @emph{IA-64/VMS Options}
664 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
665
666 @emph{LM32 Options}
667 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
668 -msign-extend-enabled -muser-enabled}
669
670 @emph{M32R/D Options}
671 @gccoptlist{-m32r2 -m32rx -m32r @gol
672 -mdebug @gol
673 -malign-loops -mno-align-loops @gol
674 -missue-rate=@var{number} @gol
675 -mbranch-cost=@var{number} @gol
676 -mmodel=@var{code-size-model-type} @gol
677 -msdata=@var{sdata-type} @gol
678 -mno-flush-func -mflush-func=@var{name} @gol
679 -mno-flush-trap -mflush-trap=@var{number} @gol
680 -G @var{num}}
681
682 @emph{M32C Options}
683 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
684
685 @emph{M680x0 Options}
686 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
687 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
688 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
689 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
690 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
691 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
692 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
693 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
694 -mxgot -mno-xgot}
695
696 @emph{MCore Options}
697 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
698 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
699 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
700 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
701 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
702
703 @emph{MeP Options}
704 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
705 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
706 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
707 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
708 -mtiny=@var{n}}
709
710 @emph{MicroBlaze Options}
711 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
712 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
713 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
714 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
715 -mxl-mode-@var{app-model}}
716
717 @emph{MIPS Options}
718 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
719 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
720 -mips64  -mips64r2 @gol
721 -mips16  -mno-mips16  -mflip-mips16 @gol
722 -minterlink-mips16  -mno-interlink-mips16 @gol
723 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
724 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
725 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
726 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
727 -mfpu=@var{fpu-type} @gol
728 -msmartmips  -mno-smartmips @gol
729 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
730 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
731 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
732 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
733 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
734 -membedded-data  -mno-embedded-data @gol
735 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
736 -mcode-readable=@var{setting} @gol
737 -msplit-addresses  -mno-split-addresses @gol
738 -mexplicit-relocs  -mno-explicit-relocs @gol
739 -mcheck-zero-division  -mno-check-zero-division @gol
740 -mdivide-traps  -mdivide-breaks @gol
741 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
742 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
743 -mfix-24k -mno-fix-24k @gol
744 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
745 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
746 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
747 -mflush-func=@var{func}  -mno-flush-func @gol
748 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
749 -mfp-exceptions -mno-fp-exceptions @gol
750 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
751 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
752
753 @emph{MMIX Options}
754 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
755 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
756 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
757 -mno-base-addresses  -msingle-exit  -mno-single-exit}
758
759 @emph{MN10300 Options}
760 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
761 -mno-am33 -mam33 -mam33-2 -mam34 @gol
762 -mtune=@var{cpu-type} @gol
763 -mreturn-pointer-on-d0 @gol
764 -mno-crt0  -mrelax -mliw -msetlb}
765
766 @emph{PDP-11 Options}
767 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
768 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
769 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
770 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
771 -mbranch-expensive  -mbranch-cheap @gol
772 -munix-asm  -mdec-asm}
773
774 @emph{picoChip Options}
775 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
776 -msymbol-as-address -mno-inefficient-warnings}
777
778 @emph{PowerPC Options}
779 See RS/6000 and PowerPC Options.
780
781 @emph{RL78 Options}
782 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
783
784 @emph{RS/6000 and PowerPC Options}
785 @gccoptlist{-mcpu=@var{cpu-type} @gol
786 -mtune=@var{cpu-type} @gol
787 -mcmodel=@var{code-model} @gol
788 -mpower  -mno-power  -mpower2  -mno-power2 @gol
789 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
790 -maltivec  -mno-altivec @gol
791 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
792 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
793 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
794 -mfprnd  -mno-fprnd @gol
795 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
796 -mnew-mnemonics  -mold-mnemonics @gol
797 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
798 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
799 -malign-power  -malign-natural @gol
800 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
801 -msingle-float -mdouble-float -msimple-fpu @gol
802 -mstring  -mno-string  -mupdate  -mno-update @gol
803 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
804 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
805 -mstrict-align  -mno-strict-align  -mrelocatable @gol
806 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
807 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
808 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
809 -mprioritize-restricted-insns=@var{priority} @gol
810 -msched-costly-dep=@var{dependence_type} @gol
811 -minsert-sched-nops=@var{scheme} @gol
812 -mcall-sysv  -mcall-netbsd @gol
813 -maix-struct-return  -msvr4-struct-return @gol
814 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
815 -mblock-move-inline-limit=@var{num} @gol
816 -misel -mno-isel @gol
817 -misel=yes  -misel=no @gol
818 -mspe -mno-spe @gol
819 -mspe=yes  -mspe=no @gol
820 -mpaired @gol
821 -mgen-cell-microcode -mwarn-cell-microcode @gol
822 -mvrsave -mno-vrsave @gol
823 -mmulhw -mno-mulhw @gol
824 -mdlmzb -mno-dlmzb @gol
825 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
826 -mprototype  -mno-prototype @gol
827 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
828 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
829 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
830 -mno-recip-precision @gol
831 -mveclibabi=@var{type} -mfriz -mno-friz @gol
832 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
833 -msave-toc-indirect -mno-save-toc-indirect}
834
835 @emph{RX Options}
836 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
837 -mcpu=@gol
838 -mbig-endian-data -mlittle-endian-data @gol
839 -msmall-data @gol
840 -msim  -mno-sim@gol
841 -mas100-syntax -mno-as100-syntax@gol
842 -mrelax@gol
843 -mmax-constant-size=@gol
844 -mint-register=@gol
845 -mpid@gol
846 -msave-acc-in-interrupts}
847
848 @emph{S/390 and zSeries Options}
849 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
850 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
851 -mlong-double-64 -mlong-double-128 @gol
852 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
853 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
854 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
855 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
856 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
857
858 @emph{Score Options}
859 @gccoptlist{-meb -mel @gol
860 -mnhwloop @gol
861 -muls @gol
862 -mmac @gol
863 -mscore5 -mscore5u -mscore7 -mscore7d}
864
865 @emph{SH Options}
866 @gccoptlist{-m1  -m2  -m2e @gol
867 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
868 -m3  -m3e @gol
869 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
870 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
871 -m5-64media  -m5-64media-nofpu @gol
872 -m5-32media  -m5-32media-nofpu @gol
873 -m5-compact  -m5-compact-nofpu @gol
874 -mb  -ml  -mdalign  -mrelax @gol
875 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
876 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
877 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
878 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
879 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
880 -maccumulate-outgoing-args -minvalid-symbols}
881
882 @emph{Solaris 2 Options}
883 @gccoptlist{-mimpure-text  -mno-impure-text @gol
884 -pthreads -pthread}
885
886 @emph{SPARC Options}
887 @gccoptlist{-mcpu=@var{cpu-type} @gol
888 -mtune=@var{cpu-type} @gol
889 -mcmodel=@var{code-model} @gol
890 -mmemory-model=@var{mem-model} @gol
891 -m32  -m64  -mapp-regs  -mno-app-regs @gol
892 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
893 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
894 -mhard-quad-float  -msoft-quad-float @gol
895 -mlittle-endian @gol
896 -mstack-bias  -mno-stack-bias @gol
897 -munaligned-doubles  -mno-unaligned-doubles @gol
898 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
899 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
900 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
901 -mfix-at697f}
902
903 @emph{SPU Options}
904 @gccoptlist{-mwarn-reloc -merror-reloc @gol
905 -msafe-dma -munsafe-dma @gol
906 -mbranch-hints @gol
907 -msmall-mem -mlarge-mem -mstdmain @gol
908 -mfixed-range=@var{register-range} @gol
909 -mea32 -mea64 @gol
910 -maddress-space-conversion -mno-address-space-conversion @gol
911 -mcache-size=@var{cache-size} @gol
912 -matomic-updates -mno-atomic-updates}
913
914 @emph{System V Options}
915 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
916
917 @emph{V850 Options}
918 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
919 -mprolog-function  -mno-prolog-function  -mspace @gol
920 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
921 -mapp-regs  -mno-app-regs @gol
922 -mdisable-callt  -mno-disable-callt @gol
923 -mv850e2v3 @gol
924 -mv850e2 @gol
925 -mv850e1 -mv850es @gol
926 -mv850e @gol
927 -mv850  -mbig-switch}
928
929 @emph{VAX Options}
930 @gccoptlist{-mg  -mgnu  -munix}
931
932 @emph{VxWorks Options}
933 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
934 -Xbind-lazy  -Xbind-now}
935
936 @emph{x86-64 Options}
937 See i386 and x86-64 Options.
938
939 @emph{Xstormy16 Options}
940 @gccoptlist{-msim}
941
942 @emph{Xtensa Options}
943 @gccoptlist{-mconst16 -mno-const16 @gol
944 -mfused-madd  -mno-fused-madd @gol
945 -mforce-no-pic @gol
946 -mserialize-volatile  -mno-serialize-volatile @gol
947 -mtext-section-literals  -mno-text-section-literals @gol
948 -mtarget-align  -mno-target-align @gol
949 -mlongcalls  -mno-longcalls}
950
951 @emph{zSeries Options}
952 See S/390 and zSeries Options.
953
954 @item Code Generation Options
955 @xref{Code Gen Options,,Options for Code Generation Conventions}.
956 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
957 -ffixed-@var{reg}  -fexceptions @gol
958 -fnon-call-exceptions  -funwind-tables @gol
959 -fasynchronous-unwind-tables @gol
960 -finhibit-size-directive  -finstrument-functions @gol
961 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
962 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
963 -fno-common  -fno-ident @gol
964 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
965 -fno-jump-tables @gol
966 -frecord-gcc-switches @gol
967 -freg-struct-return  -fshort-enums @gol
968 -fshort-double  -fshort-wchar @gol
969 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
970 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
971 -fno-stack-limit -fsplit-stack @gol
972 -fleading-underscore  -ftls-model=@var{model} @gol
973 -ftrapv  -fwrapv  -fbounds-check @gol
974 -fvisibility -fstrict-volatile-bitfields}
975 @end table
976
977 @menu
978 * Overall Options::     Controlling the kind of output:
979                         an executable, object files, assembler files,
980                         or preprocessed source.
981 * C Dialect Options::   Controlling the variant of C language compiled.
982 * C++ Dialect Options:: Variations on C++.
983 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
984                         and Objective-C++.
985 * Language Independent Options:: Controlling how diagnostics should be
986                         formatted.
987 * Warning Options::     How picky should the compiler be?
988 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
989 * Optimize Options::    How much optimization?
990 * Preprocessor Options:: Controlling header files and macro definitions.
991                          Also, getting dependency information for Make.
992 * Assembler Options::   Passing options to the assembler.
993 * Link Options::        Specifying libraries and so on.
994 * Directory Options::   Where to find header files and libraries.
995                         Where to find the compiler executable files.
996 * Spec Files::          How to pass switches to sub-processes.
997 * Target Options::      Running a cross-compiler, or an old version of GCC.
998 @end menu
999
1000 @node Overall Options
1001 @section Options Controlling the Kind of Output
1002
1003 Compilation can involve up to four stages: preprocessing, compilation
1004 proper, assembly and linking, always in that order.  GCC is capable of
1005 preprocessing and compiling several files either into several
1006 assembler input files, or into one assembler input file; then each
1007 assembler input file produces an object file, and linking combines all
1008 the object files (those newly compiled, and those specified as input)
1009 into an executable file.
1010
1011 @cindex file name suffix
1012 For any given input file, the file name suffix determines what kind of
1013 compilation is done:
1014
1015 @table @gcctabopt
1016 @item @var{file}.c
1017 C source code which must be preprocessed.
1018
1019 @item @var{file}.i
1020 C source code which should not be preprocessed.
1021
1022 @item @var{file}.ii
1023 C++ source code which should not be preprocessed.
1024
1025 @item @var{file}.m
1026 Objective-C source code.  Note that you must link with the @file{libobjc}
1027 library to make an Objective-C program work.
1028
1029 @item @var{file}.mi
1030 Objective-C source code which should not be preprocessed.
1031
1032 @item @var{file}.mm
1033 @itemx @var{file}.M
1034 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1035 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1036 to a literal capital M@.
1037
1038 @item @var{file}.mii
1039 Objective-C++ source code which should not be preprocessed.
1040
1041 @item @var{file}.h
1042 C, C++, Objective-C or Objective-C++ header file to be turned into a
1043 precompiled header (default), or C, C++ header file to be turned into an
1044 Ada spec (via the @option{-fdump-ada-spec} switch).
1045
1046 @item @var{file}.cc
1047 @itemx @var{file}.cp
1048 @itemx @var{file}.cxx
1049 @itemx @var{file}.cpp
1050 @itemx @var{file}.CPP
1051 @itemx @var{file}.c++
1052 @itemx @var{file}.C
1053 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1054 the last two letters must both be literally @samp{x}.  Likewise,
1055 @samp{.C} refers to a literal capital C@.
1056
1057 @item @var{file}.mm
1058 @itemx @var{file}.M
1059 Objective-C++ source code which must be preprocessed.
1060
1061 @item @var{file}.mii
1062 Objective-C++ source code which should not be preprocessed.
1063
1064 @item @var{file}.hh
1065 @itemx @var{file}.H
1066 @itemx @var{file}.hp
1067 @itemx @var{file}.hxx
1068 @itemx @var{file}.hpp
1069 @itemx @var{file}.HPP
1070 @itemx @var{file}.h++
1071 @itemx @var{file}.tcc
1072 C++ header file to be turned into a precompiled header or Ada spec.
1073
1074 @item @var{file}.f
1075 @itemx @var{file}.for
1076 @itemx @var{file}.ftn
1077 Fixed form Fortran source code which should not be preprocessed.
1078
1079 @item @var{file}.F
1080 @itemx @var{file}.FOR
1081 @itemx @var{file}.fpp
1082 @itemx @var{file}.FPP
1083 @itemx @var{file}.FTN
1084 Fixed form Fortran source code which must be preprocessed (with the traditional
1085 preprocessor).
1086
1087 @item @var{file}.f90
1088 @itemx @var{file}.f95
1089 @itemx @var{file}.f03
1090 @itemx @var{file}.f08
1091 Free form Fortran source code which should not be preprocessed.
1092
1093 @item @var{file}.F90
1094 @itemx @var{file}.F95
1095 @itemx @var{file}.F03
1096 @itemx @var{file}.F08
1097 Free form Fortran source code which must be preprocessed (with the
1098 traditional preprocessor).
1099
1100 @item @var{file}.go
1101 Go source code.
1102
1103 @c FIXME: Descriptions of Java file types.
1104 @c @var{file}.java
1105 @c @var{file}.class
1106 @c @var{file}.zip
1107 @c @var{file}.jar
1108
1109 @item @var{file}.ads
1110 Ada source code file which contains a library unit declaration (a
1111 declaration of a package, subprogram, or generic, or a generic
1112 instantiation), or a library unit renaming declaration (a package,
1113 generic, or subprogram renaming declaration).  Such files are also
1114 called @dfn{specs}.
1115
1116 @item @var{file}.adb
1117 Ada source code file containing a library unit body (a subprogram or
1118 package body).  Such files are also called @dfn{bodies}.
1119
1120 @c GCC also knows about some suffixes for languages not yet included:
1121 @c Pascal:
1122 @c @var{file}.p
1123 @c @var{file}.pas
1124 @c Ratfor:
1125 @c @var{file}.r
1126
1127 @item @var{file}.s
1128 Assembler code.
1129
1130 @item @var{file}.S
1131 @itemx @var{file}.sx
1132 Assembler code which must be preprocessed.
1133
1134 @item @var{other}
1135 An object file to be fed straight into linking.
1136 Any file name with no recognized suffix is treated this way.
1137 @end table
1138
1139 @opindex x
1140 You can specify the input language explicitly with the @option{-x} option:
1141
1142 @table @gcctabopt
1143 @item -x @var{language}
1144 Specify explicitly the @var{language} for the following input files
1145 (rather than letting the compiler choose a default based on the file
1146 name suffix).  This option applies to all following input files until
1147 the next @option{-x} option.  Possible values for @var{language} are:
1148 @smallexample
1149 c  c-header  cpp-output
1150 c++  c++-header  c++-cpp-output
1151 objective-c  objective-c-header  objective-c-cpp-output
1152 objective-c++ objective-c++-header objective-c++-cpp-output
1153 assembler  assembler-with-cpp
1154 ada
1155 f77  f77-cpp-input f95  f95-cpp-input
1156 go
1157 java
1158 @end smallexample
1159
1160 @item -x none
1161 Turn off any specification of a language, so that subsequent files are
1162 handled according to their file name suffixes (as they are if @option{-x}
1163 has not been used at all).
1164
1165 @item -pass-exit-codes
1166 @opindex pass-exit-codes
1167 Normally the @command{gcc} program will exit with the code of 1 if any
1168 phase of the compiler returns a non-success return code.  If you specify
1169 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1170 numerically highest error produced by any phase that returned an error
1171 indication.  The C, C++, and Fortran frontends return 4, if an internal
1172 compiler error is encountered.
1173 @end table
1174
1175 If you only want some of the stages of compilation, you can use
1176 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1177 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1178 @command{gcc} is to stop.  Note that some combinations (for example,
1179 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1180
1181 @table @gcctabopt
1182 @item -c
1183 @opindex c
1184 Compile or assemble the source files, but do not link.  The linking
1185 stage simply is not done.  The ultimate output is in the form of an
1186 object file for each source file.
1187
1188 By default, the object file name for a source file is made by replacing
1189 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1190
1191 Unrecognized input files, not requiring compilation or assembly, are
1192 ignored.
1193
1194 @item -S
1195 @opindex S
1196 Stop after the stage of compilation proper; do not assemble.  The output
1197 is in the form of an assembler code file for each non-assembler input
1198 file specified.
1199
1200 By default, the assembler file name for a source file is made by
1201 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1202
1203 Input files that don't require compilation are ignored.
1204
1205 @item -E
1206 @opindex E
1207 Stop after the preprocessing stage; do not run the compiler proper.  The
1208 output is in the form of preprocessed source code, which is sent to the
1209 standard output.
1210
1211 Input files which don't require preprocessing are ignored.
1212
1213 @cindex output file option
1214 @item -o @var{file}
1215 @opindex o
1216 Place output in file @var{file}.  This applies regardless to whatever
1217 sort of output is being produced, whether it be an executable file,
1218 an object file, an assembler file or preprocessed C code.
1219
1220 If @option{-o} is not specified, the default is to put an executable
1221 file in @file{a.out}, the object file for
1222 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1223 assembler file in @file{@var{source}.s}, a precompiled header file in
1224 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1225 standard output.
1226
1227 @item -v
1228 @opindex v
1229 Print (on standard error output) the commands executed to run the stages
1230 of compilation.  Also print the version number of the compiler driver
1231 program and of the preprocessor and the compiler proper.
1232
1233 @item -###
1234 @opindex ###
1235 Like @option{-v} except the commands are not executed and arguments
1236 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1237 This is useful for shell scripts to capture the driver-generated command lines.
1238
1239 @item -pipe
1240 @opindex pipe
1241 Use pipes rather than temporary files for communication between the
1242 various stages of compilation.  This fails to work on some systems where
1243 the assembler is unable to read from a pipe; but the GNU assembler has
1244 no trouble.
1245
1246 @item --help
1247 @opindex help
1248 Print (on the standard output) a description of the command line options
1249 understood by @command{gcc}.  If the @option{-v} option is also specified
1250 then @option{--help} will also be passed on to the various processes
1251 invoked by @command{gcc}, so that they can display the command line options
1252 they accept.  If the @option{-Wextra} option has also been specified
1253 (prior to the @option{--help} option), then command line options which
1254 have no documentation associated with them will also be displayed.
1255
1256 @item --target-help
1257 @opindex target-help
1258 Print (on the standard output) a description of target-specific command
1259 line options for each tool.  For some targets extra target-specific
1260 information may also be printed.
1261
1262 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1263 Print (on the standard output) a description of the command line
1264 options understood by the compiler that fit into all specified classes
1265 and qualifiers.  These are the supported classes:
1266
1267 @table @asis
1268 @item @samp{optimizers}
1269 This will display all of the optimization options supported by the
1270 compiler.
1271
1272 @item @samp{warnings}
1273 This will display all of the options controlling warning messages
1274 produced by the compiler.
1275
1276 @item @samp{target}
1277 This will display target-specific options.  Unlike the
1278 @option{--target-help} option however, target-specific options of the
1279 linker and assembler will not be displayed.  This is because those
1280 tools do not currently support the extended @option{--help=} syntax.
1281
1282 @item @samp{params}
1283 This will display the values recognized by the @option{--param}
1284 option.
1285
1286 @item @var{language}
1287 This will display the options supported for @var{language}, where
1288 @var{language} is the name of one of the languages supported in this
1289 version of GCC.
1290
1291 @item @samp{common}
1292 This will display the options that are common to all languages.
1293 @end table
1294
1295 These are the supported qualifiers:
1296
1297 @table @asis
1298 @item @samp{undocumented}
1299 Display only those options which are undocumented.
1300
1301 @item @samp{joined}
1302 Display options which take an argument that appears after an equal
1303 sign in the same continuous piece of text, such as:
1304 @samp{--help=target}.
1305
1306 @item @samp{separate}
1307 Display options which take an argument that appears as a separate word
1308 following the original option, such as: @samp{-o output-file}.
1309 @end table
1310
1311 Thus for example to display all the undocumented target-specific
1312 switches supported by the compiler the following can be used:
1313
1314 @smallexample
1315 --help=target,undocumented
1316 @end smallexample
1317
1318 The sense of a qualifier can be inverted by prefixing it with the
1319 @samp{^} character, so for example to display all binary warning
1320 options (i.e., ones that are either on or off and that do not take an
1321 argument), which have a description the following can be used:
1322
1323 @smallexample
1324 --help=warnings,^joined,^undocumented
1325 @end smallexample
1326
1327 The argument to @option{--help=} should not consist solely of inverted
1328 qualifiers.
1329
1330 Combining several classes is possible, although this usually
1331 restricts the output by so much that there is nothing to display.  One
1332 case where it does work however is when one of the classes is
1333 @var{target}.  So for example to display all the target-specific
1334 optimization options the following can be used:
1335
1336 @smallexample
1337 --help=target,optimizers
1338 @end smallexample
1339
1340 The @option{--help=} option can be repeated on the command line.  Each
1341 successive use will display its requested class of options, skipping
1342 those that have already been displayed.
1343
1344 If the @option{-Q} option appears on the command line before the
1345 @option{--help=} option, then the descriptive text displayed by
1346 @option{--help=} is changed.  Instead of describing the displayed
1347 options, an indication is given as to whether the option is enabled,
1348 disabled or set to a specific value (assuming that the compiler
1349 knows this at the point where the @option{--help=} option is used).
1350
1351 Here is a truncated example from the ARM port of @command{gcc}:
1352
1353 @smallexample
1354   % gcc -Q -mabi=2 --help=target -c
1355   The following options are target specific:
1356   -mabi=                                2
1357   -mabort-on-noreturn                   [disabled]
1358   -mapcs                                [disabled]
1359 @end smallexample
1360
1361 The output is sensitive to the effects of previous command line
1362 options, so for example it is possible to find out which optimizations
1363 are enabled at @option{-O2} by using:
1364
1365 @smallexample
1366 -Q -O2 --help=optimizers
1367 @end smallexample
1368
1369 Alternatively you can discover which binary optimizations are enabled
1370 by @option{-O3} by using:
1371
1372 @smallexample
1373 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1374 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1375 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1376 @end smallexample
1377
1378 @item -no-canonical-prefixes
1379 @opindex no-canonical-prefixes
1380 Do not expand any symbolic links, resolve references to @samp{/../}
1381 or @samp{/./}, or make the path absolute when generating a relative
1382 prefix.
1383
1384 @item --version
1385 @opindex version
1386 Display the version number and copyrights of the invoked GCC@.
1387
1388 @item -wrapper
1389 @opindex wrapper
1390 Invoke all subcommands under a wrapper program.  The name of the
1391 wrapper program and its parameters are passed as a comma separated
1392 list.
1393
1394 @smallexample
1395 gcc -c t.c -wrapper gdb,--args
1396 @end smallexample
1397
1398 This will invoke all subprograms of @command{gcc} under
1399 @samp{gdb --args}, thus the invocation of @command{cc1} will be
1400 @samp{gdb --args cc1 @dots{}}.
1401
1402 @item -fplugin=@var{name}.so
1403 Load the plugin code in file @var{name}.so, assumed to be a
1404 shared object to be dlopen'd by the compiler.  The base name of
1405 the shared object file is used to identify the plugin for the
1406 purposes of argument parsing (See
1407 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1408 Each plugin should define the callback functions specified in the
1409 Plugins API.
1410
1411 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1412 Define an argument called @var{key} with a value of @var{value}
1413 for the plugin called @var{name}.
1414
1415 @item -fdump-ada-spec@r{[}-slim@r{]}
1416 For C and C++ source and include files, generate corresponding Ada
1417 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1418 GNAT User's Guide}, which provides detailed documentation on this feature.
1419
1420 @item -fdump-go-spec=@var{file}
1421 For input files in any language, generate corresponding Go
1422 declarations in @var{file}.  This generates Go @code{const},
1423 @code{type}, @code{var}, and @code{func} declarations which may be a
1424 useful way to start writing a Go interface to code written in some
1425 other language.
1426
1427 @include @value{srcdir}/../libiberty/at-file.texi
1428 @end table
1429
1430 @node Invoking G++
1431 @section Compiling C++ Programs
1432
1433 @cindex suffixes for C++ source
1434 @cindex C++ source file suffixes
1435 C++ source files conventionally use one of the suffixes @samp{.C},
1436 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1437 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1438 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1439 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1440 files with these names and compiles them as C++ programs even if you
1441 call the compiler the same way as for compiling C programs (usually
1442 with the name @command{gcc}).
1443
1444 @findex g++
1445 @findex c++
1446 However, the use of @command{gcc} does not add the C++ library.
1447 @command{g++} is a program that calls GCC and treats @samp{.c},
1448 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1449 files unless @option{-x} is used, and automatically specifies linking
1450 against the C++ library.  This program is also useful when
1451 precompiling a C header file with a @samp{.h} extension for use in C++
1452 compilations.  On many systems, @command{g++} is also installed with
1453 the name @command{c++}.
1454
1455 @cindex invoking @command{g++}
1456 When you compile C++ programs, you may specify many of the same
1457 command-line options that you use for compiling programs in any
1458 language; or command-line options meaningful for C and related
1459 languages; or options that are meaningful only for C++ programs.
1460 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1461 explanations of options for languages related to C@.
1462 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1463 explanations of options that are meaningful only for C++ programs.
1464
1465 @node C Dialect Options
1466 @section Options Controlling C Dialect
1467 @cindex dialect options
1468 @cindex language dialect options
1469 @cindex options, dialect
1470
1471 The following options control the dialect of C (or languages derived
1472 from C, such as C++, Objective-C and Objective-C++) that the compiler
1473 accepts:
1474
1475 @table @gcctabopt
1476 @cindex ANSI support
1477 @cindex ISO support
1478 @item -ansi
1479 @opindex ansi
1480 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1481 equivalent to @samp{-std=c++98}.
1482
1483 This turns off certain features of GCC that are incompatible with ISO
1484 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1485 such as the @code{asm} and @code{typeof} keywords, and
1486 predefined macros such as @code{unix} and @code{vax} that identify the
1487 type of system you are using.  It also enables the undesirable and
1488 rarely used ISO trigraph feature.  For the C compiler,
1489 it disables recognition of C++ style @samp{//} comments as well as
1490 the @code{inline} keyword.
1491
1492 The alternate keywords @code{__asm__}, @code{__extension__},
1493 @code{__inline__} and @code{__typeof__} continue to work despite
1494 @option{-ansi}.  You would not want to use them in an ISO C program, of
1495 course, but it is useful to put them in header files that might be included
1496 in compilations done with @option{-ansi}.  Alternate predefined macros
1497 such as @code{__unix__} and @code{__vax__} are also available, with or
1498 without @option{-ansi}.
1499
1500 The @option{-ansi} option does not cause non-ISO programs to be
1501 rejected gratuitously.  For that, @option{-pedantic} is required in
1502 addition to @option{-ansi}.  @xref{Warning Options}.
1503
1504 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1505 option is used.  Some header files may notice this macro and refrain
1506 from declaring certain functions or defining certain macros that the
1507 ISO standard doesn't call for; this is to avoid interfering with any
1508 programs that might use these names for other things.
1509
1510 Functions that would normally be built in but do not have semantics
1511 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1512 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1513 built-in functions provided by GCC}, for details of the functions
1514 affected.
1515
1516 @item -std=
1517 @opindex std
1518 Determine the language standard. @xref{Standards,,Language Standards
1519 Supported by GCC}, for details of these standard versions.  This option
1520 is currently only supported when compiling C or C++.
1521
1522 The compiler can accept several base standards, such as @samp{c90} or
1523 @samp{c++98}, and GNU dialects of those standards, such as
1524 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1525 compiler will accept all programs following that standard and those
1526 using GNU extensions that do not contradict it.  For example,
1527 @samp{-std=c90} turns off certain features of GCC that are
1528 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1529 keywords, but not other GNU extensions that do not have a meaning in
1530 ISO C90, such as omitting the middle term of a @code{?:}
1531 expression. On the other hand, by specifying a GNU dialect of a
1532 standard, all features the compiler support are enabled, even when
1533 those features change the meaning of the base standard and some
1534 strict-conforming programs may be rejected.  The particular standard
1535 is used by @option{-pedantic} to identify which features are GNU
1536 extensions given that version of the standard. For example
1537 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1538 comments, while @samp{-std=gnu99 -pedantic} would not.
1539
1540 A value for this option must be provided; possible values are
1541
1542 @table @samp
1543 @item c90
1544 @itemx c89
1545 @itemx iso9899:1990
1546 Support all ISO C90 programs (certain GNU extensions that conflict
1547 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1548
1549 @item iso9899:199409
1550 ISO C90 as modified in amendment 1.
1551
1552 @item c99
1553 @itemx c9x
1554 @itemx iso9899:1999
1555 @itemx iso9899:199x
1556 ISO C99.  Note that this standard is not yet fully supported; see
1557 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1558 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1559
1560 @item c1x
1561 ISO C1X, the draft of the next revision of the ISO C standard.
1562 Support is limited and experimental and features enabled by this
1563 option may be changed or removed if changed in or removed from the
1564 standard draft.
1565
1566 @item gnu90
1567 @itemx gnu89
1568 GNU dialect of ISO C90 (including some C99 features). This
1569 is the default for C code.
1570
1571 @item gnu99
1572 @itemx gnu9x
1573 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1574 this will become the default.  The name @samp{gnu9x} is deprecated.
1575
1576 @item gnu1x
1577 GNU dialect of ISO C1X.  Support is limited and experimental and
1578 features enabled by this option may be changed or removed if changed
1579 in or removed from the standard draft.
1580
1581 @item c++98
1582 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1583 C++ code.
1584
1585 @item gnu++98
1586 GNU dialect of @option{-std=c++98}.  This is the default for
1587 C++ code.
1588
1589 @item c++11
1590 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1591 experimental, and may change in incompatible ways in future releases.
1592
1593 @item gnu++11
1594 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1595 experimental, and may change in incompatible ways in future releases.
1596 @end table
1597
1598 @item -fgnu89-inline
1599 @opindex fgnu89-inline
1600 The option @option{-fgnu89-inline} tells GCC to use the traditional
1601 GNU semantics for @code{inline} functions when in C99 mode.
1602 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1603 is accepted and ignored by GCC versions 4.1.3 up to but not including
1604 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1605 C99 mode.  Using this option is roughly equivalent to adding the
1606 @code{gnu_inline} function attribute to all inline functions
1607 (@pxref{Function Attributes}).
1608
1609 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1610 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1611 specifies the default behavior).  This option was first supported in
1612 GCC 4.3.  This option is not supported in @option{-std=c90} or
1613 @option{-std=gnu90} mode.
1614
1615 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1616 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1617 in effect for @code{inline} functions.  @xref{Common Predefined
1618 Macros,,,cpp,The C Preprocessor}.
1619
1620 @item -aux-info @var{filename}
1621 @opindex aux-info
1622 Output to the given filename prototyped declarations for all functions
1623 declared and/or defined in a translation unit, including those in header
1624 files.  This option is silently ignored in any language other than C@.
1625
1626 Besides declarations, the file indicates, in comments, the origin of
1627 each declaration (source file and line), whether the declaration was
1628 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1629 @samp{O} for old, respectively, in the first character after the line
1630 number and the colon), and whether it came from a declaration or a
1631 definition (@samp{C} or @samp{F}, respectively, in the following
1632 character).  In the case of function definitions, a K&R-style list of
1633 arguments followed by their declarations is also provided, inside
1634 comments, after the declaration.
1635
1636 @item -fallow-parameterless-variadic-functions
1637 Accept variadic functions without named parameters.
1638
1639 Although it is possible to define such a function, this is not very
1640 useful as it is not possible to read the arguments.  This is only
1641 supported for C as this construct is allowed by C++.
1642
1643 @item -fno-asm
1644 @opindex fno-asm
1645 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1646 keyword, so that code can use these words as identifiers.  You can use
1647 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1648 instead.  @option{-ansi} implies @option{-fno-asm}.
1649
1650 In C++, this switch only affects the @code{typeof} keyword, since
1651 @code{asm} and @code{inline} are standard keywords.  You may want to
1652 use the @option{-fno-gnu-keywords} flag instead, which has the same
1653 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1654 switch only affects the @code{asm} and @code{typeof} keywords, since
1655 @code{inline} is a standard keyword in ISO C99.
1656
1657 @item -fno-builtin
1658 @itemx -fno-builtin-@var{function}
1659 @opindex fno-builtin
1660 @cindex built-in functions
1661 Don't recognize built-in functions that do not begin with
1662 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1663 functions provided by GCC}, for details of the functions affected,
1664 including those which are not built-in functions when @option{-ansi} or
1665 @option{-std} options for strict ISO C conformance are used because they
1666 do not have an ISO standard meaning.
1667
1668 GCC normally generates special code to handle certain built-in functions
1669 more efficiently; for instance, calls to @code{alloca} may become single
1670 instructions that adjust the stack directly, and calls to @code{memcpy}
1671 may become inline copy loops.  The resulting code is often both smaller
1672 and faster, but since the function calls no longer appear as such, you
1673 cannot set a breakpoint on those calls, nor can you change the behavior
1674 of the functions by linking with a different library.  In addition,
1675 when a function is recognized as a built-in function, GCC may use
1676 information about that function to warn about problems with calls to
1677 that function, or to generate more efficient code, even if the
1678 resulting code still contains calls to that function.  For example,
1679 warnings are given with @option{-Wformat} for bad calls to
1680 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1681 known not to modify global memory.
1682
1683 With the @option{-fno-builtin-@var{function}} option
1684 only the built-in function @var{function} is
1685 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1686 function is named that is not built-in in this version of GCC, this
1687 option is ignored.  There is no corresponding
1688 @option{-fbuiltin-@var{function}} option; if you wish to enable
1689 built-in functions selectively when using @option{-fno-builtin} or
1690 @option{-ffreestanding}, you may define macros such as:
1691
1692 @smallexample
1693 #define abs(n)          __builtin_abs ((n))
1694 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1695 @end smallexample
1696
1697 @item -fhosted
1698 @opindex fhosted
1699 @cindex hosted environment
1700
1701 Assert that compilation takes place in a hosted environment.  This implies
1702 @option{-fbuiltin}.  A hosted environment is one in which the
1703 entire standard library is available, and in which @code{main} has a return
1704 type of @code{int}.  Examples are nearly everything except a kernel.
1705 This is equivalent to @option{-fno-freestanding}.
1706
1707 @item -ffreestanding
1708 @opindex ffreestanding
1709 @cindex hosted environment
1710
1711 Assert that compilation takes place in a freestanding environment.  This
1712 implies @option{-fno-builtin}.  A freestanding environment
1713 is one in which the standard library may not exist, and program startup may
1714 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1715 This is equivalent to @option{-fno-hosted}.
1716
1717 @xref{Standards,,Language Standards Supported by GCC}, for details of
1718 freestanding and hosted environments.
1719
1720 @item -fopenmp
1721 @opindex fopenmp
1722 @cindex OpenMP parallel
1723 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1724 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1725 compiler generates parallel code according to the OpenMP Application
1726 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1727 implies @option{-pthread}, and thus is only supported on targets that
1728 have support for @option{-pthread}.
1729
1730 @item -fgnu-tm
1731 @opindex fgnu-tm
1732 When the option @option{-fgnu-tm} is specified, the compiler will
1733 generate code for the Linux variant of Intel's current Transactional
1734 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1735 an experimental feature whose interface may change in future versions
1736 of GCC, as the official specification changes.  Please note that not
1737 all architectures are supported for this feature.
1738
1739 For more information on GCC's support for transactional memory,
1740 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1741 Transactional Memory Library}.
1742
1743 @item -fms-extensions
1744 @opindex fms-extensions
1745 Accept some non-standard constructs used in Microsoft header files.
1746
1747 In C++ code, this allows member names in structures to be similar
1748 to previous types declarations.
1749
1750 @smallexample
1751 typedef int UOW;
1752 struct ABC @{
1753   UOW UOW;
1754 @};
1755 @end smallexample
1756
1757 Some cases of unnamed fields in structures and unions are only
1758 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1759 fields within structs/unions}, for details.
1760
1761 @item -fplan9-extensions
1762 Accept some non-standard constructs used in Plan 9 code.
1763
1764 This enables @option{-fms-extensions}, permits passing pointers to
1765 structures with anonymous fields to functions which expect pointers to
1766 elements of the type of the field, and permits referring to anonymous
1767 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1768 struct/union fields within structs/unions}, for details.  This is only
1769 supported for C, not C++.
1770
1771 @item -trigraphs
1772 @opindex trigraphs
1773 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1774 options for strict ISO C conformance) implies @option{-trigraphs}.
1775
1776 @item -no-integrated-cpp
1777 @opindex no-integrated-cpp
1778 Performs a compilation in two passes: preprocessing and compiling.  This
1779 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1780 @option{-B} option.  The user supplied compilation step can then add in
1781 an additional preprocessing step after normal preprocessing but before
1782 compiling.  The default is to use the integrated cpp (internal cpp)
1783
1784 The semantics of this option will change if "cc1", "cc1plus", and
1785 "cc1obj" are merged.
1786
1787 @cindex traditional C language
1788 @cindex C language, traditional
1789 @item -traditional
1790 @itemx -traditional-cpp
1791 @opindex traditional-cpp
1792 @opindex traditional
1793 Formerly, these options caused GCC to attempt to emulate a pre-standard
1794 C compiler.  They are now only supported with the @option{-E} switch.
1795 The preprocessor continues to support a pre-standard mode.  See the GNU
1796 CPP manual for details.
1797
1798 @item -fcond-mismatch
1799 @opindex fcond-mismatch
1800 Allow conditional expressions with mismatched types in the second and
1801 third arguments.  The value of such an expression is void.  This option
1802 is not supported for C++.
1803
1804 @item -flax-vector-conversions
1805 @opindex flax-vector-conversions
1806 Allow implicit conversions between vectors with differing numbers of
1807 elements and/or incompatible element types.  This option should not be
1808 used for new code.
1809
1810 @item -funsigned-char
1811 @opindex funsigned-char
1812 Let the type @code{char} be unsigned, like @code{unsigned char}.
1813
1814 Each kind of machine has a default for what @code{char} should
1815 be.  It is either like @code{unsigned char} by default or like
1816 @code{signed char} by default.
1817
1818 Ideally, a portable program should always use @code{signed char} or
1819 @code{unsigned char} when it depends on the signedness of an object.
1820 But many programs have been written to use plain @code{char} and
1821 expect it to be signed, or expect it to be unsigned, depending on the
1822 machines they were written for.  This option, and its inverse, let you
1823 make such a program work with the opposite default.
1824
1825 The type @code{char} is always a distinct type from each of
1826 @code{signed char} or @code{unsigned char}, even though its behavior
1827 is always just like one of those two.
1828
1829 @item -fsigned-char
1830 @opindex fsigned-char
1831 Let the type @code{char} be signed, like @code{signed char}.
1832
1833 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1834 the negative form of @option{-funsigned-char}.  Likewise, the option
1835 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1836
1837 @item -fsigned-bitfields
1838 @itemx -funsigned-bitfields
1839 @itemx -fno-signed-bitfields
1840 @itemx -fno-unsigned-bitfields
1841 @opindex fsigned-bitfields
1842 @opindex funsigned-bitfields
1843 @opindex fno-signed-bitfields
1844 @opindex fno-unsigned-bitfields
1845 These options control whether a bit-field is signed or unsigned, when the
1846 declaration does not use either @code{signed} or @code{unsigned}.  By
1847 default, such a bit-field is signed, because this is consistent: the
1848 basic integer types such as @code{int} are signed types.
1849 @end table
1850
1851 @node C++ Dialect Options
1852 @section Options Controlling C++ Dialect
1853
1854 @cindex compiler options, C++
1855 @cindex C++ options, command line
1856 @cindex options, C++
1857 This section describes the command-line options that are only meaningful
1858 for C++ programs; but you can also use most of the GNU compiler options
1859 regardless of what language your program is in.  For example, you
1860 might compile a file @code{firstClass.C} like this:
1861
1862 @smallexample
1863 g++ -g -frepo -O -c firstClass.C
1864 @end smallexample
1865
1866 @noindent
1867 In this example, only @option{-frepo} is an option meant
1868 only for C++ programs; you can use the other options with any
1869 language supported by GCC@.
1870
1871 Here is a list of options that are @emph{only} for compiling C++ programs:
1872
1873 @table @gcctabopt
1874
1875 @item -fabi-version=@var{n}
1876 @opindex fabi-version
1877 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1878 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1879 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1880 the version that conforms most closely to the C++ ABI specification.
1881 Therefore, the ABI obtained using version 0 will change as ABI bugs
1882 are fixed.
1883
1884 The default is version 2.
1885
1886 Version 3 corrects an error in mangling a constant address as a
1887 template argument.
1888
1889 Version 4 implements a standard mangling for vector types.
1890
1891 Version 5 corrects the mangling of attribute const/volatile on
1892 function pointer types, decltype of a plain decl, and use of a
1893 function parameter in the declaration of another parameter.
1894
1895 Version 6 corrects the promotion behavior of C++11 scoped enums.
1896
1897 See also @option{-Wabi}.
1898
1899 @item -fno-access-control
1900 @opindex fno-access-control
1901 Turn off all access checking.  This switch is mainly useful for working
1902 around bugs in the access control code.
1903
1904 @item -fcheck-new
1905 @opindex fcheck-new
1906 Check that the pointer returned by @code{operator new} is non-null
1907 before attempting to modify the storage allocated.  This check is
1908 normally unnecessary because the C++ standard specifies that
1909 @code{operator new} will only return @code{0} if it is declared
1910 @samp{throw()}, in which case the compiler will always check the
1911 return value even without this option.  In all other cases, when
1912 @code{operator new} has a non-empty exception specification, memory
1913 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1914 @samp{new (nothrow)}.
1915
1916 @item -fconserve-space
1917 @opindex fconserve-space
1918 Put uninitialized or runtime-initialized global variables into the
1919 common segment, as C does.  This saves space in the executable at the
1920 cost of not diagnosing duplicate definitions.  If you compile with this
1921 flag and your program mysteriously crashes after @code{main()} has
1922 completed, you may have an object that is being destroyed twice because
1923 two definitions were merged.
1924
1925 This option is no longer useful on most targets, now that support has
1926 been added for putting variables into BSS without making them common.
1927
1928 @item -fconstexpr-depth=@var{n}
1929 @opindex fconstexpr-depth
1930 Set the maximum nested evaluation depth for C++11 constexpr functions
1931 to @var{n}.  A limit is needed to detect endless recursion during
1932 constant expression evaluation.  The minimum specified by the standard
1933 is 512.
1934
1935 @item -fdeduce-init-list
1936 @opindex fdeduce-init-list
1937 Enable deduction of a template type parameter as
1938 std::initializer_list from a brace-enclosed initializer list, i.e.
1939
1940 @smallexample
1941 template <class T> auto forward(T t) -> decltype (realfn (t))
1942 @{
1943   return realfn (t);
1944 @}
1945
1946 void f()
1947 @{
1948   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1949 @}
1950 @end smallexample
1951
1952 This deduction was implemented as a possible extension to the
1953 originally proposed semantics for the C++11 standard, but was not part
1954 of the final standard, so it is disabled by default.  This option is
1955 deprecated, and may be removed in a future version of G++.
1956
1957 @item -ffriend-injection
1958 @opindex ffriend-injection
1959 Inject friend functions into the enclosing namespace, so that they are
1960 visible outside the scope of the class in which they are declared.
1961 Friend functions were documented to work this way in the old Annotated
1962 C++ Reference Manual, and versions of G++ before 4.1 always worked
1963 that way.  However, in ISO C++ a friend function which is not declared
1964 in an enclosing scope can only be found using argument dependent
1965 lookup.  This option causes friends to be injected as they were in
1966 earlier releases.
1967
1968 This option is for compatibility, and may be removed in a future
1969 release of G++.
1970
1971 @item -fno-elide-constructors
1972 @opindex fno-elide-constructors
1973 The C++ standard allows an implementation to omit creating a temporary
1974 which is only used to initialize another object of the same type.
1975 Specifying this option disables that optimization, and forces G++ to
1976 call the copy constructor in all cases.
1977
1978 @item -fno-enforce-eh-specs
1979 @opindex fno-enforce-eh-specs
1980 Don't generate code to check for violation of exception specifications
1981 at runtime.  This option violates the C++ standard, but may be useful
1982 for reducing code size in production builds, much like defining
1983 @samp{NDEBUG}.  This does not give user code permission to throw
1984 exceptions in violation of the exception specifications; the compiler
1985 will still optimize based on the specifications, so throwing an
1986 unexpected exception will result in undefined behavior.
1987
1988 @item -ffor-scope
1989 @itemx -fno-for-scope
1990 @opindex ffor-scope
1991 @opindex fno-for-scope
1992 If @option{-ffor-scope} is specified, the scope of variables declared in
1993 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1994 as specified by the C++ standard.
1995 If @option{-fno-for-scope} is specified, the scope of variables declared in
1996 a @i{for-init-statement} extends to the end of the enclosing scope,
1997 as was the case in old versions of G++, and other (traditional)
1998 implementations of C++.
1999
2000 The default if neither flag is given to follow the standard,
2001 but to allow and give a warning for old-style code that would
2002 otherwise be invalid, or have different behavior.
2003
2004 @item -fno-gnu-keywords
2005 @opindex fno-gnu-keywords
2006 Do not recognize @code{typeof} as a keyword, so that code can use this
2007 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2008 @option{-ansi} implies @option{-fno-gnu-keywords}.
2009
2010 @item -fno-implicit-templates
2011 @opindex fno-implicit-templates
2012 Never emit code for non-inline templates which are instantiated
2013 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2014 @xref{Template Instantiation}, for more information.
2015
2016 @item -fno-implicit-inline-templates
2017 @opindex fno-implicit-inline-templates
2018 Don't emit code for implicit instantiations of inline templates, either.
2019 The default is to handle inlines differently so that compiles with and
2020 without optimization will need the same set of explicit instantiations.
2021
2022 @item -fno-implement-inlines
2023 @opindex fno-implement-inlines
2024 To save space, do not emit out-of-line copies of inline functions
2025 controlled by @samp{#pragma implementation}.  This will cause linker
2026 errors if these functions are not inlined everywhere they are called.
2027
2028 @item -fms-extensions
2029 @opindex fms-extensions
2030 Disable pedantic warnings about constructs used in MFC, such as implicit
2031 int and getting a pointer to member function via non-standard syntax.
2032
2033 @item -fno-nonansi-builtins
2034 @opindex fno-nonansi-builtins
2035 Disable built-in declarations of functions that are not mandated by
2036 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2037 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2038
2039 @item -fnothrow-opt
2040 @opindex fnothrow-opt
2041 Treat a @code{throw()} exception specification as though it were a
2042 @code{noexcept} specification to reduce or eliminate the text size
2043 overhead relative to a function with no exception specification.  If
2044 the function has local variables of types with non-trivial
2045 destructors, the exception specification will actually make the
2046 function smaller because the EH cleanups for those variables can be
2047 optimized away.  The semantic effect is that an exception thrown out of
2048 a function with such an exception specification will result in a call
2049 to @code{terminate} rather than @code{unexpected}.
2050
2051 @item -fno-operator-names
2052 @opindex fno-operator-names
2053 Do not treat the operator name keywords @code{and}, @code{bitand},
2054 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2055 synonyms as keywords.
2056
2057 @item -fno-optional-diags
2058 @opindex fno-optional-diags
2059 Disable diagnostics that the standard says a compiler does not need to
2060 issue.  Currently, the only such diagnostic issued by G++ is the one for
2061 a name having multiple meanings within a class.
2062
2063 @item -fpermissive
2064 @opindex fpermissive
2065 Downgrade some diagnostics about nonconformant code from errors to
2066 warnings.  Thus, using @option{-fpermissive} will allow some
2067 nonconforming code to compile.
2068
2069 @item -fno-pretty-templates
2070 @opindex fno-pretty-templates
2071 When an error message refers to a specialization of a function
2072 template, the compiler will normally print the signature of the
2073 template followed by the template arguments and any typedefs or
2074 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2075 rather than @code{void f(int)}) so that it's clear which template is
2076 involved.  When an error message refers to a specialization of a class
2077 template, the compiler will omit any template arguments which match
2078 the default template arguments for that template.  If either of these
2079 behaviors make it harder to understand the error message rather than
2080 easier, using @option{-fno-pretty-templates} will disable them.
2081
2082 @item -frepo
2083 @opindex frepo
2084 Enable automatic template instantiation at link time.  This option also
2085 implies @option{-fno-implicit-templates}.  @xref{Template
2086 Instantiation}, for more information.
2087
2088 @item -fno-rtti
2089 @opindex fno-rtti
2090 Disable generation of information about every class with virtual
2091 functions for use by the C++ runtime type identification features
2092 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2093 of the language, you can save some space by using this flag.  Note that
2094 exception handling uses the same information, but it will generate it as
2095 needed. The @samp{dynamic_cast} operator can still be used for casts that
2096 do not require runtime type information, i.e.@: casts to @code{void *} or to
2097 unambiguous base classes.
2098
2099 @item -fstats
2100 @opindex fstats
2101 Emit statistics about front-end processing at the end of the compilation.
2102 This information is generally only useful to the G++ development team.
2103
2104 @item -fstrict-enums
2105 @opindex fstrict-enums
2106 Allow the compiler to optimize using the assumption that a value of
2107 enumeration type can only be one of the values of the enumeration (as
2108 defined in the C++ standard; basically, a value which can be
2109 represented in the minimum number of bits needed to represent all the
2110 enumerators).  This assumption may not be valid if the program uses a
2111 cast to convert an arbitrary integer value to the enumeration type.
2112
2113 @item -ftemplate-depth=@var{n}
2114 @opindex ftemplate-depth
2115 Set the maximum instantiation depth for template classes to @var{n}.
2116 A limit on the template instantiation depth is needed to detect
2117 endless recursions during template class instantiation.  ANSI/ISO C++
2118 conforming programs must not rely on a maximum depth greater than 17
2119 (changed to 1024 in C++11).  The default value is 900, as the compiler
2120 can run out of stack space before hitting 1024 in some situations.
2121
2122 @item -fno-threadsafe-statics
2123 @opindex fno-threadsafe-statics
2124 Do not emit the extra code to use the routines specified in the C++
2125 ABI for thread-safe initialization of local statics.  You can use this
2126 option to reduce code size slightly in code that doesn't need to be
2127 thread-safe.
2128
2129 @item -fuse-cxa-atexit
2130 @opindex fuse-cxa-atexit
2131 Register destructors for objects with static storage duration with the
2132 @code{__cxa_atexit} function rather than the @code{atexit} function.
2133 This option is required for fully standards-compliant handling of static
2134 destructors, but will only work if your C library supports
2135 @code{__cxa_atexit}.
2136
2137 @item -fno-use-cxa-get-exception-ptr
2138 @opindex fno-use-cxa-get-exception-ptr
2139 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2140 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2141 if the runtime routine is not available.
2142
2143 @item -fvisibility-inlines-hidden
2144 @opindex fvisibility-inlines-hidden
2145 This switch declares that the user does not attempt to compare
2146 pointers to inline functions or methods where the addresses of the two functions
2147 were taken in different shared objects.
2148
2149 The effect of this is that GCC may, effectively, mark inline methods with
2150 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2151 appear in the export table of a DSO and do not require a PLT indirection
2152 when used within the DSO@.  Enabling this option can have a dramatic effect
2153 on load and link times of a DSO as it massively reduces the size of the
2154 dynamic export table when the library makes heavy use of templates.
2155
2156 The behavior of this switch is not quite the same as marking the
2157 methods as hidden directly, because it does not affect static variables
2158 local to the function or cause the compiler to deduce that
2159 the function is defined in only one shared object.
2160
2161 You may mark a method as having a visibility explicitly to negate the
2162 effect of the switch for that method.  For example, if you do want to
2163 compare pointers to a particular inline method, you might mark it as
2164 having default visibility.  Marking the enclosing class with explicit
2165 visibility will have no effect.
2166
2167 Explicitly instantiated inline methods are unaffected by this option
2168 as their linkage might otherwise cross a shared library boundary.
2169 @xref{Template Instantiation}.
2170
2171 @item -fvisibility-ms-compat
2172 @opindex fvisibility-ms-compat
2173 This flag attempts to use visibility settings to make GCC's C++
2174 linkage model compatible with that of Microsoft Visual Studio.
2175
2176 The flag makes these changes to GCC's linkage model:
2177
2178 @enumerate
2179 @item
2180 It sets the default visibility to @code{hidden}, like
2181 @option{-fvisibility=hidden}.
2182
2183 @item
2184 Types, but not their members, are not hidden by default.
2185
2186 @item
2187 The One Definition Rule is relaxed for types without explicit
2188 visibility specifications which are defined in more than one different
2189 shared object: those declarations are permitted if they would have
2190 been permitted when this option was not used.
2191 @end enumerate
2192
2193 In new code it is better to use @option{-fvisibility=hidden} and
2194 export those classes which are intended to be externally visible.
2195 Unfortunately it is possible for code to rely, perhaps accidentally,
2196 on the Visual Studio behavior.
2197
2198 Among the consequences of these changes are that static data members
2199 of the same type with the same name but defined in different shared
2200 objects will be different, so changing one will not change the other;
2201 and that pointers to function members defined in different shared
2202 objects may not compare equal.  When this flag is given, it is a
2203 violation of the ODR to define types with the same name differently.
2204
2205 @item -fno-weak
2206 @opindex fno-weak
2207 Do not use weak symbol support, even if it is provided by the linker.
2208 By default, G++ will use weak symbols if they are available.  This
2209 option exists only for testing, and should not be used by end-users;
2210 it will result in inferior code and has no benefits.  This option may
2211 be removed in a future release of G++.
2212
2213 @item -nostdinc++
2214 @opindex nostdinc++
2215 Do not search for header files in the standard directories specific to
2216 C++, but do still search the other standard directories.  (This option
2217 is used when building the C++ library.)
2218 @end table
2219
2220 In addition, these optimization, warning, and code generation options
2221 have meanings only for C++ programs:
2222
2223 @table @gcctabopt
2224 @item -fno-default-inline
2225 @opindex fno-default-inline
2226 Do not assume @samp{inline} for functions defined inside a class scope.
2227 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2228 functions will have linkage like inline functions; they just won't be
2229 inlined by default.
2230
2231 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2232 @opindex Wabi
2233 @opindex Wno-abi
2234 Warn when G++ generates code that is probably not compatible with the
2235 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2236 all such cases, there are probably some cases that are not warned about,
2237 even though G++ is generating incompatible code.  There may also be
2238 cases where warnings are emitted even though the code that is generated
2239 will be compatible.
2240
2241 You should rewrite your code to avoid these warnings if you are
2242 concerned about the fact that code generated by G++ may not be binary
2243 compatible with code generated by other compilers.
2244
2245 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2246
2247 @itemize @bullet
2248
2249 @item
2250 A template with a non-type template parameter of reference type is
2251 mangled incorrectly:
2252 @smallexample
2253 extern int N;
2254 template <int &> struct S @{@};
2255 void n (S<N>) @{2@}
2256 @end smallexample
2257
2258 This is fixed in @option{-fabi-version=3}.
2259
2260 @item
2261 SIMD vector types declared using @code{__attribute ((vector_size))} are
2262 mangled in a non-standard way that does not allow for overloading of
2263 functions taking vectors of different sizes.
2264
2265 The mangling is changed in @option{-fabi-version=4}.
2266 @end itemize
2267
2268 The known incompatibilities in @option{-fabi-version=1} include:
2269
2270 @itemize @bullet
2271
2272 @item
2273 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2274 pack data into the same byte as a base class.  For example:
2275
2276 @smallexample
2277 struct A @{ virtual void f(); int f1 : 1; @};
2278 struct B : public A @{ int f2 : 1; @};
2279 @end smallexample
2280
2281 @noindent
2282 In this case, G++ will place @code{B::f2} into the same byte
2283 as@code{A::f1}; other compilers will not.  You can avoid this problem
2284 by explicitly padding @code{A} so that its size is a multiple of the
2285 byte size on your platform; that will cause G++ and other compilers to
2286 layout @code{B} identically.
2287
2288 @item
2289 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2290 tail padding when laying out virtual bases.  For example:
2291
2292 @smallexample
2293 struct A @{ virtual void f(); char c1; @};
2294 struct B @{ B(); char c2; @};
2295 struct C : public A, public virtual B @{@};
2296 @end smallexample
2297
2298 @noindent
2299 In this case, G++ will not place @code{B} into the tail-padding for
2300 @code{A}; other compilers will.  You can avoid this problem by
2301 explicitly padding @code{A} so that its size is a multiple of its
2302 alignment (ignoring virtual base classes); that will cause G++ and other
2303 compilers to layout @code{C} identically.
2304
2305 @item
2306 Incorrect handling of bit-fields with declared widths greater than that
2307 of their underlying types, when the bit-fields appear in a union.  For
2308 example:
2309
2310 @smallexample
2311 union U @{ int i : 4096; @};
2312 @end smallexample
2313
2314 @noindent
2315 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2316 union too small by the number of bits in an @code{int}.
2317
2318 @item
2319 Empty classes can be placed at incorrect offsets.  For example:
2320
2321 @smallexample
2322 struct A @{@};
2323
2324 struct B @{
2325   A a;
2326   virtual void f ();
2327 @};
2328
2329 struct C : public B, public A @{@};
2330 @end smallexample
2331
2332 @noindent
2333 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2334 it should be placed at offset zero.  G++ mistakenly believes that the
2335 @code{A} data member of @code{B} is already at offset zero.
2336
2337 @item
2338 Names of template functions whose types involve @code{typename} or
2339 template template parameters can be mangled incorrectly.
2340
2341 @smallexample
2342 template <typename Q>
2343 void f(typename Q::X) @{@}
2344
2345 template <template <typename> class Q>
2346 void f(typename Q<int>::X) @{@}
2347 @end smallexample
2348
2349 @noindent
2350 Instantiations of these templates may be mangled incorrectly.
2351
2352 @end itemize
2353
2354 It also warns psABI related changes.  The known psABI changes at this
2355 point include:
2356
2357 @itemize @bullet
2358
2359 @item
2360 For SYSV/x86-64, when passing union with long double, it is changed to
2361 pass in memory as specified in psABI.  For example:
2362
2363 @smallexample
2364 union U @{
2365   long double ld;
2366   int i;
2367 @};
2368 @end smallexample
2369
2370 @noindent
2371 @code{union U} will always be passed in memory.
2372
2373 @end itemize
2374
2375 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2376 @opindex Wctor-dtor-privacy
2377 @opindex Wno-ctor-dtor-privacy
2378 Warn when a class seems unusable because all the constructors or
2379 destructors in that class are private, and it has neither friends nor
2380 public static member functions.
2381
2382 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2383 @opindex Wdelete-non-virtual-dtor
2384 @opindex Wno-delete-non-virtual-dtor
2385 Warn when @samp{delete} is used to destroy an instance of a class which
2386 has virtual functions and non-virtual destructor. It is unsafe to delete
2387 an instance of a derived class through a pointer to a base class if the
2388 base class does not have a virtual destructor.  This warning is enabled
2389 by @option{-Wall}.
2390
2391 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2392 @opindex Wnarrowing
2393 @opindex Wno-narrowing
2394 Warn when a narrowing conversion prohibited by C++11 occurs within
2395 @samp{@{ @}}, e.g.
2396
2397 @smallexample
2398 int i = @{ 2.2 @}; // error: narrowing from double to int
2399 @end smallexample
2400
2401 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2402
2403 With -std=c++11, @option{-Wno-narrowing} suppresses the diagnostic
2404 required by the standard.  Note that this does not affect the meaning
2405 of well-formed code; narrowing conversions are still considered
2406 ill-formed in SFINAE context.
2407
2408 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2409 @opindex Wnoexcept
2410 @opindex Wno-noexcept
2411 Warn when a noexcept-expression evaluates to false because of a call
2412 to a function that does not have a non-throwing exception
2413 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2414 the compiler to never throw an exception.
2415
2416 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2417 @opindex Wnon-virtual-dtor
2418 @opindex Wno-non-virtual-dtor
2419 Warn when a class has virtual functions and accessible non-virtual
2420 destructor, in which case it would be possible but unsafe to delete
2421 an instance of a derived class through a pointer to the base class.
2422 This warning is also enabled if -Weffc++ is specified.
2423
2424 @item -Wreorder @r{(C++ and Objective-C++ only)}
2425 @opindex Wreorder
2426 @opindex Wno-reorder
2427 @cindex reordering, warning
2428 @cindex warning for reordering of member initializers
2429 Warn when the order of member initializers given in the code does not
2430 match the order in which they must be executed.  For instance:
2431
2432 @smallexample
2433 struct A @{
2434   int i;
2435   int j;
2436   A(): j (0), i (1) @{ @}
2437 @};
2438 @end smallexample
2439
2440 The compiler will rearrange the member initializers for @samp{i}
2441 and @samp{j} to match the declaration order of the members, emitting
2442 a warning to that effect.  This warning is enabled by @option{-Wall}.
2443 @end table
2444
2445 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2446
2447 @table @gcctabopt
2448 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2449 @opindex Weffc++
2450 @opindex Wno-effc++
2451 Warn about violations of the following style guidelines from Scott Meyers'
2452 @cite{Effective C++} book:
2453
2454 @itemize @bullet
2455 @item
2456 Item 11:  Define a copy constructor and an assignment operator for classes
2457 with dynamically allocated memory.
2458
2459 @item
2460 Item 12:  Prefer initialization to assignment in constructors.
2461
2462 @item
2463 Item 14:  Make destructors virtual in base classes.
2464
2465 @item
2466 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2467
2468 @item
2469 Item 23:  Don't try to return a reference when you must return an object.
2470
2471 @end itemize
2472
2473 Also warn about violations of the following style guidelines from
2474 Scott Meyers' @cite{More Effective C++} book:
2475
2476 @itemize @bullet
2477 @item
2478 Item 6:  Distinguish between prefix and postfix forms of increment and
2479 decrement operators.
2480
2481 @item
2482 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2483
2484 @end itemize
2485
2486 When selecting this option, be aware that the standard library
2487 headers do not obey all of these guidelines; use @samp{grep -v}
2488 to filter out those warnings.
2489
2490 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2491 @opindex Wstrict-null-sentinel
2492 @opindex Wno-strict-null-sentinel
2493 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2494 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2495 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2496 it is guaranteed to be of the same size as a pointer.  But this use is
2497 not portable across different compilers.
2498
2499 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2500 @opindex Wno-non-template-friend
2501 @opindex Wnon-template-friend
2502 Disable warnings when non-templatized friend functions are declared
2503 within a template.  Since the advent of explicit template specification
2504 support in G++, if the name of the friend is an unqualified-id (i.e.,
2505 @samp{friend foo(int)}), the C++ language specification demands that the
2506 friend declare or define an ordinary, nontemplate function.  (Section
2507 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2508 could be interpreted as a particular specialization of a templatized
2509 function.  Because this non-conforming behavior is no longer the default
2510 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2511 check existing code for potential trouble spots and is on by default.
2512 This new compiler behavior can be turned off with
2513 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2514 but disables the helpful warning.
2515
2516 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2517 @opindex Wold-style-cast
2518 @opindex Wno-old-style-cast
2519 Warn if an old-style (C-style) cast to a non-void type is used within
2520 a C++ program.  The new-style casts (@samp{dynamic_cast},
2521 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2522 less vulnerable to unintended effects and much easier to search for.
2523
2524 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2525 @opindex Woverloaded-virtual
2526 @opindex Wno-overloaded-virtual
2527 @cindex overloaded virtual function, warning
2528 @cindex warning for overloaded virtual function
2529 Warn when a function declaration hides virtual functions from a
2530 base class.  For example, in:
2531
2532 @smallexample
2533 struct A @{
2534   virtual void f();
2535 @};
2536
2537 struct B: public A @{
2538   void f(int);
2539 @};
2540 @end smallexample
2541
2542 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2543 like:
2544
2545 @smallexample
2546 B* b;
2547 b->f();
2548 @end smallexample
2549
2550 will fail to compile.
2551
2552 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2553 @opindex Wno-pmf-conversions
2554 @opindex Wpmf-conversions
2555 Disable the diagnostic for converting a bound pointer to member function
2556 to a plain pointer.
2557
2558 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2559 @opindex Wsign-promo
2560 @opindex Wno-sign-promo
2561 Warn when overload resolution chooses a promotion from unsigned or
2562 enumerated type to a signed type, over a conversion to an unsigned type of
2563 the same size.  Previous versions of G++ would try to preserve
2564 unsignedness, but the standard mandates the current behavior.
2565
2566 @smallexample
2567 struct A @{
2568   operator int ();
2569   A& operator = (int);
2570 @};
2571
2572 main ()
2573 @{
2574   A a,b;
2575   a = b;
2576 @}
2577 @end smallexample
2578
2579 In this example, G++ will synthesize a default @samp{A& operator =
2580 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2581 @end table
2582
2583 @node Objective-C and Objective-C++ Dialect Options
2584 @section Options Controlling Objective-C and Objective-C++ Dialects
2585
2586 @cindex compiler options, Objective-C and Objective-C++
2587 @cindex Objective-C and Objective-C++ options, command line
2588 @cindex options, Objective-C and Objective-C++
2589 (NOTE: This manual does not describe the Objective-C and Objective-C++
2590 languages themselves.  @xref{Standards,,Language Standards
2591 Supported by GCC}, for references.)
2592
2593 This section describes the command-line options that are only meaningful
2594 for Objective-C and Objective-C++ programs, but you can also use most of
2595 the language-independent GNU compiler options.
2596 For example, you might compile a file @code{some_class.m} like this:
2597
2598 @smallexample
2599 gcc -g -fgnu-runtime -O -c some_class.m
2600 @end smallexample
2601
2602 @noindent
2603 In this example, @option{-fgnu-runtime} is an option meant only for
2604 Objective-C and Objective-C++ programs; you can use the other options with
2605 any language supported by GCC@.
2606
2607 Note that since Objective-C is an extension of the C language, Objective-C
2608 compilations may also use options specific to the C front-end (e.g.,
2609 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2610 C++-specific options (e.g., @option{-Wabi}).
2611
2612 Here is a list of options that are @emph{only} for compiling Objective-C
2613 and Objective-C++ programs:
2614
2615 @table @gcctabopt
2616 @item -fconstant-string-class=@var{class-name}
2617 @opindex fconstant-string-class
2618 Use @var{class-name} as the name of the class to instantiate for each
2619 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2620 class name is @code{NXConstantString} if the GNU runtime is being used, and
2621 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2622 @option{-fconstant-cfstrings} option, if also present, will override the
2623 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2624 to be laid out as constant CoreFoundation strings.
2625
2626 @item -fgnu-runtime
2627 @opindex fgnu-runtime
2628 Generate object code compatible with the standard GNU Objective-C
2629 runtime.  This is the default for most types of systems.
2630
2631 @item -fnext-runtime
2632 @opindex fnext-runtime
2633 Generate output compatible with the NeXT runtime.  This is the default
2634 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2635 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2636 used.
2637
2638 @item -fno-nil-receivers
2639 @opindex fno-nil-receivers
2640 Assume that all Objective-C message dispatches (@code{[receiver
2641 message:arg]}) in this translation unit ensure that the receiver is
2642 not @code{nil}.  This allows for more efficient entry points in the
2643 runtime to be used.  This option is only available in conjunction with
2644 the NeXT runtime and ABI version 0 or 1.
2645
2646 @item -fobjc-abi-version=@var{n}
2647 @opindex fobjc-abi-version
2648 Use version @var{n} of the Objective-C ABI for the selected runtime.
2649 This option is currently supported only for the NeXT runtime.  In that
2650 case, Version 0 is the traditional (32-bit) ABI without support for
2651 properties and other Objective-C 2.0 additions.  Version 1 is the
2652 traditional (32-bit) ABI with support for properties and other
2653 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2654 nothing is specified, the default is Version 0 on 32-bit target
2655 machines, and Version 2 on 64-bit target machines.
2656
2657 @item -fobjc-call-cxx-cdtors
2658 @opindex fobjc-call-cxx-cdtors
2659 For each Objective-C class, check if any of its instance variables is a
2660 C++ object with a non-trivial default constructor.  If so, synthesize a
2661 special @code{- (id) .cxx_construct} instance method that will run
2662 non-trivial default constructors on any such instance variables, in order,
2663 and then return @code{self}.  Similarly, check if any instance variable
2664 is a C++ object with a non-trivial destructor, and if so, synthesize a
2665 special @code{- (void) .cxx_destruct} method that will run
2666 all such default destructors, in reverse order.
2667
2668 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2669 methods thusly generated will only operate on instance variables
2670 declared in the current Objective-C class, and not those inherited
2671 from superclasses.  It is the responsibility of the Objective-C
2672 runtime to invoke all such methods in an object's inheritance
2673 hierarchy.  The @code{- (id) .cxx_construct} methods will be invoked
2674 by the runtime immediately after a new object instance is allocated;
2675 the @code{- (void) .cxx_destruct} methods will be invoked immediately
2676 before the runtime deallocates an object instance.
2677
2678 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2679 support for invoking the @code{- (id) .cxx_construct} and
2680 @code{- (void) .cxx_destruct} methods.
2681
2682 @item -fobjc-direct-dispatch
2683 @opindex fobjc-direct-dispatch
2684 Allow fast jumps to the message dispatcher.  On Darwin this is
2685 accomplished via the comm page.
2686
2687 @item -fobjc-exceptions
2688 @opindex fobjc-exceptions
2689 Enable syntactic support for structured exception handling in
2690 Objective-C, similar to what is offered by C++ and Java.  This option
2691 is required to use the Objective-C keywords @code{@@try},
2692 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2693 @code{@@synchronized}.  This option is available with both the GNU
2694 runtime and the NeXT runtime (but not available in conjunction with
2695 the NeXT runtime on Mac OS X 10.2 and earlier).
2696
2697 @item -fobjc-gc
2698 @opindex fobjc-gc
2699 Enable garbage collection (GC) in Objective-C and Objective-C++
2700 programs.  This option is only available with the NeXT runtime; the
2701 GNU runtime has a different garbage collection implementation that
2702 does not require special compiler flags.
2703
2704 @item -fobjc-nilcheck
2705 @opindex fobjc-nilcheck
2706 For the NeXT runtime with version 2 of the ABI, check for a nil
2707 receiver in method invocations before doing the actual method call.
2708 This is the default and can be disabled using
2709 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2710 checked for nil in this way no matter what this flag is set to.
2711 Currently this flag does nothing when the GNU runtime, or an older
2712 version of the NeXT runtime ABI, is used.
2713
2714 @item -fobjc-std=objc1
2715 @opindex fobjc-std
2716 Conform to the language syntax of Objective-C 1.0, the language
2717 recognized by GCC 4.0.  This only affects the Objective-C additions to
2718 the C/C++ language; it does not affect conformance to C/C++ standards,
2719 which is controlled by the separate C/C++ dialect option flags.  When
2720 this option is used with the Objective-C or Objective-C++ compiler,
2721 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2722 This is useful if you need to make sure that your Objective-C code can
2723 be compiled with older versions of GCC.
2724
2725 @item -freplace-objc-classes
2726 @opindex freplace-objc-classes
2727 Emit a special marker instructing @command{ld(1)} not to statically link in
2728 the resulting object file, and allow @command{dyld(1)} to load it in at
2729 run time instead.  This is used in conjunction with the Fix-and-Continue
2730 debugging mode, where the object file in question may be recompiled and
2731 dynamically reloaded in the course of program execution, without the need
2732 to restart the program itself.  Currently, Fix-and-Continue functionality
2733 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2734 and later.
2735
2736 @item -fzero-link
2737 @opindex fzero-link
2738 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2739 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2740 compile time) with static class references that get initialized at load time,
2741 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2742 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2743 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2744 for individual class implementations to be modified during program execution.
2745 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2746 regardless of command line options.
2747
2748 @item -gen-decls
2749 @opindex gen-decls
2750 Dump interface declarations for all classes seen in the source file to a
2751 file named @file{@var{sourcename}.decl}.
2752
2753 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2754 @opindex Wassign-intercept
2755 @opindex Wno-assign-intercept
2756 Warn whenever an Objective-C assignment is being intercepted by the
2757 garbage collector.
2758
2759 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2760 @opindex Wno-protocol
2761 @opindex Wprotocol
2762 If a class is declared to implement a protocol, a warning is issued for
2763 every method in the protocol that is not implemented by the class.  The
2764 default behavior is to issue a warning for every method not explicitly
2765 implemented in the class, even if a method implementation is inherited
2766 from the superclass.  If you use the @option{-Wno-protocol} option, then
2767 methods inherited from the superclass are considered to be implemented,
2768 and no warning is issued for them.
2769
2770 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2771 @opindex Wselector
2772 @opindex Wno-selector
2773 Warn if multiple methods of different types for the same selector are
2774 found during compilation.  The check is performed on the list of methods
2775 in the final stage of compilation.  Additionally, a check is performed
2776 for each selector appearing in a @code{@@selector(@dots{})}
2777 expression, and a corresponding method for that selector has been found
2778 during compilation.  Because these checks scan the method table only at
2779 the end of compilation, these warnings are not produced if the final
2780 stage of compilation is not reached, for example because an error is
2781 found during compilation, or because the @option{-fsyntax-only} option is
2782 being used.
2783
2784 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2785 @opindex Wstrict-selector-match
2786 @opindex Wno-strict-selector-match
2787 Warn if multiple methods with differing argument and/or return types are
2788 found for a given selector when attempting to send a message using this
2789 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2790 is off (which is the default behavior), the compiler will omit such warnings
2791 if any differences found are confined to types which share the same size
2792 and alignment.
2793
2794 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2795 @opindex Wundeclared-selector
2796 @opindex Wno-undeclared-selector
2797 Warn if a @code{@@selector(@dots{})} expression referring to an
2798 undeclared selector is found.  A selector is considered undeclared if no
2799 method with that name has been declared before the
2800 @code{@@selector(@dots{})} expression, either explicitly in an
2801 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2802 an @code{@@implementation} section.  This option always performs its
2803 checks as soon as a @code{@@selector(@dots{})} expression is found,
2804 while @option{-Wselector} only performs its checks in the final stage of
2805 compilation.  This also enforces the coding style convention
2806 that methods and selectors must be declared before being used.
2807
2808 @item -print-objc-runtime-info
2809 @opindex print-objc-runtime-info
2810 Generate C header describing the largest structure that is passed by
2811 value, if any.
2812
2813 @end table
2814
2815 @node Language Independent Options
2816 @section Options to Control Diagnostic Messages Formatting
2817 @cindex options to control diagnostics formatting
2818 @cindex diagnostic messages
2819 @cindex message formatting
2820
2821 Traditionally, diagnostic messages have been formatted irrespective of
2822 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2823 below can be used to control the diagnostic messages formatting
2824 algorithm, e.g.@: how many characters per line, how often source location
2825 information should be reported.  Right now, only the C++ front end can
2826 honor these options.  However it is expected, in the near future, that
2827 the remaining front ends would be able to digest them correctly.
2828
2829 @table @gcctabopt
2830 @item -fmessage-length=@var{n}
2831 @opindex fmessage-length
2832 Try to format error messages so that they fit on lines of about @var{n}
2833 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2834 the front ends supported by GCC@.  If @var{n} is zero, then no
2835 line-wrapping will be done; each error message will appear on a single
2836 line.
2837
2838 @opindex fdiagnostics-show-location
2839 @item -fdiagnostics-show-location=once
2840 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2841 reporter to emit @emph{once} source location information; that is, in
2842 case the message is too long to fit on a single physical line and has to
2843 be wrapped, the source location won't be emitted (as prefix) again,
2844 over and over, in subsequent continuation lines.  This is the default
2845 behavior.
2846
2847 @item -fdiagnostics-show-location=every-line
2848 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2849 messages reporter to emit the same source location information (as
2850 prefix) for physical lines that result from the process of breaking
2851 a message which is too long to fit on a single line.
2852
2853 @item -fno-diagnostics-show-option
2854 @opindex fno-diagnostics-show-option
2855 @opindex fdiagnostics-show-option
2856 By default, each diagnostic emitted includes text which indicates the
2857 command line option that directly controls the diagnostic (if such an
2858 option is known to the diagnostic machinery).  Specifying the
2859 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2860
2861 @item -Wcoverage-mismatch
2862 @opindex Wcoverage-mismatch
2863 Warn if feedback profiles do not match when using the
2864 @option{-fprofile-use} option.
2865 If a source file was changed between @option{-fprofile-gen} and
2866 @option{-fprofile-use}, the files with the profile feedback can fail
2867 to match the source file and GCC can not use the profile feedback
2868 information.  By default, this warning is enabled and is treated as an
2869 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2870 warning or @option{-Wno-error=coverage-mismatch} can be used to
2871 disable the error.  Disable the error for this warning can result in
2872 poorly optimized code, so disabling the error is useful only in the
2873 case of very minor changes such as bug fixes to an existing code-base.
2874 Completely disabling the warning is not recommended.
2875
2876 @end table
2877
2878 @node Warning Options
2879 @section Options to Request or Suppress Warnings
2880 @cindex options to control warnings
2881 @cindex warning messages
2882 @cindex messages, warning
2883 @cindex suppressing warnings
2884
2885 Warnings are diagnostic messages that report constructions which
2886 are not inherently erroneous but which are risky or suggest there
2887 may have been an error.
2888
2889 The following language-independent options do not enable specific
2890 warnings but control the kinds of diagnostics produced by GCC.
2891
2892 @table @gcctabopt
2893 @cindex syntax checking
2894 @item -fsyntax-only
2895 @opindex fsyntax-only
2896 Check the code for syntax errors, but don't do anything beyond that.
2897
2898 @item -fmax-errors=@var{n}
2899 @opindex fmax-errors
2900 Limits the maximum number of error messages to @var{n}, at which point
2901 GCC bails out rather than attempting to continue processing the source
2902 code.  If @var{n} is 0 (the default), there is no limit on the number
2903 of error messages produced.  If @option{-Wfatal-errors} is also
2904 specified, then @option{-Wfatal-errors} takes precedence over this
2905 option.
2906
2907 @item -w
2908 @opindex w
2909 Inhibit all warning messages.
2910
2911 @item -Werror
2912 @opindex Werror
2913 @opindex Wno-error
2914 Make all warnings into errors.
2915
2916 @item -Werror=
2917 @opindex Werror=
2918 @opindex Wno-error=
2919 Make the specified warning into an error.  The specifier for a warning
2920 is appended, for example @option{-Werror=switch} turns the warnings
2921 controlled by @option{-Wswitch} into errors.  This switch takes a
2922 negative form, to be used to negate @option{-Werror} for specific
2923 warnings, for example @option{-Wno-error=switch} makes
2924 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2925 is in effect.
2926
2927 The warning message for each controllable warning includes the
2928 option which controls the warning.  That option can then be used with
2929 @option{-Werror=} and @option{-Wno-error=} as described above.
2930 (Printing of the option in the warning message can be disabled using the
2931 @option{-fno-diagnostics-show-option} flag.)
2932
2933 Note that specifying @option{-Werror=}@var{foo} automatically implies
2934 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2935 imply anything.
2936
2937 @item -Wfatal-errors
2938 @opindex Wfatal-errors
2939 @opindex Wno-fatal-errors
2940 This option causes the compiler to abort compilation on the first error
2941 occurred rather than trying to keep going and printing further error
2942 messages.
2943
2944 @end table
2945
2946 You can request many specific warnings with options beginning
2947 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2948 implicit declarations.  Each of these specific warning options also
2949 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2950 example, @option{-Wno-implicit}.  This manual lists only one of the
2951 two forms, whichever is not the default.  For further,
2952 language-specific options also refer to @ref{C++ Dialect Options} and
2953 @ref{Objective-C and Objective-C++ Dialect Options}.
2954
2955 When an unrecognized warning option is requested (e.g.,
2956 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2957 that the option is not recognized.  However, if the @option{-Wno-} form
2958 is used, the behavior is slightly different: No diagnostic will be
2959 produced for @option{-Wno-unknown-warning} unless other diagnostics
2960 are being produced.  This allows the use of new @option{-Wno-} options
2961 with old compilers, but if something goes wrong, the compiler will
2962 warn that an unrecognized option was used.
2963
2964 @table @gcctabopt
2965 @item -pedantic
2966 @opindex pedantic
2967 Issue all the warnings demanded by strict ISO C and ISO C++;
2968 reject all programs that use forbidden extensions, and some other
2969 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2970 version of the ISO C standard specified by any @option{-std} option used.
2971
2972 Valid ISO C and ISO C++ programs should compile properly with or without
2973 this option (though a rare few will require @option{-ansi} or a
2974 @option{-std} option specifying the required version of ISO C)@.  However,
2975 without this option, certain GNU extensions and traditional C and C++
2976 features are supported as well.  With this option, they are rejected.
2977
2978 @option{-pedantic} does not cause warning messages for use of the
2979 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2980 warnings are also disabled in the expression that follows
2981 @code{__extension__}.  However, only system header files should use
2982 these escape routes; application programs should avoid them.
2983 @xref{Alternate Keywords}.
2984
2985 Some users try to use @option{-pedantic} to check programs for strict ISO
2986 C conformance.  They soon find that it does not do quite what they want:
2987 it finds some non-ISO practices, but not all---only those for which
2988 ISO C @emph{requires} a diagnostic, and some others for which
2989 diagnostics have been added.
2990
2991 A feature to report any failure to conform to ISO C might be useful in
2992 some instances, but would require considerable additional work and would
2993 be quite different from @option{-pedantic}.  We don't have plans to
2994 support such a feature in the near future.
2995
2996 Where the standard specified with @option{-std} represents a GNU
2997 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2998 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2999 extended dialect is based.  Warnings from @option{-pedantic} are given
3000 where they are required by the base standard.  (It would not make sense
3001 for such warnings to be given only for features not in the specified GNU
3002 C dialect, since by definition the GNU dialects of C include all
3003 features the compiler supports with the given option, and there would be
3004 nothing to warn about.)
3005
3006 @item -pedantic-errors
3007 @opindex pedantic-errors
3008 Like @option{-pedantic}, except that errors are produced rather than
3009 warnings.
3010
3011 @item -Wall
3012 @opindex Wall
3013 @opindex Wno-all
3014 This enables all the warnings about constructions that some users
3015 consider questionable, and that are easy to avoid (or modify to
3016 prevent the warning), even in conjunction with macros.  This also
3017 enables some language-specific warnings described in @ref{C++ Dialect
3018 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3019
3020 @option{-Wall} turns on the following warning flags:
3021
3022 @gccoptlist{-Waddress   @gol
3023 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3024 -Wc++11-compat  @gol
3025 -Wchar-subscripts  @gol
3026 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
3027 -Wimplicit-int @r{(C and Objective-C only)} @gol
3028 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3029 -Wcomment  @gol
3030 -Wformat   @gol
3031 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3032 -Wmaybe-uninitialized @gol
3033 -Wmissing-braces  @gol
3034 -Wnonnull  @gol
3035 -Wparentheses  @gol
3036 -Wpointer-sign  @gol
3037 -Wreorder   @gol
3038 -Wreturn-type  @gol
3039 -Wsequence-point  @gol
3040 -Wsign-compare @r{(only in C++)}  @gol
3041 -Wstrict-aliasing  @gol
3042 -Wstrict-overflow=1  @gol
3043 -Wswitch  @gol
3044 -Wtrigraphs  @gol
3045 -Wuninitialized  @gol
3046 -Wunknown-pragmas  @gol
3047 -Wunused-function  @gol
3048 -Wunused-label     @gol
3049 -Wunused-value     @gol
3050 -Wunused-variable  @gol
3051 -Wvolatile-register-var @gol
3052 }
3053
3054 Note that some warning flags are not implied by @option{-Wall}.  Some of
3055 them warn about constructions that users generally do not consider
3056 questionable, but which occasionally you might wish to check for;
3057 others warn about constructions that are necessary or hard to avoid in
3058 some cases, and there is no simple way to modify the code to suppress
3059 the warning. Some of them are enabled by @option{-Wextra} but many of
3060 them must be enabled individually.
3061
3062 @item -Wextra
3063 @opindex W
3064 @opindex Wextra
3065 @opindex Wno-extra
3066 This enables some extra warning flags that are not enabled by
3067 @option{-Wall}. (This option used to be called @option{-W}.  The older
3068 name is still supported, but the newer name is more descriptive.)
3069
3070 @gccoptlist{-Wclobbered  @gol
3071 -Wempty-body  @gol
3072 -Wignored-qualifiers @gol
3073 -Wmissing-field-initializers  @gol
3074 -Wmissing-parameter-type @r{(C only)}  @gol
3075 -Wold-style-declaration @r{(C only)}  @gol
3076 -Woverride-init  @gol
3077 -Wsign-compare  @gol
3078 -Wtype-limits  @gol
3079 -Wuninitialized  @gol
3080 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3081 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3082 }
3083
3084 The option @option{-Wextra} also prints warning messages for the
3085 following cases:
3086
3087 @itemize @bullet
3088
3089 @item
3090 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3091 @samp{>}, or @samp{>=}.
3092
3093 @item
3094 (C++ only) An enumerator and a non-enumerator both appear in a
3095 conditional expression.
3096
3097 @item
3098 (C++ only) Ambiguous virtual bases.
3099
3100 @item
3101 (C++ only) Subscripting an array which has been declared @samp{register}.
3102
3103 @item
3104 (C++ only) Taking the address of a variable which has been declared
3105 @samp{register}.
3106
3107 @item
3108 (C++ only) A base class is not initialized in a derived class' copy
3109 constructor.
3110
3111 @end itemize
3112
3113 @item -Wchar-subscripts
3114 @opindex Wchar-subscripts
3115 @opindex Wno-char-subscripts
3116 Warn if an array subscript has type @code{char}.  This is a common cause
3117 of error, as programmers often forget that this type is signed on some
3118 machines.
3119 This warning is enabled by @option{-Wall}.
3120
3121 @item -Wcomment
3122 @opindex Wcomment
3123 @opindex Wno-comment
3124 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3125 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3126 This warning is enabled by @option{-Wall}.
3127
3128 @item -Wno-cpp
3129 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3130
3131 Suppress warning messages emitted by @code{#warning} directives.
3132
3133 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3134 @opindex Wdouble-promotion
3135 @opindex Wno-double-promotion
3136 Give a warning when a value of type @code{float} is implicitly
3137 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3138 floating-point unit implement @code{float} in hardware, but emulate
3139 @code{double} in software.  On such a machine, doing computations
3140 using @code{double} values is much more expensive because of the
3141 overhead required for software emulation.
3142
3143 It is easy to accidentally do computations with @code{double} because
3144 floating-point literals are implicitly of type @code{double}.  For
3145 example, in:
3146 @smallexample
3147 @group
3148 float area(float radius)
3149 @{
3150    return 3.14159 * radius * radius;
3151 @}
3152 @end group
3153 @end smallexample
3154 the compiler will perform the entire computation with @code{double}
3155 because the floating-point literal is a @code{double}.
3156
3157 @item -Wformat
3158 @opindex Wformat
3159 @opindex Wno-format
3160 @opindex ffreestanding
3161 @opindex fno-builtin
3162 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3163 the arguments supplied have types appropriate to the format string
3164 specified, and that the conversions specified in the format string make
3165 sense.  This includes standard functions, and others specified by format
3166 attributes (@pxref{Function Attributes}), in the @code{printf},
3167 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3168 not in the C standard) families (or other target-specific families).
3169 Which functions are checked without format attributes having been
3170 specified depends on the standard version selected, and such checks of
3171 functions without the attribute specified are disabled by
3172 @option{-ffreestanding} or @option{-fno-builtin}.
3173
3174 The formats are checked against the format features supported by GNU
3175 libc version 2.2.  These include all ISO C90 and C99 features, as well
3176 as features from the Single Unix Specification and some BSD and GNU
3177 extensions.  Other library implementations may not support all these
3178 features; GCC does not support warning about features that go beyond a
3179 particular library's limitations.  However, if @option{-pedantic} is used
3180 with @option{-Wformat}, warnings will be given about format features not
3181 in the selected standard version (but not for @code{strfmon} formats,
3182 since those are not in any version of the C standard).  @xref{C Dialect
3183 Options,,Options Controlling C Dialect}.
3184
3185 Since @option{-Wformat} also checks for null format arguments for
3186 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3187
3188 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3189 aspects of format checking, the options @option{-Wformat-y2k},
3190 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3191 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3192 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3193
3194 @item -Wformat-y2k
3195 @opindex Wformat-y2k
3196 @opindex Wno-format-y2k
3197 If @option{-Wformat} is specified, also warn about @code{strftime}
3198 formats which may yield only a two-digit year.
3199
3200 @item -Wno-format-contains-nul
3201 @opindex Wno-format-contains-nul
3202 @opindex Wformat-contains-nul
3203 If @option{-Wformat} is specified, do not warn about format strings that
3204 contain NUL bytes.
3205
3206 @item -Wno-format-extra-args
3207 @opindex Wno-format-extra-args
3208 @opindex Wformat-extra-args
3209 If @option{-Wformat} is specified, do not warn about excess arguments to a
3210 @code{printf} or @code{scanf} format function.  The C standard specifies
3211 that such arguments are ignored.
3212
3213 Where the unused arguments lie between used arguments that are
3214 specified with @samp{$} operand number specifications, normally
3215 warnings are still given, since the implementation could not know what
3216 type to pass to @code{va_arg} to skip the unused arguments.  However,
3217 in the case of @code{scanf} formats, this option will suppress the
3218 warning if the unused arguments are all pointers, since the Single
3219 Unix Specification says that such unused arguments are allowed.
3220
3221 @item -Wno-format-zero-length
3222 @opindex Wno-format-zero-length
3223 @opindex Wformat-zero-length
3224 If @option{-Wformat} is specified, do not warn about zero-length formats.
3225 The C standard specifies that zero-length formats are allowed.
3226
3227 @item -Wformat-nonliteral
3228 @opindex Wformat-nonliteral
3229 @opindex Wno-format-nonliteral
3230 If @option{-Wformat} is specified, also warn if the format string is not a
3231 string literal and so cannot be checked, unless the format function
3232 takes its format arguments as a @code{va_list}.
3233
3234 @item -Wformat-security
3235 @opindex Wformat-security
3236 @opindex Wno-format-security
3237 If @option{-Wformat} is specified, also warn about uses of format
3238 functions that represent possible security problems.  At present, this
3239 warns about calls to @code{printf} and @code{scanf} functions where the
3240 format string is not a string literal and there are no format arguments,
3241 as in @code{printf (foo);}.  This may be a security hole if the format
3242 string came from untrusted input and contains @samp{%n}.  (This is
3243 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3244 in future warnings may be added to @option{-Wformat-security} that are not
3245 included in @option{-Wformat-nonliteral}.)
3246
3247 @item -Wformat=2
3248 @opindex Wformat=2
3249 @opindex Wno-format=2
3250 Enable @option{-Wformat} plus format checks not included in
3251 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3252 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3253
3254 @item -Wnonnull
3255 @opindex Wnonnull
3256 @opindex Wno-nonnull
3257 Warn about passing a null pointer for arguments marked as
3258 requiring a non-null value by the @code{nonnull} function attribute.
3259
3260 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3261 can be disabled with the @option{-Wno-nonnull} option.
3262
3263 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3264 @opindex Winit-self
3265 @opindex Wno-init-self
3266 Warn about uninitialized variables which are initialized with themselves.
3267 Note this option can only be used with the @option{-Wuninitialized} option.
3268
3269 For example, GCC will warn about @code{i} being uninitialized in the
3270 following snippet only when @option{-Winit-self} has been specified:
3271 @smallexample
3272 @group
3273 int f()
3274 @{
3275   int i = i;
3276   return i;
3277 @}
3278 @end group
3279 @end smallexample
3280
3281 @item -Wimplicit-int @r{(C and Objective-C only)}
3282 @opindex Wimplicit-int
3283 @opindex Wno-implicit-int
3284 Warn when a declaration does not specify a type.
3285 This warning is enabled by @option{-Wall}.
3286
3287 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3288 @opindex Wimplicit-function-declaration
3289 @opindex Wno-implicit-function-declaration
3290 Give a warning whenever a function is used before being declared. In
3291 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3292 enabled by default and it is made into an error by
3293 @option{-pedantic-errors}. This warning is also enabled by
3294 @option{-Wall}.
3295
3296 @item -Wimplicit @r{(C and Objective-C only)}
3297 @opindex Wimplicit
3298 @opindex Wno-implicit
3299 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3300 This warning is enabled by @option{-Wall}.
3301
3302 @item -Wignored-qualifiers @r{(C and C++ only)}
3303 @opindex Wignored-qualifiers
3304 @opindex Wno-ignored-qualifiers
3305 Warn if the return type of a function has a type qualifier
3306 such as @code{const}.  For ISO C such a type qualifier has no effect,
3307 since the value returned by a function is not an lvalue.
3308 For C++, the warning is only emitted for scalar types or @code{void}.
3309 ISO C prohibits qualified @code{void} return types on function
3310 definitions, so such return types always receive a warning
3311 even without this option.
3312
3313 This warning is also enabled by @option{-Wextra}.
3314
3315 @item -Wmain
3316 @opindex Wmain
3317 @opindex Wno-main
3318 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3319 a function with external linkage, returning int, taking either zero
3320 arguments, two, or three arguments of appropriate types.  This warning
3321 is enabled by default in C++ and is enabled by either @option{-Wall}
3322 or @option{-pedantic}.
3323
3324 @item -Wmissing-braces
3325 @opindex Wmissing-braces
3326 @opindex Wno-missing-braces
3327 Warn if an aggregate or union initializer is not fully bracketed.  In
3328 the following example, the initializer for @samp{a} is not fully
3329 bracketed, but that for @samp{b} is fully bracketed.
3330
3331 @smallexample
3332 int a[2][2] = @{ 0, 1, 2, 3 @};
3333 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3334 @end smallexample
3335
3336 This warning is enabled by @option{-Wall}.
3337
3338 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3339 @opindex Wmissing-include-dirs
3340 @opindex Wno-missing-include-dirs
3341 Warn if a user-supplied include directory does not exist.
3342
3343 @item -Wparentheses
3344 @opindex Wparentheses
3345 @opindex Wno-parentheses
3346 Warn if parentheses are omitted in certain contexts, such
3347 as when there is an assignment in a context where a truth value
3348 is expected, or when operators are nested whose precedence people
3349 often get confused about.
3350
3351 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3352 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3353 interpretation from that of ordinary mathematical notation.
3354
3355 Also warn about constructions where there may be confusion to which
3356 @code{if} statement an @code{else} branch belongs.  Here is an example of
3357 such a case:
3358
3359 @smallexample
3360 @group
3361 @{
3362   if (a)
3363     if (b)
3364       foo ();
3365   else
3366     bar ();
3367 @}
3368 @end group
3369 @end smallexample
3370
3371 In C/C++, every @code{else} branch belongs to the innermost possible
3372 @code{if} statement, which in this example is @code{if (b)}.  This is
3373 often not what the programmer expected, as illustrated in the above
3374 example by indentation the programmer chose.  When there is the
3375 potential for this confusion, GCC will issue a warning when this flag
3376 is specified.  To eliminate the warning, add explicit braces around
3377 the innermost @code{if} statement so there is no way the @code{else}
3378 could belong to the enclosing @code{if}.  The resulting code would
3379 look like this:
3380
3381 @smallexample
3382 @group
3383 @{
3384   if (a)
3385     @{
3386       if (b)
3387         foo ();
3388       else
3389         bar ();
3390     @}
3391 @}
3392 @end group
3393 @end smallexample
3394
3395 Also warn for dangerous uses of the
3396 ?: with omitted middle operand GNU extension. When the condition
3397 in the ?: operator is a boolean expression the omitted value will
3398 be always 1. Often the user expects it to be a value computed
3399 inside the conditional expression instead.
3400
3401 This warning is enabled by @option{-Wall}.
3402
3403 @item -Wsequence-point
3404 @opindex Wsequence-point
3405 @opindex Wno-sequence-point
3406 Warn about code that may have undefined semantics because of violations
3407 of sequence point rules in the C and C++ standards.
3408
3409 The C and C++ standards defines the order in which expressions in a C/C++
3410 program are evaluated in terms of @dfn{sequence points}, which represent
3411 a partial ordering between the execution of parts of the program: those
3412 executed before the sequence point, and those executed after it.  These
3413 occur after the evaluation of a full expression (one which is not part
3414 of a larger expression), after the evaluation of the first operand of a
3415 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3416 function is called (but after the evaluation of its arguments and the
3417 expression denoting the called function), and in certain other places.
3418 Other than as expressed by the sequence point rules, the order of
3419 evaluation of subexpressions of an expression is not specified.  All
3420 these rules describe only a partial order rather than a total order,
3421 since, for example, if two functions are called within one expression
3422 with no sequence point between them, the order in which the functions
3423 are called is not specified.  However, the standards committee have
3424 ruled that function calls do not overlap.
3425
3426 It is not specified when between sequence points modifications to the
3427 values of objects take effect.  Programs whose behavior depends on this
3428 have undefined behavior; the C and C++ standards specify that ``Between
3429 the previous and next sequence point an object shall have its stored
3430 value modified at most once by the evaluation of an expression.
3431 Furthermore, the prior value shall be read only to determine the value
3432 to be stored.''.  If a program breaks these rules, the results on any
3433 particular implementation are entirely unpredictable.
3434
3435 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3436 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3437 diagnosed by this option, and it may give an occasional false positive
3438 result, but in general it has been found fairly effective at detecting
3439 this sort of problem in programs.
3440
3441 The standard is worded confusingly, therefore there is some debate
3442 over the precise meaning of the sequence point rules in subtle cases.
3443 Links to discussions of the problem, including proposed formal
3444 definitions, may be found on the GCC readings page, at
3445 @uref{http://gcc.gnu.org/@/readings.html}.
3446
3447 This warning is enabled by @option{-Wall} for C and C++.
3448
3449 @item -Wreturn-type
3450 @opindex Wreturn-type
3451 @opindex Wno-return-type
3452 Warn whenever a function is defined with a return-type that defaults
3453 to @code{int}.  Also warn about any @code{return} statement with no
3454 return-value in a function whose return-type is not @code{void}
3455 (falling off the end of the function body is considered returning
3456 without a value), and about a @code{return} statement with an
3457 expression in a function whose return-type is @code{void}.
3458
3459 For C++, a function without return type always produces a diagnostic
3460 message, even when @option{-Wno-return-type} is specified.  The only
3461 exceptions are @samp{main} and functions defined in system headers.
3462
3463 This warning is enabled by @option{-Wall}.
3464
3465 @item -Wswitch
3466 @opindex Wswitch
3467 @opindex Wno-switch
3468 Warn whenever a @code{switch} statement has an index of enumerated type
3469 and lacks a @code{case} for one or more of the named codes of that
3470 enumeration.  (The presence of a @code{default} label prevents this
3471 warning.)  @code{case} labels outside the enumeration range also
3472 provoke warnings when this option is used (even if there is a
3473 @code{default} label).
3474 This warning is enabled by @option{-Wall}.
3475
3476 @item -Wswitch-default
3477 @opindex Wswitch-default
3478 @opindex Wno-switch-default
3479 Warn whenever a @code{switch} statement does not have a @code{default}
3480 case.
3481
3482 @item -Wswitch-enum
3483 @opindex Wswitch-enum
3484 @opindex Wno-switch-enum
3485 Warn whenever a @code{switch} statement has an index of enumerated type
3486 and lacks a @code{case} for one or more of the named codes of that
3487 enumeration.  @code{case} labels outside the enumeration range also
3488 provoke warnings when this option is used.  The only difference
3489 between @option{-Wswitch} and this option is that this option gives a
3490 warning about an omitted enumeration code even if there is a
3491 @code{default} label.
3492
3493 @item -Wsync-nand @r{(C and C++ only)}
3494 @opindex Wsync-nand
3495 @opindex Wno-sync-nand
3496 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3497 built-in functions are used.  These functions changed semantics in GCC 4.4.
3498
3499 @item -Wtrigraphs
3500 @opindex Wtrigraphs
3501 @opindex Wno-trigraphs
3502 Warn if any trigraphs are encountered that might change the meaning of
3503 the program (trigraphs within comments are not warned about).
3504 This warning is enabled by @option{-Wall}.
3505
3506 @item -Wunused-but-set-parameter
3507 @opindex Wunused-but-set-parameter
3508 @opindex Wno-unused-but-set-parameter
3509 Warn whenever a function parameter is assigned to, but otherwise unused
3510 (aside from its declaration).
3511
3512 To suppress this warning use the @samp{unused} attribute
3513 (@pxref{Variable Attributes}).
3514
3515 This warning is also enabled by @option{-Wunused} together with
3516 @option{-Wextra}.
3517
3518 @item -Wunused-but-set-variable
3519 @opindex Wunused-but-set-variable
3520 @opindex Wno-unused-but-set-variable
3521 Warn whenever a local variable is assigned to, but otherwise unused
3522 (aside from its declaration).
3523 This warning is enabled by @option{-Wall}.
3524
3525 To suppress this warning use the @samp{unused} attribute
3526 (@pxref{Variable Attributes}).
3527
3528 This warning is also enabled by @option{-Wunused}, which is enabled
3529 by @option{-Wall}.
3530
3531 @item -Wunused-function
3532 @opindex Wunused-function
3533 @opindex Wno-unused-function
3534 Warn whenever a static function is declared but not defined or a
3535 non-inline static function is unused.
3536 This warning is enabled by @option{-Wall}.
3537
3538 @item -Wunused-label
3539 @opindex Wunused-label
3540 @opindex Wno-unused-label
3541 Warn whenever a label is declared but not used.
3542 This warning is enabled by @option{-Wall}.
3543
3544 To suppress this warning use the @samp{unused} attribute
3545 (@pxref{Variable Attributes}).
3546
3547 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3548 @opindex Wunused-local-typedefs
3549 Warn when a typedef locally defined in a function is not used.
3550
3551 @item -Wunused-parameter
3552 @opindex Wunused-parameter
3553 @opindex Wno-unused-parameter
3554 Warn whenever a function parameter is unused aside from its declaration.
3555
3556 To suppress this warning use the @samp{unused} attribute
3557 (@pxref{Variable Attributes}).
3558
3559 @item -Wno-unused-result
3560 @opindex Wunused-result
3561 @opindex Wno-unused-result
3562 Do not warn if a caller of a function marked with attribute
3563 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3564 its return value. The default is @option{-Wunused-result}.
3565
3566 @item -Wunused-variable
3567 @opindex Wunused-variable
3568 @opindex Wno-unused-variable
3569 Warn whenever a local variable or non-constant static variable is unused
3570 aside from its declaration.
3571 This warning is enabled by @option{-Wall}.
3572
3573 To suppress this warning use the @samp{unused} attribute
3574 (@pxref{Variable Attributes}).
3575
3576 @item -Wunused-value
3577 @opindex Wunused-value
3578 @opindex Wno-unused-value
3579 Warn whenever a statement computes a result that is explicitly not
3580 used. To suppress this warning cast the unused expression to
3581 @samp{void}. This includes an expression-statement or the left-hand
3582 side of a comma expression that contains no side effects. For example,
3583 an expression such as @samp{x[i,j]} will cause a warning, while
3584 @samp{x[(void)i,j]} will not.
3585
3586 This warning is enabled by @option{-Wall}.
3587
3588 @item -Wunused
3589 @opindex Wunused
3590 @opindex Wno-unused
3591 All the above @option{-Wunused} options combined.
3592
3593 In order to get a warning about an unused function parameter, you must
3594 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3595 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3596
3597 @item -Wuninitialized
3598 @opindex Wuninitialized
3599 @opindex Wno-uninitialized
3600 Warn if an automatic variable is used without first being initialized
3601 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3602 warn if a non-static reference or non-static @samp{const} member
3603 appears in a class without constructors.
3604
3605 If you want to warn about code which uses the uninitialized value of the
3606 variable in its own initializer, use the @option{-Winit-self} option.
3607
3608 These warnings occur for individual uninitialized or clobbered
3609 elements of structure, union or array variables as well as for
3610 variables which are uninitialized or clobbered as a whole.  They do
3611 not occur for variables or elements declared @code{volatile}.  Because
3612 these warnings depend on optimization, the exact variables or elements
3613 for which there are warnings will depend on the precise optimization
3614 options and version of GCC used.
3615
3616 Note that there may be no warning about a variable that is used only
3617 to compute a value that itself is never used, because such
3618 computations may be deleted by data flow analysis before the warnings
3619 are printed.
3620
3621 @item -Wmaybe-uninitialized
3622 @opindex Wmaybe-uninitialized
3623 @opindex Wno-maybe-uninitialized
3624 For an automatic variable, if there exists a path from the function
3625 entry to a use of the variable that is initialized, but there exist
3626 some other paths the variable is not initialized, the compiler will
3627 emit a warning if it can not prove the uninitialized paths do not
3628 happen at runtime. These warnings are made optional because GCC is
3629 not smart enough to see all the reasons why the code might be correct
3630 despite appearing to have an error.  Here is one example of how
3631 this can happen:
3632
3633 @smallexample
3634 @group
3635 @{
3636   int x;
3637   switch (y)
3638     @{
3639     case 1: x = 1;
3640       break;
3641     case 2: x = 4;
3642       break;
3643     case 3: x = 5;
3644     @}
3645   foo (x);
3646 @}
3647 @end group
3648 @end smallexample
3649
3650 @noindent
3651 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3652 always initialized, but GCC doesn't know this. To suppress the
3653 warning, the user needs to provide a default case with assert(0) or
3654 similar code.
3655
3656 @cindex @code{longjmp} warnings
3657 This option also warns when a non-volatile automatic variable might be
3658 changed by a call to @code{longjmp}.  These warnings as well are possible
3659 only in optimizing compilation.
3660
3661 The compiler sees only the calls to @code{setjmp}.  It cannot know
3662 where @code{longjmp} will be called; in fact, a signal handler could
3663 call it at any point in the code.  As a result, you may get a warning
3664 even when there is in fact no problem because @code{longjmp} cannot
3665 in fact be called at the place which would cause a problem.
3666
3667 Some spurious warnings can be avoided if you declare all the functions
3668 you use that never return as @code{noreturn}.  @xref{Function
3669 Attributes}.
3670
3671 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3672
3673 @item -Wunknown-pragmas
3674 @opindex Wunknown-pragmas
3675 @opindex Wno-unknown-pragmas
3676 @cindex warning for unknown pragmas
3677 @cindex unknown pragmas, warning
3678 @cindex pragmas, warning of unknown
3679 Warn when a #pragma directive is encountered which is not understood by
3680 GCC@.  If this command line option is used, warnings will even be issued
3681 for unknown pragmas in system header files.  This is not the case if
3682 the warnings were only enabled by the @option{-Wall} command line option.
3683
3684 @item -Wno-pragmas
3685 @opindex Wno-pragmas
3686 @opindex Wpragmas
3687 Do not warn about misuses of pragmas, such as incorrect parameters,
3688 invalid syntax, or conflicts between pragmas.  See also
3689 @samp{-Wunknown-pragmas}.
3690
3691 @item -Wstrict-aliasing
3692 @opindex Wstrict-aliasing
3693 @opindex Wno-strict-aliasing
3694 This option is only active when @option{-fstrict-aliasing} is active.
3695 It warns about code which might break the strict aliasing rules that the
3696 compiler is using for optimization.  The warning does not catch all
3697 cases, but does attempt to catch the more common pitfalls.  It is
3698 included in @option{-Wall}.
3699 It is equivalent to @option{-Wstrict-aliasing=3}
3700
3701 @item -Wstrict-aliasing=n
3702 @opindex Wstrict-aliasing=n
3703 @opindex Wno-strict-aliasing=n
3704 This option is only active when @option{-fstrict-aliasing} is active.
3705 It warns about code which might break the strict aliasing rules that the
3706 compiler is using for optimization.
3707 Higher levels correspond to higher accuracy (fewer false positives).
3708 Higher levels also correspond to more effort, similar to the way -O works.
3709 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3710 with n=3.
3711
3712 Level 1: Most aggressive, quick, least accurate.
3713 Possibly useful when higher levels
3714 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3715 false negatives.  However, it has many false positives.
3716 Warns for all pointer conversions between possibly incompatible types,
3717 even if never dereferenced.  Runs in the frontend only.
3718
3719 Level 2: Aggressive, quick, not too precise.
3720 May still have many false positives (not as many as level 1 though),
3721 and few false negatives (but possibly more than level 1).
3722 Unlike level 1, it only warns when an address is taken.  Warns about
3723 incomplete types.  Runs in the frontend only.
3724
3725 Level 3 (default for @option{-Wstrict-aliasing}):
3726 Should have very few false positives and few false
3727 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3728 Takes care of the common pun+dereference pattern in the frontend:
3729 @code{*(int*)&some_float}.
3730 If optimization is enabled, it also runs in the backend, where it deals
3731 with multiple statement cases using flow-sensitive points-to information.
3732 Only warns when the converted pointer is dereferenced.
3733 Does not warn about incomplete types.
3734
3735 @item -Wstrict-overflow
3736 @itemx -Wstrict-overflow=@var{n}
3737 @opindex Wstrict-overflow
3738 @opindex Wno-strict-overflow
3739 This option is only active when @option{-fstrict-overflow} is active.
3740 It warns about cases where the compiler optimizes based on the
3741 assumption that signed overflow does not occur.  Note that it does not
3742 warn about all cases where the code might overflow: it only warns
3743 about cases where the compiler implements some optimization.  Thus
3744 this warning depends on the optimization level.
3745
3746 An optimization which assumes that signed overflow does not occur is
3747 perfectly safe if the values of the variables involved are such that
3748 overflow never does, in fact, occur.  Therefore this warning can
3749 easily give a false positive: a warning about code which is not
3750 actually a problem.  To help focus on important issues, several
3751 warning levels are defined.  No warnings are issued for the use of
3752 undefined signed overflow when estimating how many iterations a loop
3753 will require, in particular when determining whether a loop will be
3754 executed at all.
3755
3756 @table @gcctabopt
3757 @item -Wstrict-overflow=1
3758 Warn about cases which are both questionable and easy to avoid.  For
3759 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3760 compiler will simplify this to @code{1}.  This level of
3761 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3762 are not, and must be explicitly requested.
3763
3764 @item -Wstrict-overflow=2
3765 Also warn about other cases where a comparison is simplified to a
3766 constant.  For example: @code{abs (x) >= 0}.  This can only be
3767 simplified when @option{-fstrict-overflow} is in effect, because
3768 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3769 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3770 @option{-Wstrict-overflow=2}.
3771
3772 @item -Wstrict-overflow=3
3773 Also warn about other cases where a comparison is simplified.  For
3774 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3775
3776 @item -Wstrict-overflow=4
3777 Also warn about other simplifications not covered by the above cases.
3778 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3779
3780 @item -Wstrict-overflow=5
3781 Also warn about cases where the compiler reduces the magnitude of a
3782 constant involved in a comparison.  For example: @code{x + 2 > y} will
3783 be simplified to @code{x + 1 >= y}.  This is reported only at the
3784 highest warning level because this simplification applies to many
3785 comparisons, so this warning level will give a very large number of
3786 false positives.
3787 @end table
3788
3789 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3790 @opindex Wsuggest-attribute=
3791 @opindex Wno-suggest-attribute=
3792 Warn for cases where adding an attribute may be beneficial. The
3793 attributes currently supported are listed below.
3794
3795 @table @gcctabopt
3796 @item -Wsuggest-attribute=pure
3797 @itemx -Wsuggest-attribute=const
3798 @itemx -Wsuggest-attribute=noreturn
3799 @opindex Wsuggest-attribute=pure
3800 @opindex Wno-suggest-attribute=pure
3801 @opindex Wsuggest-attribute=const
3802 @opindex Wno-suggest-attribute=const
3803 @opindex Wsuggest-attribute=noreturn
3804 @opindex Wno-suggest-attribute=noreturn
3805
3806 Warn about functions which might be candidates for attributes
3807 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3808 functions visible in other compilation units or (in the case of @code{pure} and
3809 @code{const}) if it cannot prove that the function returns normally. A function
3810 returns normally if it doesn't contain an infinite loop nor returns abnormally
3811 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3812 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3813 higher.  Higher optimization levels improve the accuracy of the analysis.
3814 @end table
3815
3816 @item -Warray-bounds
3817 @opindex Wno-array-bounds
3818 @opindex Warray-bounds
3819 This option is only active when @option{-ftree-vrp} is active
3820 (default for @option{-O2} and above). It warns about subscripts to arrays
3821 that are always out of bounds. This warning is enabled by @option{-Wall}.
3822
3823 @item -Wno-div-by-zero
3824 @opindex Wno-div-by-zero
3825 @opindex Wdiv-by-zero
3826 Do not warn about compile-time integer division by zero.  Floating point
3827 division by zero is not warned about, as it can be a legitimate way of
3828 obtaining infinities and NaNs.
3829
3830 @item -Wsystem-headers
3831 @opindex Wsystem-headers
3832 @opindex Wno-system-headers
3833 @cindex warnings from system headers
3834 @cindex system headers, warnings from
3835 Print warning messages for constructs found in system header files.
3836 Warnings from system headers are normally suppressed, on the assumption
3837 that they usually do not indicate real problems and would only make the
3838 compiler output harder to read.  Using this command line option tells
3839 GCC to emit warnings from system headers as if they occurred in user
3840 code.  However, note that using @option{-Wall} in conjunction with this
3841 option will @emph{not} warn about unknown pragmas in system
3842 headers---for that, @option{-Wunknown-pragmas} must also be used.
3843
3844 @item -Wtrampolines
3845 @opindex Wtrampolines
3846 @opindex Wno-trampolines
3847  Warn about trampolines generated for pointers to nested functions.
3848
3849  A trampoline is a small piece of data or code that is created at run
3850  time on the stack when the address of a nested function is taken, and
3851  is used to call the nested function indirectly.  For some targets, it
3852  is made up of data only and thus requires no special treatment.  But,
3853  for most targets, it is made up of code and thus requires the stack
3854  to be made executable in order for the program to work properly.
3855
3856 @item -Wfloat-equal
3857 @opindex Wfloat-equal
3858 @opindex Wno-float-equal
3859 Warn if floating point values are used in equality comparisons.
3860
3861 The idea behind this is that sometimes it is convenient (for the
3862 programmer) to consider floating-point values as approximations to
3863 infinitely precise real numbers.  If you are doing this, then you need
3864 to compute (by analyzing the code, or in some other way) the maximum or
3865 likely maximum error that the computation introduces, and allow for it
3866 when performing comparisons (and when producing output, but that's a
3867 different problem).  In particular, instead of testing for equality, you
3868 would check to see whether the two values have ranges that overlap; and
3869 this is done with the relational operators, so equality comparisons are
3870 probably mistaken.
3871
3872 @item -Wtraditional @r{(C and Objective-C only)}
3873 @opindex Wtraditional
3874 @opindex Wno-traditional
3875 Warn about certain constructs that behave differently in traditional and
3876 ISO C@.  Also warn about ISO C constructs that have no traditional C
3877 equivalent, and/or problematic constructs which should be avoided.
3878
3879 @itemize @bullet
3880 @item
3881 Macro parameters that appear within string literals in the macro body.
3882 In traditional C macro replacement takes place within string literals,
3883 but does not in ISO C@.
3884
3885 @item
3886 In traditional C, some preprocessor directives did not exist.
3887 Traditional preprocessors would only consider a line to be a directive
3888 if the @samp{#} appeared in column 1 on the line.  Therefore
3889 @option{-Wtraditional} warns about directives that traditional C
3890 understands but would ignore because the @samp{#} does not appear as the
3891 first character on the line.  It also suggests you hide directives like
3892 @samp{#pragma} not understood by traditional C by indenting them.  Some
3893 traditional implementations would not recognize @samp{#elif}, so it
3894 suggests avoiding it altogether.
3895
3896 @item
3897 A function-like macro that appears without arguments.
3898
3899 @item
3900 The unary plus operator.
3901
3902 @item
3903 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3904 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3905 constants.)  Note, these suffixes appear in macros defined in the system
3906 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3907 Use of these macros in user code might normally lead to spurious
3908 warnings, however GCC's integrated preprocessor has enough context to
3909 avoid warning in these cases.
3910
3911 @item
3912 A function declared external in one block and then used after the end of
3913 the block.
3914
3915 @item
3916 A @code{switch} statement has an operand of type @code{long}.
3917
3918 @item
3919 A non-@code{static} function declaration follows a @code{static} one.
3920 This construct is not accepted by some traditional C compilers.
3921
3922 @item
3923 The ISO type of an integer constant has a different width or
3924 signedness from its traditional type.  This warning is only issued if
3925 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3926 typically represent bit patterns, are not warned about.
3927
3928 @item
3929 Usage of ISO string concatenation is detected.
3930
3931 @item
3932 Initialization of automatic aggregates.
3933
3934 @item
3935 Identifier conflicts with labels.  Traditional C lacks a separate
3936 namespace for labels.
3937
3938 @item
3939 Initialization of unions.  If the initializer is zero, the warning is
3940 omitted.  This is done under the assumption that the zero initializer in
3941 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3942 initializer warnings and relies on default initialization to zero in the
3943 traditional C case.
3944
3945 @item
3946 Conversions by prototypes between fixed/floating point values and vice
3947 versa.  The absence of these prototypes when compiling with traditional
3948 C would cause serious problems.  This is a subset of the possible
3949 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3950
3951 @item
3952 Use of ISO C style function definitions.  This warning intentionally is
3953 @emph{not} issued for prototype declarations or variadic functions
3954 because these ISO C features will appear in your code when using
3955 libiberty's traditional C compatibility macros, @code{PARAMS} and
3956 @code{VPARAMS}.  This warning is also bypassed for nested functions
3957 because that feature is already a GCC extension and thus not relevant to
3958 traditional C compatibility.
3959 @end itemize
3960
3961 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3962 @opindex Wtraditional-conversion
3963 @opindex Wno-traditional-conversion
3964 Warn if a prototype causes a type conversion that is different from what
3965 would happen to the same argument in the absence of a prototype.  This
3966 includes conversions of fixed point to floating and vice versa, and
3967 conversions changing the width or signedness of a fixed point argument
3968 except when the same as the default promotion.
3969
3970 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3971 @opindex Wdeclaration-after-statement
3972 @opindex Wno-declaration-after-statement
3973 Warn when a declaration is found after a statement in a block.  This
3974 construct, known from C++, was introduced with ISO C99 and is by default
3975 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3976 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3977
3978 @item -Wundef
3979 @opindex Wundef
3980 @opindex Wno-undef
3981 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3982
3983 @item -Wno-endif-labels
3984 @opindex Wno-endif-labels
3985 @opindex Wendif-labels
3986 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3987
3988 @item -Wshadow
3989 @opindex Wshadow
3990 @opindex Wno-shadow
3991 Warn whenever a local variable or type declaration shadows another variable,
3992 parameter, type, or class member (in C++), or whenever a built-in function
3993 is shadowed. Note that in C++, the compiler will not warn if a local variable
3994 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3995
3996 @item -Wlarger-than=@var{len}
3997 @opindex Wlarger-than=@var{len}
3998 @opindex Wlarger-than-@var{len}
3999 Warn whenever an object of larger than @var{len} bytes is defined.
4000
4001 @item -Wframe-larger-than=@var{len}
4002 @opindex Wframe-larger-than
4003 Warn if the size of a function frame is larger than @var{len} bytes.
4004 The computation done to determine the stack frame size is approximate
4005 and not conservative.
4006 The actual requirements may be somewhat greater than @var{len}
4007 even if you do not get a warning.  In addition, any space allocated
4008 via @code{alloca}, variable-length arrays, or related constructs
4009 is not included by the compiler when determining
4010 whether or not to issue a warning.
4011
4012 @item -Wno-free-nonheap-object
4013 @opindex Wno-free-nonheap-object
4014 @opindex Wfree-nonheap-object
4015 Do not warn when attempting to free an object which was not allocated
4016 on the heap.
4017
4018 @item -Wstack-usage=@var{len}
4019 @opindex Wstack-usage
4020 Warn if the stack usage of a function might be larger than @var{len} bytes.
4021 The computation done to determine the stack usage is conservative.
4022 Any space allocated via @code{alloca}, variable-length arrays, or related
4023 constructs is included by the compiler when determining whether or not to
4024 issue a warning.
4025
4026 The message is in keeping with the output of @option{-fstack-usage}.
4027
4028 @itemize
4029 @item
4030 If the stack usage is fully static but exceeds the specified amount, it's:
4031
4032 @smallexample
4033   warning: stack usage is 1120 bytes
4034 @end smallexample
4035 @item
4036 If the stack usage is (partly) dynamic but bounded, it's:
4037
4038 @smallexample
4039   warning: stack usage might be 1648 bytes
4040 @end smallexample
4041 @item
4042 If the stack usage is (partly) dynamic and not bounded, it's:
4043
4044 @smallexample
4045   warning: stack usage might be unbounded
4046 @end smallexample
4047 @end itemize
4048
4049 @item -Wunsafe-loop-optimizations
4050 @opindex Wunsafe-loop-optimizations
4051 @opindex Wno-unsafe-loop-optimizations
4052 Warn if the loop cannot be optimized because the compiler could not
4053 assume anything on the bounds of the loop indices.  With
4054 @option{-funsafe-loop-optimizations} warn if the compiler made
4055 such assumptions.
4056
4057 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4058 @opindex Wno-pedantic-ms-format
4059 @opindex Wpedantic-ms-format
4060 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
4061 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
4062 depending on the MS runtime, when you are using the options @option{-Wformat}
4063 and @option{-pedantic} without gnu-extensions.
4064
4065 @item -Wpointer-arith
4066 @opindex Wpointer-arith
4067 @opindex Wno-pointer-arith
4068 Warn about anything that depends on the ``size of'' a function type or
4069 of @code{void}.  GNU C assigns these types a size of 1, for
4070 convenience in calculations with @code{void *} pointers and pointers
4071 to functions.  In C++, warn also when an arithmetic operation involves
4072 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
4073
4074 @item -Wtype-limits
4075 @opindex Wtype-limits
4076 @opindex Wno-type-limits
4077 Warn if a comparison is always true or always false due to the limited
4078 range of the data type, but do not warn for constant expressions.  For
4079 example, warn if an unsigned variable is compared against zero with
4080 @samp{<} or @samp{>=}.  This warning is also enabled by
4081 @option{-Wextra}.
4082
4083 @item -Wbad-function-cast @r{(C and Objective-C only)}
4084 @opindex Wbad-function-cast
4085 @opindex Wno-bad-function-cast
4086 Warn whenever a function call is cast to a non-matching type.
4087 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4088
4089 @item -Wc++-compat @r{(C and Objective-C only)}
4090 Warn about ISO C constructs that are outside of the common subset of
4091 ISO C and ISO C++, e.g.@: request for implicit conversion from
4092 @code{void *} to a pointer to non-@code{void} type.
4093
4094 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4095 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4096 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4097 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4098 enabled by @option{-Wall}.
4099
4100 @item -Wcast-qual
4101 @opindex Wcast-qual
4102 @opindex Wno-cast-qual
4103 Warn whenever a pointer is cast so as to remove a type qualifier from
4104 the target type.  For example, warn if a @code{const char *} is cast
4105 to an ordinary @code{char *}.
4106
4107 Also warn when making a cast which introduces a type qualifier in an
4108 unsafe way.  For example, casting @code{char **} to @code{const char **}
4109 is unsafe, as in this example:
4110
4111 @smallexample
4112   /* p is char ** value.  */
4113   const char **q = (const char **) p;
4114   /* Assignment of readonly string to const char * is OK.  */
4115   *q = "string";
4116   /* Now char** pointer points to read-only memory.  */
4117   **p = 'b';
4118 @end smallexample
4119
4120 @item -Wcast-align
4121 @opindex Wcast-align
4122 @opindex Wno-cast-align
4123 Warn whenever a pointer is cast such that the required alignment of the
4124 target is increased.  For example, warn if a @code{char *} is cast to
4125 an @code{int *} on machines where integers can only be accessed at
4126 two- or four-byte boundaries.
4127
4128 @item -Wwrite-strings
4129 @opindex Wwrite-strings
4130 @opindex Wno-write-strings
4131 When compiling C, give string constants the type @code{const
4132 char[@var{length}]} so that copying the address of one into a
4133 non-@code{const} @code{char *} pointer will get a warning.  These
4134 warnings will help you find at compile time code that can try to write
4135 into a string constant, but only if you have been very careful about
4136 using @code{const} in declarations and prototypes.  Otherwise, it will
4137 just be a nuisance. This is why we did not make @option{-Wall} request
4138 these warnings.
4139
4140 When compiling C++, warn about the deprecated conversion from string
4141 literals to @code{char *}.  This warning is enabled by default for C++
4142 programs.
4143
4144 @item -Wclobbered
4145 @opindex Wclobbered
4146 @opindex Wno-clobbered
4147 Warn for variables that might be changed by @samp{longjmp} or
4148 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4149
4150 @item -Wconversion
4151 @opindex Wconversion
4152 @opindex Wno-conversion
4153 Warn for implicit conversions that may alter a value. This includes
4154 conversions between real and integer, like @code{abs (x)} when
4155 @code{x} is @code{double}; conversions between signed and unsigned,
4156 like @code{unsigned ui = -1}; and conversions to smaller types, like
4157 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4158 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4159 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4160 conversions between signed and unsigned integers can be disabled by
4161 using @option{-Wno-sign-conversion}.
4162
4163 For C++, also warn for confusing overload resolution for user-defined
4164 conversions; and conversions that will never use a type conversion
4165 operator: conversions to @code{void}, the same type, a base class or a
4166 reference to them. Warnings about conversions between signed and
4167 unsigned integers are disabled by default in C++ unless
4168 @option{-Wsign-conversion} is explicitly enabled.
4169
4170 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4171 @opindex Wconversion-null
4172 @opindex Wno-conversion-null
4173 Do not warn for conversions between @code{NULL} and non-pointer
4174 types. @option{-Wconversion-null} is enabled by default.
4175
4176 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4177 @opindex Wzero-as-null-pointer-constant
4178 @opindex Wno-zero-as-null-pointer-constant
4179 Warn when a literal '0' is used as null pointer constant.  This can
4180 be useful to facilitate the conversion to @code{nullptr} in C++11.
4181
4182 @item -Wempty-body
4183 @opindex Wempty-body
4184 @opindex Wno-empty-body
4185 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4186 while} statement.  This warning is also enabled by @option{-Wextra}.
4187
4188 @item -Wenum-compare
4189 @opindex Wenum-compare
4190 @opindex Wno-enum-compare
4191 Warn about a comparison between values of different enum types. In C++
4192 this warning is enabled by default.  In C this warning is enabled by
4193 @option{-Wall}.
4194
4195 @item -Wjump-misses-init @r{(C, Objective-C only)}
4196 @opindex Wjump-misses-init
4197 @opindex Wno-jump-misses-init
4198 Warn if a @code{goto} statement or a @code{switch} statement jumps
4199 forward across the initialization of a variable, or jumps backward to a
4200 label after the variable has been initialized.  This only warns about
4201 variables which are initialized when they are declared.  This warning is
4202 only supported for C and Objective C; in C++ this sort of branch is an
4203 error in any case.
4204
4205 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4206 can be disabled with the @option{-Wno-jump-misses-init} option.
4207
4208 @item -Wsign-compare
4209 @opindex Wsign-compare
4210 @opindex Wno-sign-compare
4211 @cindex warning for comparison of signed and unsigned values
4212 @cindex comparison of signed and unsigned values, warning
4213 @cindex signed and unsigned values, comparison warning
4214 Warn when a comparison between signed and unsigned values could produce
4215 an incorrect result when the signed value is converted to unsigned.
4216 This warning is also enabled by @option{-Wextra}; to get the other warnings
4217 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4218
4219 @item -Wsign-conversion
4220 @opindex Wsign-conversion
4221 @opindex Wno-sign-conversion
4222 Warn for implicit conversions that may change the sign of an integer
4223 value, like assigning a signed integer expression to an unsigned
4224 integer variable. An explicit cast silences the warning. In C, this
4225 option is enabled also by @option{-Wconversion}.
4226
4227 @item -Waddress
4228 @opindex Waddress
4229 @opindex Wno-address
4230 Warn about suspicious uses of memory addresses. These include using
4231 the address of a function in a conditional expression, such as
4232 @code{void func(void); if (func)}, and comparisons against the memory
4233 address of a string literal, such as @code{if (x == "abc")}.  Such
4234 uses typically indicate a programmer error: the address of a function
4235 always evaluates to true, so their use in a conditional usually
4236 indicate that the programmer forgot the parentheses in a function
4237 call; and comparisons against string literals result in unspecified
4238 behavior and are not portable in C, so they usually indicate that the
4239 programmer intended to use @code{strcmp}.  This warning is enabled by
4240 @option{-Wall}.
4241
4242 @item -Wlogical-op
4243 @opindex Wlogical-op
4244 @opindex Wno-logical-op
4245 Warn about suspicious uses of logical operators in expressions.
4246 This includes using logical operators in contexts where a
4247 bit-wise operator is likely to be expected.
4248
4249 @item -Waggregate-return
4250 @opindex Waggregate-return
4251 @opindex Wno-aggregate-return
4252 Warn if any functions that return structures or unions are defined or
4253 called.  (In languages where you can return an array, this also elicits
4254 a warning.)
4255
4256 @item -Wno-attributes
4257 @opindex Wno-attributes
4258 @opindex Wattributes
4259 Do not warn if an unexpected @code{__attribute__} is used, such as
4260 unrecognized attributes, function attributes applied to variables,
4261 etc.  This will not stop errors for incorrect use of supported
4262 attributes.
4263
4264 @item -Wno-builtin-macro-redefined
4265 @opindex Wno-builtin-macro-redefined
4266 @opindex Wbuiltin-macro-redefined
4267 Do not warn if certain built-in macros are redefined.  This suppresses
4268 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4269 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4270
4271 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4272 @opindex Wstrict-prototypes
4273 @opindex Wno-strict-prototypes
4274 Warn if a function is declared or defined without specifying the
4275 argument types.  (An old-style function definition is permitted without
4276 a warning if preceded by a declaration which specifies the argument
4277 types.)
4278
4279 @item -Wold-style-declaration @r{(C and Objective-C only)}
4280 @opindex Wold-style-declaration
4281 @opindex Wno-old-style-declaration
4282 Warn for obsolescent usages, according to the C Standard, in a
4283 declaration. For example, warn if storage-class specifiers like
4284 @code{static} are not the first things in a declaration.  This warning
4285 is also enabled by @option{-Wextra}.
4286
4287 @item -Wold-style-definition @r{(C and Objective-C only)}
4288 @opindex Wold-style-definition
4289 @opindex Wno-old-style-definition
4290 Warn if an old-style function definition is used.  A warning is given
4291 even if there is a previous prototype.
4292
4293 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4294 @opindex Wmissing-parameter-type
4295 @opindex Wno-missing-parameter-type
4296 A function parameter is declared without a type specifier in K&R-style
4297 functions:
4298
4299 @smallexample
4300 void foo(bar) @{ @}
4301 @end smallexample
4302
4303 This warning is also enabled by @option{-Wextra}.
4304
4305 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4306 @opindex Wmissing-prototypes
4307 @opindex Wno-missing-prototypes
4308 Warn if a global function is defined without a previous prototype
4309 declaration.  This warning is issued even if the definition itself
4310 provides a prototype.  The aim is to detect global functions that fail
4311 to be declared in header files.
4312
4313 @item -Wmissing-declarations
4314 @opindex Wmissing-declarations
4315 @opindex Wno-missing-declarations
4316 Warn if a global function is defined without a previous declaration.
4317 Do so even if the definition itself provides a prototype.
4318 Use this option to detect global functions that are not declared in
4319 header files.  In C++, no warnings are issued for function templates,
4320 or for inline functions, or for functions in anonymous namespaces.
4321
4322 @item -Wmissing-field-initializers
4323 @opindex Wmissing-field-initializers
4324 @opindex Wno-missing-field-initializers
4325 @opindex W
4326 @opindex Wextra
4327 @opindex Wno-extra
4328 Warn if a structure's initializer has some fields missing.  For
4329 example, the following code would cause such a warning, because
4330 @code{x.h} is implicitly zero:
4331
4332 @smallexample
4333 struct s @{ int f, g, h; @};
4334 struct s x = @{ 3, 4 @};
4335 @end smallexample
4336
4337 This option does not warn about designated initializers, so the following
4338 modification would not trigger a warning:
4339
4340 @smallexample
4341 struct s @{ int f, g, h; @};
4342 struct s x = @{ .f = 3, .g = 4 @};
4343 @end smallexample
4344
4345 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4346 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4347
4348 @item -Wmissing-format-attribute
4349 @opindex Wmissing-format-attribute
4350 @opindex Wno-missing-format-attribute
4351 @opindex Wformat
4352 @opindex Wno-format
4353 Warn about function pointers which might be candidates for @code{format}
4354 attributes.  Note these are only possible candidates, not absolute ones.
4355 GCC will guess that function pointers with @code{format} attributes that
4356 are used in assignment, initialization, parameter passing or return
4357 statements should have a corresponding @code{format} attribute in the
4358 resulting type.  I.e.@: the left-hand side of the assignment or
4359 initialization, the type of the parameter variable, or the return type
4360 of the containing function respectively should also have a @code{format}
4361 attribute to avoid the warning.
4362
4363 GCC will also warn about function definitions which might be
4364 candidates for @code{format} attributes.  Again, these are only
4365 possible candidates.  GCC will guess that @code{format} attributes
4366 might be appropriate for any function that calls a function like
4367 @code{vprintf} or @code{vscanf}, but this might not always be the
4368 case, and some functions for which @code{format} attributes are
4369 appropriate may not be detected.
4370
4371 @item -Wno-multichar
4372 @opindex Wno-multichar
4373 @opindex Wmultichar
4374 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4375 Usually they indicate a typo in the user's code, as they have
4376 implementation-defined values, and should not be used in portable code.
4377
4378 @item -Wnormalized=<none|id|nfc|nfkc>
4379 @opindex Wnormalized=
4380 @cindex NFC
4381 @cindex NFKC
4382 @cindex character set, input normalization
4383 In ISO C and ISO C++, two identifiers are different if they are
4384 different sequences of characters.  However, sometimes when characters
4385 outside the basic ASCII character set are used, you can have two
4386 different character sequences that look the same.  To avoid confusion,
4387 the ISO 10646 standard sets out some @dfn{normalization rules} which
4388 when applied ensure that two sequences that look the same are turned into
4389 the same sequence.  GCC can warn you if you are using identifiers which
4390 have not been normalized; this option controls that warning.
4391
4392 There are four levels of warning that GCC supports.  The default is
4393 @option{-Wnormalized=nfc}, which warns about any identifier which is
4394 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4395 recommended form for most uses.
4396
4397 Unfortunately, there are some characters which ISO C and ISO C++ allow
4398 in identifiers that when turned into NFC aren't allowable as
4399 identifiers.  That is, there's no way to use these symbols in portable
4400 ISO C or C++ and have all your identifiers in NFC@.
4401 @option{-Wnormalized=id} suppresses the warning for these characters.
4402 It is hoped that future versions of the standards involved will correct
4403 this, which is why this option is not the default.
4404
4405 You can switch the warning off for all characters by writing
4406 @option{-Wnormalized=none}.  You would only want to do this if you
4407 were using some other normalization scheme (like ``D''), because
4408 otherwise you can easily create bugs that are literally impossible to see.
4409
4410 Some characters in ISO 10646 have distinct meanings but look identical
4411 in some fonts or display methodologies, especially once formatting has
4412 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4413 LETTER N'', will display just like a regular @code{n} which has been
4414 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4415 normalization scheme to convert all these into a standard form as
4416 well, and GCC will warn if your code is not in NFKC if you use
4417 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4418 about every identifier that contains the letter O because it might be
4419 confused with the digit 0, and so is not the default, but may be
4420 useful as a local coding convention if the programming environment is
4421 unable to be fixed to display these characters distinctly.
4422
4423 @item -Wno-deprecated
4424 @opindex Wno-deprecated
4425 @opindex Wdeprecated
4426 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4427
4428 @item -Wno-deprecated-declarations
4429 @opindex Wno-deprecated-declarations
4430 @opindex Wdeprecated-declarations
4431 Do not warn about uses of functions (@pxref{Function Attributes}),
4432 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4433 Attributes}) marked as deprecated by using the @code{deprecated}
4434 attribute.
4435
4436 @item -Wno-overflow
4437 @opindex Wno-overflow
4438 @opindex Woverflow
4439 Do not warn about compile-time overflow in constant expressions.
4440
4441 @item -Woverride-init @r{(C and Objective-C only)}
4442 @opindex Woverride-init
4443 @opindex Wno-override-init
4444 @opindex W
4445 @opindex Wextra
4446 @opindex Wno-extra
4447 Warn if an initialized field without side effects is overridden when
4448 using designated initializers (@pxref{Designated Inits, , Designated
4449 Initializers}).
4450
4451 This warning is included in @option{-Wextra}.  To get other
4452 @option{-Wextra} warnings without this one, use @samp{-Wextra
4453 -Wno-override-init}.
4454
4455 @item -Wpacked
4456 @opindex Wpacked
4457 @opindex Wno-packed
4458 Warn if a structure is given the packed attribute, but the packed
4459 attribute has no effect on the layout or size of the structure.
4460 Such structures may be mis-aligned for little benefit.  For
4461 instance, in this code, the variable @code{f.x} in @code{struct bar}
4462 will be misaligned even though @code{struct bar} does not itself
4463 have the packed attribute:
4464
4465 @smallexample
4466 @group
4467 struct foo @{
4468   int x;
4469   char a, b, c, d;
4470 @} __attribute__((packed));
4471 struct bar @{
4472   char z;
4473   struct foo f;
4474 @};
4475 @end group
4476 @end smallexample
4477
4478 @item -Wpacked-bitfield-compat
4479 @opindex Wpacked-bitfield-compat
4480 @opindex Wno-packed-bitfield-compat
4481 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4482 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4483 the change can lead to differences in the structure layout.  GCC
4484 informs you when the offset of such a field has changed in GCC 4.4.
4485 For example there is no longer a 4-bit padding between field @code{a}
4486 and @code{b} in this structure:
4487
4488 @smallexample
4489 struct foo
4490 @{
4491   char a:4;
4492   char b:8;
4493 @} __attribute__ ((packed));
4494 @end smallexample
4495
4496 This warning is enabled by default.  Use
4497 @option{-Wno-packed-bitfield-compat} to disable this warning.
4498
4499 @item -Wpadded
4500 @opindex Wpadded
4501 @opindex Wno-padded
4502 Warn if padding is included in a structure, either to align an element
4503 of the structure or to align the whole structure.  Sometimes when this
4504 happens it is possible to rearrange the fields of the structure to
4505 reduce the padding and so make the structure smaller.
4506
4507 @item -Wredundant-decls
4508 @opindex Wredundant-decls
4509 @opindex Wno-redundant-decls
4510 Warn if anything is declared more than once in the same scope, even in
4511 cases where multiple declaration is valid and changes nothing.
4512
4513 @item -Wnested-externs @r{(C and Objective-C only)}
4514 @opindex Wnested-externs
4515 @opindex Wno-nested-externs
4516 Warn if an @code{extern} declaration is encountered within a function.
4517
4518 @item -Winline
4519 @opindex Winline
4520 @opindex Wno-inline
4521 Warn if a function can not be inlined and it was declared as inline.
4522 Even with this option, the compiler will not warn about failures to
4523 inline functions declared in system headers.
4524
4525 The compiler uses a variety of heuristics to determine whether or not
4526 to inline a function.  For example, the compiler takes into account
4527 the size of the function being inlined and the amount of inlining
4528 that has already been done in the current function.  Therefore,
4529 seemingly insignificant changes in the source program can cause the
4530 warnings produced by @option{-Winline} to appear or disappear.
4531
4532 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4533 @opindex Wno-invalid-offsetof
4534 @opindex Winvalid-offsetof
4535 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4536 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4537 to a non-POD type is undefined.  In existing C++ implementations,
4538 however, @samp{offsetof} typically gives meaningful results even when
4539 applied to certain kinds of non-POD types. (Such as a simple
4540 @samp{struct} that fails to be a POD type only by virtue of having a
4541 constructor.)  This flag is for users who are aware that they are
4542 writing nonportable code and who have deliberately chosen to ignore the
4543 warning about it.
4544
4545 The restrictions on @samp{offsetof} may be relaxed in a future version
4546 of the C++ standard.
4547
4548 @item -Wno-int-to-pointer-cast
4549 @opindex Wno-int-to-pointer-cast
4550 @opindex Wint-to-pointer-cast
4551 Suppress warnings from casts to pointer type of an integer of a
4552 different size. In C++, casting to a pointer type of smaller size is
4553 an error. @option{Wint-to-pointer-cast} is enabled by default.
4554
4555
4556 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4557 @opindex Wno-pointer-to-int-cast
4558 @opindex Wpointer-to-int-cast
4559 Suppress warnings from casts from a pointer to an integer type of a
4560 different size.
4561
4562 @item -Winvalid-pch
4563 @opindex Winvalid-pch
4564 @opindex Wno-invalid-pch
4565 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4566 the search path but can't be used.
4567
4568 @item -Wlong-long
4569 @opindex Wlong-long
4570 @opindex Wno-long-long
4571 Warn if @samp{long long} type is used.  This is enabled by either
4572 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4573 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4574
4575 @item -Wvariadic-macros
4576 @opindex Wvariadic-macros
4577 @opindex Wno-variadic-macros
4578 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4579 alternate syntax when in pedantic ISO C99 mode.  This is default.
4580 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4581
4582 @item -Wvector-operation-performance
4583 @opindex Wvector-operation-performance
4584 @opindex Wno-vector-operation-performance
4585 Warn if vector operation is not implemented via SIMD capabilities of the
4586 architecture.  Mainly useful for the performance tuning.
4587 Vector operation can be implemented @code{piecewise} which means that the
4588 scalar operation is performed on every vector element; 
4589 @code{in parallel} which means that the vector operation is implemented
4590 using scalars of wider type, which normally is more performance efficient;
4591 and @code{as a single scalar} which means that vector fits into a
4592 scalar type.
4593
4594 @item -Wvla
4595 @opindex Wvla
4596 @opindex Wno-vla
4597 Warn if variable length array is used in the code.
4598 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4599 the variable length array.
4600
4601 @item -Wvolatile-register-var
4602 @opindex Wvolatile-register-var
4603 @opindex Wno-volatile-register-var
4604 Warn if a register variable is declared volatile.  The volatile
4605 modifier does not inhibit all optimizations that may eliminate reads
4606 and/or writes to register variables.  This warning is enabled by
4607 @option{-Wall}.
4608
4609 @item -Wdisabled-optimization
4610 @opindex Wdisabled-optimization
4611 @opindex Wno-disabled-optimization
4612 Warn if a requested optimization pass is disabled.  This warning does
4613 not generally indicate that there is anything wrong with your code; it
4614 merely indicates that GCC's optimizers were unable to handle the code
4615 effectively.  Often, the problem is that your code is too big or too
4616 complex; GCC will refuse to optimize programs when the optimization
4617 itself is likely to take inordinate amounts of time.
4618
4619 @item -Wpointer-sign @r{(C and Objective-C only)}
4620 @opindex Wpointer-sign
4621 @opindex Wno-pointer-sign
4622 Warn for pointer argument passing or assignment with different signedness.
4623 This option is only supported for C and Objective-C@.  It is implied by
4624 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4625 @option{-Wno-pointer-sign}.
4626
4627 @item -Wstack-protector
4628 @opindex Wstack-protector
4629 @opindex Wno-stack-protector
4630 This option is only active when @option{-fstack-protector} is active.  It
4631 warns about functions that will not be protected against stack smashing.
4632
4633 @item -Wno-mudflap
4634 @opindex Wno-mudflap
4635 Suppress warnings about constructs that cannot be instrumented by
4636 @option{-fmudflap}.
4637
4638 @item -Woverlength-strings
4639 @opindex Woverlength-strings
4640 @opindex Wno-overlength-strings
4641 Warn about string constants which are longer than the ``minimum
4642 maximum'' length specified in the C standard.  Modern compilers
4643 generally allow string constants which are much longer than the
4644 standard's minimum limit, but very portable programs should avoid
4645 using longer strings.
4646
4647 The limit applies @emph{after} string constant concatenation, and does
4648 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4649 C99, it was raised to 4095.  C++98 does not specify a normative
4650 minimum maximum, so we do not diagnose overlength strings in C++@.
4651
4652 This option is implied by @option{-pedantic}, and can be disabled with
4653 @option{-Wno-overlength-strings}.
4654
4655 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4656 @opindex Wunsuffixed-float-constants
4657
4658 GCC will issue a warning for any floating constant that does not have
4659 a suffix.  When used together with @option{-Wsystem-headers} it will
4660 warn about such constants in system header files.  This can be useful
4661 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4662 from the decimal floating-point extension to C99.
4663 @end table
4664
4665 @node Debugging Options
4666 @section Options for Debugging Your Program or GCC
4667 @cindex options, debugging
4668 @cindex debugging information options
4669
4670 GCC has various special options that are used for debugging
4671 either your program or GCC:
4672
4673 @table @gcctabopt
4674 @item -g
4675 @opindex g
4676 Produce debugging information in the operating system's native format
4677 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4678 information.
4679
4680 On most systems that use stabs format, @option{-g} enables use of extra
4681 debugging information that only GDB can use; this extra information
4682 makes debugging work better in GDB but will probably make other debuggers
4683 crash or
4684 refuse to read the program.  If you want to control for certain whether
4685 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4686 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4687
4688 GCC allows you to use @option{-g} with
4689 @option{-O}.  The shortcuts taken by optimized code may occasionally
4690 produce surprising results: some variables you declared may not exist
4691 at all; flow of control may briefly move where you did not expect it;
4692 some statements may not be executed because they compute constant
4693 results or their values were already at hand; some statements may
4694 execute in different places because they were moved out of loops.
4695
4696 Nevertheless it proves possible to debug optimized output.  This makes
4697 it reasonable to use the optimizer for programs that might have bugs.
4698
4699 The following options are useful when GCC is generated with the
4700 capability for more than one debugging format.
4701
4702 @item -ggdb
4703 @opindex ggdb
4704 Produce debugging information for use by GDB@.  This means to use the
4705 most expressive format available (DWARF 2, stabs, or the native format
4706 if neither of those are supported), including GDB extensions if at all
4707 possible.
4708
4709 @item -gstabs
4710 @opindex gstabs
4711 Produce debugging information in stabs format (if that is supported),
4712 without GDB extensions.  This is the format used by DBX on most BSD
4713 systems.  On MIPS, Alpha and System V Release 4 systems this option
4714 produces stabs debugging output which is not understood by DBX or SDB@.
4715 On System V Release 4 systems this option requires the GNU assembler.
4716
4717 @item -feliminate-unused-debug-symbols
4718 @opindex feliminate-unused-debug-symbols
4719 Produce debugging information in stabs format (if that is supported),
4720 for only symbols that are actually used.
4721
4722 @item -femit-class-debug-always
4723 Instead of emitting debugging information for a C++ class in only one
4724 object file, emit it in all object files using the class.  This option
4725 should be used only with debuggers that are unable to handle the way GCC
4726 normally emits debugging information for classes because using this
4727 option will increase the size of debugging information by as much as a
4728 factor of two.
4729
4730 @item -fno-debug-types-section
4731 @opindex fno-debug-types-section
4732 @opindex fdebug-types-section
4733 By default when using DWARF v4 or higher type DIEs will be put into
4734 their own .debug_types section instead of making them part of the
4735 .debug_info section.  It is more efficient to put them in a separate
4736 comdat sections since the linker will then be able to remove duplicates.
4737 But not all DWARF consumers support .debug_types sections yet.
4738
4739 @item -gstabs+
4740 @opindex gstabs+
4741 Produce debugging information in stabs format (if that is supported),
4742 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4743 use of these extensions is likely to make other debuggers crash or
4744 refuse to read the program.
4745
4746 @item -gcoff
4747 @opindex gcoff
4748 Produce debugging information in COFF format (if that is supported).
4749 This is the format used by SDB on most System V systems prior to
4750 System V Release 4.
4751
4752 @item -gxcoff
4753 @opindex gxcoff
4754 Produce debugging information in XCOFF format (if that is supported).
4755 This is the format used by the DBX debugger on IBM RS/6000 systems.
4756
4757 @item -gxcoff+
4758 @opindex gxcoff+
4759 Produce debugging information in XCOFF format (if that is supported),
4760 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4761 use of these extensions is likely to make other debuggers crash or
4762 refuse to read the program, and may cause assemblers other than the GNU
4763 assembler (GAS) to fail with an error.
4764
4765 @item -gdwarf-@var{version}
4766 @opindex gdwarf-@var{version}
4767 Produce debugging information in DWARF format (if that is
4768 supported).  This is the format used by DBX on IRIX 6.  The value
4769 of @var{version} may be either 2, 3 or 4; the default version is 2.
4770
4771 Note that with DWARF version 2 some ports require, and will always
4772 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4773
4774 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4775 for maximum benefit.
4776
4777 @item -grecord-gcc-switches
4778 @opindex grecord-gcc-switches
4779 This switch causes the command line options, that were used to invoke the
4780 compiler and may affect code generation, to be appended to the
4781 DW_AT_producer attribute in DWARF debugging information.  The options
4782 are concatenated with spaces separating them from each other and from
4783 the compiler version.  See also @option{-frecord-gcc-switches} for another
4784 way of storing compiler options into the object file.
4785
4786 @item -gno-record-gcc-switches
4787 @opindex gno-record-gcc-switches
4788 Disallow appending command line options to the DW_AT_producer attribute
4789 in DWARF debugging information.  This is the default.
4790
4791 @item -gstrict-dwarf
4792 @opindex gstrict-dwarf
4793 Disallow using extensions of later DWARF standard version than selected
4794 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4795 DWARF extensions from later standard versions is allowed.
4796
4797 @item -gno-strict-dwarf
4798 @opindex gno-strict-dwarf
4799 Allow using extensions of later DWARF standard version than selected with
4800 @option{-gdwarf-@var{version}}.
4801
4802 @item -gvms
4803 @opindex gvms
4804 Produce debugging information in VMS debug format (if that is
4805 supported).  This is the format used by DEBUG on VMS systems.
4806
4807 @item -g@var{level}
4808 @itemx -ggdb@var{level}
4809 @itemx -gstabs@var{level}
4810 @itemx -gcoff@var{level}
4811 @itemx -gxcoff@var{level}
4812 @itemx -gvms@var{level}
4813 Request debugging information and also use @var{level} to specify how
4814 much information.  The default level is 2.
4815
4816 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4817 @option{-g}.
4818
4819 Level 1 produces minimal information, enough for making backtraces in
4820 parts of the program that you don't plan to debug.  This includes
4821 descriptions of functions and external variables, but no information
4822 about local variables and no line numbers.
4823
4824 Level 3 includes extra information, such as all the macro definitions
4825 present in the program.  Some debuggers support macro expansion when
4826 you use @option{-g3}.
4827
4828 @option{-gdwarf-2} does not accept a concatenated debug level, because
4829 GCC used to support an option @option{-gdwarf} that meant to generate
4830 debug information in version 1 of the DWARF format (which is very
4831 different from version 2), and it would have been too confusing.  That
4832 debug format is long obsolete, but the option cannot be changed now.
4833 Instead use an additional @option{-g@var{level}} option to change the
4834 debug level for DWARF.
4835
4836 @item -gtoggle
4837 @opindex gtoggle
4838 Turn off generation of debug info, if leaving out this option would have
4839 generated it, or turn it on at level 2 otherwise.  The position of this
4840 argument in the command line does not matter, it takes effect after all
4841 other options are processed, and it does so only once, no matter how
4842 many times it is given.  This is mainly intended to be used with
4843 @option{-fcompare-debug}.
4844
4845 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4846 @opindex fdump-final-insns
4847 Dump the final internal representation (RTL) to @var{file}.  If the
4848 optional argument is omitted (or if @var{file} is @code{.}), the name
4849 of the dump file will be determined by appending @code{.gkd} to the
4850 compilation output file name.
4851
4852 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4853 @opindex fcompare-debug
4854 @opindex fno-compare-debug
4855 If no error occurs during compilation, run the compiler a second time,
4856 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4857 passed to the second compilation.  Dump the final internal
4858 representation in both compilations, and print an error if they differ.
4859
4860 If the equal sign is omitted, the default @option{-gtoggle} is used.
4861
4862 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4863 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4864 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4865 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4866 is used.
4867
4868 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4869 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4870 of the final representation and the second compilation, preventing even
4871 @env{GCC_COMPARE_DEBUG} from taking effect.
4872
4873 To verify full coverage during @option{-fcompare-debug} testing, set
4874 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4875 which GCC will reject as an invalid option in any actual compilation
4876 (rather than preprocessing, assembly or linking).  To get just a
4877 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4878 not overridden} will do.
4879
4880 @item -fcompare-debug-second
4881 @opindex fcompare-debug-second
4882 This option is implicitly passed to the compiler for the second
4883 compilation requested by @option{-fcompare-debug}, along with options to
4884 silence warnings, and omitting other options that would cause
4885 side-effect compiler outputs to files or to the standard output.  Dump
4886 files and preserved temporary files are renamed so as to contain the
4887 @code{.gk} additional extension during the second compilation, to avoid
4888 overwriting those generated by the first.
4889
4890 When this option is passed to the compiler driver, it causes the
4891 @emph{first} compilation to be skipped, which makes it useful for little
4892 other than debugging the compiler proper.
4893
4894 @item -feliminate-dwarf2-dups
4895 @opindex feliminate-dwarf2-dups
4896 Compress DWARF2 debugging information by eliminating duplicated
4897 information about each symbol.  This option only makes sense when
4898 generating DWARF2 debugging information with @option{-gdwarf-2}.
4899
4900 @item -femit-struct-debug-baseonly
4901 Emit debug information for struct-like types
4902 only when the base name of the compilation source file
4903 matches the base name of file in which the struct was defined.
4904
4905 This option substantially reduces the size of debugging information,
4906 but at significant potential loss in type information to the debugger.
4907 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4908 See @option{-femit-struct-debug-detailed} for more detailed control.
4909
4910 This option works only with DWARF 2.
4911
4912 @item -femit-struct-debug-reduced
4913 Emit debug information for struct-like types
4914 only when the base name of the compilation source file
4915 matches the base name of file in which the type was defined,
4916 unless the struct is a template or defined in a system header.
4917
4918 This option significantly reduces the size of debugging information,
4919 with some potential loss in type information to the debugger.
4920 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4921 See @option{-femit-struct-debug-detailed} for more detailed control.
4922
4923 This option works only with DWARF 2.
4924
4925 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4926 Specify the struct-like types
4927 for which the compiler will generate debug information.
4928 The intent is to reduce duplicate struct debug information
4929 between different object files within the same program.
4930
4931 This option is a detailed version of
4932 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4933 which will serve for most needs.
4934
4935 A specification has the syntax@*
4936 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4937
4938 The optional first word limits the specification to
4939 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4940 A struct type is used directly when it is the type of a variable, member.
4941 Indirect uses arise through pointers to structs.
4942 That is, when use of an incomplete struct would be legal, the use is indirect.
4943 An example is
4944 @samp{struct one direct; struct two * indirect;}.
4945
4946 The optional second word limits the specification to
4947 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4948 Generic structs are a bit complicated to explain.
4949 For C++, these are non-explicit specializations of template classes,
4950 or non-template classes within the above.
4951 Other programming languages have generics,
4952 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4953
4954 The third word specifies the source files for those
4955 structs for which the compiler will emit debug information.
4956 The values @samp{none} and @samp{any} have the normal meaning.
4957 The value @samp{base} means that
4958 the base of name of the file in which the type declaration appears
4959 must match the base of the name of the main compilation file.
4960 In practice, this means that
4961 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4962 but types declared in other header will not.
4963 The value @samp{sys} means those types satisfying @samp{base}
4964 or declared in system or compiler headers.
4965
4966 You may need to experiment to determine the best settings for your application.
4967
4968 The default is @samp{-femit-struct-debug-detailed=all}.
4969
4970 This option works only with DWARF 2.
4971
4972 @item -fno-merge-debug-strings
4973 @opindex fmerge-debug-strings
4974 @opindex fno-merge-debug-strings
4975 Direct the linker to not merge together strings in the debugging
4976 information which are identical in different object files.  Merging is
4977 not supported by all assemblers or linkers.  Merging decreases the size
4978 of the debug information in the output file at the cost of increasing
4979 link processing time.  Merging is enabled by default.
4980
4981 @item -fdebug-prefix-map=@var{old}=@var{new}
4982 @opindex fdebug-prefix-map
4983 When compiling files in directory @file{@var{old}}, record debugging
4984 information describing them as in @file{@var{new}} instead.
4985
4986 @item -fno-dwarf2-cfi-asm
4987 @opindex fdwarf2-cfi-asm
4988 @opindex fno-dwarf2-cfi-asm
4989 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4990 instead of using GAS @code{.cfi_*} directives.
4991
4992 @cindex @command{prof}
4993 @item -p
4994 @opindex p
4995 Generate extra code to write profile information suitable for the
4996 analysis program @command{prof}.  You must use this option when compiling
4997 the source files you want data about, and you must also use it when
4998 linking.
4999
5000 @cindex @command{gprof}
5001 @item -pg
5002 @opindex pg
5003 Generate extra code to write profile information suitable for the
5004 analysis program @command{gprof}.  You must use this option when compiling
5005 the source files you want data about, and you must also use it when
5006 linking.
5007
5008 @item -Q
5009 @opindex Q
5010 Makes the compiler print out each function name as it is compiled, and
5011 print some statistics about each pass when it finishes.
5012
5013 @item -ftime-report
5014 @opindex ftime-report
5015 Makes the compiler print some statistics about the time consumed by each
5016 pass when it finishes.
5017
5018 @item -fmem-report
5019 @opindex fmem-report
5020 Makes the compiler print some statistics about permanent memory
5021 allocation when it finishes.
5022
5023 @item -fpre-ipa-mem-report
5024 @opindex fpre-ipa-mem-report
5025 @item -fpost-ipa-mem-report
5026 @opindex fpost-ipa-mem-report
5027 Makes the compiler print some statistics about permanent memory
5028 allocation before or after interprocedural optimization.
5029
5030 @item -fstack-usage
5031 @opindex fstack-usage
5032 Makes the compiler output stack usage information for the program, on a
5033 per-function basis.  The filename for the dump is made by appending
5034 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5035 the output file, if explicitly specified and it is not an executable,
5036 otherwise it is the basename of the source file.  An entry is made up
5037 of three fields:
5038
5039 @itemize
5040 @item
5041 The name of the function.
5042 @item
5043 A number of bytes.
5044 @item
5045 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5046 @end itemize
5047
5048 The qualifier @code{static} means that the function manipulates the stack
5049 statically: a fixed number of bytes are allocated for the frame on function
5050 entry and released on function exit; no stack adjustments are otherwise made
5051 in the function.  The second field is this fixed number of bytes.
5052
5053 The qualifier @code{dynamic} means that the function manipulates the stack
5054 dynamically: in addition to the static allocation described above, stack
5055 adjustments are made in the body of the function, for example to push/pop
5056 arguments around function calls.  If the qualifier @code{bounded} is also
5057 present, the amount of these adjustments is bounded at compile-time and
5058 the second field is an upper bound of the total amount of stack used by
5059 the function.  If it is not present, the amount of these adjustments is
5060 not bounded at compile-time and the second field only represents the
5061 bounded part.
5062
5063 @item -fprofile-arcs
5064 @opindex fprofile-arcs
5065 Add code so that program flow @dfn{arcs} are instrumented.  During
5066 execution the program records how many times each branch and call is
5067 executed and how many times it is taken or returns.  When the compiled
5068 program exits it saves this data to a file called
5069 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5070 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5071 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5072 @var{auxname} is generated from the name of the output file, if
5073 explicitly specified and it is not the final executable, otherwise it is
5074 the basename of the source file.  In both cases any suffix is removed
5075 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5076 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5077 @xref{Cross-profiling}.
5078
5079 @cindex @command{gcov}
5080 @item --coverage
5081 @opindex coverage
5082
5083 This option is used to compile and link code instrumented for coverage
5084 analysis.  The option is a synonym for @option{-fprofile-arcs}
5085 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5086 linking).  See the documentation for those options for more details.
5087
5088 @itemize
5089
5090 @item
5091 Compile the source files with @option{-fprofile-arcs} plus optimization
5092 and code generation options.  For test coverage analysis, use the
5093 additional @option{-ftest-coverage} option.  You do not need to profile
5094 every source file in a program.
5095
5096 @item
5097 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5098 (the latter implies the former).
5099
5100 @item
5101 Run the program on a representative workload to generate the arc profile
5102 information.  This may be repeated any number of times.  You can run
5103 concurrent instances of your program, and provided that the file system
5104 supports locking, the data files will be correctly updated.  Also
5105 @code{fork} calls are detected and correctly handled (double counting
5106 will not happen).
5107
5108 @item
5109 For profile-directed optimizations, compile the source files again with
5110 the same optimization and code generation options plus
5111 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5112 Control Optimization}).
5113
5114 @item
5115 For test coverage analysis, use @command{gcov} to produce human readable
5116 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5117 @command{gcov} documentation for further information.
5118
5119 @end itemize
5120
5121 With @option{-fprofile-arcs}, for each function of your program GCC
5122 creates a program flow graph, then finds a spanning tree for the graph.
5123 Only arcs that are not on the spanning tree have to be instrumented: the
5124 compiler adds code to count the number of times that these arcs are
5125 executed.  When an arc is the only exit or only entrance to a block, the
5126 instrumentation code can be added to the block; otherwise, a new basic
5127 block must be created to hold the instrumentation code.
5128
5129 @need 2000
5130 @item -ftest-coverage
5131 @opindex ftest-coverage
5132 Produce a notes file that the @command{gcov} code-coverage utility
5133 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5134 show program coverage.  Each source file's note file is called
5135 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5136 above for a description of @var{auxname} and instructions on how to
5137 generate test coverage data.  Coverage data will match the source files
5138 more closely, if you do not optimize.
5139
5140 @item -fdbg-cnt-list
5141 @opindex fdbg-cnt-list
5142 Print the name and the counter upper bound for all debug counters.
5143
5144
5145 @item -fdbg-cnt=@var{counter-value-list}
5146 @opindex fdbg-cnt
5147 Set the internal debug counter upper bound.  @var{counter-value-list}
5148 is a comma-separated list of @var{name}:@var{value} pairs
5149 which sets the upper bound of each debug counter @var{name} to @var{value}.
5150 All debug counters have the initial upper bound of @var{UINT_MAX},
5151 thus dbg_cnt() returns true always unless the upper bound is set by this option.
5152 e.g. With -fdbg-cnt=dce:10,tail_call:0
5153 dbg_cnt(dce) will return true only for first 10 invocations
5154
5155 @itemx -fenable-@var{kind}-@var{pass}
5156 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5157 @opindex fdisable-
5158 @opindex fenable-
5159
5160 This is a set of debugging options that are used to explicitly disable/enable
5161 optimization passes. For compiler users, regular options for enabling/disabling
5162 passes should be used instead.
5163
5164 @itemize
5165
5166 @item -fdisable-ipa-@var{pass}
5167 Disable ipa pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5168 statically invoked in the compiler multiple times, the pass name should be
5169 appended with a sequential number starting from 1.
5170
5171 @item -fdisable-rtl-@var{pass}
5172 @item -fdisable-rtl-@var{pass}=@var{range-list}
5173 Disable rtl pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5174 statically invoked in the compiler multiple times, the pass name should be
5175 appended with a sequential number starting from 1.  @var{range-list} is a comma
5176 seperated list of function ranges or assembler names.  Each range is a number
5177 pair seperated by a colon.  The range is inclusive in both ends.  If the range
5178 is trivial, the number pair can be simplified as a single number.  If the
5179 function's cgraph node's @var{uid} is falling within one of the specified ranges,
5180 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5181 function header of a dump file, and the pass names can be dumped by using
5182 option @option{-fdump-passes}.
5183
5184 @item -fdisable-tree-@var{pass}
5185 @item -fdisable-tree-@var{pass}=@var{range-list}
5186 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5187 option arguments.
5188
5189 @item -fenable-ipa-@var{pass}
5190 Enable ipa pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5191 statically invoked in the compiler multiple times, the pass name should be
5192 appended with a sequential number starting from 1.
5193
5194 @item -fenable-rtl-@var{pass}
5195 @item -fenable-rtl-@var{pass}=@var{range-list}
5196 Enable rtl pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5197 description and examples.
5198
5199 @item -fenable-tree-@var{pass}
5200 @item -fenable-tree-@var{pass}=@var{range-list}
5201 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5202 of option arguments.
5203
5204 @smallexample
5205
5206 # disable ccp1 for all functions
5207    -fdisable-tree-ccp1
5208 # disable complete unroll for function whose cgraph node uid is 1
5209    -fenable-tree-cunroll=1
5210 # disable gcse2 for functions at the following ranges [1,1],
5211 # [300,400], and [400,1000]
5212 # disable gcse2 for functions foo and foo2
5213    -fdisable-rtl-gcse2=foo,foo2
5214 # disable early inlining
5215    -fdisable-tree-einline
5216 # disable ipa inlining
5217    -fdisable-ipa-inline
5218 # enable tree full unroll
5219    -fenable-tree-unroll
5220
5221 @end smallexample
5222
5223 @end itemize
5224
5225 @item -d@var{letters}
5226 @itemx -fdump-rtl-@var{pass}
5227 @opindex d
5228 Says to make debugging dumps during compilation at times specified by
5229 @var{letters}.  This is used for debugging the RTL-based passes of the
5230 compiler.  The file names for most of the dumps are made by appending
5231 a pass number and a word to the @var{dumpname}, and the files are
5232 created in the directory of the output file.  Note that the pass
5233 number is computed statically as passes get registered into the pass
5234 manager.  Thus the numbering is not related to the dynamic order of
5235 execution of passes.  In particular, a pass installed by a plugin
5236 could have a number over 200 even if it executed quite early.
5237 @var{dumpname} is generated from the name of the output file, if
5238 explicitly specified and it is not an executable, otherwise it is the
5239 basename of the source file. These switches may have different effects
5240 when @option{-E} is used for preprocessing.
5241
5242 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5243 @option{-d} option @var{letters}.  Here are the possible
5244 letters for use in @var{pass} and @var{letters}, and their meanings:
5245
5246 @table @gcctabopt
5247
5248 @item -fdump-rtl-alignments
5249 @opindex fdump-rtl-alignments
5250 Dump after branch alignments have been computed.
5251
5252 @item -fdump-rtl-asmcons
5253 @opindex fdump-rtl-asmcons
5254 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5255
5256 @item -fdump-rtl-auto_inc_dec
5257 @opindex fdump-rtl-auto_inc_dec
5258 Dump after auto-inc-dec discovery.  This pass is only run on
5259 architectures that have auto inc or auto dec instructions.
5260
5261 @item -fdump-rtl-barriers
5262 @opindex fdump-rtl-barriers
5263 Dump after cleaning up the barrier instructions.
5264
5265 @item -fdump-rtl-bbpart
5266 @opindex fdump-rtl-bbpart
5267 Dump after partitioning hot and cold basic blocks.
5268
5269 @item -fdump-rtl-bbro
5270 @opindex fdump-rtl-bbro
5271 Dump after block reordering.
5272
5273 @item -fdump-rtl-btl1
5274 @itemx -fdump-rtl-btl2
5275 @opindex fdump-rtl-btl2
5276 @opindex fdump-rtl-btl2
5277 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5278 after the two branch
5279 target load optimization passes.
5280
5281 @item -fdump-rtl-bypass
5282 @opindex fdump-rtl-bypass
5283 Dump after jump bypassing and control flow optimizations.
5284
5285 @item -fdump-rtl-combine
5286 @opindex fdump-rtl-combine
5287 Dump after the RTL instruction combination pass.
5288
5289 @item -fdump-rtl-compgotos
5290 @opindex fdump-rtl-compgotos
5291 Dump after duplicating the computed gotos.
5292
5293 @item -fdump-rtl-ce1
5294 @itemx -fdump-rtl-ce2
5295 @itemx -fdump-rtl-ce3
5296 @opindex fdump-rtl-ce1
5297 @opindex fdump-rtl-ce2
5298 @opindex fdump-rtl-ce3
5299 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5300 @option{-fdump-rtl-ce3} enable dumping after the three
5301 if conversion passes.
5302
5303 @itemx -fdump-rtl-cprop_hardreg
5304 @opindex fdump-rtl-cprop_hardreg
5305 Dump after hard register copy propagation.
5306
5307 @itemx -fdump-rtl-csa
5308 @opindex fdump-rtl-csa
5309 Dump after combining stack adjustments.
5310
5311 @item -fdump-rtl-cse1
5312 @itemx -fdump-rtl-cse2
5313 @opindex fdump-rtl-cse1
5314 @opindex fdump-rtl-cse2
5315 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5316 the two common sub-expression elimination passes.
5317
5318 @itemx -fdump-rtl-dce
5319 @opindex fdump-rtl-dce
5320 Dump after the standalone dead code elimination passes.
5321
5322 @itemx -fdump-rtl-dbr
5323 @opindex fdump-rtl-dbr
5324 Dump after delayed branch scheduling.
5325
5326 @item -fdump-rtl-dce1
5327 @itemx -fdump-rtl-dce2
5328 @opindex fdump-rtl-dce1
5329 @opindex fdump-rtl-dce2
5330 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5331 the two dead store elimination passes.
5332
5333 @item -fdump-rtl-eh
5334 @opindex fdump-rtl-eh
5335 Dump after finalization of EH handling code.
5336
5337 @item -fdump-rtl-eh_ranges
5338 @opindex fdump-rtl-eh_ranges
5339 Dump after conversion of EH handling range regions.
5340
5341 @item -fdump-rtl-expand
5342 @opindex fdump-rtl-expand
5343 Dump after RTL generation.
5344
5345 @item -fdump-rtl-fwprop1
5346 @itemx -fdump-rtl-fwprop2
5347 @opindex fdump-rtl-fwprop1
5348 @opindex fdump-rtl-fwprop2
5349 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5350 dumping after the two forward propagation passes.
5351
5352 @item -fdump-rtl-gcse1
5353 @itemx -fdump-rtl-gcse2
5354 @opindex fdump-rtl-gcse1
5355 @opindex fdump-rtl-gcse2
5356 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5357 after global common subexpression elimination.
5358
5359 @item -fdump-rtl-init-regs
5360 @opindex fdump-rtl-init-regs
5361 Dump after the initialization of the registers.
5362
5363 @item -fdump-rtl-initvals
5364 @opindex fdump-rtl-initvals
5365 Dump after the computation of the initial value sets.
5366
5367 @itemx -fdump-rtl-into_cfglayout
5368 @opindex fdump-rtl-into_cfglayout
5369 Dump after converting to cfglayout mode.
5370
5371 @item -fdump-rtl-ira
5372 @opindex fdump-rtl-ira
5373 Dump after iterated register allocation.
5374
5375 @item -fdump-rtl-jump
5376 @opindex fdump-rtl-jump
5377 Dump after the second jump optimization.
5378
5379 @item -fdump-rtl-loop2
5380 @opindex fdump-rtl-loop2
5381 @option{-fdump-rtl-loop2} enables dumping after the rtl
5382 loop optimization passes.
5383
5384 @item -fdump-rtl-mach
5385 @opindex fdump-rtl-mach
5386 Dump after performing the machine dependent reorganization pass, if that
5387 pass exists.
5388
5389 @item -fdump-rtl-mode_sw
5390 @opindex fdump-rtl-mode_sw
5391 Dump after removing redundant mode switches.
5392
5393 @item -fdump-rtl-rnreg
5394 @opindex fdump-rtl-rnreg
5395 Dump after register renumbering.
5396
5397 @itemx -fdump-rtl-outof_cfglayout
5398 @opindex fdump-rtl-outof_cfglayout
5399 Dump after converting from cfglayout mode.
5400
5401 @item -fdump-rtl-peephole2
5402 @opindex fdump-rtl-peephole2
5403 Dump after the peephole pass.
5404
5405 @item -fdump-rtl-postreload
5406 @opindex fdump-rtl-postreload
5407 Dump after post-reload optimizations.
5408
5409 @itemx -fdump-rtl-pro_and_epilogue
5410 @opindex fdump-rtl-pro_and_epilogue
5411 Dump after generating the function pro and epilogues.
5412
5413 @item -fdump-rtl-regmove
5414 @opindex fdump-rtl-regmove
5415 Dump after the register move pass.
5416
5417 @item -fdump-rtl-sched1
5418 @itemx -fdump-rtl-sched2
5419 @opindex fdump-rtl-sched1
5420 @opindex fdump-rtl-sched2
5421 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5422 after the basic block scheduling passes.
5423
5424 @item -fdump-rtl-see
5425 @opindex fdump-rtl-see
5426 Dump after sign extension elimination.
5427
5428 @item -fdump-rtl-seqabstr
5429 @opindex fdump-rtl-seqabstr
5430 Dump after common sequence discovery.
5431
5432 @item -fdump-rtl-shorten
5433 @opindex fdump-rtl-shorten
5434 Dump after shortening branches.
5435
5436 @item -fdump-rtl-sibling
5437 @opindex fdump-rtl-sibling
5438 Dump after sibling call optimizations.
5439
5440 @item -fdump-rtl-split1
5441 @itemx -fdump-rtl-split2
5442 @itemx -fdump-rtl-split3
5443 @itemx -fdump-rtl-split4
5444 @itemx -fdump-rtl-split5
5445 @opindex fdump-rtl-split1
5446 @opindex fdump-rtl-split2
5447 @opindex fdump-rtl-split3
5448 @opindex fdump-rtl-split4
5449 @opindex fdump-rtl-split5
5450 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5451 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5452 @option{-fdump-rtl-split5} enable dumping after five rounds of
5453 instruction splitting.
5454
5455 @item -fdump-rtl-sms
5456 @opindex fdump-rtl-sms
5457 Dump after modulo scheduling.  This pass is only run on some
5458 architectures.
5459
5460 @item -fdump-rtl-stack
5461 @opindex fdump-rtl-stack
5462 Dump after conversion from GCC's "flat register file" registers to the
5463 x87's stack-like registers.  This pass is only run on x86 variants.
5464
5465 @item -fdump-rtl-subreg1
5466 @itemx -fdump-rtl-subreg2
5467 @opindex fdump-rtl-subreg1
5468 @opindex fdump-rtl-subreg2
5469 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5470 the two subreg expansion passes.
5471
5472 @item -fdump-rtl-unshare
5473 @opindex fdump-rtl-unshare
5474 Dump after all rtl has been unshared.
5475
5476 @item -fdump-rtl-vartrack
5477 @opindex fdump-rtl-vartrack
5478 Dump after variable tracking.
5479
5480 @item -fdump-rtl-vregs
5481 @opindex fdump-rtl-vregs
5482 Dump after converting virtual registers to hard registers.
5483
5484 @item -fdump-rtl-web
5485 @opindex fdump-rtl-web
5486 Dump after live range splitting.
5487
5488 @item -fdump-rtl-regclass
5489 @itemx -fdump-rtl-subregs_of_mode_init
5490 @itemx -fdump-rtl-subregs_of_mode_finish
5491 @itemx -fdump-rtl-dfinit
5492 @itemx -fdump-rtl-dfinish
5493 @opindex fdump-rtl-regclass
5494 @opindex fdump-rtl-subregs_of_mode_init
5495 @opindex fdump-rtl-subregs_of_mode_finish
5496 @opindex fdump-rtl-dfinit
5497 @opindex fdump-rtl-dfinish
5498 These dumps are defined but always produce empty files.
5499
5500 @item -fdump-rtl-all
5501 @opindex fdump-rtl-all
5502 Produce all the dumps listed above.
5503
5504 @item -dA
5505 @opindex dA
5506 Annotate the assembler output with miscellaneous debugging information.
5507
5508 @item -dD
5509 @opindex dD
5510 Dump all macro definitions, at the end of preprocessing, in addition to
5511 normal output.
5512
5513 @item -dH
5514 @opindex dH
5515 Produce a core dump whenever an error occurs.
5516
5517 @item -dm
5518 @opindex dm
5519 Print statistics on memory usage, at the end of the run, to
5520 standard error.
5521
5522 @item -dp
5523 @opindex dp
5524 Annotate the assembler output with a comment indicating which
5525 pattern and alternative was used.  The length of each instruction is
5526 also printed.
5527
5528 @item -dP
5529 @opindex dP
5530 Dump the RTL in the assembler output as a comment before each instruction.
5531 Also turns on @option{-dp} annotation.
5532
5533 @item -dv
5534 @opindex dv
5535 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5536 dump a representation of the control flow graph suitable for viewing with VCG
5537 to @file{@var{file}.@var{pass}.vcg}.
5538
5539 @item -dx
5540 @opindex dx
5541 Just generate RTL for a function instead of compiling it.  Usually used
5542 with @option{-fdump-rtl-expand}.
5543 @end table
5544
5545 @item -fdump-noaddr
5546 @opindex fdump-noaddr
5547 When doing debugging dumps, suppress address output.  This makes it more
5548 feasible to use diff on debugging dumps for compiler invocations with
5549 different compiler binaries and/or different
5550 text / bss / data / heap / stack / dso start locations.
5551
5552 @item -fdump-unnumbered
5553 @opindex fdump-unnumbered
5554 When doing debugging dumps, suppress instruction numbers and address output.
5555 This makes it more feasible to use diff on debugging dumps for compiler
5556 invocations with different options, in particular with and without
5557 @option{-g}.
5558
5559 @item -fdump-unnumbered-links
5560 @opindex fdump-unnumbered-links
5561 When doing debugging dumps (see @option{-d} option above), suppress
5562 instruction numbers for the links to the previous and next instructions
5563 in a sequence.
5564
5565 @item -fdump-translation-unit @r{(C++ only)}
5566 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5567 @opindex fdump-translation-unit
5568 Dump a representation of the tree structure for the entire translation
5569 unit to a file.  The file name is made by appending @file{.tu} to the
5570 source file name, and the file is created in the same directory as the
5571 output file.  If the @samp{-@var{options}} form is used, @var{options}
5572 controls the details of the dump as described for the
5573 @option{-fdump-tree} options.
5574
5575 @item -fdump-class-hierarchy @r{(C++ only)}
5576 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5577 @opindex fdump-class-hierarchy
5578 Dump a representation of each class's hierarchy and virtual function
5579 table layout to a file.  The file name is made by appending
5580 @file{.class} to the source file name, and the file is created in the
5581 same directory as the output file.  If the @samp{-@var{options}} form
5582 is used, @var{options} controls the details of the dump as described
5583 for the @option{-fdump-tree} options.
5584
5585 @item -fdump-ipa-@var{switch}
5586 @opindex fdump-ipa
5587 Control the dumping at various stages of inter-procedural analysis
5588 language tree to a file.  The file name is generated by appending a
5589 switch specific suffix to the source file name, and the file is created
5590 in the same directory as the output file.  The following dumps are
5591 possible:
5592
5593 @table @samp
5594 @item all
5595 Enables all inter-procedural analysis dumps.
5596
5597 @item cgraph
5598 Dumps information about call-graph optimization, unused function removal,
5599 and inlining decisions.
5600
5601 @item inline
5602 Dump after function inlining.
5603
5604 @end table
5605
5606 @item -fdump-passes
5607 @opindex fdump-passes
5608 Dump the list of optimization passes that are turned on and off by
5609 the current command line options.
5610
5611 @item -fdump-statistics-@var{option}
5612 @opindex fdump-statistics
5613 Enable and control dumping of pass statistics in a separate file.  The
5614 file name is generated by appending a suffix ending in
5615 @samp{.statistics} to the source file name, and the file is created in
5616 the same directory as the output file.  If the @samp{-@var{option}}
5617 form is used, @samp{-stats} will cause counters to be summed over the
5618 whole compilation unit while @samp{-details} will dump every event as
5619 the passes generate them.  The default with no option is to sum
5620 counters for each function compiled.
5621
5622 @item -fdump-tree-@var{switch}
5623 @itemx -fdump-tree-@var{switch}-@var{options}
5624 @opindex fdump-tree
5625 Control the dumping at various stages of processing the intermediate
5626 language tree to a file.  The file name is generated by appending a
5627 switch specific suffix to the source file name, and the file is
5628 created in the same directory as the output file.  If the
5629 @samp{-@var{options}} form is used, @var{options} is a list of
5630 @samp{-} separated options that control the details of the dump.  Not
5631 all options are applicable to all dumps, those which are not
5632 meaningful will be ignored.  The following options are available
5633
5634 @table @samp
5635 @item address
5636 Print the address of each node.  Usually this is not meaningful as it
5637 changes according to the environment and source file.  Its primary use
5638 is for tying up a dump file with a debug environment.
5639 @item asmname
5640 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5641 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5642 use working backward from mangled names in the assembly file.
5643 @item slim
5644 Inhibit dumping of members of a scope or body of a function merely
5645 because that scope has been reached.  Only dump such items when they
5646 are directly reachable by some other path.  When dumping pretty-printed
5647 trees, this option inhibits dumping the bodies of control structures.
5648 @item raw
5649 Print a raw representation of the tree.  By default, trees are
5650 pretty-printed into a C-like representation.
5651 @item details
5652 Enable more detailed dumps (not honored by every dump option).
5653 @item stats
5654 Enable dumping various statistics about the pass (not honored by every dump
5655 option).
5656 @item blocks
5657 Enable showing basic block boundaries (disabled in raw dumps).
5658 @item vops
5659 Enable showing virtual operands for every statement.
5660 @item lineno
5661 Enable showing line numbers for statements.
5662 @item uid
5663 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5664 @item verbose
5665 Enable showing the tree dump for each statement.
5666 @item eh
5667 Enable showing the EH region number holding each statement.
5668 @item scev
5669 Enable showing scalar evolution analysis details.
5670 @item all
5671 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5672 and @option{lineno}.
5673 @end table
5674
5675 The following tree dumps are possible:
5676 @table @samp
5677
5678 @item original
5679 @opindex fdump-tree-original
5680 Dump before any tree based optimization, to @file{@var{file}.original}.
5681
5682 @item optimized
5683 @opindex fdump-tree-optimized
5684 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5685
5686 @item gimple
5687 @opindex fdump-tree-gimple
5688 Dump each function before and after the gimplification pass to a file.  The
5689 file name is made by appending @file{.gimple} to the source file name.
5690
5691 @item cfg
5692 @opindex fdump-tree-cfg
5693 Dump the control flow graph of each function to a file.  The file name is
5694 made by appending @file{.cfg} to the source file name.
5695
5696 @item vcg
5697 @opindex fdump-tree-vcg
5698 Dump the control flow graph of each function to a file in VCG format.  The
5699 file name is made by appending @file{.vcg} to the source file name.  Note
5700 that if the file contains more than one function, the generated file cannot
5701 be used directly by VCG@.  You will need to cut and paste each function's
5702 graph into its own separate file first.
5703
5704 @item ch
5705 @opindex fdump-tree-ch
5706 Dump each function after copying loop headers.  The file name is made by
5707 appending @file{.ch} to the source file name.
5708
5709 @item ssa
5710 @opindex fdump-tree-ssa
5711 Dump SSA related information to a file.  The file name is made by appending
5712 @file{.ssa} to the source file name.
5713
5714 @item alias
5715 @opindex fdump-tree-alias
5716 Dump aliasing information for each function.  The file name is made by
5717 appending @file{.alias} to the source file name.
5718
5719 @item ccp
5720 @opindex fdump-tree-ccp
5721 Dump each function after CCP@.  The file name is made by appending
5722 @file{.ccp} to the source file name.
5723
5724 @item storeccp
5725 @opindex fdump-tree-storeccp
5726 Dump each function after STORE-CCP@.  The file name is made by appending
5727 @file{.storeccp} to the source file name.
5728
5729 @item pre
5730 @opindex fdump-tree-pre
5731 Dump trees after partial redundancy elimination.  The file name is made
5732 by appending @file{.pre} to the source file name.
5733
5734 @item fre
5735 @opindex fdump-tree-fre
5736 Dump trees after full redundancy elimination.  The file name is made
5737 by appending @file{.fre} to the source file name.
5738
5739 @item copyprop
5740 @opindex fdump-tree-copyprop
5741 Dump trees after copy propagation.  The file name is made
5742 by appending @file{.copyprop} to the source file name.
5743
5744 @item store_copyprop
5745 @opindex fdump-tree-store_copyprop
5746 Dump trees after store copy-propagation.  The file name is made
5747 by appending @file{.store_copyprop} to the source file name.
5748
5749 @item dce
5750 @opindex fdump-tree-dce
5751 Dump each function after dead code elimination.  The file name is made by
5752 appending @file{.dce} to the source file name.
5753
5754 @item mudflap
5755 @opindex fdump-tree-mudflap
5756 Dump each function after adding mudflap instrumentation.  The file name is
5757 made by appending @file{.mudflap} to the source file name.
5758
5759 @item sra
5760 @opindex fdump-tree-sra
5761 Dump each function after performing scalar replacement of aggregates.  The
5762 file name is made by appending @file{.sra} to the source file name.
5763
5764 @item sink
5765 @opindex fdump-tree-sink
5766 Dump each function after performing code sinking.  The file name is made
5767 by appending @file{.sink} to the source file name.
5768
5769 @item dom
5770 @opindex fdump-tree-dom
5771 Dump each function after applying dominator tree optimizations.  The file
5772 name is made by appending @file{.dom} to the source file name.
5773
5774 @item dse
5775 @opindex fdump-tree-dse
5776 Dump each function after applying dead store elimination.  The file
5777 name is made by appending @file{.dse} to the source file name.
5778
5779 @item phiopt
5780 @opindex fdump-tree-phiopt
5781 Dump each function after optimizing PHI nodes into straightline code.  The file
5782 name is made by appending @file{.phiopt} to the source file name.
5783
5784 @item forwprop
5785 @opindex fdump-tree-forwprop
5786 Dump each function after forward propagating single use variables.  The file
5787 name is made by appending @file{.forwprop} to the source file name.
5788
5789 @item copyrename
5790 @opindex fdump-tree-copyrename
5791 Dump each function after applying the copy rename optimization.  The file
5792 name is made by appending @file{.copyrename} to the source file name.
5793
5794 @item nrv
5795 @opindex fdump-tree-nrv
5796 Dump each function after applying the named return value optimization on
5797 generic trees.  The file name is made by appending @file{.nrv} to the source
5798 file name.
5799
5800 @item vect
5801 @opindex fdump-tree-vect
5802 Dump each function after applying vectorization of loops.  The file name is
5803 made by appending @file{.vect} to the source file name.
5804
5805 @item slp
5806 @opindex fdump-tree-slp
5807 Dump each function after applying vectorization of basic blocks.  The file name
5808 is made by appending @file{.slp} to the source file name.
5809
5810 @item vrp
5811 @opindex fdump-tree-vrp
5812 Dump each function after Value Range Propagation (VRP).  The file name
5813 is made by appending @file{.vrp} to the source file name.
5814
5815 @item all
5816 @opindex fdump-tree-all
5817 Enable all the available tree dumps with the flags provided in this option.
5818 @end table
5819
5820 @item -ftree-vectorizer-verbose=@var{n}
5821 @opindex ftree-vectorizer-verbose
5822 This option controls the amount of debugging output the vectorizer prints.
5823 This information is written to standard error, unless
5824 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5825 in which case it is output to the usual dump listing file, @file{.vect}.
5826 For @var{n}=0 no diagnostic information is reported.
5827 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5828 and the total number of loops that got vectorized.
5829 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5830 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5831 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5832 level that @option{-fdump-tree-vect-stats} uses.
5833 Higher verbosity levels mean either more information dumped for each
5834 reported loop, or same amount of information reported for more loops:
5835 if @var{n}=3, vectorizer cost model information is reported.
5836 If @var{n}=4, alignment related information is added to the reports.
5837 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5838 memory access-patterns) is added to the reports.
5839 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5840 that did not pass the first analysis phase (i.e., may not be countable, or
5841 may have complicated control-flow).
5842 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5843 If @var{n}=8, SLP related information is added to the reports.
5844 For @var{n}=9, all the information the vectorizer generates during its
5845 analysis and transformation is reported.  This is the same verbosity level
5846 that @option{-fdump-tree-vect-details} uses.
5847
5848 @item -frandom-seed=@var{string}
5849 @opindex frandom-seed
5850 This option provides a seed that GCC uses when it would otherwise use
5851 random numbers.  It is used to generate certain symbol names
5852 that have to be different in every compiled file.  It is also used to
5853 place unique stamps in coverage data files and the object files that
5854 produce them.  You can use the @option{-frandom-seed} option to produce
5855 reproducibly identical object files.
5856
5857 The @var{string} should be different for every file you compile.
5858
5859 @item -fsched-verbose=@var{n}
5860 @opindex fsched-verbose
5861 On targets that use instruction scheduling, this option controls the
5862 amount of debugging output the scheduler prints.  This information is
5863 written to standard error, unless @option{-fdump-rtl-sched1} or
5864 @option{-fdump-rtl-sched2} is specified, in which case it is output
5865 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5866 respectively.  However for @var{n} greater than nine, the output is
5867 always printed to standard error.
5868
5869 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5870 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5871 For @var{n} greater than one, it also output basic block probabilities,
5872 detailed ready list information and unit/insn info.  For @var{n} greater
5873 than two, it includes RTL at abort point, control-flow and regions info.
5874 And for @var{n} over four, @option{-fsched-verbose} also includes
5875 dependence info.
5876
5877 @item -save-temps
5878 @itemx -save-temps=cwd
5879 @opindex save-temps
5880 Store the usual ``temporary'' intermediate files permanently; place them
5881 in the current directory and name them based on the source file.  Thus,
5882 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5883 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5884 preprocessed @file{foo.i} output file even though the compiler now
5885 normally uses an integrated preprocessor.
5886
5887 When used in combination with the @option{-x} command line option,
5888 @option{-save-temps} is sensible enough to avoid over writing an
5889 input source file with the same extension as an intermediate file.
5890 The corresponding intermediate file may be obtained by renaming the
5891 source file before using @option{-save-temps}.
5892
5893 If you invoke GCC in parallel, compiling several different source
5894 files that share a common base name in different subdirectories or the
5895 same source file compiled for multiple output destinations, it is
5896 likely that the different parallel compilers will interfere with each
5897 other, and overwrite the temporary files.  For instance:
5898
5899 @smallexample
5900 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5901 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5902 @end smallexample
5903
5904 may result in @file{foo.i} and @file{foo.o} being written to
5905 simultaneously by both compilers.
5906
5907 @item -save-temps=obj
5908 @opindex save-temps=obj
5909 Store the usual ``temporary'' intermediate files permanently.  If the
5910 @option{-o} option is used, the temporary files are based on the
5911 object file.  If the @option{-o} option is not used, the
5912 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5913
5914 For example:
5915
5916 @smallexample
5917 gcc -save-temps=obj -c foo.c
5918 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5919 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5920 @end smallexample
5921
5922 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5923 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5924 @file{dir2/yfoobar.o}.
5925
5926 @item -time@r{[}=@var{file}@r{]}
5927 @opindex time
5928 Report the CPU time taken by each subprocess in the compilation
5929 sequence.  For C source files, this is the compiler proper and assembler
5930 (plus the linker if linking is done).
5931
5932 Without the specification of an output file, the output looks like this:
5933
5934 @smallexample
5935 # cc1 0.12 0.01
5936 # as 0.00 0.01
5937 @end smallexample
5938
5939 The first number on each line is the ``user time'', that is time spent
5940 executing the program itself.  The second number is ``system time'',
5941 time spent executing operating system routines on behalf of the program.
5942 Both numbers are in seconds.
5943
5944 With the specification of an output file, the output is appended to the
5945 named file, and it looks like this:
5946
5947 @smallexample
5948 0.12 0.01 cc1 @var{options}
5949 0.00 0.01 as @var{options}
5950 @end smallexample
5951
5952 The ``user time'' and the ``system time'' are moved before the program
5953 name, and the options passed to the program are displayed, so that one
5954 can later tell what file was being compiled, and with which options.
5955
5956 @item -fvar-tracking
5957 @opindex fvar-tracking
5958 Run variable tracking pass.  It computes where variables are stored at each
5959 position in code.  Better debugging information is then generated
5960 (if the debugging information format supports this information).
5961
5962 It is enabled by default when compiling with optimization (@option{-Os},
5963 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5964 the debug info format supports it.
5965
5966 @item -fvar-tracking-assignments
5967 @opindex fvar-tracking-assignments
5968 @opindex fno-var-tracking-assignments
5969 Annotate assignments to user variables early in the compilation and
5970 attempt to carry the annotations over throughout the compilation all the
5971 way to the end, in an attempt to improve debug information while
5972 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5973
5974 It can be enabled even if var-tracking is disabled, in which case
5975 annotations will be created and maintained, but discarded at the end.
5976
5977 @item -fvar-tracking-assignments-toggle
5978 @opindex fvar-tracking-assignments-toggle
5979 @opindex fno-var-tracking-assignments-toggle
5980 Toggle @option{-fvar-tracking-assignments}, in the same way that
5981 @option{-gtoggle} toggles @option{-g}.
5982
5983 @item -print-file-name=@var{library}
5984 @opindex print-file-name
5985 Print the full absolute name of the library file @var{library} that
5986 would be used when linking---and don't do anything else.  With this
5987 option, GCC does not compile or link anything; it just prints the
5988 file name.
5989
5990 @item -print-multi-directory
5991 @opindex print-multi-directory
5992 Print the directory name corresponding to the multilib selected by any
5993 other switches present in the command line.  This directory is supposed
5994 to exist in @env{GCC_EXEC_PREFIX}.
5995
5996 @item -print-multi-lib
5997 @opindex print-multi-lib
5998 Print the mapping from multilib directory names to compiler switches
5999 that enable them.  The directory name is separated from the switches by
6000 @samp{;}, and each switch starts with an @samp{@@} instead of the
6001 @samp{-}, without spaces between multiple switches.  This is supposed to
6002 ease shell-processing.
6003
6004 @item -print-multi-os-directory
6005 @opindex print-multi-os-directory
6006 Print the path to OS libraries for the selected
6007 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6008 present in the @file{lib} subdirectory and no multilibs are used, this is
6009 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6010 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6011 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6012 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6013
6014 @item -print-prog-name=@var{program}
6015 @opindex print-prog-name
6016 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6017
6018 @item -print-libgcc-file-name
6019 @opindex print-libgcc-file-name
6020 Same as @option{-print-file-name=libgcc.a}.
6021
6022 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6023 but you do want to link with @file{libgcc.a}.  You can do
6024
6025 @smallexample
6026 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6027 @end smallexample
6028
6029 @item -print-search-dirs
6030 @opindex print-search-dirs
6031 Print the name of the configured installation directory and a list of
6032 program and library directories @command{gcc} will search---and don't do anything else.
6033
6034 This is useful when @command{gcc} prints the error message
6035 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6036 To resolve this you either need to put @file{cpp0} and the other compiler
6037 components where @command{gcc} expects to find them, or you can set the environment
6038 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6039 Don't forget the trailing @samp{/}.
6040 @xref{Environment Variables}.
6041
6042 @item -print-sysroot
6043 @opindex print-sysroot
6044 Print the target sysroot directory that will be used during
6045 compilation.  This is the target sysroot specified either at configure
6046 time or using the @option{--sysroot} option, possibly with an extra
6047 suffix that depends on compilation options.  If no target sysroot is
6048 specified, the option prints nothing.
6049
6050 @item -print-sysroot-headers-suffix
6051 @opindex print-sysroot-headers-suffix
6052 Print the suffix added to the target sysroot when searching for
6053 headers, or give an error if the compiler is not configured with such
6054 a suffix---and don't do anything else.
6055
6056 @item -dumpmachine
6057 @opindex dumpmachine
6058 Print the compiler's target machine (for example,
6059 @samp{i686-pc-linux-gnu})---and don't do anything else.
6060
6061 @item -dumpversion
6062 @opindex dumpversion
6063 Print the compiler version (for example, @samp{3.0})---and don't do
6064 anything else.
6065
6066 @item -dumpspecs
6067 @opindex dumpspecs
6068 Print the compiler's built-in specs---and don't do anything else.  (This
6069 is used when GCC itself is being built.)  @xref{Spec Files}.
6070
6071 @item -feliminate-unused-debug-types
6072 @opindex feliminate-unused-debug-types
6073 Normally, when producing DWARF2 output, GCC will emit debugging
6074 information for all types declared in a compilation
6075 unit, regardless of whether or not they are actually used
6076 in that compilation unit.  Sometimes this is useful, such as
6077 if, in the debugger, you want to cast a value to a type that is
6078 not actually used in your program (but is declared).  More often,
6079 however, this results in a significant amount of wasted space.
6080 With this option, GCC will avoid producing debug symbol output
6081 for types that are nowhere used in the source file being compiled.
6082 @end table
6083
6084 @node Optimize Options
6085 @section Options That Control Optimization
6086 @cindex optimize options
6087 @cindex options, optimization
6088
6089 These options control various sorts of optimizations.
6090
6091 Without any optimization option, the compiler's goal is to reduce the
6092 cost of compilation and to make debugging produce the expected
6093 results.  Statements are independent: if you stop the program with a
6094 breakpoint between statements, you can then assign a new value to any
6095 variable or change the program counter to any other statement in the
6096 function and get exactly the results you would expect from the source
6097 code.
6098
6099 Turning on optimization flags makes the compiler attempt to improve
6100 the performance and/or code size at the expense of compilation time
6101 and possibly the ability to debug the program.
6102
6103 The compiler performs optimization based on the knowledge it has of the
6104 program.  Compiling multiple files at once to a single output file mode allows
6105 the compiler to use information gained from all of the files when compiling
6106 each of them.
6107
6108 Not all optimizations are controlled directly by a flag.  Only
6109 optimizations that have a flag are listed in this section.
6110
6111 Most optimizations are only enabled if an @option{-O} level is set on
6112 the command line.  Otherwise they are disabled, even if individual
6113 optimization flags are specified.
6114
6115 Depending on the target and how GCC was configured, a slightly different
6116 set of optimizations may be enabled at each @option{-O} level than
6117 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
6118 to find out the exact set of optimizations that are enabled at each level.
6119 @xref{Overall Options}, for examples.
6120
6121 @table @gcctabopt
6122 @item -O
6123 @itemx -O1
6124 @opindex O
6125 @opindex O1
6126 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6127 more memory for a large function.
6128
6129 With @option{-O}, the compiler tries to reduce code size and execution
6130 time, without performing any optimizations that take a great deal of
6131 compilation time.
6132
6133 @option{-O} turns on the following optimization flags:
6134 @gccoptlist{
6135 -fauto-inc-dec @gol
6136 -fcompare-elim @gol
6137 -fcprop-registers @gol
6138 -fdce @gol
6139 -fdefer-pop @gol
6140 -fdelayed-branch @gol
6141 -fdse @gol
6142 -fguess-branch-probability @gol
6143 -fif-conversion2 @gol
6144 -fif-conversion @gol
6145 -fipa-pure-const @gol
6146 -fipa-profile @gol
6147 -fipa-reference @gol
6148 -fmerge-constants
6149 -fsplit-wide-types @gol
6150 -ftree-bit-ccp @gol
6151 -ftree-builtin-call-dce @gol
6152 -ftree-ccp @gol
6153 -ftree-ch @gol
6154 -ftree-copyrename @gol
6155 -ftree-dce @gol
6156 -ftree-dominator-opts @gol
6157 -ftree-dse @gol
6158 -ftree-forwprop @gol
6159 -ftree-fre @gol
6160 -ftree-phiprop @gol
6161 -ftree-sra @gol
6162 -ftree-pta @gol
6163 -ftree-ter @gol
6164 -funit-at-a-time}
6165
6166 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6167 where doing so does not interfere with debugging.
6168
6169 @item -O2
6170 @opindex O2
6171 Optimize even more.  GCC performs nearly all supported optimizations
6172 that do not involve a space-speed tradeoff.
6173 As compared to @option{-O}, this option increases both compilation time
6174 and the performance of the generated code.
6175
6176 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6177 also turns on the following optimization flags:
6178 @gccoptlist{-fthread-jumps @gol
6179 -falign-functions  -falign-jumps @gol
6180 -falign-loops  -falign-labels @gol
6181 -fcaller-saves @gol
6182 -fcrossjumping @gol
6183 -fcse-follow-jumps  -fcse-skip-blocks @gol
6184 -fdelete-null-pointer-checks @gol
6185 -fdevirtualize @gol
6186 -fexpensive-optimizations @gol
6187 -fgcse  -fgcse-lm  @gol
6188 -finline-small-functions @gol
6189 -findirect-inlining @gol
6190 -fipa-sra @gol
6191 -foptimize-sibling-calls @gol
6192 -fpartial-inlining @gol
6193 -fpeephole2 @gol
6194 -fregmove @gol
6195 -freorder-blocks  -freorder-functions @gol
6196 -frerun-cse-after-loop  @gol
6197 -fsched-interblock  -fsched-spec @gol
6198 -fschedule-insns  -fschedule-insns2 @gol
6199 -fstrict-aliasing -fstrict-overflow @gol
6200 -ftree-switch-conversion -ftree-tail-merge @gol
6201 -ftree-pre @gol
6202 -ftree-vrp}
6203
6204 Please note the warning under @option{-fgcse} about
6205 invoking @option{-O2} on programs that use computed gotos.
6206
6207 @item -O3
6208 @opindex O3
6209 Optimize yet more.  @option{-O3} turns on all optimizations specified
6210 by @option{-O2} and also turns on the @option{-finline-functions},
6211 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6212 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
6213 @option{-fipa-cp-clone} options.
6214
6215 @item -O0
6216 @opindex O0
6217 Reduce compilation time and make debugging produce the expected
6218 results.  This is the default.
6219
6220 @item -Os
6221 @opindex Os
6222 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6223 do not typically increase code size.  It also performs further
6224 optimizations designed to reduce code size.
6225
6226 @option{-Os} disables the following optimization flags:
6227 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6228 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6229 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6230
6231 @item -Ofast
6232 @opindex Ofast
6233 Disregard strict standards compliance.  @option{-Ofast} enables all
6234 @option{-O3} optimizations.  It also enables optimizations that are not
6235 valid for all standard compliant programs.
6236 It turns on @option{-ffast-math} and the Fortran-specific
6237 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6238
6239 If you use multiple @option{-O} options, with or without level numbers,
6240 the last such option is the one that is effective.
6241 @end table
6242
6243 Options of the form @option{-f@var{flag}} specify machine-independent
6244 flags.  Most flags have both positive and negative forms; the negative
6245 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
6246 below, only one of the forms is listed---the one you typically will
6247 use.  You can figure out the other form by either removing @samp{no-}
6248 or adding it.
6249
6250 The following options control specific optimizations.  They are either
6251 activated by @option{-O} options or are related to ones that are.  You
6252 can use the following flags in the rare cases when ``fine-tuning'' of
6253 optimizations to be performed is desired.
6254
6255 @table @gcctabopt
6256 @item -fno-default-inline
6257 @opindex fno-default-inline
6258 Do not make member functions inline by default merely because they are
6259 defined inside the class scope (C++ only).  Otherwise, when you specify
6260 @w{@option{-O}}, member functions defined inside class scope are compiled
6261 inline by default; i.e., you don't need to add @samp{inline} in front of
6262 the member function name.
6263
6264 @item -fno-defer-pop
6265 @opindex fno-defer-pop
6266 Always pop the arguments to each function call as soon as that function
6267 returns.  For machines which must pop arguments after a function call,
6268 the compiler normally lets arguments accumulate on the stack for several
6269 function calls and pops them all at once.
6270
6271 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6272
6273 @item -fforward-propagate
6274 @opindex fforward-propagate
6275 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6276 instructions and checks if the result can be simplified.  If loop unrolling
6277 is active, two passes are performed and the second is scheduled after
6278 loop unrolling.
6279
6280 This option is enabled by default at optimization levels @option{-O},
6281 @option{-O2}, @option{-O3}, @option{-Os}.
6282
6283 @item -ffp-contract=@var{style}
6284 @opindex ffp-contract
6285 @option{-ffp-contract=off} disables floating-point expression contraction.
6286 @option{-ffp-contract=fast} enables floating-point expression contraction
6287 such as forming of fused multiply-add operations if the target has
6288 native support for them.
6289 @option{-ffp-contract=on} enables floating-point expression contraction
6290 if allowed by the language standard.  This is currently not implemented
6291 and treated equal to @option{-ffp-contract=off}.
6292
6293 The default is @option{-ffp-contract=fast}.
6294
6295 @item -fomit-frame-pointer
6296 @opindex fomit-frame-pointer
6297 Don't keep the frame pointer in a register for functions that
6298 don't need one.  This avoids the instructions to save, set up and
6299 restore frame pointers; it also makes an extra register available
6300 in many functions.  @strong{It also makes debugging impossible on
6301 some machines.}
6302
6303 On some machines, such as the VAX, this flag has no effect, because
6304 the standard calling sequence automatically handles the frame pointer
6305 and nothing is saved by pretending it doesn't exist.  The
6306 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6307 whether a target machine supports this flag.  @xref{Registers,,Register
6308 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6309
6310 Starting with GCC version 4.6, the default setting (when not optimizing for
6311 size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to
6312 @option{-fomit-frame-pointer}.  The default can be reverted to
6313 @option{-fno-omit-frame-pointer} by configuring GCC with the
6314 @option{--enable-frame-pointer} configure option.
6315
6316 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6317
6318 @item -foptimize-sibling-calls
6319 @opindex foptimize-sibling-calls
6320 Optimize sibling and tail recursive calls.
6321
6322 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6323
6324 @item -fno-inline
6325 @opindex fno-inline
6326 Don't pay attention to the @code{inline} keyword.  Normally this option
6327 is used to keep the compiler from expanding any functions inline.
6328 Note that if you are not optimizing, no functions can be expanded inline.
6329
6330 @item -finline-small-functions
6331 @opindex finline-small-functions
6332 Integrate functions into their callers when their body is smaller than expected
6333 function call code (so overall size of program gets smaller).  The compiler
6334 heuristically decides which functions are simple enough to be worth integrating
6335 in this way.
6336
6337 Enabled at level @option{-O2}.
6338
6339 @item -findirect-inlining
6340 @opindex findirect-inlining
6341 Inline also indirect calls that are discovered to be known at compile
6342 time thanks to previous inlining.  This option has any effect only
6343 when inlining itself is turned on by the @option{-finline-functions}
6344 or @option{-finline-small-functions} options.
6345
6346 Enabled at level @option{-O2}.
6347
6348 @item -finline-functions
6349 @opindex finline-functions
6350 Integrate all simple functions into their callers.  The compiler
6351 heuristically decides which functions are simple enough to be worth
6352 integrating in this way.
6353
6354 If all calls to a given function are integrated, and the function is
6355 declared @code{static}, then the function is normally not output as
6356 assembler code in its own right.
6357
6358 Enabled at level @option{-O3}.
6359
6360 @item -finline-functions-called-once
6361 @opindex finline-functions-called-once
6362 Consider all @code{static} functions called once for inlining into their
6363 caller even if they are not marked @code{inline}.  If a call to a given
6364 function is integrated, then the function is not output as assembler code
6365 in its own right.
6366
6367 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6368
6369 @item -fearly-inlining
6370 @opindex fearly-inlining
6371 Inline functions marked by @code{always_inline} and functions whose body seems
6372 smaller than the function call overhead early before doing
6373 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6374 makes profiling significantly cheaper and usually inlining faster on programs
6375 having large chains of nested wrapper functions.
6376
6377 Enabled by default.
6378
6379 @item -fipa-sra
6380 @opindex fipa-sra
6381 Perform interprocedural scalar replacement of aggregates, removal of
6382 unused parameters and replacement of parameters passed by reference
6383 by parameters passed by value.
6384
6385 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6386
6387 @item -finline-limit=@var{n}
6388 @opindex finline-limit
6389 By default, GCC limits the size of functions that can be inlined.  This flag
6390 allows coarse control of this limit.  @var{n} is the size of functions that
6391 can be inlined in number of pseudo instructions.
6392
6393 Inlining is actually controlled by a number of parameters, which may be
6394 specified individually by using @option{--param @var{name}=@var{value}}.
6395 The @option{-finline-limit=@var{n}} option sets some of these parameters
6396 as follows:
6397
6398 @table @gcctabopt
6399 @item max-inline-insns-single
6400 is set to @var{n}/2.
6401 @item max-inline-insns-auto
6402 is set to @var{n}/2.
6403 @end table
6404
6405 See below for a documentation of the individual
6406 parameters controlling inlining and for the defaults of these parameters.
6407
6408 @emph{Note:} there may be no value to @option{-finline-limit} that results
6409 in default behavior.
6410
6411 @emph{Note:} pseudo instruction represents, in this particular context, an
6412 abstract measurement of function's size.  In no way does it represent a count
6413 of assembly instructions and as such its exact meaning might change from one
6414 release to an another.
6415
6416 @item -fno-keep-inline-dllexport
6417 @opindex -fno-keep-inline-dllexport
6418 This is a more fine-grained version of @option{-fkeep-inline-functions},
6419 which applies only to functions that are declared using the @code{dllexport}
6420 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6421 Functions}.)
6422
6423 @item -fkeep-inline-functions
6424 @opindex fkeep-inline-functions
6425 In C, emit @code{static} functions that are declared @code{inline}
6426 into the object file, even if the function has been inlined into all
6427 of its callers.  This switch does not affect functions using the
6428 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6429 inline functions into the object file.
6430
6431 @item -fkeep-static-consts
6432 @opindex fkeep-static-consts
6433 Emit variables declared @code{static const} when optimization isn't turned
6434 on, even if the variables aren't referenced.
6435
6436 GCC enables this option by default.  If you want to force the compiler to
6437 check if the variable was referenced, regardless of whether or not
6438 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6439
6440 @item -fmerge-constants
6441 @opindex fmerge-constants
6442 Attempt to merge identical constants (string constants and floating point
6443 constants) across compilation units.
6444
6445 This option is the default for optimized compilation if the assembler and
6446 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6447 behavior.
6448
6449 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6450
6451 @item -fmerge-all-constants
6452 @opindex fmerge-all-constants
6453 Attempt to merge identical constants and identical variables.
6454
6455 This option implies @option{-fmerge-constants}.  In addition to
6456 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6457 arrays or initialized constant variables with integral or floating point
6458 types.  Languages like C or C++ require each variable, including multiple
6459 instances of the same variable in recursive calls, to have distinct locations,
6460 so using this option will result in non-conforming
6461 behavior.
6462
6463 @item -fmodulo-sched
6464 @opindex fmodulo-sched
6465 Perform swing modulo scheduling immediately before the first scheduling
6466 pass.  This pass looks at innermost loops and reorders their
6467 instructions by overlapping different iterations.
6468
6469 @item -fmodulo-sched-allow-regmoves
6470 @opindex fmodulo-sched-allow-regmoves
6471 Perform more aggressive SMS based modulo scheduling with register moves
6472 allowed.  By setting this flag certain anti-dependences edges will be
6473 deleted which will trigger the generation of reg-moves based on the
6474 life-range analysis.  This option is effective only with
6475 @option{-fmodulo-sched} enabled.
6476
6477 @item -fno-branch-count-reg
6478 @opindex fno-branch-count-reg
6479 Do not use ``decrement and branch'' instructions on a count register,
6480 but instead generate a sequence of instructions that decrement a
6481 register, compare it against zero, then branch based upon the result.
6482 This option is only meaningful on architectures that support such
6483 instructions, which include x86, PowerPC, IA-64 and S/390.
6484
6485 The default is @option{-fbranch-count-reg}.
6486
6487 @item -fno-function-cse
6488 @opindex fno-function-cse
6489 Do not put function addresses in registers; make each instruction that
6490 calls a constant function contain the function's address explicitly.
6491
6492 This option results in less efficient code, but some strange hacks
6493 that alter the assembler output may be confused by the optimizations
6494 performed when this option is not used.
6495
6496 The default is @option{-ffunction-cse}
6497
6498 @item -fno-zero-initialized-in-bss
6499 @opindex fno-zero-initialized-in-bss
6500 If the target supports a BSS section, GCC by default puts variables that
6501 are initialized to zero into BSS@.  This can save space in the resulting
6502 code.
6503
6504 This option turns off this behavior because some programs explicitly
6505 rely on variables going to the data section.  E.g., so that the
6506 resulting executable can find the beginning of that section and/or make
6507 assumptions based on that.
6508
6509 The default is @option{-fzero-initialized-in-bss}.
6510
6511 @item -fmudflap -fmudflapth -fmudflapir
6512 @opindex fmudflap
6513 @opindex fmudflapth
6514 @opindex fmudflapir
6515 @cindex bounds checking
6516 @cindex mudflap
6517 For front-ends that support it (C and C++), instrument all risky
6518 pointer/array dereferencing operations, some standard library
6519 string/heap functions, and some other associated constructs with
6520 range/validity tests.  Modules so instrumented should be immune to
6521 buffer overflows, invalid heap use, and some other classes of C/C++
6522 programming errors.  The instrumentation relies on a separate runtime
6523 library (@file{libmudflap}), which will be linked into a program if
6524 @option{-fmudflap} is given at link time.  Run-time behavior of the
6525 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6526 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6527 for its options.
6528
6529 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6530 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6531 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6532 instrumentation should ignore pointer reads.  This produces less
6533 instrumentation (and therefore faster execution) and still provides
6534 some protection against outright memory corrupting writes, but allows
6535 erroneously read data to propagate within a program.
6536
6537 @item -fthread-jumps
6538 @opindex fthread-jumps
6539 Perform optimizations where we check to see if a jump branches to a
6540 location where another comparison subsumed by the first is found.  If
6541 so, the first branch is redirected to either the destination of the
6542 second branch or a point immediately following it, depending on whether
6543 the condition is known to be true or false.
6544
6545 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6546
6547 @item -fsplit-wide-types
6548 @opindex fsplit-wide-types
6549 When using a type that occupies multiple registers, such as @code{long
6550 long} on a 32-bit system, split the registers apart and allocate them
6551 independently.  This normally generates better code for those types,
6552 but may make debugging more difficult.
6553
6554 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6555 @option{-Os}.
6556
6557 @item -fcse-follow-jumps
6558 @opindex fcse-follow-jumps
6559 In common subexpression elimination (CSE), scan through jump instructions
6560 when the target of the jump is not reached by any other path.  For
6561 example, when CSE encounters an @code{if} statement with an
6562 @code{else} clause, CSE will follow the jump when the condition
6563 tested is false.
6564
6565 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6566
6567 @item -fcse-skip-blocks
6568 @opindex fcse-skip-blocks
6569 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6570 follow jumps which conditionally skip over blocks.  When CSE
6571 encounters a simple @code{if} statement with no else clause,
6572 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6573 body of the @code{if}.
6574
6575 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6576
6577 @item -frerun-cse-after-loop
6578 @opindex frerun-cse-after-loop
6579 Re-run common subexpression elimination after loop optimizations has been
6580 performed.
6581
6582 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6583
6584 @item -fgcse
6585 @opindex fgcse
6586 Perform a global common subexpression elimination pass.
6587 This pass also performs global constant and copy propagation.
6588
6589 @emph{Note:} When compiling a program using computed gotos, a GCC
6590 extension, you may get better runtime performance if you disable
6591 the global common subexpression elimination pass by adding
6592 @option{-fno-gcse} to the command line.
6593
6594 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6595
6596 @item -fgcse-lm
6597 @opindex fgcse-lm
6598 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6599 attempt to move loads which are only killed by stores into themselves.  This
6600 allows a loop containing a load/store sequence to be changed to a load outside
6601 the loop, and a copy/store within the loop.
6602
6603 Enabled by default when gcse is enabled.
6604
6605 @item -fgcse-sm
6606 @opindex fgcse-sm
6607 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6608 global common subexpression elimination.  This pass will attempt to move
6609 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6610 loops containing a load/store sequence can be changed to a load before
6611 the loop and a store after the loop.
6612
6613 Not enabled at any optimization level.
6614
6615 @item -fgcse-las
6616 @opindex fgcse-las
6617 When @option{-fgcse-las} is enabled, the global common subexpression
6618 elimination pass eliminates redundant loads that come after stores to the
6619 same memory location (both partial and full redundancies).
6620
6621 Not enabled at any optimization level.
6622
6623 @item -fgcse-after-reload
6624 @opindex fgcse-after-reload
6625 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6626 pass is performed after reload.  The purpose of this pass is to cleanup
6627 redundant spilling.
6628
6629 @item -funsafe-loop-optimizations
6630 @opindex funsafe-loop-optimizations
6631 If given, the loop optimizer will assume that loop indices do not
6632 overflow, and that the loops with nontrivial exit condition are not
6633 infinite.  This enables a wider range of loop optimizations even if
6634 the loop optimizer itself cannot prove that these assumptions are valid.
6635 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6636 if it finds this kind of loop.
6637
6638 @item -fcrossjumping
6639 @opindex fcrossjumping
6640 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6641 resulting code may or may not perform better than without cross-jumping.
6642
6643 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6644
6645 @item -fauto-inc-dec
6646 @opindex fauto-inc-dec
6647 Combine increments or decrements of addresses with memory accesses.
6648 This pass is always skipped on architectures that do not have
6649 instructions to support this.  Enabled by default at @option{-O} and
6650 higher on architectures that support this.
6651
6652 @item -fdce
6653 @opindex fdce
6654 Perform dead code elimination (DCE) on RTL@.
6655 Enabled by default at @option{-O} and higher.
6656
6657 @item -fdse
6658 @opindex fdse
6659 Perform dead store elimination (DSE) on RTL@.
6660 Enabled by default at @option{-O} and higher.
6661
6662 @item -fif-conversion
6663 @opindex fif-conversion
6664 Attempt to transform conditional jumps into branch-less equivalents.  This
6665 include use of conditional moves, min, max, set flags and abs instructions, and
6666 some tricks doable by standard arithmetics.  The use of conditional execution
6667 on chips where it is available is controlled by @code{if-conversion2}.
6668
6669 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6670
6671 @item -fif-conversion2
6672 @opindex fif-conversion2
6673 Use conditional execution (where available) to transform conditional jumps into
6674 branch-less equivalents.
6675
6676 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6677
6678 @item -fdelete-null-pointer-checks
6679 @opindex fdelete-null-pointer-checks
6680 Assume that programs cannot safely dereference null pointers, and that
6681 no code or data element resides there.  This enables simple constant
6682 folding optimizations at all optimization levels.  In addition, other
6683 optimization passes in GCC use this flag to control global dataflow
6684 analyses that eliminate useless checks for null pointers; these assume
6685 that if a pointer is checked after it has already been dereferenced,
6686 it cannot be null.
6687
6688 Note however that in some environments this assumption is not true.
6689 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6690 for programs which depend on that behavior.
6691
6692 Some targets, especially embedded ones, disable this option at all levels.
6693 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6694 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6695 are enabled independently at different optimization levels.
6696
6697 @item -fdevirtualize
6698 @opindex fdevirtualize
6699 Attempt to convert calls to virtual functions to direct calls.  This
6700 is done both within a procedure and interprocedurally as part of
6701 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6702 propagation (@option{-fipa-cp}).
6703 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6704
6705 @item -fexpensive-optimizations
6706 @opindex fexpensive-optimizations
6707 Perform a number of minor optimizations that are relatively expensive.
6708
6709 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6710
6711 @item -foptimize-register-move
6712 @itemx -fregmove
6713 @opindex foptimize-register-move
6714 @opindex fregmove
6715 Attempt to reassign register numbers in move instructions and as
6716 operands of other simple instructions in order to maximize the amount of
6717 register tying.  This is especially helpful on machines with two-operand
6718 instructions.
6719
6720 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6721 optimization.
6722
6723 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6724
6725 @item -fira-algorithm=@var{algorithm}
6726 Use specified coloring algorithm for the integrated register
6727 allocator.  The @var{algorithm} argument should be @code{priority} or
6728 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6729 the second one specifies Chaitin-Briggs coloring.  The second
6730 algorithm can be unimplemented for some architectures.  If it is
6731 implemented, it is the default because Chaitin-Briggs coloring as a
6732 rule generates a better code.
6733
6734 @item -fira-region=@var{region}
6735 Use specified regions for the integrated register allocator.  The
6736 @var{region} argument should be one of @code{all}, @code{mixed}, or
6737 @code{one}.  The first value means using all loops as register
6738 allocation regions, the second value which is enabled by default when
6739 compiling with optimization for speed (@option{-O}, @option{-O2},
6740 @dots{}) means using all loops except for loops with small register
6741 pressure as the regions, and third one which is enabled by default for
6742 @option{-Os} or @option{-O0} means using all function as a single
6743 region.  The first value can give best result for machines with small
6744 size and irregular register set, the third one results in faster and
6745 generates decent code and the smallest size code, and the second value
6746 usually give the best results in most cases and for most
6747 architectures.
6748
6749 @item -fira-loop-pressure
6750 @opindex fira-loop-pressure
6751 Use IRA to evaluate register pressure in loops for decision to move
6752 loop invariants.  Usage of this option usually results in generation
6753 of faster and smaller code on machines with big register files (>= 32
6754 registers) but it can slow compiler down.
6755
6756 This option is enabled at level @option{-O3} for some targets.
6757
6758 @item -fno-ira-share-save-slots
6759 @opindex fno-ira-share-save-slots
6760 Switch off sharing stack slots used for saving call used hard
6761 registers living through a call.  Each hard register will get a
6762 separate stack slot and as a result function stack frame will be
6763 bigger.
6764
6765 @item -fno-ira-share-spill-slots
6766 @opindex fno-ira-share-spill-slots
6767 Switch off sharing stack slots allocated for pseudo-registers.  Each
6768 pseudo-register which did not get a hard register will get a separate
6769 stack slot and as a result function stack frame will be bigger.
6770
6771 @item -fira-verbose=@var{n}
6772 @opindex fira-verbose
6773 Set up how verbose dump file for the integrated register allocator
6774 will be.  Default value is 5.  If the value is greater or equal to 10,
6775 the dump file will be stderr as if the value were @var{n} minus 10.
6776
6777 @item -fdelayed-branch
6778 @opindex fdelayed-branch
6779 If supported for the target machine, attempt to reorder instructions
6780 to exploit instruction slots available after delayed branch
6781 instructions.
6782
6783 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6784
6785 @item -fschedule-insns
6786 @opindex fschedule-insns
6787 If supported for the target machine, attempt to reorder instructions to
6788 eliminate execution stalls due to required data being unavailable.  This
6789 helps machines that have slow floating point or memory load instructions
6790 by allowing other instructions to be issued until the result of the load
6791 or floating point instruction is required.
6792
6793 Enabled at levels @option{-O2}, @option{-O3}.
6794
6795 @item -fschedule-insns2
6796 @opindex fschedule-insns2
6797 Similar to @option{-fschedule-insns}, but requests an additional pass of
6798 instruction scheduling after register allocation has been done.  This is
6799 especially useful on machines with a relatively small number of
6800 registers and where memory load instructions take more than one cycle.
6801
6802 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6803
6804 @item -fno-sched-interblock
6805 @opindex fno-sched-interblock
6806 Don't schedule instructions across basic blocks.  This is normally
6807 enabled by default when scheduling before register allocation, i.e.@:
6808 with @option{-fschedule-insns} or at @option{-O2} or higher.
6809
6810 @item -fno-sched-spec
6811 @opindex fno-sched-spec
6812 Don't allow speculative motion of non-load instructions.  This is normally
6813 enabled by default when scheduling before register allocation, i.e.@:
6814 with @option{-fschedule-insns} or at @option{-O2} or higher.
6815
6816 @item -fsched-pressure
6817 @opindex fsched-pressure
6818 Enable register pressure sensitive insn scheduling before the register
6819 allocation.  This only makes sense when scheduling before register
6820 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6821 @option{-O2} or higher.  Usage of this option can improve the
6822 generated code and decrease its size by preventing register pressure
6823 increase above the number of available hard registers and as a
6824 consequence register spills in the register allocation.
6825
6826 @item -fsched-spec-load
6827 @opindex fsched-spec-load
6828 Allow speculative motion of some load instructions.  This only makes
6829 sense when scheduling before register allocation, i.e.@: with
6830 @option{-fschedule-insns} or at @option{-O2} or higher.
6831
6832 @item -fsched-spec-load-dangerous
6833 @opindex fsched-spec-load-dangerous
6834 Allow speculative motion of more load instructions.  This only makes
6835 sense when scheduling before register allocation, i.e.@: with
6836 @option{-fschedule-insns} or at @option{-O2} or higher.
6837
6838 @item -fsched-stalled-insns
6839 @itemx -fsched-stalled-insns=@var{n}
6840 @opindex fsched-stalled-insns
6841 Define how many insns (if any) can be moved prematurely from the queue
6842 of stalled insns into the ready list, during the second scheduling pass.
6843 @option{-fno-sched-stalled-insns} means that no insns will be moved
6844 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6845 on how many queued insns can be moved prematurely.
6846 @option{-fsched-stalled-insns} without a value is equivalent to
6847 @option{-fsched-stalled-insns=1}.
6848
6849 @item -fsched-stalled-insns-dep
6850 @itemx -fsched-stalled-insns-dep=@var{n}
6851 @opindex fsched-stalled-insns-dep
6852 Define how many insn groups (cycles) will be examined for a dependency
6853 on a stalled insn that is candidate for premature removal from the queue
6854 of stalled insns.  This has an effect only during the second scheduling pass,
6855 and only if @option{-fsched-stalled-insns} is used.
6856 @option{-fno-sched-stalled-insns-dep} is equivalent to
6857 @option{-fsched-stalled-insns-dep=0}.
6858 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6859 @option{-fsched-stalled-insns-dep=1}.
6860
6861 @item -fsched2-use-superblocks
6862 @opindex fsched2-use-superblocks
6863 When scheduling after register allocation, do use superblock scheduling
6864 algorithm.  Superblock scheduling allows motion across basic block boundaries
6865 resulting on faster schedules.  This option is experimental, as not all machine
6866 descriptions used by GCC model the CPU closely enough to avoid unreliable
6867 results from the algorithm.
6868
6869 This only makes sense when scheduling after register allocation, i.e.@: with
6870 @option{-fschedule-insns2} or at @option{-O2} or higher.
6871
6872 @item -fsched-group-heuristic
6873 @opindex fsched-group-heuristic
6874 Enable the group heuristic in the scheduler.  This heuristic favors
6875 the instruction that belongs to a schedule group.  This is enabled
6876 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6877 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6878
6879 @item -fsched-critical-path-heuristic
6880 @opindex fsched-critical-path-heuristic
6881 Enable the critical-path heuristic in the scheduler.  This heuristic favors
6882 instructions on the critical path.  This is enabled by default when
6883 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6884 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6885
6886 @item -fsched-spec-insn-heuristic
6887 @opindex fsched-spec-insn-heuristic
6888 Enable the speculative instruction heuristic in the scheduler.  This
6889 heuristic favors speculative instructions with greater dependency weakness.
6890 This is enabled by default when scheduling is enabled, i.e.@:
6891 with @option{-fschedule-insns} or @option{-fschedule-insns2}
6892 or at @option{-O2} or higher.
6893
6894 @item -fsched-rank-heuristic
6895 @opindex fsched-rank-heuristic
6896 Enable the rank heuristic in the scheduler.  This heuristic favors
6897 the instruction belonging to a basic block with greater size or frequency.
6898 This is enabled by default when scheduling is enabled, i.e.@:
6899 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6900 at @option{-O2} or higher.
6901
6902 @item -fsched-last-insn-heuristic
6903 @opindex fsched-last-insn-heuristic
6904 Enable the last-instruction heuristic in the scheduler.  This heuristic
6905 favors the instruction that is less dependent on the last instruction
6906 scheduled.  This is enabled by default when scheduling is enabled,
6907 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6908 at @option{-O2} or higher.
6909
6910 @item -fsched-dep-count-heuristic
6911 @opindex fsched-dep-count-heuristic
6912 Enable the dependent-count heuristic in the scheduler.  This heuristic
6913 favors the instruction that has more instructions depending on it.
6914 This is enabled by default when scheduling is enabled, i.e.@:
6915 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6916 at @option{-O2} or higher.
6917
6918 @item -freschedule-modulo-scheduled-loops
6919 @opindex freschedule-modulo-scheduled-loops
6920 The modulo scheduling comes before the traditional scheduling, if a loop
6921 was modulo scheduled we may want to prevent the later scheduling passes
6922 from changing its schedule, we use this option to control that.
6923
6924 @item -fselective-scheduling
6925 @opindex fselective-scheduling
6926 Schedule instructions using selective scheduling algorithm.  Selective
6927 scheduling runs instead of the first scheduler pass.
6928
6929 @item -fselective-scheduling2
6930 @opindex fselective-scheduling2
6931 Schedule instructions using selective scheduling algorithm.  Selective
6932 scheduling runs instead of the second scheduler pass.
6933
6934 @item -fsel-sched-pipelining
6935 @opindex fsel-sched-pipelining
6936 Enable software pipelining of innermost loops during selective scheduling.
6937 This option has no effect until one of @option{-fselective-scheduling} or
6938 @option{-fselective-scheduling2} is turned on.
6939
6940 @item -fsel-sched-pipelining-outer-loops
6941 @opindex fsel-sched-pipelining-outer-loops
6942 When pipelining loops during selective scheduling, also pipeline outer loops.
6943 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6944
6945 @item -fshrink-wrap
6946 @opindex fshrink-wrap
6947 Emit function prologues only before parts of the function that need it,
6948 rather than at the top of the function.  This flag is enabled by default at
6949 @option{-O} and higher.
6950
6951 @item -fcaller-saves
6952 @opindex fcaller-saves
6953 Enable values to be allocated in registers that will be clobbered by
6954 function calls, by emitting extra instructions to save and restore the
6955 registers around such calls.  Such allocation is done only when it
6956 seems to result in better code than would otherwise be produced.
6957
6958 This option is always enabled by default on certain machines, usually
6959 those which have no call-preserved registers to use instead.
6960
6961 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6962
6963 @item -fcombine-stack-adjustments
6964 @opindex fcombine-stack-adjustments
6965 Tracks stack adjustments (pushes and pops) and stack memory references
6966 and then tries to find ways to combine them.
6967
6968 Enabled by default at @option{-O1} and higher.
6969
6970 @item -fconserve-stack
6971 @opindex fconserve-stack
6972 Attempt to minimize stack usage.  The compiler will attempt to use less
6973 stack space, even if that makes the program slower.  This option
6974 implies setting the @option{large-stack-frame} parameter to 100
6975 and the @option{large-stack-frame-growth} parameter to 400.
6976
6977 @item -ftree-reassoc
6978 @opindex ftree-reassoc
6979 Perform reassociation on trees.  This flag is enabled by default
6980 at @option{-O} and higher.
6981
6982 @item -ftree-pre
6983 @opindex ftree-pre
6984 Perform partial redundancy elimination (PRE) on trees.  This flag is
6985 enabled by default at @option{-O2} and @option{-O3}.
6986
6987 @item -ftree-forwprop
6988 @opindex ftree-forwprop
6989 Perform forward propagation on trees.  This flag is enabled by default
6990 at @option{-O} and higher.
6991
6992 @item -ftree-fre
6993 @opindex ftree-fre
6994 Perform full redundancy elimination (FRE) on trees.  The difference
6995 between FRE and PRE is that FRE only considers expressions
6996 that are computed on all paths leading to the redundant computation.
6997 This analysis is faster than PRE, though it exposes fewer redundancies.
6998 This flag is enabled by default at @option{-O} and higher.
6999
7000 @item -ftree-phiprop
7001 @opindex ftree-phiprop
7002 Perform hoisting of loads from conditional pointers on trees.  This
7003 pass is enabled by default at @option{-O} and higher.
7004
7005 @item -ftree-copy-prop
7006 @opindex ftree-copy-prop
7007 Perform copy propagation on trees.  This pass eliminates unnecessary
7008 copy operations.  This flag is enabled by default at @option{-O} and
7009 higher.
7010
7011 @item -fipa-pure-const
7012 @opindex fipa-pure-const
7013 Discover which functions are pure or constant.
7014 Enabled by default at @option{-O} and higher.
7015
7016 @item -fipa-reference
7017 @opindex fipa-reference
7018 Discover which static variables do not escape cannot escape the
7019 compilation unit.
7020 Enabled by default at @option{-O} and higher.
7021
7022 @item -fipa-pta
7023 @opindex fipa-pta
7024 Perform interprocedural pointer analysis and interprocedural modification
7025 and reference analysis.  This option can cause excessive memory and
7026 compile-time usage on large compilation units.  It is not enabled by
7027 default at any optimization level.
7028
7029 @item -fipa-profile
7030 @opindex fipa-profile
7031 Perform interprocedural profile propagation.  The functions called only from
7032 cold functions are marked as cold. Also functions executed once (such as
7033 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7034 functions and loop less parts of functions executed once are then optimized for
7035 size.
7036 Enabled by default at @option{-O} and higher.
7037
7038 @item -fipa-cp
7039 @opindex fipa-cp
7040 Perform interprocedural constant propagation.
7041 This optimization analyzes the program to determine when values passed
7042 to functions are constants and then optimizes accordingly.
7043 This optimization can substantially increase performance
7044 if the application has constants passed to functions.
7045 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7046
7047 @item -fipa-cp-clone
7048 @opindex fipa-cp-clone
7049 Perform function cloning to make interprocedural constant propagation stronger.
7050 When enabled, interprocedural constant propagation will perform function cloning
7051 when externally visible function can be called with constant arguments.
7052 Because this optimization can create multiple copies of functions,
7053 it may significantly increase code size
7054 (see @option{--param ipcp-unit-growth=@var{value}}).
7055 This flag is enabled by default at @option{-O3}.
7056
7057 @item -fipa-matrix-reorg
7058 @opindex fipa-matrix-reorg
7059 Perform matrix flattening and transposing.
7060 Matrix flattening tries to replace an @math{m}-dimensional matrix
7061 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
7062 This reduces the level of indirection needed for accessing the elements
7063 of the matrix. The second optimization is matrix transposing that
7064 attempts to change the order of the matrix's dimensions in order to
7065 improve cache locality.
7066 Both optimizations need the @option{-fwhole-program} flag.
7067 Transposing is enabled only if profiling information is available.
7068
7069 @item -ftree-sink
7070 @opindex ftree-sink
7071 Perform forward store motion  on trees.  This flag is
7072 enabled by default at @option{-O} and higher.
7073
7074 @item -ftree-bit-ccp
7075 @opindex ftree-bit-ccp
7076 Perform sparse conditional bit constant propagation on trees and propagate
7077 pointer alignment information.
7078 This pass only operates on local scalar variables and is enabled by default
7079 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7080
7081 @item -ftree-ccp
7082 @opindex ftree-ccp
7083 Perform sparse conditional constant propagation (CCP) on trees.  This
7084 pass only operates on local scalar variables and is enabled by default
7085 at @option{-O} and higher.
7086
7087 @item -ftree-switch-conversion
7088 Perform conversion of simple initializations in a switch to
7089 initializations from a scalar array.  This flag is enabled by default
7090 at @option{-O2} and higher.
7091
7092 @item -ftree-tail-merge
7093 Look for identical code sequences.  When found, replace one with a jump to the
7094 other.  This optimization is known as tail merging or cross jumping.  This flag
7095 is enabled by default at @option{-O2} and higher.  The run time of this pass can
7096 be limited using @option{max-tail-merge-comparisons} parameter and
7097 @option{max-tail-merge-iterations} parameter.
7098
7099 @item -ftree-dce
7100 @opindex ftree-dce
7101 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7102 default at @option{-O} and higher.
7103
7104 @item -ftree-builtin-call-dce
7105 @opindex ftree-builtin-call-dce
7106 Perform conditional dead code elimination (DCE) for calls to builtin functions
7107 that may set @code{errno} but are otherwise side-effect free.  This flag is
7108 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7109 specified.
7110
7111 @item -ftree-dominator-opts
7112 @opindex ftree-dominator-opts
7113 Perform a variety of simple scalar cleanups (constant/copy
7114 propagation, redundancy elimination, range propagation and expression
7115 simplification) based on a dominator tree traversal.  This also
7116 performs jump threading (to reduce jumps to jumps). This flag is
7117 enabled by default at @option{-O} and higher.
7118
7119 @item -ftree-dse
7120 @opindex ftree-dse
7121 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7122 a memory location which will later be overwritten by another store without
7123 any intervening loads.  In this case the earlier store can be deleted.  This
7124 flag is enabled by default at @option{-O} and higher.
7125
7126 @item -ftree-ch
7127 @opindex ftree-ch
7128 Perform loop header copying on trees.  This is beneficial since it increases
7129 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7130 is enabled by default at @option{-O} and higher.  It is not enabled
7131 for @option{-Os}, since it usually increases code size.
7132
7133 @item -ftree-loop-optimize
7134 @opindex ftree-loop-optimize
7135 Perform loop optimizations on trees.  This flag is enabled by default
7136 at @option{-O} and higher.
7137
7138 @item -ftree-loop-linear
7139 @opindex ftree-loop-linear
7140 Perform loop interchange transformations on tree.  Same as
7141 @option{-floop-interchange}.  To use this code transformation, GCC has
7142 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7143 enable the Graphite loop transformation infrastructure.
7144
7145 @item -floop-interchange
7146 @opindex floop-interchange
7147 Perform loop interchange transformations on loops.  Interchanging two
7148 nested loops switches the inner and outer loops.  For example, given a
7149 loop like:
7150 @smallexample
7151 DO J = 1, M
7152   DO I = 1, N
7153     A(J, I) = A(J, I) * C
7154   ENDDO
7155 ENDDO
7156 @end smallexample
7157 loop interchange will transform the loop as if the user had written:
7158 @smallexample
7159 DO I = 1, N
7160   DO J = 1, M
7161     A(J, I) = A(J, I) * C
7162   ENDDO
7163 ENDDO
7164 @end smallexample
7165 which can be beneficial when @code{N} is larger than the caches,
7166 because in Fortran, the elements of an array are stored in memory
7167 contiguously by column, and the original loop iterates over rows,
7168 potentially creating at each access a cache miss.  This optimization
7169 applies to all the languages supported by GCC and is not limited to
7170 Fortran.  To use this code transformation, GCC has to be configured
7171 with @option{--with-ppl} and @option{--with-cloog} to enable the
7172 Graphite loop transformation infrastructure.
7173
7174 @item -floop-strip-mine
7175 @opindex floop-strip-mine
7176 Perform loop strip mining transformations on loops.  Strip mining
7177 splits a loop into two nested loops.  The outer loop has strides
7178 equal to the strip size and the inner loop has strides of the
7179 original loop within a strip.  The strip length can be changed
7180 using the @option{loop-block-tile-size} parameter.  For example,
7181 given a loop like:
7182 @smallexample
7183 DO I = 1, N
7184   A(I) = A(I) + C
7185 ENDDO
7186 @end smallexample
7187 loop strip mining will transform the loop as if the user had written:
7188 @smallexample
7189 DO II = 1, N, 51
7190   DO I = II, min (II + 50, N)
7191     A(I) = A(I) + C
7192   ENDDO
7193 ENDDO
7194 @end smallexample
7195 This optimization applies to all the languages supported by GCC and is
7196 not limited to Fortran.  To use this code transformation, GCC has to
7197 be configured with @option{--with-ppl} and @option{--with-cloog} to
7198 enable the Graphite loop transformation infrastructure.
7199
7200 @item -floop-block
7201 @opindex floop-block
7202 Perform loop blocking transformations on loops.  Blocking strip mines
7203 each loop in the loop nest such that the memory accesses of the
7204 element loops fit inside caches.  The strip length can be changed
7205 using the @option{loop-block-tile-size} parameter.  For example, given
7206 a loop like:
7207 @smallexample
7208 DO I = 1, N
7209   DO J = 1, M
7210     A(J, I) = B(I) + C(J)
7211   ENDDO
7212 ENDDO
7213 @end smallexample
7214 loop blocking will transform the loop as if the user had written:
7215 @smallexample
7216 DO II = 1, N, 51
7217   DO JJ = 1, M, 51
7218     DO I = II, min (II + 50, N)
7219       DO J = JJ, min (JJ + 50, M)
7220         A(J, I) = B(I) + C(J)
7221       ENDDO
7222     ENDDO
7223   ENDDO
7224 ENDDO
7225 @end smallexample
7226 which can be beneficial when @code{M} is larger than the caches,
7227 because the innermost loop will iterate over a smaller amount of data
7228 that can be kept in the caches.  This optimization applies to all the
7229 languages supported by GCC and is not limited to Fortran.  To use this
7230 code transformation, GCC has to be configured with @option{--with-ppl}
7231 and @option{--with-cloog} to enable the Graphite loop transformation
7232 infrastructure.
7233
7234 @item -fgraphite-identity
7235 @opindex fgraphite-identity
7236 Enable the identity transformation for graphite.  For every SCoP we generate
7237 the polyhedral representation and transform it back to gimple.  Using
7238 @option{-fgraphite-identity} we can check the costs or benefits of the
7239 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7240 are also performed by the code generator CLooG, like index splitting and
7241 dead code elimination in loops.
7242
7243 @item -floop-flatten
7244 @opindex floop-flatten
7245 Removes the loop nesting structure: transforms the loop nest into a
7246 single loop.  This transformation can be useful to vectorize all the
7247 levels of the loop nest.
7248
7249 @item -floop-parallelize-all
7250 @opindex floop-parallelize-all
7251 Use the Graphite data dependence analysis to identify loops that can
7252 be parallelized.  Parallelize all the loops that can be analyzed to
7253 not contain loop carried dependences without checking that it is
7254 profitable to parallelize the loops.
7255
7256 @item -fcheck-data-deps
7257 @opindex fcheck-data-deps
7258 Compare the results of several data dependence analyzers.  This option
7259 is used for debugging the data dependence analyzers.
7260
7261 @item -ftree-loop-if-convert
7262 Attempt to transform conditional jumps in the innermost loops to
7263 branch-less equivalents.  The intent is to remove control-flow from
7264 the innermost loops in order to improve the ability of the
7265 vectorization pass to handle these loops.  This is enabled by default
7266 if vectorization is enabled.
7267
7268 @item -ftree-loop-if-convert-stores
7269 Attempt to also if-convert conditional jumps containing memory writes.
7270 This transformation can be unsafe for multi-threaded programs as it
7271 transforms conditional memory writes into unconditional memory writes.
7272 For example,
7273 @smallexample
7274 for (i = 0; i < N; i++)
7275   if (cond)
7276     A[i] = expr;
7277 @end smallexample
7278 would be transformed to
7279 @smallexample
7280 for (i = 0; i < N; i++)
7281   A[i] = cond ? expr : A[i];
7282 @end smallexample
7283 potentially producing data races.
7284
7285 @item -ftree-loop-distribution
7286 Perform loop distribution.  This flag can improve cache performance on
7287 big loop bodies and allow further loop optimizations, like
7288 parallelization or vectorization, to take place.  For example, the loop
7289 @smallexample
7290 DO I = 1, N
7291   A(I) = B(I) + C
7292   D(I) = E(I) * F
7293 ENDDO
7294 @end smallexample
7295 is transformed to
7296 @smallexample
7297 DO I = 1, N
7298    A(I) = B(I) + C
7299 ENDDO
7300 DO I = 1, N
7301    D(I) = E(I) * F
7302 ENDDO
7303 @end smallexample
7304
7305 @item -ftree-loop-distribute-patterns
7306 Perform loop distribution of patterns that can be code generated with
7307 calls to a library.  This flag is enabled by default at @option{-O3}.
7308
7309 This pass distributes the initialization loops and generates a call to
7310 memset zero.  For example, the loop
7311 @smallexample
7312 DO I = 1, N
7313   A(I) = 0
7314   B(I) = A(I) + I
7315 ENDDO
7316 @end smallexample
7317 is transformed to
7318 @smallexample
7319 DO I = 1, N
7320    A(I) = 0
7321 ENDDO
7322 DO I = 1, N
7323    B(I) = A(I) + I
7324 ENDDO
7325 @end smallexample
7326 and the initialization loop is transformed into a call to memset zero.
7327
7328 @item -ftree-loop-im
7329 @opindex ftree-loop-im
7330 Perform loop invariant motion on trees.  This pass moves only invariants that
7331 would be hard to handle at RTL level (function calls, operations that expand to
7332 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7333 operands of conditions that are invariant out of the loop, so that we can use
7334 just trivial invariantness analysis in loop unswitching.  The pass also includes
7335 store motion.
7336
7337 @item -ftree-loop-ivcanon
7338 @opindex ftree-loop-ivcanon
7339 Create a canonical counter for number of iterations in the loop for that
7340 determining number of iterations requires complicated analysis.  Later
7341 optimizations then may determine the number easily.  Useful especially
7342 in connection with unrolling.
7343
7344 @item -fivopts
7345 @opindex fivopts
7346 Perform induction variable optimizations (strength reduction, induction
7347 variable merging and induction variable elimination) on trees.
7348
7349 @item -ftree-parallelize-loops=n
7350 @opindex ftree-parallelize-loops
7351 Parallelize loops, i.e., split their iteration space to run in n threads.
7352 This is only possible for loops whose iterations are independent
7353 and can be arbitrarily reordered.  The optimization is only
7354 profitable on multiprocessor machines, for loops that are CPU-intensive,
7355 rather than constrained e.g.@: by memory bandwidth.  This option
7356 implies @option{-pthread}, and thus is only supported on targets
7357 that have support for @option{-pthread}.
7358
7359 @item -ftree-pta
7360 @opindex ftree-pta
7361 Perform function-local points-to analysis on trees.  This flag is
7362 enabled by default at @option{-O} and higher.
7363
7364 @item -ftree-sra
7365 @opindex ftree-sra
7366 Perform scalar replacement of aggregates.  This pass replaces structure
7367 references with scalars to prevent committing structures to memory too
7368 early.  This flag is enabled by default at @option{-O} and higher.
7369
7370 @item -ftree-copyrename
7371 @opindex ftree-copyrename
7372 Perform copy renaming on trees.  This pass attempts to rename compiler
7373 temporaries to other variables at copy locations, usually resulting in
7374 variable names which more closely resemble the original variables.  This flag
7375 is enabled by default at @option{-O} and higher.
7376
7377 @item -ftree-ter
7378 @opindex ftree-ter
7379 Perform temporary expression replacement during the SSA->normal phase.  Single
7380 use/single def temporaries are replaced at their use location with their
7381 defining expression.  This results in non-GIMPLE code, but gives the expanders
7382 much more complex trees to work on resulting in better RTL generation.  This is
7383 enabled by default at @option{-O} and higher.
7384
7385 @item -ftree-vectorize
7386 @opindex ftree-vectorize
7387 Perform loop vectorization on trees. This flag is enabled by default at
7388 @option{-O3}.
7389
7390 @item -ftree-slp-vectorize
7391 @opindex ftree-slp-vectorize
7392 Perform basic block vectorization on trees. This flag is enabled by default at
7393 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7394
7395 @item -ftree-vect-loop-version
7396 @opindex ftree-vect-loop-version
7397 Perform loop versioning when doing loop vectorization on trees.  When a loop
7398 appears to be vectorizable except that data alignment or data dependence cannot
7399 be determined at compile time then vectorized and non-vectorized versions of
7400 the loop are generated along with runtime checks for alignment or dependence
7401 to control which version is executed.  This option is enabled by default
7402 except at level @option{-Os} where it is disabled.
7403
7404 @item -fvect-cost-model
7405 @opindex fvect-cost-model
7406 Enable cost model for vectorization.
7407
7408 @item -ftree-vrp
7409 @opindex ftree-vrp
7410 Perform Value Range Propagation on trees.  This is similar to the
7411 constant propagation pass, but instead of values, ranges of values are
7412 propagated.  This allows the optimizers to remove unnecessary range
7413 checks like array bound checks and null pointer checks.  This is
7414 enabled by default at @option{-O2} and higher.  Null pointer check
7415 elimination is only done if @option{-fdelete-null-pointer-checks} is
7416 enabled.
7417
7418 @item -ftracer
7419 @opindex ftracer
7420 Perform tail duplication to enlarge superblock size.  This transformation
7421 simplifies the control flow of the function allowing other optimizations to do
7422 better job.
7423
7424 @item -funroll-loops
7425 @opindex funroll-loops
7426 Unroll loops whose number of iterations can be determined at compile
7427 time or upon entry to the loop.  @option{-funroll-loops} implies
7428 @option{-frerun-cse-after-loop}.  This option makes code larger,
7429 and may or may not make it run faster.
7430
7431 @item -funroll-all-loops
7432 @opindex funroll-all-loops
7433 Unroll all loops, even if their number of iterations is uncertain when
7434 the loop is entered.  This usually makes programs run more slowly.
7435 @option{-funroll-all-loops} implies the same options as
7436 @option{-funroll-loops},
7437
7438 @item -fsplit-ivs-in-unroller
7439 @opindex fsplit-ivs-in-unroller
7440 Enables expressing of values of induction variables in later iterations
7441 of the unrolled loop using the value in the first iteration.  This breaks
7442 long dependency chains, thus improving efficiency of the scheduling passes.
7443
7444 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7445 same effect.  However in cases the loop body is more complicated than
7446 a single basic block, this is not reliable.  It also does not work at all
7447 on some of the architectures due to restrictions in the CSE pass.
7448
7449 This optimization is enabled by default.
7450
7451 @item -fvariable-expansion-in-unroller
7452 @opindex fvariable-expansion-in-unroller
7453 With this option, the compiler will create multiple copies of some
7454 local variables when unrolling a loop which can result in superior code.
7455
7456 @item -fpartial-inlining
7457 @opindex fpartial-inlining
7458 Inline parts of functions.  This option has any effect only
7459 when inlining itself is turned on by the @option{-finline-functions}
7460 or @option{-finline-small-functions} options.
7461
7462 Enabled at level @option{-O2}.
7463
7464 @item -fpredictive-commoning
7465 @opindex fpredictive-commoning
7466 Perform predictive commoning optimization, i.e., reusing computations
7467 (especially memory loads and stores) performed in previous
7468 iterations of loops.
7469
7470 This option is enabled at level @option{-O3}.
7471
7472 @item -fprefetch-loop-arrays
7473 @opindex fprefetch-loop-arrays
7474 If supported by the target machine, generate instructions to prefetch
7475 memory to improve the performance of loops that access large arrays.
7476
7477 This option may generate better or worse code; results are highly
7478 dependent on the structure of loops within the source code.
7479
7480 Disabled at level @option{-Os}.
7481
7482 @item -fno-peephole
7483 @itemx -fno-peephole2
7484 @opindex fno-peephole
7485 @opindex fno-peephole2
7486 Disable any machine-specific peephole optimizations.  The difference
7487 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7488 are implemented in the compiler; some targets use one, some use the
7489 other, a few use both.
7490
7491 @option{-fpeephole} is enabled by default.
7492 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7493
7494 @item -fno-guess-branch-probability
7495 @opindex fno-guess-branch-probability
7496 Do not guess branch probabilities using heuristics.
7497
7498 GCC will use heuristics to guess branch probabilities if they are
7499 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7500 heuristics are based on the control flow graph.  If some branch probabilities
7501 are specified by @samp{__builtin_expect}, then the heuristics will be
7502 used to guess branch probabilities for the rest of the control flow graph,
7503 taking the @samp{__builtin_expect} info into account.  The interactions
7504 between the heuristics and @samp{__builtin_expect} can be complex, and in
7505 some cases, it may be useful to disable the heuristics so that the effects
7506 of @samp{__builtin_expect} are easier to understand.
7507
7508 The default is @option{-fguess-branch-probability} at levels
7509 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7510
7511 @item -freorder-blocks
7512 @opindex freorder-blocks
7513 Reorder basic blocks in the compiled function in order to reduce number of
7514 taken branches and improve code locality.
7515
7516 Enabled at levels @option{-O2}, @option{-O3}.
7517
7518 @item -freorder-blocks-and-partition
7519 @opindex freorder-blocks-and-partition
7520 In addition to reordering basic blocks in the compiled function, in order
7521 to reduce number of taken branches, partitions hot and cold basic blocks
7522 into separate sections of the assembly and .o files, to improve
7523 paging and cache locality performance.
7524
7525 This optimization is automatically turned off in the presence of
7526 exception handling, for linkonce sections, for functions with a user-defined
7527 section attribute and on any architecture that does not support named
7528 sections.
7529
7530 @item -freorder-functions
7531 @opindex freorder-functions
7532 Reorder functions in the object file in order to
7533 improve code locality.  This is implemented by using special
7534 subsections @code{.text.hot} for most frequently executed functions and
7535 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7536 the linker so object file format must support named sections and linker must
7537 place them in a reasonable way.
7538
7539 Also profile feedback must be available in to make this option effective.  See
7540 @option{-fprofile-arcs} for details.
7541
7542 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7543
7544 @item -fstrict-aliasing
7545 @opindex fstrict-aliasing
7546 Allow the compiler to assume the strictest aliasing rules applicable to
7547 the language being compiled.  For C (and C++), this activates
7548 optimizations based on the type of expressions.  In particular, an
7549 object of one type is assumed never to reside at the same address as an
7550 object of a different type, unless the types are almost the same.  For
7551 example, an @code{unsigned int} can alias an @code{int}, but not a
7552 @code{void*} or a @code{double}.  A character type may alias any other
7553 type.
7554
7555 @anchor{Type-punning}Pay special attention to code like this:
7556 @smallexample
7557 union a_union @{
7558   int i;
7559   double d;
7560 @};
7561
7562 int f() @{
7563   union a_union t;
7564   t.d = 3.0;
7565   return t.i;
7566 @}
7567 @end smallexample
7568 The practice of reading from a different union member than the one most
7569 recently written to (called ``type-punning'') is common.  Even with
7570 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7571 is accessed through the union type.  So, the code above will work as
7572 expected.  @xref{Structures unions enumerations and bit-fields
7573 implementation}.  However, this code might not:
7574 @smallexample
7575 int f() @{
7576   union a_union t;
7577   int* ip;
7578   t.d = 3.0;
7579   ip = &t.i;
7580   return *ip;
7581 @}
7582 @end smallexample
7583
7584 Similarly, access by taking the address, casting the resulting pointer
7585 and dereferencing the result has undefined behavior, even if the cast
7586 uses a union type, e.g.:
7587 @smallexample
7588 int f() @{
7589   double d = 3.0;
7590   return ((union a_union *) &d)->i;
7591 @}
7592 @end smallexample
7593
7594 The @option{-fstrict-aliasing} option is enabled at levels
7595 @option{-O2}, @option{-O3}, @option{-Os}.
7596
7597 @item -fstrict-overflow
7598 @opindex fstrict-overflow
7599 Allow the compiler to assume strict signed overflow rules, depending
7600 on the language being compiled.  For C (and C++) this means that
7601 overflow when doing arithmetic with signed numbers is undefined, which
7602 means that the compiler may assume that it will not happen.  This
7603 permits various optimizations.  For example, the compiler will assume
7604 that an expression like @code{i + 10 > i} will always be true for
7605 signed @code{i}.  This assumption is only valid if signed overflow is
7606 undefined, as the expression is false if @code{i + 10} overflows when
7607 using twos complement arithmetic.  When this option is in effect any
7608 attempt to determine whether an operation on signed numbers will
7609 overflow must be written carefully to not actually involve overflow.
7610
7611 This option also allows the compiler to assume strict pointer
7612 semantics: given a pointer to an object, if adding an offset to that
7613 pointer does not produce a pointer to the same object, the addition is
7614 undefined.  This permits the compiler to conclude that @code{p + u >
7615 p} is always true for a pointer @code{p} and unsigned integer
7616 @code{u}.  This assumption is only valid because pointer wraparound is
7617 undefined, as the expression is false if @code{p + u} overflows using
7618 twos complement arithmetic.
7619
7620 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7621 that integer signed overflow is fully defined: it wraps.  When
7622 @option{-fwrapv} is used, there is no difference between
7623 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7624 integers.  With @option{-fwrapv} certain types of overflow are
7625 permitted.  For example, if the compiler gets an overflow when doing
7626 arithmetic on constants, the overflowed value can still be used with
7627 @option{-fwrapv}, but not otherwise.
7628
7629 The @option{-fstrict-overflow} option is enabled at levels
7630 @option{-O2}, @option{-O3}, @option{-Os}.
7631
7632 @item -falign-functions
7633 @itemx -falign-functions=@var{n}
7634 @opindex falign-functions
7635 Align the start of functions to the next power-of-two greater than
7636 @var{n}, skipping up to @var{n} bytes.  For instance,
7637 @option{-falign-functions=32} aligns functions to the next 32-byte
7638 boundary, but @option{-falign-functions=24} would align to the next
7639 32-byte boundary only if this can be done by skipping 23 bytes or less.
7640
7641 @option{-fno-align-functions} and @option{-falign-functions=1} are
7642 equivalent and mean that functions will not be aligned.
7643
7644 Some assemblers only support this flag when @var{n} is a power of two;
7645 in that case, it is rounded up.
7646
7647 If @var{n} is not specified or is zero, use a machine-dependent default.
7648
7649 Enabled at levels @option{-O2}, @option{-O3}.
7650
7651 @item -falign-labels
7652 @itemx -falign-labels=@var{n}
7653 @opindex falign-labels
7654 Align all branch targets to a power-of-two boundary, skipping up to
7655 @var{n} bytes like @option{-falign-functions}.  This option can easily
7656 make code slower, because it must insert dummy operations for when the
7657 branch target is reached in the usual flow of the code.
7658
7659 @option{-fno-align-labels} and @option{-falign-labels=1} are
7660 equivalent and mean that labels will not be aligned.
7661
7662 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7663 are greater than this value, then their values are used instead.
7664
7665 If @var{n} is not specified or is zero, use a machine-dependent default
7666 which is very likely to be @samp{1}, meaning no alignment.
7667
7668 Enabled at levels @option{-O2}, @option{-O3}.
7669
7670 @item -falign-loops
7671 @itemx -falign-loops=@var{n}
7672 @opindex falign-loops
7673 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7674 like @option{-falign-functions}.  The hope is that the loop will be
7675 executed many times, which will make up for any execution of the dummy
7676 operations.
7677
7678 @option{-fno-align-loops} and @option{-falign-loops=1} are
7679 equivalent and mean that loops will not be aligned.
7680
7681 If @var{n} is not specified or is zero, use a machine-dependent default.
7682
7683 Enabled at levels @option{-O2}, @option{-O3}.
7684
7685 @item -falign-jumps
7686 @itemx -falign-jumps=@var{n}
7687 @opindex falign-jumps
7688 Align branch targets to a power-of-two boundary, for branch targets
7689 where the targets can only be reached by jumping, skipping up to @var{n}
7690 bytes like @option{-falign-functions}.  In this case, no dummy operations
7691 need be executed.
7692
7693 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7694 equivalent and mean that loops will not be aligned.
7695
7696 If @var{n} is not specified or is zero, use a machine-dependent default.
7697
7698 Enabled at levels @option{-O2}, @option{-O3}.
7699
7700 @item -funit-at-a-time
7701 @opindex funit-at-a-time
7702 This option is left for compatibility reasons. @option{-funit-at-a-time}
7703 has no effect, while @option{-fno-unit-at-a-time} implies
7704 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7705
7706 Enabled by default.
7707
7708 @item -fno-toplevel-reorder
7709 @opindex fno-toplevel-reorder
7710 Do not reorder top-level functions, variables, and @code{asm}
7711 statements.  Output them in the same order that they appear in the
7712 input file.  When this option is used, unreferenced static variables
7713 will not be removed.  This option is intended to support existing code
7714 which relies on a particular ordering.  For new code, it is better to
7715 use attributes.
7716
7717 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7718 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7719 targets.
7720
7721 @item -fweb
7722 @opindex fweb
7723 Constructs webs as commonly used for register allocation purposes and assign
7724 each web individual pseudo register.  This allows the register allocation pass
7725 to operate on pseudos directly, but also strengthens several other optimization
7726 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7727 however, make debugging impossible, since variables will no longer stay in a
7728 ``home register''.
7729
7730 Enabled by default with @option{-funroll-loops}.
7731
7732 @item -fwhole-program
7733 @opindex fwhole-program
7734 Assume that the current compilation unit represents the whole program being
7735 compiled.  All public functions and variables with the exception of @code{main}
7736 and those merged by attribute @code{externally_visible} become static functions
7737 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.
7738 While this option is equivalent to proper use of the @code{static} keyword for
7739 programs consisting of a single file, in combination with option
7740 @option{-flto} this flag can be used to
7741 compile many smaller scale programs since the functions and variables become
7742 local for the whole combined compilation unit, not for the single source file
7743 itself.
7744
7745 This option implies @option{-fwhole-file} for Fortran programs.
7746
7747 @item -flto[=@var{n}]
7748 @opindex flto
7749 This option runs the standard link-time optimizer.  When invoked
7750 with source code, it generates GIMPLE (one of GCC's internal
7751 representations) and writes it to special ELF sections in the object
7752 file.  When the object files are linked together, all the function
7753 bodies are read from these ELF sections and instantiated as if they
7754 had been part of the same translation unit.
7755
7756 To use the link-timer optimizer, @option{-flto} needs to be specified at
7757 compile time and during the final link.  For example,
7758
7759 @smallexample
7760 gcc -c -O2 -flto foo.c
7761 gcc -c -O2 -flto bar.c
7762 gcc -o myprog -flto -O2 foo.o bar.o
7763 @end smallexample
7764
7765 The first two invocations to GCC will save a bytecode representation
7766 of GIMPLE into special ELF sections inside @file{foo.o} and
7767 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7768 @file{foo.o} and @file{bar.o}, merge the two files into a single
7769 internal image, and compile the result as usual.  Since both
7770 @file{foo.o} and @file{bar.o} are merged into a single image, this
7771 causes all the inter-procedural analyses and optimizations in GCC to
7772 work across the two files as if they were a single one.  This means,
7773 for example, that the inliner will be able to inline functions in
7774 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7775
7776 Another (simpler) way to enable link-time optimization is,
7777
7778 @smallexample
7779 gcc -o myprog -flto -O2 foo.c bar.c
7780 @end smallexample
7781
7782 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7783 merge them together into a single GIMPLE representation and optimize
7784 them as usual to produce @file{myprog}.
7785
7786 The only important thing to keep in mind is that to enable link-time
7787 optimizations the @option{-flto} flag needs to be passed to both the
7788 compile and the link commands.
7789
7790 To make whole program optimization effective, it is necessary to make
7791 certain whole program assumptions.  The compiler needs to know
7792 what functions and variables can be accessed by libraries and runtime
7793 outside of the link time optimized unit.  When supported by the linker,
7794 the linker plugin (see @option{-fuse-linker-plugin}) passes to the
7795 compiler information about used and externally visible symbols.  When
7796 the linker plugin is not available, @option{-fwhole-program} should be
7797 used to allow the compiler to make these assumptions, which will lead
7798 to more aggressive optimization decisions.
7799
7800 Note that when a file is compiled with @option{-flto}, the generated
7801 object file will be larger than a regular object file because it will
7802 contain GIMPLE bytecodes and the usual final code.  This means that
7803 object files with LTO information can be linked as a normal object
7804 file.  So, in the previous example, if the final link is done with
7805
7806 @smallexample
7807 gcc -o myprog foo.o bar.o
7808 @end smallexample
7809
7810 The only difference will be that no inter-procedural optimizations
7811 will be applied to produce @file{myprog}.  The two object files
7812 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7813 linker.
7814
7815 Additionally, the optimization flags used to compile individual files
7816 are not necessarily related to those used at link-time.  For instance,
7817
7818 @smallexample
7819 gcc -c -O0 -flto foo.c
7820 gcc -c -O0 -flto bar.c
7821 gcc -o myprog -flto -O3 foo.o bar.o
7822 @end smallexample
7823
7824 This will produce individual object files with unoptimized assembler
7825 code, but the resulting binary @file{myprog} will be optimized at
7826 @option{-O3}.  Now, if the final binary is generated without
7827 @option{-flto}, then @file{myprog} will not be optimized.
7828
7829 When producing the final binary with @option{-flto}, GCC will only
7830 apply link-time optimizations to those files that contain bytecode.
7831 Therefore, you can mix and match object files and libraries with
7832 GIMPLE bytecodes and final object code.  GCC will automatically select
7833 which files to optimize in LTO mode and which files to link without
7834 further processing.
7835
7836 There are some code generation flags that GCC will preserve when
7837 generating bytecodes, as they need to be used during the final link
7838 stage.  Currently, the following options are saved into the GIMPLE
7839 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7840 @option{-m} target flags.
7841
7842 At link time, these options are read-in and reapplied.  Note that the
7843 current implementation makes no attempt at recognizing conflicting
7844 values for these options.  If two or more files have a conflicting
7845 value (e.g., one file is compiled with @option{-fPIC} and another
7846 isn't), the compiler will simply use the last value read from the
7847 bytecode files.  It is recommended, then, that all the files
7848 participating in the same link be compiled with the same options.
7849
7850 Another feature of LTO is that it is possible to apply interprocedural
7851 optimizations on files written in different languages.  This requires
7852 some support in the language front end.  Currently, the C, C++ and
7853 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7854 something like this should work
7855
7856 @smallexample
7857 gcc -c -flto foo.c
7858 g++ -c -flto bar.cc
7859 gfortran -c -flto baz.f90
7860 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7861 @end smallexample
7862
7863 Notice that the final link is done with @command{g++} to get the C++
7864 runtime libraries and @option{-lgfortran} is added to get the Fortran
7865 runtime libraries.  In general, when mixing languages in LTO mode, you
7866 should use the same link command used when mixing languages in a
7867 regular (non-LTO) compilation.  This means that if your build process
7868 was mixing languages before, all you need to add is @option{-flto} to
7869 all the compile and link commands.
7870
7871 If LTO encounters objects with C linkage declared with incompatible
7872 types in separate translation units to be linked together (undefined
7873 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7874 issued.  The behavior is still undefined at runtime.
7875
7876 If object files containing GIMPLE bytecode are stored in a library archive, say
7877 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7878 are using a linker with linker plugin support.  To enable this feature, use
7879 the flag @option{-fuse-linker-plugin} at link-time:
7880
7881 @smallexample
7882 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7883 @end smallexample
7884
7885 With the linker plugin enabled, the linker will extract the needed
7886 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7887 to make them part of the aggregated GIMPLE image to be optimized.
7888
7889 If you are not using a linker with linker plugin support and/or do not
7890 enable linker plugin then the objects inside @file{libfoo.a}
7891 will be extracted and linked as usual, but they will not participate
7892 in the LTO optimization process.
7893
7894 Link time optimizations do not require the presence of the whole program to
7895 operate.  If the program does not require any symbols to be exported, it is
7896 possible to combine @option{-flto} and with @option{-fwhole-program} to allow
7897 the interprocedural optimizers to use more aggressive assumptions which may
7898 lead to improved optimization opportunities.
7899 Use of @option{-fwhole-program} is not needed when linker plugin is
7900 active (see @option{-fuse-linker-plugin}).
7901
7902 Regarding portability: the current implementation of LTO makes no
7903 attempt at generating bytecode that can be ported between different
7904 types of hosts.  The bytecode files are versioned and there is a
7905 strict version check, so bytecode files generated in one version of
7906 GCC will not work with an older/newer version of GCC.
7907
7908 Link time optimization does not play well with generating debugging
7909 information.  Combining @option{-flto} with
7910 @option{-g} is currently experimental and expected to produce wrong
7911 results.
7912
7913 If you specify the optional @var{n}, the optimization and code
7914 generation done at link time is executed in parallel using @var{n}
7915 parallel jobs by utilizing an installed @command{make} program.  The
7916 environment variable @env{MAKE} may be used to override the program
7917 used.  The default value for @var{n} is 1.
7918
7919 You can also specify @option{-flto=jobserver} to use GNU make's
7920 job server mode to determine the number of parallel jobs. This
7921 is useful when the Makefile calling GCC is already executing in parallel.
7922 The parent Makefile will need a @samp{+} prepended to the command recipe
7923 for this to work. This will likely only work if @env{MAKE} is
7924 GNU make.
7925
7926 This option is disabled by default.
7927
7928 @item -flto-partition=@var{alg}
7929 @opindex flto-partition
7930 Specify the partitioning algorithm used by the link time optimizer.
7931 The value is either @code{1to1} to specify a partitioning mirroring
7932 the original source files or @code{balanced} to specify partitioning
7933 into equally sized chunks (whenever possible).  Specifying @code{none}
7934 as an algorithm disables partitioning and streaming completely. The
7935 default value is @code{balanced}.
7936
7937 @item -flto-compression-level=@var{n}
7938 This option specifies the level of compression used for intermediate
7939 language written to LTO object files, and is only meaningful in
7940 conjunction with LTO mode (@option{-flto}).  Valid
7941 values are 0 (no compression) to 9 (maximum compression).  Values
7942 outside this range are clamped to either 0 or 9.  If the option is not
7943 given, a default balanced compression setting is used.
7944
7945 @item -flto-report
7946 Prints a report with internal details on the workings of the link-time
7947 optimizer.  The contents of this report vary from version to version,
7948 it is meant to be useful to GCC developers when processing object
7949 files in LTO mode (via @option{-flto}).
7950
7951 Disabled by default.
7952
7953 @item -fuse-linker-plugin
7954 Enables the use of a linker plugin during link time optimization.  This
7955 option relies on plugin support in the linker, which is available in gold
7956 or in GNU ld 2.21 or newer.
7957
7958 This option enables the extraction of object files with GIMPLE bytecode out
7959 of library archives. This improves the quality of optimization by exposing
7960 more code to the link time optimizer.  This information specifies what
7961 symbols can be accessed externally (by non-LTO object or during dynamic
7962 linking).  Resulting code quality improvements on binaries (and shared
7963 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
7964 See @option{-flto} for a description of the effect of this flag and how to
7965 use it.
7966
7967 Enabled by default when LTO support in GCC is enabled and GCC was compiled
7968 with a linker supporting plugins (GNU ld 2.21 or newer or gold).
7969
7970 @item -ffat-lto-objects
7971 @opindex ffat-lto-objects
7972 Fat LTO objects are object files that contain both the intermediate language
7973 and the object code. This makes them useable for both LTO linking and normal
7974 linking. This option makes effect only with @option{-flto} and is ignored 
7975 at linktime.
7976
7977 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
7978 requires the complete toolchain to be aware of LTO. It requires a linker with
7979 linker plugin support for basic functionality.  Additionally, nm, ar and ranlib
7980 need to support linker plugins to allow a full-featured build environment
7981 (capable of building static libraries etc).
7982
7983 The default is @option{-ffat-lto-objects} but this default is intended to
7984 change in future releases when linker plugin enabled environments become more
7985 common.
7986 @item -fcompare-elim
7987 @opindex fcompare-elim
7988 After register allocation and post-register allocation instruction splitting,
7989 identify arithmetic instructions that compute processor flags similar to a
7990 comparison operation based on that arithmetic.  If possible, eliminate the
7991 explicit comparison operation.
7992
7993 This pass only applies to certain targets that cannot explicitly represent
7994 the comparison operation before register allocation is complete.
7995
7996 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7997
7998 @item -fcprop-registers
7999 @opindex fcprop-registers
8000 After register allocation and post-register allocation instruction splitting,
8001 we perform a copy-propagation pass to try to reduce scheduling dependencies
8002 and occasionally eliminate the copy.
8003
8004 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8005
8006 @item -fprofile-correction
8007 @opindex fprofile-correction
8008 Profiles collected using an instrumented binary for multi-threaded programs may
8009 be inconsistent due to missed counter updates. When this option is specified,
8010 GCC will use heuristics to correct or smooth out such inconsistencies. By
8011 default, GCC will emit an error message when an inconsistent profile is detected.
8012
8013 @item -fprofile-dir=@var{path}
8014 @opindex fprofile-dir
8015
8016 Set the directory to search for the profile data files in to @var{path}.
8017 This option affects only the profile data generated by
8018 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8019 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8020 and its related options.  Both absolute and relative paths can be used.
8021 By default, GCC will use the current directory as @var{path}, thus the
8022 profile data file will appear in the same directory as the object file.
8023
8024 @item -fprofile-generate
8025 @itemx -fprofile-generate=@var{path}
8026 @opindex fprofile-generate
8027
8028 Enable options usually used for instrumenting application to produce
8029 profile useful for later recompilation with profile feedback based
8030 optimization.  You must use @option{-fprofile-generate} both when
8031 compiling and when linking your program.
8032
8033 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8034
8035 If @var{path} is specified, GCC will look at the @var{path} to find
8036 the profile feedback data files. See @option{-fprofile-dir}.
8037
8038 @item -fprofile-use
8039 @itemx -fprofile-use=@var{path}
8040 @opindex fprofile-use
8041 Enable profile feedback directed optimizations, and optimizations
8042 generally profitable only with profile feedback available.
8043
8044 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8045 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
8046
8047 By default, GCC emits an error message if the feedback profiles do not
8048 match the source code.  This error can be turned into a warning by using
8049 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8050 code.
8051
8052 If @var{path} is specified, GCC will look at the @var{path} to find
8053 the profile feedback data files. See @option{-fprofile-dir}.
8054 @end table
8055
8056 The following options control compiler behavior regarding floating
8057 point arithmetic.  These options trade off between speed and
8058 correctness.  All must be specifically enabled.
8059
8060 @table @gcctabopt
8061 @item -ffloat-store
8062 @opindex ffloat-store
8063 Do not store floating point variables in registers, and inhibit other
8064 options that might change whether a floating point value is taken from a
8065 register or memory.
8066
8067 @cindex floating point precision
8068 This option prevents undesirable excess precision on machines such as
8069 the 68000 where the floating registers (of the 68881) keep more
8070 precision than a @code{double} is supposed to have.  Similarly for the
8071 x86 architecture.  For most programs, the excess precision does only
8072 good, but a few programs rely on the precise definition of IEEE floating
8073 point.  Use @option{-ffloat-store} for such programs, after modifying
8074 them to store all pertinent intermediate computations into variables.
8075
8076 @item -fexcess-precision=@var{style}
8077 @opindex fexcess-precision
8078 This option allows further control over excess precision on machines
8079 where floating-point registers have more precision than the IEEE
8080 @code{float} and @code{double} types and the processor does not
8081 support operations rounding to those types.  By default,
8082 @option{-fexcess-precision=fast} is in effect; this means that
8083 operations are carried out in the precision of the registers and that
8084 it is unpredictable when rounding to the types specified in the source
8085 code takes place.  When compiling C, if
8086 @option{-fexcess-precision=standard} is specified then excess
8087 precision will follow the rules specified in ISO C99; in particular,
8088 both casts and assignments cause values to be rounded to their
8089 semantic types (whereas @option{-ffloat-store} only affects
8090 assignments).  This option is enabled by default for C if a strict
8091 conformance option such as @option{-std=c99} is used.
8092
8093 @opindex mfpmath
8094 @option{-fexcess-precision=standard} is not implemented for languages
8095 other than C, and has no effect if
8096 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8097 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8098 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8099 semantics apply without excess precision, and in the latter, rounding
8100 is unpredictable.
8101
8102 @item -ffast-math
8103 @opindex ffast-math
8104 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8105 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8106 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8107
8108 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8109
8110 This option is not turned on by any @option{-O} option besides
8111 @option{-Ofast} since it can result in incorrect output for programs
8112 which depend on an exact implementation of IEEE or ISO rules/specifications
8113 for math functions. It may, however, yield faster code for programs
8114 that do not require the guarantees of these specifications.
8115
8116 @item -fno-math-errno
8117 @opindex fno-math-errno
8118 Do not set ERRNO after calling math functions that are executed
8119 with a single instruction, e.g., sqrt.  A program that relies on
8120 IEEE exceptions for math error handling may want to use this flag
8121 for speed while maintaining IEEE arithmetic compatibility.
8122
8123 This option is not turned on by any @option{-O} option since
8124 it can result in incorrect output for programs which depend on
8125 an exact implementation of IEEE or ISO rules/specifications for
8126 math functions. It may, however, yield faster code for programs
8127 that do not require the guarantees of these specifications.
8128
8129 The default is @option{-fmath-errno}.
8130
8131 On Darwin systems, the math library never sets @code{errno}.  There is
8132 therefore no reason for the compiler to consider the possibility that
8133 it might, and @option{-fno-math-errno} is the default.
8134
8135 @item -funsafe-math-optimizations
8136 @opindex funsafe-math-optimizations
8137
8138 Allow optimizations for floating-point arithmetic that (a) assume
8139 that arguments and results are valid and (b) may violate IEEE or
8140 ANSI standards.  When used at link-time, it may include libraries
8141 or startup files that change the default FPU control word or other
8142 similar optimizations.
8143
8144 This option is not turned on by any @option{-O} option since
8145 it can result in incorrect output for programs which depend on
8146 an exact implementation of IEEE or ISO rules/specifications for
8147 math functions. It may, however, yield faster code for programs
8148 that do not require the guarantees of these specifications.
8149 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8150 @option{-fassociative-math} and @option{-freciprocal-math}.
8151
8152 The default is @option{-fno-unsafe-math-optimizations}.
8153
8154 @item -fassociative-math
8155 @opindex fassociative-math
8156
8157 Allow re-association of operands in series of floating-point operations.
8158 This violates the ISO C and C++ language standard by possibly changing
8159 computation result.  NOTE: re-ordering may change the sign of zero as
8160 well as ignore NaNs and inhibit or create underflow or overflow (and
8161 thus cannot be used on a code which relies on rounding behavior like
8162 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
8163 and thus may not be used when ordered comparisons are required.
8164 This option requires that both @option{-fno-signed-zeros} and
8165 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8166 much sense with @option{-frounding-math}. For Fortran the option
8167 is automatically enabled when both @option{-fno-signed-zeros} and
8168 @option{-fno-trapping-math} are in effect.
8169
8170 The default is @option{-fno-associative-math}.
8171
8172 @item -freciprocal-math
8173 @opindex freciprocal-math
8174
8175 Allow the reciprocal of a value to be used instead of dividing by
8176 the value if this enables optimizations.  For example @code{x / y}
8177 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
8178 is subject to common subexpression elimination.  Note that this loses
8179 precision and increases the number of flops operating on the value.
8180
8181 The default is @option{-fno-reciprocal-math}.
8182
8183 @item -ffinite-math-only
8184 @opindex ffinite-math-only
8185 Allow optimizations for floating-point arithmetic that assume
8186 that arguments and results are not NaNs or +-Infs.
8187
8188 This option is not turned on by any @option{-O} option since
8189 it can result in incorrect output for programs which depend on
8190 an exact implementation of IEEE or ISO rules/specifications for
8191 math functions. It may, however, yield faster code for programs
8192 that do not require the guarantees of these specifications.
8193
8194 The default is @option{-fno-finite-math-only}.
8195
8196 @item -fno-signed-zeros
8197 @opindex fno-signed-zeros
8198 Allow optimizations for floating point arithmetic that ignore the
8199 signedness of zero.  IEEE arithmetic specifies the behavior of
8200 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8201 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8202 This option implies that the sign of a zero result isn't significant.
8203
8204 The default is @option{-fsigned-zeros}.
8205
8206 @item -fno-trapping-math
8207 @opindex fno-trapping-math
8208 Compile code assuming that floating-point operations cannot generate
8209 user-visible traps.  These traps include division by zero, overflow,
8210 underflow, inexact result and invalid operation.  This option requires
8211 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8212 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8213
8214 This option should never be turned on by any @option{-O} option since
8215 it can result in incorrect output for programs which depend on
8216 an exact implementation of IEEE or ISO rules/specifications for
8217 math functions.
8218
8219 The default is @option{-ftrapping-math}.
8220
8221 @item -frounding-math
8222 @opindex frounding-math
8223 Disable transformations and optimizations that assume default floating
8224 point rounding behavior.  This is round-to-zero for all floating point
8225 to integer conversions, and round-to-nearest for all other arithmetic
8226 truncations.  This option should be specified for programs that change
8227 the FP rounding mode dynamically, or that may be executed with a
8228 non-default rounding mode.  This option disables constant folding of
8229 floating point expressions at compile-time (which may be affected by
8230 rounding mode) and arithmetic transformations that are unsafe in the
8231 presence of sign-dependent rounding modes.
8232
8233 The default is @option{-fno-rounding-math}.
8234
8235 This option is experimental and does not currently guarantee to
8236 disable all GCC optimizations that are affected by rounding mode.
8237 Future versions of GCC may provide finer control of this setting
8238 using C99's @code{FENV_ACCESS} pragma.  This command line option
8239 will be used to specify the default state for @code{FENV_ACCESS}.
8240
8241 @item -fsignaling-nans
8242 @opindex fsignaling-nans
8243 Compile code assuming that IEEE signaling NaNs may generate user-visible
8244 traps during floating-point operations.  Setting this option disables
8245 optimizations that may change the number of exceptions visible with
8246 signaling NaNs.  This option implies @option{-ftrapping-math}.
8247
8248 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8249 be defined.
8250
8251 The default is @option{-fno-signaling-nans}.
8252
8253 This option is experimental and does not currently guarantee to
8254 disable all GCC optimizations that affect signaling NaN behavior.
8255
8256 @item -fsingle-precision-constant
8257 @opindex fsingle-precision-constant
8258 Treat floating point constant as single precision constant instead of
8259 implicitly converting it to double precision constant.
8260
8261 @item -fcx-limited-range
8262 @opindex fcx-limited-range
8263 When enabled, this option states that a range reduction step is not
8264 needed when performing complex division.  Also, there is no checking
8265 whether the result of a complex multiplication or division is @code{NaN
8266 + I*NaN}, with an attempt to rescue the situation in that case.  The
8267 default is @option{-fno-cx-limited-range}, but is enabled by
8268 @option{-ffast-math}.
8269
8270 This option controls the default setting of the ISO C99
8271 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8272 all languages.
8273
8274 @item -fcx-fortran-rules
8275 @opindex fcx-fortran-rules
8276 Complex multiplication and division follow Fortran rules.  Range
8277 reduction is done as part of complex division, but there is no checking
8278 whether the result of a complex multiplication or division is @code{NaN
8279 + I*NaN}, with an attempt to rescue the situation in that case.
8280
8281 The default is @option{-fno-cx-fortran-rules}.
8282
8283 @end table
8284
8285 The following options control optimizations that may improve
8286 performance, but are not enabled by any @option{-O} options.  This
8287 section includes experimental options that may produce broken code.
8288
8289 @table @gcctabopt
8290 @item -fbranch-probabilities
8291 @opindex fbranch-probabilities
8292 After running a program compiled with @option{-fprofile-arcs}
8293 (@pxref{Debugging Options,, Options for Debugging Your Program or
8294 @command{gcc}}), you can compile it a second time using
8295 @option{-fbranch-probabilities}, to improve optimizations based on
8296 the number of times each branch was taken.  When the program
8297 compiled with @option{-fprofile-arcs} exits it saves arc execution
8298 counts to a file called @file{@var{sourcename}.gcda} for each source
8299 file.  The information in this data file is very dependent on the
8300 structure of the generated code, so you must use the same source code
8301 and the same optimization options for both compilations.
8302
8303 With @option{-fbranch-probabilities}, GCC puts a
8304 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8305 These can be used to improve optimization.  Currently, they are only
8306 used in one place: in @file{reorg.c}, instead of guessing which path a
8307 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8308 exactly determine which path is taken more often.
8309
8310 @item -fprofile-values
8311 @opindex fprofile-values
8312 If combined with @option{-fprofile-arcs}, it adds code so that some
8313 data about values of expressions in the program is gathered.
8314
8315 With @option{-fbranch-probabilities}, it reads back the data gathered
8316 from profiling values of expressions for usage in optimizations.
8317
8318 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8319
8320 @item -fvpt
8321 @opindex fvpt
8322 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8323 a code to gather information about values of expressions.
8324
8325 With @option{-fbranch-probabilities}, it reads back the data gathered
8326 and actually performs the optimizations based on them.
8327 Currently the optimizations include specialization of division operation
8328 using the knowledge about the value of the denominator.
8329
8330 @item -frename-registers
8331 @opindex frename-registers
8332 Attempt to avoid false dependencies in scheduled code by making use
8333 of registers left over after register allocation.  This optimization
8334 will most benefit processors with lots of registers.  Depending on the
8335 debug information format adopted by the target, however, it can
8336 make debugging impossible, since variables will no longer stay in
8337 a ``home register''.
8338
8339 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8340
8341 @item -ftracer
8342 @opindex ftracer
8343 Perform tail duplication to enlarge superblock size.  This transformation
8344 simplifies the control flow of the function allowing other optimizations to do
8345 better job.
8346
8347 Enabled with @option{-fprofile-use}.
8348
8349 @item -funroll-loops
8350 @opindex funroll-loops
8351 Unroll loops whose number of iterations can be determined at compile time or
8352 upon entry to the loop.  @option{-funroll-loops} implies
8353 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8354 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8355 small constant number of iterations).  This option makes code larger, and may
8356 or may not make it run faster.
8357
8358 Enabled with @option{-fprofile-use}.
8359
8360 @item -funroll-all-loops
8361 @opindex funroll-all-loops
8362 Unroll all loops, even if their number of iterations is uncertain when
8363 the loop is entered.  This usually makes programs run more slowly.
8364 @option{-funroll-all-loops} implies the same options as
8365 @option{-funroll-loops}.
8366
8367 @item -fpeel-loops
8368 @opindex fpeel-loops
8369 Peels the loops for that there is enough information that they do not
8370 roll much (from profile feedback).  It also turns on complete loop peeling
8371 (i.e.@: complete removal of loops with small constant number of iterations).
8372
8373 Enabled with @option{-fprofile-use}.
8374
8375 @item -fmove-loop-invariants
8376 @opindex fmove-loop-invariants
8377 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8378 at level @option{-O1}
8379
8380 @item -funswitch-loops
8381 @opindex funswitch-loops
8382 Move branches with loop invariant conditions out of the loop, with duplicates
8383 of the loop on both branches (modified according to result of the condition).
8384
8385 @item -ffunction-sections
8386 @itemx -fdata-sections
8387 @opindex ffunction-sections
8388 @opindex fdata-sections
8389 Place each function or data item into its own section in the output
8390 file if the target supports arbitrary sections.  The name of the
8391 function or the name of the data item determines the section's name
8392 in the output file.
8393
8394 Use these options on systems where the linker can perform optimizations
8395 to improve locality of reference in the instruction space.  Most systems
8396 using the ELF object format and SPARC processors running Solaris 2 have
8397 linkers with such optimizations.  AIX may have these optimizations in
8398 the future.
8399
8400 Only use these options when there are significant benefits from doing
8401 so.  When you specify these options, the assembler and linker will
8402 create larger object and executable files and will also be slower.
8403 You will not be able to use @code{gprof} on all systems if you
8404 specify this option and you may have problems with debugging if
8405 you specify both this option and @option{-g}.
8406
8407 @item -fbranch-target-load-optimize
8408 @opindex fbranch-target-load-optimize
8409 Perform branch target register load optimization before prologue / epilogue
8410 threading.
8411 The use of target registers can typically be exposed only during reload,
8412 thus hoisting loads out of loops and doing inter-block scheduling needs
8413 a separate optimization pass.
8414
8415 @item -fbranch-target-load-optimize2
8416 @opindex fbranch-target-load-optimize2
8417 Perform branch target register load optimization after prologue / epilogue
8418 threading.
8419
8420 @item -fbtr-bb-exclusive
8421 @opindex fbtr-bb-exclusive
8422 When performing branch target register load optimization, don't reuse
8423 branch target registers in within any basic block.
8424
8425 @item -fstack-protector
8426 @opindex fstack-protector
8427 Emit extra code to check for buffer overflows, such as stack smashing
8428 attacks.  This is done by adding a guard variable to functions with
8429 vulnerable objects.  This includes functions that call alloca, and
8430 functions with buffers larger than 8 bytes.  The guards are initialized
8431 when a function is entered and then checked when the function exits.
8432 If a guard check fails, an error message is printed and the program exits.
8433
8434 @item -fstack-protector-all
8435 @opindex fstack-protector-all
8436 Like @option{-fstack-protector} except that all functions are protected.
8437
8438 @item -fsection-anchors
8439 @opindex fsection-anchors
8440 Try to reduce the number of symbolic address calculations by using
8441 shared ``anchor'' symbols to address nearby objects.  This transformation
8442 can help to reduce the number of GOT entries and GOT accesses on some
8443 targets.
8444
8445 For example, the implementation of the following function @code{foo}:
8446
8447 @smallexample
8448 static int a, b, c;
8449 int foo (void) @{ return a + b + c; @}
8450 @end smallexample
8451
8452 would usually calculate the addresses of all three variables, but if you
8453 compile it with @option{-fsection-anchors}, it will access the variables
8454 from a common anchor point instead.  The effect is similar to the
8455 following pseudocode (which isn't valid C):
8456
8457 @smallexample
8458 int foo (void)
8459 @{
8460   register int *xr = &x;
8461   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8462 @}
8463 @end smallexample
8464
8465 Not all targets support this option.
8466
8467 @item --param @var{name}=@var{value}
8468 @opindex param
8469 In some places, GCC uses various constants to control the amount of
8470 optimization that is done.  For example, GCC will not inline functions
8471 that contain more that a certain number of instructions.  You can
8472 control some of these constants on the command-line using the
8473 @option{--param} option.
8474
8475 The names of specific parameters, and the meaning of the values, are
8476 tied to the internals of the compiler, and are subject to change
8477 without notice in future releases.
8478
8479 In each case, the @var{value} is an integer.  The allowable choices for
8480 @var{name} are given in the following table:
8481
8482 @table @gcctabopt
8483 @item predictable-branch-outcome
8484 When branch is predicted to be taken with probability lower than this threshold
8485 (in percent), then it is considered well predictable. The default is 10.
8486
8487 @item max-crossjump-edges
8488 The maximum number of incoming edges to consider for crossjumping.
8489 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8490 the number of edges incoming to each block.  Increasing values mean
8491 more aggressive optimization, making the compile time increase with
8492 probably small improvement in executable size.
8493
8494 @item min-crossjump-insns
8495 The minimum number of instructions which must be matched at the end
8496 of two blocks before crossjumping will be performed on them.  This
8497 value is ignored in the case where all instructions in the block being
8498 crossjumped from are matched.  The default value is 5.
8499
8500 @item max-grow-copy-bb-insns
8501 The maximum code size expansion factor when copying basic blocks
8502 instead of jumping.  The expansion is relative to a jump instruction.
8503 The default value is 8.
8504
8505 @item max-goto-duplication-insns
8506 The maximum number of instructions to duplicate to a block that jumps
8507 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8508 passes, GCC factors computed gotos early in the compilation process,
8509 and unfactors them as late as possible.  Only computed jumps at the
8510 end of a basic blocks with no more than max-goto-duplication-insns are
8511 unfactored.  The default value is 8.
8512
8513 @item max-delay-slot-insn-search
8514 The maximum number of instructions to consider when looking for an
8515 instruction to fill a delay slot.  If more than this arbitrary number of
8516 instructions is searched, the time savings from filling the delay slot
8517 will be minimal so stop searching.  Increasing values mean more
8518 aggressive optimization, making the compile time increase with probably
8519 small improvement in executable run time.
8520
8521 @item max-delay-slot-live-search
8522 When trying to fill delay slots, the maximum number of instructions to
8523 consider when searching for a block with valid live register
8524 information.  Increasing this arbitrarily chosen value means more
8525 aggressive optimization, increasing the compile time.  This parameter
8526 should be removed when the delay slot code is rewritten to maintain the
8527 control-flow graph.
8528
8529 @item max-gcse-memory
8530 The approximate maximum amount of memory that will be allocated in
8531 order to perform the global common subexpression elimination
8532 optimization.  If more memory than specified is required, the
8533 optimization will not be done.
8534
8535 @item max-gcse-insertion-ratio
8536 If the ratio of expression insertions to deletions is larger than this value
8537 for any expression, then RTL PRE will insert or remove the expression and thus
8538 leave partially redundant computations in the instruction stream.  The default value is 20.
8539
8540 @item max-pending-list-length
8541 The maximum number of pending dependencies scheduling will allow
8542 before flushing the current state and starting over.  Large functions
8543 with few branches or calls can create excessively large lists which
8544 needlessly consume memory and resources.
8545
8546 @item max-modulo-backtrack-attempts
8547 The maximum number of backtrack attempts the scheduler should make
8548 when modulo scheduling a loop.  Larger values can exponentially increase
8549 compile time.
8550
8551 @item max-inline-insns-single
8552 Several parameters control the tree inliner used in gcc.
8553 This number sets the maximum number of instructions (counted in GCC's
8554 internal representation) in a single function that the tree inliner
8555 will consider for inlining.  This only affects functions declared
8556 inline and methods implemented in a class declaration (C++).
8557 The default value is 400.
8558
8559 @item max-inline-insns-auto
8560 When you use @option{-finline-functions} (included in @option{-O3}),
8561 a lot of functions that would otherwise not be considered for inlining
8562 by the compiler will be investigated.  To those functions, a different
8563 (more restrictive) limit compared to functions declared inline can
8564 be applied.
8565 The default value is 40.
8566
8567 @item large-function-insns
8568 The limit specifying really large functions.  For functions larger than this
8569 limit after inlining, inlining is constrained by
8570 @option{--param large-function-growth}.  This parameter is useful primarily
8571 to avoid extreme compilation time caused by non-linear algorithms used by the
8572 backend.
8573 The default value is 2700.
8574
8575 @item large-function-growth
8576 Specifies maximal growth of large function caused by inlining in percents.
8577 The default value is 100 which limits large function growth to 2.0 times
8578 the original size.
8579
8580 @item large-unit-insns
8581 The limit specifying large translation unit.  Growth caused by inlining of
8582 units larger than this limit is limited by @option{--param inline-unit-growth}.
8583 For small units this might be too tight (consider unit consisting of function A
8584 that is inline and B that just calls A three time.  If B is small relative to
8585 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8586 large units consisting of small inlineable functions however the overall unit
8587 growth limit is needed to avoid exponential explosion of code size.  Thus for
8588 smaller units, the size is increased to @option{--param large-unit-insns}
8589 before applying @option{--param inline-unit-growth}.  The default is 10000
8590
8591 @item inline-unit-growth
8592 Specifies maximal overall growth of the compilation unit caused by inlining.
8593 The default value is 30 which limits unit growth to 1.3 times the original
8594 size.
8595
8596 @item ipcp-unit-growth
8597 Specifies maximal overall growth of the compilation unit caused by
8598 interprocedural constant propagation.  The default value is 10 which limits
8599 unit growth to 1.1 times the original size.
8600
8601 @item large-stack-frame
8602 The limit specifying large stack frames.  While inlining the algorithm is trying
8603 to not grow past this limit too much.  Default value is 256 bytes.
8604
8605 @item large-stack-frame-growth
8606 Specifies maximal growth of large stack frames caused by inlining in percents.
8607 The default value is 1000 which limits large stack frame growth to 11 times
8608 the original size.
8609
8610 @item max-inline-insns-recursive
8611 @itemx max-inline-insns-recursive-auto
8612 Specifies maximum number of instructions out-of-line copy of self recursive inline
8613 function can grow into by performing recursive inlining.
8614
8615 For functions declared inline @option{--param max-inline-insns-recursive} is
8616 taken into account.  For function not declared inline, recursive inlining
8617 happens only when @option{-finline-functions} (included in @option{-O3}) is
8618 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8619 default value is 450.
8620
8621 @item max-inline-recursive-depth
8622 @itemx max-inline-recursive-depth-auto
8623 Specifies maximum recursion depth used by the recursive inlining.
8624
8625 For functions declared inline @option{--param max-inline-recursive-depth} is
8626 taken into account.  For function not declared inline, recursive inlining
8627 happens only when @option{-finline-functions} (included in @option{-O3}) is
8628 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8629 default value is 8.
8630
8631 @item min-inline-recursive-probability
8632 Recursive inlining is profitable only for function having deep recursion
8633 in average and can hurt for function having little recursion depth by
8634 increasing the prologue size or complexity of function body to other
8635 optimizers.
8636
8637 When profile feedback is available (see @option{-fprofile-generate}) the actual
8638 recursion depth can be guessed from probability that function will recurse via
8639 given call expression.  This parameter limits inlining only to call expression
8640 whose probability exceeds given threshold (in percents).  The default value is
8641 10.
8642
8643 @item early-inlining-insns
8644 Specify growth that early inliner can make.  In effect it increases amount of
8645 inlining for code having large abstraction penalty.  The default value is 10.
8646
8647 @item max-early-inliner-iterations
8648 @itemx max-early-inliner-iterations
8649 Limit of iterations of early inliner.  This basically bounds number of nested
8650 indirect calls early inliner can resolve.  Deeper chains are still handled by
8651 late inlining.
8652
8653 @item comdat-sharing-probability
8654 @itemx comdat-sharing-probability
8655 Probability (in percent) that C++ inline function with comdat visibility
8656 will be shared across multiple compilation units.  The default value is 20.
8657
8658 @item min-vect-loop-bound
8659 The minimum number of iterations under which a loop will not get vectorized
8660 when @option{-ftree-vectorize} is used.  The number of iterations after
8661 vectorization needs to be greater than the value specified by this option
8662 to allow vectorization.  The default value is 0.
8663
8664 @item gcse-cost-distance-ratio
8665 Scaling factor in calculation of maximum distance an expression
8666 can be moved by GCSE optimizations.  This is currently supported only in the
8667 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8668 will be with simple expressions, i.e., the expressions which have cost
8669 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8670 hoisting of simple expressions.  The default value is 10.
8671
8672 @item gcse-unrestricted-cost
8673 Cost, roughly measured as the cost of a single typical machine
8674 instruction, at which GCSE optimizations will not constrain
8675 the distance an expression can travel.  This is currently
8676 supported only in the code hoisting pass.  The lesser the cost,
8677 the more aggressive code hoisting will be.  Specifying 0 will
8678 allow all expressions to travel unrestricted distances.
8679 The default value is 3.
8680
8681 @item max-hoist-depth
8682 The depth of search in the dominator tree for expressions to hoist.
8683 This is used to avoid quadratic behavior in hoisting algorithm.
8684 The value of 0 will avoid limiting the search, but may slow down compilation
8685 of huge functions.  The default value is 30.
8686
8687 @item max-tail-merge-comparisons
8688 The maximum amount of similar bbs to compare a bb with.  This is used to
8689 avoid quadratic behaviour in tree tail merging.  The default value is 10.
8690
8691 @item max-tail-merge-iterations
8692 The maximum amount of iterations of the pass over the function.  This is used to
8693 limit run time in tree tail merging.  The default value is 2.
8694
8695 @item max-unrolled-insns
8696 The maximum number of instructions that a loop should have if that loop
8697 is unrolled, and if the loop is unrolled, it determines how many times
8698 the loop code is unrolled.
8699
8700 @item max-average-unrolled-insns
8701 The maximum number of instructions biased by probabilities of their execution
8702 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8703 it determines how many times the loop code is unrolled.
8704
8705 @item max-unroll-times
8706 The maximum number of unrollings of a single loop.
8707
8708 @item max-peeled-insns
8709 The maximum number of instructions that a loop should have if that loop
8710 is peeled, and if the loop is peeled, it determines how many times
8711 the loop code is peeled.
8712
8713 @item max-peel-times
8714 The maximum number of peelings of a single loop.
8715
8716 @item max-completely-peeled-insns
8717 The maximum number of insns of a completely peeled loop.
8718
8719 @item max-completely-peel-times
8720 The maximum number of iterations of a loop to be suitable for complete peeling.
8721
8722 @item max-completely-peel-loop-nest-depth
8723 The maximum depth of a loop nest suitable for complete peeling.
8724
8725 @item max-unswitch-insns
8726 The maximum number of insns of an unswitched loop.
8727
8728 @item max-unswitch-level
8729 The maximum number of branches unswitched in a single loop.
8730
8731 @item lim-expensive
8732 The minimum cost of an expensive expression in the loop invariant motion.
8733
8734 @item iv-consider-all-candidates-bound
8735 Bound on number of candidates for induction variables below that
8736 all candidates are considered for each use in induction variable
8737 optimizations.  Only the most relevant candidates are considered
8738 if there are more candidates, to avoid quadratic time complexity.
8739
8740 @item iv-max-considered-uses
8741 The induction variable optimizations give up on loops that contain more
8742 induction variable uses.
8743
8744 @item iv-always-prune-cand-set-bound
8745 If number of candidates in the set is smaller than this value,
8746 we always try to remove unnecessary ivs from the set during its
8747 optimization when a new iv is added to the set.
8748
8749 @item scev-max-expr-size
8750 Bound on size of expressions used in the scalar evolutions analyzer.
8751 Large expressions slow the analyzer.
8752
8753 @item scev-max-expr-complexity
8754 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8755 Complex expressions slow the analyzer.
8756
8757 @item omega-max-vars
8758 The maximum number of variables in an Omega constraint system.
8759 The default value is 128.
8760
8761 @item omega-max-geqs
8762 The maximum number of inequalities in an Omega constraint system.
8763 The default value is 256.
8764
8765 @item omega-max-eqs
8766 The maximum number of equalities in an Omega constraint system.
8767 The default value is 128.
8768
8769 @item omega-max-wild-cards
8770 The maximum number of wildcard variables that the Omega solver will
8771 be able to insert.  The default value is 18.
8772
8773 @item omega-hash-table-size
8774 The size of the hash table in the Omega solver.  The default value is
8775 550.
8776
8777 @item omega-max-keys
8778 The maximal number of keys used by the Omega solver.  The default
8779 value is 500.
8780
8781 @item omega-eliminate-redundant-constraints
8782 When set to 1, use expensive methods to eliminate all redundant
8783 constraints.  The default value is 0.
8784
8785 @item vect-max-version-for-alignment-checks
8786 The maximum number of runtime checks that can be performed when
8787 doing loop versioning for alignment in the vectorizer.  See option
8788 ftree-vect-loop-version for more information.
8789
8790 @item vect-max-version-for-alias-checks
8791 The maximum number of runtime checks that can be performed when
8792 doing loop versioning for alias in the vectorizer.  See option
8793 ftree-vect-loop-version for more information.
8794
8795 @item max-iterations-to-track
8796
8797 The maximum number of iterations of a loop the brute force algorithm
8798 for analysis of # of iterations of the loop tries to evaluate.
8799
8800 @item hot-bb-count-fraction
8801 Select fraction of the maximal count of repetitions of basic block in program
8802 given basic block needs to have to be considered hot.
8803
8804 @item hot-bb-frequency-fraction
8805 Select fraction of the entry block frequency of executions of basic block in
8806 function given basic block needs to have to be considered hot.
8807
8808 @item max-predicted-iterations
8809 The maximum number of loop iterations we predict statically.  This is useful
8810 in cases where function contain single loop with known bound and other loop
8811 with unknown.  We predict the known number of iterations correctly, while
8812 the unknown number of iterations average to roughly 10.  This means that the
8813 loop without bounds would appear artificially cold relative to the other one.
8814
8815 @item align-threshold
8816
8817 Select fraction of the maximal frequency of executions of basic block in
8818 function given basic block will get aligned.
8819
8820 @item align-loop-iterations
8821
8822 A loop expected to iterate at lest the selected number of iterations will get
8823 aligned.
8824
8825 @item tracer-dynamic-coverage
8826 @itemx tracer-dynamic-coverage-feedback
8827
8828 This value is used to limit superblock formation once the given percentage of
8829 executed instructions is covered.  This limits unnecessary code size
8830 expansion.
8831
8832 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8833 feedback is available.  The real profiles (as opposed to statically estimated
8834 ones) are much less balanced allowing the threshold to be larger value.
8835
8836 @item tracer-max-code-growth
8837 Stop tail duplication once code growth has reached given percentage.  This is
8838 rather hokey argument, as most of the duplicates will be eliminated later in
8839 cross jumping, so it may be set to much higher values than is the desired code
8840 growth.
8841
8842 @item tracer-min-branch-ratio
8843
8844 Stop reverse growth when the reverse probability of best edge is less than this
8845 threshold (in percent).
8846
8847 @item tracer-min-branch-ratio
8848 @itemx tracer-min-branch-ratio-feedback
8849
8850 Stop forward growth if the best edge do have probability lower than this
8851 threshold.
8852
8853 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8854 compilation for profile feedback and one for compilation without.  The value
8855 for compilation with profile feedback needs to be more conservative (higher) in
8856 order to make tracer effective.
8857
8858 @item max-cse-path-length
8859
8860 Maximum number of basic blocks on path that cse considers.  The default is 10.
8861
8862 @item max-cse-insns
8863 The maximum instructions CSE process before flushing. The default is 1000.
8864
8865 @item ggc-min-expand
8866
8867 GCC uses a garbage collector to manage its own memory allocation.  This
8868 parameter specifies the minimum percentage by which the garbage
8869 collector's heap should be allowed to expand between collections.
8870 Tuning this may improve compilation speed; it has no effect on code
8871 generation.
8872
8873 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8874 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8875 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8876 GCC is not able to calculate RAM on a particular platform, the lower
8877 bound of 30% is used.  Setting this parameter and
8878 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8879 every opportunity.  This is extremely slow, but can be useful for
8880 debugging.
8881
8882 @item ggc-min-heapsize
8883
8884 Minimum size of the garbage collector's heap before it begins bothering
8885 to collect garbage.  The first collection occurs after the heap expands
8886 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8887 tuning this may improve compilation speed, and has no effect on code
8888 generation.
8889
8890 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8891 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8892 with a lower bound of 4096 (four megabytes) and an upper bound of
8893 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8894 particular platform, the lower bound is used.  Setting this parameter
8895 very large effectively disables garbage collection.  Setting this
8896 parameter and @option{ggc-min-expand} to zero causes a full collection
8897 to occur at every opportunity.
8898
8899 @item max-reload-search-insns
8900 The maximum number of instruction reload should look backward for equivalent
8901 register.  Increasing values mean more aggressive optimization, making the
8902 compile time increase with probably slightly better performance.  The default
8903 value is 100.
8904
8905 @item max-cselib-memory-locations
8906 The maximum number of memory locations cselib should take into account.
8907 Increasing values mean more aggressive optimization, making the compile time
8908 increase with probably slightly better performance.  The default value is 500.
8909
8910 @item reorder-blocks-duplicate
8911 @itemx reorder-blocks-duplicate-feedback
8912
8913 Used by basic block reordering pass to decide whether to use unconditional
8914 branch or duplicate the code on its destination.  Code is duplicated when its
8915 estimated size is smaller than this value multiplied by the estimated size of
8916 unconditional jump in the hot spots of the program.
8917
8918 The @option{reorder-block-duplicate-feedback} is used only when profile
8919 feedback is available and may be set to higher values than
8920 @option{reorder-block-duplicate} since information about the hot spots is more
8921 accurate.
8922
8923 @item max-sched-ready-insns
8924 The maximum number of instructions ready to be issued the scheduler should
8925 consider at any given time during the first scheduling pass.  Increasing
8926 values mean more thorough searches, making the compilation time increase
8927 with probably little benefit.  The default value is 100.
8928
8929 @item max-sched-region-blocks
8930 The maximum number of blocks in a region to be considered for
8931 interblock scheduling.  The default value is 10.
8932
8933 @item max-pipeline-region-blocks
8934 The maximum number of blocks in a region to be considered for
8935 pipelining in the selective scheduler.  The default value is 15.
8936
8937 @item max-sched-region-insns
8938 The maximum number of insns in a region to be considered for
8939 interblock scheduling.  The default value is 100.
8940
8941 @item max-pipeline-region-insns
8942 The maximum number of insns in a region to be considered for
8943 pipelining in the selective scheduler.  The default value is 200.
8944
8945 @item min-spec-prob
8946 The minimum probability (in percents) of reaching a source block
8947 for interblock speculative scheduling.  The default value is 40.
8948
8949 @item max-sched-extend-regions-iters
8950 The maximum number of iterations through CFG to extend regions.
8951 0 - disable region extension,
8952 N - do at most N iterations.
8953 The default value is 0.
8954
8955 @item max-sched-insn-conflict-delay
8956 The maximum conflict delay for an insn to be considered for speculative motion.
8957 The default value is 3.
8958
8959 @item sched-spec-prob-cutoff
8960 The minimal probability of speculation success (in percents), so that
8961 speculative insn will be scheduled.
8962 The default value is 40.
8963
8964 @item sched-mem-true-dep-cost
8965 Minimal distance (in CPU cycles) between store and load targeting same
8966 memory locations.  The default value is 1.
8967
8968 @item selsched-max-lookahead
8969 The maximum size of the lookahead window of selective scheduling.  It is a
8970 depth of search for available instructions.
8971 The default value is 50.
8972
8973 @item selsched-max-sched-times
8974 The maximum number of times that an instruction will be scheduled during
8975 selective scheduling.  This is the limit on the number of iterations
8976 through which the instruction may be pipelined.  The default value is 2.
8977
8978 @item selsched-max-insns-to-rename
8979 The maximum number of best instructions in the ready list that are considered
8980 for renaming in the selective scheduler.  The default value is 2.
8981
8982 @item sms-min-sc
8983 The minimum value of stage count that swing modulo scheduler will
8984 generate.  The default value is 2.
8985
8986 @item max-last-value-rtl
8987 The maximum size measured as number of RTLs that can be recorded in an expression
8988 in combiner for a pseudo register as last known value of that register.  The default
8989 is 10000.
8990
8991 @item integer-share-limit
8992 Small integer constants can use a shared data structure, reducing the
8993 compiler's memory usage and increasing its speed.  This sets the maximum
8994 value of a shared integer constant.  The default value is 256.
8995
8996 @item min-virtual-mappings
8997 Specifies the minimum number of virtual mappings in the incremental
8998 SSA updater that should be registered to trigger the virtual mappings
8999 heuristic defined by virtual-mappings-ratio.  The default value is
9000 100.
9001
9002 @item virtual-mappings-ratio
9003 If the number of virtual mappings is virtual-mappings-ratio bigger
9004 than the number of virtual symbols to be updated, then the incremental
9005 SSA updater switches to a full update for those symbols.  The default
9006 ratio is 3.
9007
9008 @item ssp-buffer-size
9009 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
9010 protection when @option{-fstack-protection} is used.
9011
9012 @item max-jump-thread-duplication-stmts
9013 Maximum number of statements allowed in a block that needs to be
9014 duplicated when threading jumps.
9015
9016 @item max-fields-for-field-sensitive
9017 Maximum number of fields in a structure we will treat in
9018 a field sensitive manner during pointer analysis.  The default is zero
9019 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
9020
9021 @item prefetch-latency
9022 Estimate on average number of instructions that are executed before
9023 prefetch finishes.  The distance we prefetch ahead is proportional
9024 to this constant.  Increasing this number may also lead to less
9025 streams being prefetched (see @option{simultaneous-prefetches}).
9026
9027 @item simultaneous-prefetches
9028 Maximum number of prefetches that can run at the same time.
9029
9030 @item l1-cache-line-size
9031 The size of cache line in L1 cache, in bytes.
9032
9033 @item l1-cache-size
9034 The size of L1 cache, in kilobytes.
9035
9036 @item l2-cache-size
9037 The size of L2 cache, in kilobytes.
9038
9039 @item min-insn-to-prefetch-ratio
9040 The minimum ratio between the number of instructions and the
9041 number of prefetches to enable prefetching in a loop.
9042
9043 @item prefetch-min-insn-to-mem-ratio
9044 The minimum ratio between the number of instructions and the
9045 number of memory references to enable prefetching in a loop.
9046
9047 @item use-canonical-types
9048 Whether the compiler should use the ``canonical'' type system.  By
9049 default, this should always be 1, which uses a more efficient internal
9050 mechanism for comparing types in C++ and Objective-C++.  However, if
9051 bugs in the canonical type system are causing compilation failures,
9052 set this value to 0 to disable canonical types.
9053
9054 @item switch-conversion-max-branch-ratio
9055 Switch initialization conversion will refuse to create arrays that are
9056 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9057 branches in the switch.
9058
9059 @item max-partial-antic-length
9060 Maximum length of the partial antic set computed during the tree
9061 partial redundancy elimination optimization (@option{-ftree-pre}) when
9062 optimizing at @option{-O3} and above.  For some sorts of source code
9063 the enhanced partial redundancy elimination optimization can run away,
9064 consuming all of the memory available on the host machine.  This
9065 parameter sets a limit on the length of the sets that are computed,
9066 which prevents the runaway behavior.  Setting a value of 0 for
9067 this parameter will allow an unlimited set length.
9068
9069 @item sccvn-max-scc-size
9070 Maximum size of a strongly connected component (SCC) during SCCVN
9071 processing.  If this limit is hit, SCCVN processing for the whole
9072 function will not be done and optimizations depending on it will
9073 be disabled.  The default maximum SCC size is 10000.
9074
9075 @item ira-max-loops-num
9076 IRA uses a regional register allocation by default.  If a function
9077 contains loops more than number given by the parameter, only at most
9078 given number of the most frequently executed loops will form regions
9079 for the regional register allocation.  The default value of the
9080 parameter is 100.
9081
9082 @item ira-max-conflict-table-size
9083 Although IRA uses a sophisticated algorithm of compression conflict
9084 table, the table can be still big for huge functions.  If the conflict
9085 table for a function could be more than size in MB given by the
9086 parameter, the conflict table is not built and faster, simpler, and
9087 lower quality register allocation algorithm will be used.  The
9088 algorithm do not use pseudo-register conflicts.  The default value of
9089 the parameter is 2000.
9090
9091 @item ira-loop-reserved-regs
9092 IRA can be used to evaluate more accurate register pressure in loops
9093 for decision to move loop invariants (see @option{-O3}).  The number
9094 of available registers reserved for some other purposes is described
9095 by this parameter.  The default value of the parameter is 2 which is
9096 minimal number of registers needed for execution of typical
9097 instruction.  This value is the best found from numerous experiments.
9098
9099 @item loop-invariant-max-bbs-in-loop
9100 Loop invariant motion can be very expensive, both in compile time and
9101 in amount of needed compile time memory, with very large loops.  Loops
9102 with more basic blocks than this parameter won't have loop invariant
9103 motion optimization performed on them.  The default value of the
9104 parameter is 1000 for -O1 and 10000 for -O2 and above.
9105
9106 @item max-vartrack-size
9107 Sets a maximum number of hash table slots to use during variable
9108 tracking dataflow analysis of any function.  If this limit is exceeded
9109 with variable tracking at assignments enabled, analysis for that
9110 function is retried without it, after removing all debug insns from
9111 the function.  If the limit is exceeded even without debug insns, var
9112 tracking analysis is completely disabled for the function.  Setting
9113 the parameter to zero makes it unlimited.
9114
9115 @item max-vartrack-expr-depth
9116 Sets a maximum number of recursion levels when attempting to map
9117 variable names or debug temporaries to value expressions.  This trades
9118 compile time for more complete debug information.  If this is set too
9119 low, value expressions that are available and could be represented in
9120 debug information may end up not being used; setting this higher may
9121 enable the compiler to find more complex debug expressions, but compile
9122 time and memory use may grow.  The default is 12.
9123
9124 @item min-nondebug-insn-uid
9125 Use uids starting at this parameter for nondebug insns.  The range below
9126 the parameter is reserved exclusively for debug insns created by
9127 @option{-fvar-tracking-assignments}, but debug insns may get
9128 (non-overlapping) uids above it if the reserved range is exhausted.
9129
9130 @item ipa-sra-ptr-growth-factor
9131 IPA-SRA will replace a pointer to an aggregate with one or more new
9132 parameters only when their cumulative size is less or equal to
9133 @option{ipa-sra-ptr-growth-factor} times the size of the original
9134 pointer parameter.
9135
9136 @item tm-max-aggregate-size
9137 When making copies of thread-local variables in a transaction, this
9138 parameter specifies the size in bytes after which variables will be
9139 saved with the logging functions as opposed to save/restore code
9140 sequence pairs.  This option only applies when using
9141 @option{-fgnu-tm}.
9142
9143 @item graphite-max-nb-scop-params
9144 To avoid exponential effects in the Graphite loop transforms, the
9145 number of parameters in a Static Control Part (SCoP) is bounded.  The
9146 default value is 10 parameters.  A variable whose value is unknown at
9147 compile time and defined outside a SCoP is a parameter of the SCoP.
9148
9149 @item graphite-max-bbs-per-function
9150 To avoid exponential effects in the detection of SCoPs, the size of
9151 the functions analyzed by Graphite is bounded.  The default value is
9152 100 basic blocks.
9153
9154 @item loop-block-tile-size
9155 Loop blocking or strip mining transforms, enabled with
9156 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9157 loop in the loop nest by a given number of iterations.  The strip
9158 length can be changed using the @option{loop-block-tile-size}
9159 parameter.  The default value is 51 iterations.
9160
9161 @item ipa-cp-value-list-size
9162 IPA-CP attempts to track all possible values and types passed to a function's
9163 parameter in order to propagate them and perform devirtualization.
9164 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9165 stores per one formal parameter of a function.
9166
9167 @item lto-partitions
9168 Specify desired number of partitions produced during WHOPR compilation.
9169 The number of partitions should exceed the number of CPUs used for compilation.
9170 The default value is 32.
9171
9172 @item lto-minpartition
9173 Size of minimal partition for WHOPR (in estimated instructions).
9174 This prevents expenses of splitting very small programs into too many
9175 partitions.
9176
9177 @item cxx-max-namespaces-for-diagnostic-help
9178 The maximum number of namespaces to consult for suggestions when C++
9179 name lookup fails for an identifier.  The default is 1000.
9180
9181 @item sink-frequency-threshold
9182 The maximum relative execution frequency (in percents) of the target block
9183 relative to a statement's original block to allow statement sinking of a
9184 statement.  Larger numbers result in more aggressive statement sinking.
9185 The default value is 75.  A small positive adjustment is applied for
9186 statements with memory operands as those are even more profitable so sink.
9187
9188 @item max-stores-to-sink
9189 The maximum number of conditional stores paires that can be sunk.  Set to 0
9190 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9191 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9192
9193 @item allow-load-data-races
9194 Allow optimizers to introduce new data races on loads.
9195 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9196 unless implicitly set by the @option{-fmemory-model=} option.
9197
9198 @item allow-store-data-races
9199 Allow optimizers to introduce new data races on stores.
9200 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9201 unless implicitly set by the @option{-fmemory-model=} option.
9202
9203 @item allow-packed-load-data-races
9204 Allow optimizers to introduce new data races on packed data loads.
9205 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9206 unless implicitly set by the @option{-fmemory-model=} option.
9207
9208 @item allow-packed-store-data-races
9209 Allow optimizers to introduce new data races on packed data stores.
9210 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9211 unless implicitly set by the @option{-fmemory-model=} option.
9212
9213 @item case-values-threshold
9214 The smallest number of different values for which it is best to use a
9215 jump-table instead of a tree of conditional branches.  If the value is
9216 0, use the default for the machine.  The default is 0.
9217
9218 @item tree-reassoc-width
9219 Set the maximum number of instructions executed in parallel in
9220 reassociated tree. This parameter overrides target dependent
9221 heuristics used by default if has non zero value.
9222
9223 @end table
9224 @end table
9225
9226 @node Preprocessor Options
9227 @section Options Controlling the Preprocessor
9228 @cindex preprocessor options
9229 @cindex options, preprocessor
9230
9231 These options control the C preprocessor, which is run on each C source
9232 file before actual compilation.
9233
9234 If you use the @option{-E} option, nothing is done except preprocessing.
9235 Some of these options make sense only together with @option{-E} because
9236 they cause the preprocessor output to be unsuitable for actual
9237 compilation.
9238
9239 @table @gcctabopt
9240 @item -Wp,@var{option}
9241 @opindex Wp
9242 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9243 and pass @var{option} directly through to the preprocessor.  If
9244 @var{option} contains commas, it is split into multiple options at the
9245 commas.  However, many options are modified, translated or interpreted
9246 by the compiler driver before being passed to the preprocessor, and
9247 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9248 interface is undocumented and subject to change, so whenever possible
9249 you should avoid using @option{-Wp} and let the driver handle the
9250 options instead.
9251
9252 @item -Xpreprocessor @var{option}
9253 @opindex Xpreprocessor
9254 Pass @var{option} as an option to the preprocessor.  You can use this to
9255 supply system-specific preprocessor options which GCC does not know how to
9256 recognize.
9257
9258 If you want to pass an option that takes an argument, you must use
9259 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9260 @end table
9261
9262 @include cppopts.texi
9263
9264 @node Assembler Options
9265 @section Passing Options to the Assembler
9266
9267 @c prevent bad page break with this line
9268 You can pass options to the assembler.
9269
9270 @table @gcctabopt
9271 @item -Wa,@var{option}
9272 @opindex Wa
9273 Pass @var{option} as an option to the assembler.  If @var{option}
9274 contains commas, it is split into multiple options at the commas.
9275
9276 @item -Xassembler @var{option}
9277 @opindex Xassembler
9278 Pass @var{option} as an option to the assembler.  You can use this to
9279 supply system-specific assembler options which GCC does not know how to
9280 recognize.
9281
9282 If you want to pass an option that takes an argument, you must use
9283 @option{-Xassembler} twice, once for the option and once for the argument.
9284
9285 @end table
9286
9287 @node Link Options
9288 @section Options for Linking
9289 @cindex link options
9290 @cindex options, linking
9291
9292 These options come into play when the compiler links object files into
9293 an executable output file.  They are meaningless if the compiler is
9294 not doing a link step.
9295
9296 @table @gcctabopt
9297 @cindex file names
9298 @item @var{object-file-name}
9299 A file name that does not end in a special recognized suffix is
9300 considered to name an object file or library.  (Object files are
9301 distinguished from libraries by the linker according to the file
9302 contents.)  If linking is done, these object files are used as input
9303 to the linker.
9304
9305 @item -c
9306 @itemx -S
9307 @itemx -E
9308 @opindex c
9309 @opindex S
9310 @opindex E
9311 If any of these options is used, then the linker is not run, and
9312 object file names should not be used as arguments.  @xref{Overall
9313 Options}.
9314
9315 @cindex Libraries
9316 @item -l@var{library}
9317 @itemx -l @var{library}
9318 @opindex l
9319 Search the library named @var{library} when linking.  (The second
9320 alternative with the library as a separate argument is only for
9321 POSIX compliance and is not recommended.)
9322
9323 It makes a difference where in the command you write this option; the
9324 linker searches and processes libraries and object files in the order they
9325 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9326 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9327 to functions in @samp{z}, those functions may not be loaded.
9328
9329 The linker searches a standard list of directories for the library,
9330 which is actually a file named @file{lib@var{library}.a}.  The linker
9331 then uses this file as if it had been specified precisely by name.
9332
9333 The directories searched include several standard system directories
9334 plus any that you specify with @option{-L}.
9335
9336 Normally the files found this way are library files---archive files
9337 whose members are object files.  The linker handles an archive file by
9338 scanning through it for members which define symbols that have so far
9339 been referenced but not defined.  But if the file that is found is an
9340 ordinary object file, it is linked in the usual fashion.  The only
9341 difference between using an @option{-l} option and specifying a file name
9342 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9343 and searches several directories.
9344
9345 @item -lobjc
9346 @opindex lobjc
9347 You need this special case of the @option{-l} option in order to
9348 link an Objective-C or Objective-C++ program.
9349
9350 @item -nostartfiles
9351 @opindex nostartfiles
9352 Do not use the standard system startup files when linking.
9353 The standard system libraries are used normally, unless @option{-nostdlib}
9354 or @option{-nodefaultlibs} is used.
9355
9356 @item -nodefaultlibs
9357 @opindex nodefaultlibs
9358 Do not use the standard system libraries when linking.
9359 Only the libraries you specify will be passed to the linker, options
9360 specifying linkage of the system libraries, such as @code{-static-libgcc}
9361 or @code{-shared-libgcc}, will be ignored.
9362 The standard startup files are used normally, unless @option{-nostartfiles}
9363 is used.  The compiler may generate calls to @code{memcmp},
9364 @code{memset}, @code{memcpy} and @code{memmove}.
9365 These entries are usually resolved by entries in
9366 libc.  These entry points should be supplied through some other
9367 mechanism when this option is specified.
9368
9369 @item -nostdlib
9370 @opindex nostdlib
9371 Do not use the standard system startup files or libraries when linking.
9372 No startup files and only the libraries you specify will be passed to
9373 the linker, options specifying linkage of the system libraries, such as
9374 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
9375 The compiler may generate calls to @code{memcmp}, @code{memset},
9376 @code{memcpy} and @code{memmove}.
9377 These entries are usually resolved by entries in
9378 libc.  These entry points should be supplied through some other
9379 mechanism when this option is specified.
9380
9381 @cindex @option{-lgcc}, use with @option{-nostdlib}
9382 @cindex @option{-nostdlib} and unresolved references
9383 @cindex unresolved references and @option{-nostdlib}
9384 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9385 @cindex @option{-nodefaultlibs} and unresolved references
9386 @cindex unresolved references and @option{-nodefaultlibs}
9387 One of the standard libraries bypassed by @option{-nostdlib} and
9388 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9389 that GCC uses to overcome shortcomings of particular machines, or special
9390 needs for some languages.
9391 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9392 Collection (GCC) Internals},
9393 for more discussion of @file{libgcc.a}.)
9394 In most cases, you need @file{libgcc.a} even when you want to avoid
9395 other standard libraries.  In other words, when you specify @option{-nostdlib}
9396 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9397 This ensures that you have no unresolved references to internal GCC
9398 library subroutines.  (For example, @samp{__main}, used to ensure C++
9399 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9400 GNU Compiler Collection (GCC) Internals}.)
9401
9402 @item -pie
9403 @opindex pie
9404 Produce a position independent executable on targets which support it.
9405 For predictable results, you must also specify the same set of options
9406 that were used to generate code (@option{-fpie}, @option{-fPIE},
9407 or model suboptions) when you specify this option.
9408
9409 @item -rdynamic
9410 @opindex rdynamic
9411 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9412 that support it. This instructs the linker to add all symbols, not
9413 only used ones, to the dynamic symbol table. This option is needed
9414 for some uses of @code{dlopen} or to allow obtaining backtraces
9415 from within a program.
9416
9417 @item -s
9418 @opindex s
9419 Remove all symbol table and relocation information from the executable.
9420
9421 @item -static
9422 @opindex static
9423 On systems that support dynamic linking, this prevents linking with the shared
9424 libraries.  On other systems, this option has no effect.
9425
9426 @item -shared
9427 @opindex shared
9428 Produce a shared object which can then be linked with other objects to
9429 form an executable.  Not all systems support this option.  For predictable
9430 results, you must also specify the same set of options that were used to
9431 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9432 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9433 needs to build supplementary stub code for constructors to work.  On
9434 multi-libbed systems, @samp{gcc -shared} must select the correct support
9435 libraries to link against.  Failing to supply the correct flags may lead
9436 to subtle defects.  Supplying them in cases where they are not necessary
9437 is innocuous.}
9438
9439 @item -shared-libgcc
9440 @itemx -static-libgcc
9441 @opindex shared-libgcc
9442 @opindex static-libgcc
9443 On systems that provide @file{libgcc} as a shared library, these options
9444 force the use of either the shared or static version respectively.
9445 If no shared version of @file{libgcc} was built when the compiler was
9446 configured, these options have no effect.
9447
9448 There are several situations in which an application should use the
9449 shared @file{libgcc} instead of the static version.  The most common
9450 of these is when the application wishes to throw and catch exceptions
9451 across different shared libraries.  In that case, each of the libraries
9452 as well as the application itself should use the shared @file{libgcc}.
9453
9454 Therefore, the G++ and GCJ drivers automatically add
9455 @option{-shared-libgcc} whenever you build a shared library or a main
9456 executable, because C++ and Java programs typically use exceptions, so
9457 this is the right thing to do.
9458
9459 If, instead, you use the GCC driver to create shared libraries, you may
9460 find that they will not always be linked with the shared @file{libgcc}.
9461 If GCC finds, at its configuration time, that you have a non-GNU linker
9462 or a GNU linker that does not support option @option{--eh-frame-hdr},
9463 it will link the shared version of @file{libgcc} into shared libraries
9464 by default.  Otherwise, it will take advantage of the linker and optimize
9465 away the linking with the shared version of @file{libgcc}, linking with
9466 the static version of libgcc by default.  This allows exceptions to
9467 propagate through such shared libraries, without incurring relocation
9468 costs at library load time.
9469
9470 However, if a library or main executable is supposed to throw or catch
9471 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9472 for the languages used in the program, or using the option
9473 @option{-shared-libgcc}, such that it is linked with the shared
9474 @file{libgcc}.
9475
9476 @item -static-libstdc++
9477 When the @command{g++} program is used to link a C++ program, it will
9478 normally automatically link against @option{libstdc++}.  If
9479 @file{libstdc++} is available as a shared library, and the
9480 @option{-static} option is not used, then this will link against the
9481 shared version of @file{libstdc++}.  That is normally fine.  However, it
9482 is sometimes useful to freeze the version of @file{libstdc++} used by
9483 the program without going all the way to a fully static link.  The
9484 @option{-static-libstdc++} option directs the @command{g++} driver to
9485 link @file{libstdc++} statically, without necessarily linking other
9486 libraries statically.
9487
9488 @item -symbolic
9489 @opindex symbolic
9490 Bind references to global symbols when building a shared object.  Warn
9491 about any unresolved references (unless overridden by the link editor
9492 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9493 this option.
9494
9495 @item -T @var{script}
9496 @opindex T
9497 @cindex linker script
9498 Use @var{script} as the linker script.  This option is supported by most
9499 systems using the GNU linker.  On some targets, such as bare-board
9500 targets without an operating system, the @option{-T} option may be required
9501 when linking to avoid references to undefined symbols.
9502
9503 @item -Xlinker @var{option}
9504 @opindex Xlinker
9505 Pass @var{option} as an option to the linker.  You can use this to
9506 supply system-specific linker options which GCC does not know how to
9507 recognize.
9508
9509 If you want to pass an option that takes a separate argument, you must use
9510 @option{-Xlinker} twice, once for the option and once for the argument.
9511 For example, to pass @option{-assert definitions}, you must write
9512 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9513 @option{-Xlinker "-assert definitions"}, because this passes the entire
9514 string as a single argument, which is not what the linker expects.
9515
9516 When using the GNU linker, it is usually more convenient to pass
9517 arguments to linker options using the @option{@var{option}=@var{value}}
9518 syntax than as separate arguments.  For example, you can specify
9519 @samp{-Xlinker -Map=output.map} rather than
9520 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9521 this syntax for command-line options.
9522
9523 @item -Wl,@var{option}
9524 @opindex Wl
9525 Pass @var{option} as an option to the linker.  If @var{option} contains
9526 commas, it is split into multiple options at the commas.  You can use this
9527 syntax to pass an argument to the option.
9528 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9529 linker.  When using the GNU linker, you can also get the same effect with
9530 @samp{-Wl,-Map=output.map}.
9531
9532 @item -u @var{symbol}
9533 @opindex u
9534 Pretend the symbol @var{symbol} is undefined, to force linking of
9535 library modules to define it.  You can use @option{-u} multiple times with
9536 different symbols to force loading of additional library modules.
9537 @end table
9538
9539 @node Directory Options
9540 @section Options for Directory Search
9541 @cindex directory options
9542 @cindex options, directory search
9543 @cindex search path
9544
9545 These options specify directories to search for header files, for
9546 libraries and for parts of the compiler:
9547
9548 @table @gcctabopt
9549 @item -I@var{dir}
9550 @opindex I
9551 Add the directory @var{dir} to the head of the list of directories to be
9552 searched for header files.  This can be used to override a system header
9553 file, substituting your own version, since these directories are
9554 searched before the system header file directories.  However, you should
9555 not use this option to add directories that contain vendor-supplied
9556 system header files (use @option{-isystem} for that).  If you use more than
9557 one @option{-I} option, the directories are scanned in left-to-right
9558 order; the standard system directories come after.
9559
9560 If a standard system include directory, or a directory specified with
9561 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9562 option will be ignored.  The directory will still be searched but as a
9563 system directory at its normal position in the system include chain.
9564 This is to ensure that GCC's procedure to fix buggy system headers and
9565 the ordering for the include_next directive are not inadvertently changed.
9566 If you really need to change the search order for system directories,
9567 use the @option{-nostdinc} and/or @option{-isystem} options.
9568
9569 @item -iplugindir=@var{dir}
9570 Set the directory to search for plugins which are passed
9571 by @option{-fplugin=@var{name}} instead of
9572 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9573 to be used by the user, but only passed by the driver.
9574
9575 @item -iquote@var{dir}
9576 @opindex iquote
9577 Add the directory @var{dir} to the head of the list of directories to
9578 be searched for header files only for the case of @samp{#include
9579 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9580 otherwise just like @option{-I}.
9581
9582 @item -L@var{dir}
9583 @opindex L
9584 Add directory @var{dir} to the list of directories to be searched
9585 for @option{-l}.
9586
9587 @item -B@var{prefix}
9588 @opindex B
9589 This option specifies where to find the executables, libraries,
9590 include files, and data files of the compiler itself.
9591
9592 The compiler driver program runs one or more of the subprograms
9593 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9594 @var{prefix} as a prefix for each program it tries to run, both with and
9595 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9596
9597 For each subprogram to be run, the compiler driver first tries the
9598 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9599 was not specified, the driver tries two standard prefixes, which are
9600 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9601 those results in a file name that is found, the unmodified program
9602 name is searched for using the directories specified in your
9603 @env{PATH} environment variable.
9604
9605 The compiler will check to see if the path provided by the @option{-B}
9606 refers to a directory, and if necessary it will add a directory
9607 separator character at the end of the path.
9608
9609 @option{-B} prefixes that effectively specify directory names also apply
9610 to libraries in the linker, because the compiler translates these
9611 options into @option{-L} options for the linker.  They also apply to
9612 includes files in the preprocessor, because the compiler translates these
9613 options into @option{-isystem} options for the preprocessor.  In this case,
9614 the compiler appends @samp{include} to the prefix.
9615
9616 The run-time support file @file{libgcc.a} can also be searched for using
9617 the @option{-B} prefix, if needed.  If it is not found there, the two
9618 standard prefixes above are tried, and that is all.  The file is left
9619 out of the link if it is not found by those means.
9620
9621 Another way to specify a prefix much like the @option{-B} prefix is to use
9622 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9623 Variables}.
9624
9625 As a special kludge, if the path provided by @option{-B} is
9626 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9627 9, then it will be replaced by @file{[dir/]include}.  This is to help
9628 with boot-strapping the compiler.
9629
9630 @item -specs=@var{file}
9631 @opindex specs
9632 Process @var{file} after the compiler reads in the standard @file{specs}
9633 file, in order to override the defaults that the @file{gcc} driver
9634 program uses when determining what switches to pass to @file{cc1},
9635 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9636 @option{-specs=@var{file}} can be specified on the command line, and they
9637 are processed in order, from left to right.
9638
9639 @item --sysroot=@var{dir}
9640 @opindex sysroot
9641 Use @var{dir} as the logical root directory for headers and libraries.
9642 For example, if the compiler would normally search for headers in
9643 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9644 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9645
9646 If you use both this option and the @option{-isysroot} option, then
9647 the @option{--sysroot} option will apply to libraries, but the
9648 @option{-isysroot} option will apply to header files.
9649
9650 The GNU linker (beginning with version 2.16) has the necessary support
9651 for this option.  If your linker does not support this option, the
9652 header file aspect of @option{--sysroot} will still work, but the
9653 library aspect will not.
9654
9655 @item -I-
9656 @opindex I-
9657 This option has been deprecated.  Please use @option{-iquote} instead for
9658 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9659 Any directories you specify with @option{-I} options before the @option{-I-}
9660 option are searched only for the case of @samp{#include "@var{file}"};
9661 they are not searched for @samp{#include <@var{file}>}.
9662
9663 If additional directories are specified with @option{-I} options after
9664 the @option{-I-}, these directories are searched for all @samp{#include}
9665 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9666 this way.)
9667
9668 In addition, the @option{-I-} option inhibits the use of the current
9669 directory (where the current input file came from) as the first search
9670 directory for @samp{#include "@var{file}"}.  There is no way to
9671 override this effect of @option{-I-}.  With @option{-I.} you can specify
9672 searching the directory which was current when the compiler was
9673 invoked.  That is not exactly the same as what the preprocessor does
9674 by default, but it is often satisfactory.
9675
9676 @option{-I-} does not inhibit the use of the standard system directories
9677 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9678 independent.
9679 @end table
9680
9681 @c man end
9682
9683 @node Spec Files
9684 @section Specifying subprocesses and the switches to pass to them
9685 @cindex Spec Files
9686
9687 @command{gcc} is a driver program.  It performs its job by invoking a
9688 sequence of other programs to do the work of compiling, assembling and
9689 linking.  GCC interprets its command-line parameters and uses these to
9690 deduce which programs it should invoke, and which command-line options
9691 it ought to place on their command lines.  This behavior is controlled
9692 by @dfn{spec strings}.  In most cases there is one spec string for each
9693 program that GCC can invoke, but a few programs have multiple spec
9694 strings to control their behavior.  The spec strings built into GCC can
9695 be overridden by using the @option{-specs=} command-line switch to specify
9696 a spec file.
9697
9698 @dfn{Spec files} are plaintext files that are used to construct spec
9699 strings.  They consist of a sequence of directives separated by blank
9700 lines.  The type of directive is determined by the first non-whitespace
9701 character on the line and it can be one of the following:
9702
9703 @table @code
9704 @item %@var{command}
9705 Issues a @var{command} to the spec file processor.  The commands that can
9706 appear here are:
9707
9708 @table @code
9709 @item %include <@var{file}>
9710 @cindex @code{%include}
9711 Search for @var{file} and insert its text at the current point in the
9712 specs file.
9713
9714 @item %include_noerr <@var{file}>
9715 @cindex @code{%include_noerr}
9716 Just like @samp{%include}, but do not generate an error message if the include
9717 file cannot be found.
9718
9719 @item %rename @var{old_name} @var{new_name}
9720 @cindex @code{%rename}
9721 Rename the spec string @var{old_name} to @var{new_name}.
9722
9723 @end table
9724
9725 @item *[@var{spec_name}]:
9726 This tells the compiler to create, override or delete the named spec
9727 string.  All lines after this directive up to the next directive or
9728 blank line are considered to be the text for the spec string.  If this
9729 results in an empty string then the spec will be deleted.  (Or, if the
9730 spec did not exist, then nothing will happen.)  Otherwise, if the spec
9731 does not currently exist a new spec will be created.  If the spec does
9732 exist then its contents will be overridden by the text of this
9733 directive, unless the first character of that text is the @samp{+}
9734 character, in which case the text will be appended to the spec.
9735
9736 @item [@var{suffix}]:
9737 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9738 and up to the next directive or blank line are considered to make up the
9739 spec string for the indicated suffix.  When the compiler encounters an
9740 input file with the named suffix, it will processes the spec string in
9741 order to work out how to compile that file.  For example:
9742
9743 @smallexample
9744 .ZZ:
9745 z-compile -input %i
9746 @end smallexample
9747
9748 This says that any input file whose name ends in @samp{.ZZ} should be
9749 passed to the program @samp{z-compile}, which should be invoked with the
9750 command-line switch @option{-input} and with the result of performing the
9751 @samp{%i} substitution.  (See below.)
9752
9753 As an alternative to providing a spec string, the text that follows a
9754 suffix directive can be one of the following:
9755
9756 @table @code
9757 @item @@@var{language}
9758 This says that the suffix is an alias for a known @var{language}.  This is
9759 similar to using the @option{-x} command-line switch to GCC to specify a
9760 language explicitly.  For example:
9761
9762 @smallexample
9763 .ZZ:
9764 @@c++
9765 @end smallexample
9766
9767 Says that .ZZ files are, in fact, C++ source files.
9768
9769 @item #@var{name}
9770 This causes an error messages saying:
9771
9772 @smallexample
9773 @var{name} compiler not installed on this system.
9774 @end smallexample
9775 @end table
9776
9777 GCC already has an extensive list of suffixes built into it.
9778 This directive will add an entry to the end of the list of suffixes, but
9779 since the list is searched from the end backwards, it is effectively
9780 possible to override earlier entries using this technique.
9781
9782 @end table
9783
9784 GCC has the following spec strings built into it.  Spec files can
9785 override these strings or create their own.  Note that individual
9786 targets can also add their own spec strings to this list.
9787
9788 @smallexample
9789 asm          Options to pass to the assembler
9790 asm_final    Options to pass to the assembler post-processor
9791 cpp          Options to pass to the C preprocessor
9792 cc1          Options to pass to the C compiler
9793 cc1plus      Options to pass to the C++ compiler
9794 endfile      Object files to include at the end of the link
9795 link         Options to pass to the linker
9796 lib          Libraries to include on the command line to the linker
9797 libgcc       Decides which GCC support library to pass to the linker
9798 linker       Sets the name of the linker
9799 predefines   Defines to be passed to the C preprocessor
9800 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9801              by default
9802 startfile    Object files to include at the start of the link
9803 @end smallexample
9804
9805 Here is a small example of a spec file:
9806
9807 @smallexample
9808 %rename lib                 old_lib
9809
9810 *lib:
9811 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9812 @end smallexample
9813
9814 This example renames the spec called @samp{lib} to @samp{old_lib} and
9815 then overrides the previous definition of @samp{lib} with a new one.
9816 The new definition adds in some extra command-line options before
9817 including the text of the old definition.
9818
9819 @dfn{Spec strings} are a list of command-line options to be passed to their
9820 corresponding program.  In addition, the spec strings can contain
9821 @samp{%}-prefixed sequences to substitute variable text or to
9822 conditionally insert text into the command line.  Using these constructs
9823 it is possible to generate quite complex command lines.
9824
9825 Here is a table of all defined @samp{%}-sequences for spec
9826 strings.  Note that spaces are not generated automatically around the
9827 results of expanding these sequences.  Therefore you can concatenate them
9828 together or combine them with constant text in a single argument.
9829
9830 @table @code
9831 @item %%
9832 Substitute one @samp{%} into the program name or argument.
9833
9834 @item %i
9835 Substitute the name of the input file being processed.
9836
9837 @item %b
9838 Substitute the basename of the input file being processed.
9839 This is the substring up to (and not including) the last period
9840 and not including the directory.
9841
9842 @item %B
9843 This is the same as @samp{%b}, but include the file suffix (text after
9844 the last period).
9845
9846 @item %d
9847 Marks the argument containing or following the @samp{%d} as a
9848 temporary file name, so that that file will be deleted if GCC exits
9849 successfully.  Unlike @samp{%g}, this contributes no text to the
9850 argument.
9851
9852 @item %g@var{suffix}
9853 Substitute a file name that has suffix @var{suffix} and is chosen
9854 once per compilation, and mark the argument in the same way as
9855 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9856 name is now chosen in a way that is hard to predict even when previously
9857 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9858 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9859 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9860 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9861 was simply substituted with a file name chosen once per compilation,
9862 without regard to any appended suffix (which was therefore treated
9863 just like ordinary text), making such attacks more likely to succeed.
9864
9865 @item %u@var{suffix}
9866 Like @samp{%g}, but generates a new temporary file name even if
9867 @samp{%u@var{suffix}} was already seen.
9868
9869 @item %U@var{suffix}
9870 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9871 new one if there is no such last file name.  In the absence of any
9872 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9873 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9874 would involve the generation of two distinct file names, one
9875 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9876 simply substituted with a file name chosen for the previous @samp{%u},
9877 without regard to any appended suffix.
9878
9879 @item %j@var{suffix}
9880 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9881 writable, and if save-temps is off; otherwise, substitute the name
9882 of a temporary file, just like @samp{%u}.  This temporary file is not
9883 meant for communication between processes, but rather as a junk
9884 disposal mechanism.
9885
9886 @item %|@var{suffix}
9887 @itemx %m@var{suffix}
9888 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9889 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9890 all.  These are the two most common ways to instruct a program that it
9891 should read from standard input or write to standard output.  If you
9892 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9893 construct: see for example @file{f/lang-specs.h}.
9894
9895 @item %.@var{SUFFIX}
9896 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9897 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9898 terminated by the next space or %.
9899
9900 @item %w
9901 Marks the argument containing or following the @samp{%w} as the
9902 designated output file of this compilation.  This puts the argument
9903 into the sequence of arguments that @samp{%o} will substitute later.
9904
9905 @item %o
9906 Substitutes the names of all the output files, with spaces
9907 automatically placed around them.  You should write spaces
9908 around the @samp{%o} as well or the results are undefined.
9909 @samp{%o} is for use in the specs for running the linker.
9910 Input files whose names have no recognized suffix are not compiled
9911 at all, but they are included among the output files, so they will
9912 be linked.
9913
9914 @item %O
9915 Substitutes the suffix for object files.  Note that this is
9916 handled specially when it immediately follows @samp{%g, %u, or %U},
9917 because of the need for those to form complete file names.  The
9918 handling is such that @samp{%O} is treated exactly as if it had already
9919 been substituted, except that @samp{%g, %u, and %U} do not currently
9920 support additional @var{suffix} characters following @samp{%O} as they would
9921 following, for example, @samp{.o}.
9922
9923 @item %p
9924 Substitutes the standard macro predefinitions for the
9925 current target machine.  Use this when running @code{cpp}.
9926
9927 @item %P
9928 Like @samp{%p}, but puts @samp{__} before and after the name of each
9929 predefined macro, except for macros that start with @samp{__} or with
9930 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9931 C@.
9932
9933 @item %I
9934 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9935 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9936 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9937 and @option{-imultilib} as necessary.
9938
9939 @item %s
9940 Current argument is the name of a library or startup file of some sort.
9941 Search for that file in a standard list of directories and substitute
9942 the full name found.  The current working directory is included in the
9943 list of directories scanned.
9944
9945 @item %T
9946 Current argument is the name of a linker script.  Search for that file
9947 in the current list of directories to scan for libraries. If the file
9948 is located insert a @option{--script} option into the command line
9949 followed by the full path name found.  If the file is not found then
9950 generate an error message.  Note: the current working directory is not
9951 searched.
9952
9953 @item %e@var{str}
9954 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9955 Use this when inconsistent options are detected.
9956
9957 @item %(@var{name})
9958 Substitute the contents of spec string @var{name} at this point.
9959
9960 @item %x@{@var{option}@}
9961 Accumulate an option for @samp{%X}.
9962
9963 @item %X
9964 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9965 spec string.
9966
9967 @item %Y
9968 Output the accumulated assembler options specified by @option{-Wa}.
9969
9970 @item %Z
9971 Output the accumulated preprocessor options specified by @option{-Wp}.
9972
9973 @item %a
9974 Process the @code{asm} spec.  This is used to compute the
9975 switches to be passed to the assembler.
9976
9977 @item %A
9978 Process the @code{asm_final} spec.  This is a spec string for
9979 passing switches to an assembler post-processor, if such a program is
9980 needed.
9981
9982 @item %l
9983 Process the @code{link} spec.  This is the spec for computing the
9984 command line passed to the linker.  Typically it will make use of the
9985 @samp{%L %G %S %D and %E} sequences.
9986
9987 @item %D
9988 Dump out a @option{-L} option for each directory that GCC believes might
9989 contain startup files.  If the target supports multilibs then the
9990 current multilib directory will be prepended to each of these paths.
9991
9992 @item %L
9993 Process the @code{lib} spec.  This is a spec string for deciding which
9994 libraries should be included on the command line to the linker.
9995
9996 @item %G
9997 Process the @code{libgcc} spec.  This is a spec string for deciding
9998 which GCC support library should be included on the command line to the linker.
9999
10000 @item %S
10001 Process the @code{startfile} spec.  This is a spec for deciding which
10002 object files should be the first ones passed to the linker.  Typically
10003 this might be a file named @file{crt0.o}.
10004
10005 @item %E
10006 Process the @code{endfile} spec.  This is a spec string that specifies
10007 the last object files that will be passed to the linker.
10008
10009 @item %C
10010 Process the @code{cpp} spec.  This is used to construct the arguments
10011 to be passed to the C preprocessor.
10012
10013 @item %1
10014 Process the @code{cc1} spec.  This is used to construct the options to be
10015 passed to the actual C compiler (@samp{cc1}).
10016
10017 @item %2
10018 Process the @code{cc1plus} spec.  This is used to construct the options to be
10019 passed to the actual C++ compiler (@samp{cc1plus}).
10020
10021 @item %*
10022 Substitute the variable part of a matched option.  See below.
10023 Note that each comma in the substituted string is replaced by
10024 a single space.
10025
10026 @item %<@code{S}
10027 Remove all occurrences of @code{-S} from the command line.  Note---this
10028 command is position dependent.  @samp{%} commands in the spec string
10029 before this one will see @code{-S}, @samp{%} commands in the spec string
10030 after this one will not.
10031
10032 @item %:@var{function}(@var{args})
10033 Call the named function @var{function}, passing it @var{args}.
10034 @var{args} is first processed as a nested spec string, then split
10035 into an argument vector in the usual fashion.  The function returns
10036 a string which is processed as if it had appeared literally as part
10037 of the current spec.
10038
10039 The following built-in spec functions are provided:
10040
10041 @table @code
10042 @item @code{getenv}
10043 The @code{getenv} spec function takes two arguments: an environment
10044 variable name and a string.  If the environment variable is not
10045 defined, a fatal error is issued.  Otherwise, the return value is the
10046 value of the environment variable concatenated with the string.  For
10047 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10048
10049 @smallexample
10050 %:getenv(TOPDIR /include)
10051 @end smallexample
10052
10053 expands to @file{/path/to/top/include}.
10054
10055 @item @code{if-exists}
10056 The @code{if-exists} spec function takes one argument, an absolute
10057 pathname to a file.  If the file exists, @code{if-exists} returns the
10058 pathname.  Here is a small example of its usage:
10059
10060 @smallexample
10061 *startfile:
10062 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10063 @end smallexample
10064
10065 @item @code{if-exists-else}
10066 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10067 spec function, except that it takes two arguments.  The first argument is
10068 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10069 returns the pathname.  If it does not exist, it returns the second argument.
10070 This way, @code{if-exists-else} can be used to select one file or another,
10071 based on the existence of the first.  Here is a small example of its usage:
10072
10073 @smallexample
10074 *startfile:
10075 crt0%O%s %:if-exists(crti%O%s) \
10076 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10077 @end smallexample
10078
10079 @item @code{replace-outfile}
10080 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10081 first argument in the outfiles array and replaces it with the second argument.  Here
10082 is a small example of its usage:
10083
10084 @smallexample
10085 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10086 @end smallexample
10087
10088 @item @code{remove-outfile}
10089 The @code{remove-outfile} spec function takes one argument.  It looks for the
10090 first argument in the outfiles array and removes it.  Here is a small example
10091 its usage:
10092
10093 @smallexample
10094 %:remove-outfile(-lm)
10095 @end smallexample
10096
10097 @item @code{pass-through-libs}
10098 The @code{pass-through-libs} spec function takes any number of arguments.  It
10099 finds any @option{-l} options and any non-options ending in ".a" (which it
10100 assumes are the names of linker input library archive files) and returns a
10101 result containing all the found arguments each prepended by
10102 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10103 intended to be passed to the LTO linker plugin.
10104
10105 @smallexample
10106 %:pass-through-libs(%G %L %G)
10107 @end smallexample
10108
10109 @item @code{print-asm-header}
10110 The @code{print-asm-header} function takes no arguments and simply
10111 prints a banner like:
10112
10113 @smallexample
10114 Assembler options
10115 =================
10116
10117 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10118 @end smallexample
10119
10120 It is used to separate compiler options from assembler options
10121 in the @option{--target-help} output.
10122 @end table
10123
10124 @item %@{@code{S}@}
10125 Substitutes the @code{-S} switch, if that switch was given to GCC@.
10126 If that switch was not specified, this substitutes nothing.  Note that
10127 the leading dash is omitted when specifying this option, and it is
10128 automatically inserted if the substitution is performed.  Thus the spec
10129 string @samp{%@{foo@}} would match the command-line option @option{-foo}
10130 and would output the command line option @option{-foo}.
10131
10132 @item %W@{@code{S}@}
10133 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10134 deleted on failure.
10135
10136 @item %@{@code{S}*@}
10137 Substitutes all the switches specified to GCC whose names start
10138 with @code{-S}, but which also take an argument.  This is used for
10139 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10140 GCC considers @option{-o foo} as being
10141 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
10142 text, including the space.  Thus two arguments would be generated.
10143
10144 @item %@{@code{S}*&@code{T}*@}
10145 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10146 (the order of @code{S} and @code{T} in the spec is not significant).
10147 There can be any number of ampersand-separated variables; for each the
10148 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10149
10150 @item %@{@code{S}:@code{X}@}
10151 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
10152
10153 @item %@{!@code{S}:@code{X}@}
10154 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
10155
10156 @item %@{@code{S}*:@code{X}@}
10157 Substitutes @code{X} if one or more switches whose names start with
10158 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10159 once, no matter how many such switches appeared.  However, if @code{%*}
10160 appears somewhere in @code{X}, then @code{X} will be substituted once
10161 for each matching switch, with the @code{%*} replaced by the part of
10162 that switch that matched the @code{*}.
10163
10164 @item %@{.@code{S}:@code{X}@}
10165 Substitutes @code{X}, if processing a file with suffix @code{S}.
10166
10167 @item %@{!.@code{S}:@code{X}@}
10168 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10169
10170 @item %@{,@code{S}:@code{X}@}
10171 Substitutes @code{X}, if processing a file for language @code{S}.
10172
10173 @item %@{!,@code{S}:@code{X}@}
10174 Substitutes @code{X}, if not processing a file for language @code{S}.
10175
10176 @item %@{@code{S}|@code{P}:@code{X}@}
10177 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
10178 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10179 @code{*} sequences as well, although they have a stronger binding than
10180 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10181 alternatives must be starred, and only the first matching alternative
10182 is substituted.
10183
10184 For example, a spec string like this:
10185
10186 @smallexample
10187 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10188 @end smallexample
10189
10190 will output the following command-line options from the following input
10191 command-line options:
10192
10193 @smallexample
10194 fred.c        -foo -baz
10195 jim.d         -bar -boggle
10196 -d fred.c     -foo -baz -boggle
10197 -d jim.d      -bar -baz -boggle
10198 @end smallexample
10199
10200 @item %@{S:X; T:Y; :D@}
10201
10202 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
10203 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10204 be as many clauses as you need.  This may be combined with @code{.},
10205 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10206
10207
10208 @end table
10209
10210 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10211 construct may contain other nested @samp{%} constructs or spaces, or
10212 even newlines.  They are processed as usual, as described above.
10213 Trailing white space in @code{X} is ignored.  White space may also
10214 appear anywhere on the left side of the colon in these constructs,
10215 except between @code{.} or @code{*} and the corresponding word.
10216
10217 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10218 handled specifically in these constructs.  If another value of
10219 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10220 @option{-W} switch is found later in the command line, the earlier
10221 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10222 just one letter, which passes all matching options.
10223
10224 The character @samp{|} at the beginning of the predicate text is used to
10225 indicate that a command should be piped to the following command, but
10226 only if @option{-pipe} is specified.
10227
10228 It is built into GCC which switches take arguments and which do not.
10229 (You might think it would be useful to generalize this to allow each
10230 compiler's spec to say which switches take arguments.  But this cannot
10231 be done in a consistent fashion.  GCC cannot even decide which input
10232 files have been specified without knowing which switches take arguments,
10233 and it must know which input files to compile in order to tell which
10234 compilers to run).
10235
10236 GCC also knows implicitly that arguments starting in @option{-l} are to be
10237 treated as compiler output files, and passed to the linker in their
10238 proper position among the other output files.
10239
10240 @c man begin OPTIONS
10241
10242 @node Target Options
10243 @section Specifying Target Machine and Compiler Version
10244 @cindex target options
10245 @cindex cross compiling
10246 @cindex specifying machine version
10247 @cindex specifying compiler version and target machine
10248 @cindex compiler version, specifying
10249 @cindex target machine, specifying
10250
10251 The usual way to run GCC is to run the executable called @command{gcc}, or
10252 @command{@var{machine}-gcc} when cross-compiling, or
10253 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10254 one that was installed last.
10255
10256 @node Submodel Options
10257 @section Hardware Models and Configurations
10258 @cindex submodel options
10259 @cindex specifying hardware config
10260 @cindex hardware models and configurations, specifying
10261 @cindex machine dependent options
10262
10263 Each target machine types can have its own
10264 special options, starting with @samp{-m}, to choose among various
10265 hardware models or configurations---for example, 68010 vs 68020,
10266 floating coprocessor or none.  A single installed version of the
10267 compiler can compile for any model or configuration, according to the
10268 options specified.
10269
10270 Some configurations of the compiler also support additional special
10271 options, usually for compatibility with other compilers on the same
10272 platform.
10273
10274 @c This list is ordered alphanumerically by subsection name.
10275 @c It should be the same order and spelling as these options are listed
10276 @c in Machine Dependent Options
10277
10278 @menu
10279 * Adapteva Epiphany Options::
10280 * ARM Options::
10281 * AVR Options::
10282 * Blackfin Options::
10283 * C6X Options::
10284 * CRIS Options::
10285 * Darwin Options::
10286 * DEC Alpha Options::
10287 * DEC Alpha/VMS Options::
10288 * FR30 Options::
10289 * FRV Options::
10290 * GNU/Linux Options::
10291 * H8/300 Options::
10292 * HPPA Options::
10293 * i386 and x86-64 Options::
10294 * i386 and x86-64 Windows Options::
10295 * IA-64 Options::
10296 * IA-64/VMS Options::
10297 * LM32 Options::
10298 * M32C Options::
10299 * M32R/D Options::
10300 * M680x0 Options::
10301 * MCore Options::
10302 * MeP Options::
10303 * MicroBlaze Options::
10304 * MIPS Options::
10305 * MMIX Options::
10306 * MN10300 Options::
10307 * PDP-11 Options::
10308 * picoChip Options::
10309 * PowerPC Options::
10310 * RL78 Options::
10311 * RS/6000 and PowerPC Options::
10312 * RX Options::
10313 * S/390 and zSeries Options::
10314 * Score Options::
10315 * SH Options::
10316 * Solaris 2 Options::
10317 * SPARC Options::
10318 * SPU Options::
10319 * System V Options::
10320 * V850 Options::
10321 * VAX Options::
10322 * VxWorks Options::
10323 * x86-64 Options::
10324 * Xstormy16 Options::
10325 * Xtensa Options::
10326 * zSeries Options::
10327 @end menu
10328
10329 @node Adapteva Epiphany Options
10330 @subsection Adapteva Epiphany Options
10331
10332 These @samp{-m} options are defined for Adapteva Epiphany:
10333
10334 @table @gcctabopt
10335 @item -mhalf-reg-file
10336 @opindex mhalf-reg-file
10337 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
10338 That allows code to run on hardware variants that lack these registers.
10339
10340 @item -mprefer-short-insn-regs
10341 @opindex mprefer-short-insn-regs
10342 Preferrentially allocate registers that allow short instruction generation.
10343 This can result in increasesd instruction count, so if this reduces or
10344 increases code size might vary from case to case.
10345
10346 @item -mbranch-cost=@var{num}
10347 @opindex mbranch-cost
10348 Set the cost of branches to roughly @var{num} ``simple'' instructions.
10349 This cost is only a heuristic and is not guaranteed to produce
10350 consistent results across releases.
10351
10352 @item -mcmove
10353 @opindex mcmove
10354 Enable the generation of conditional moves.
10355
10356 @item -mnops=@var{num}
10357 @opindex mnops
10358 Emit @var{num} nops before every other generated instruction.
10359
10360 @item -mno-soft-cmpsf
10361 @opindex mno-soft-cmpsf
10362 For single-precision floating point comparisons, emit an fsub instruction
10363 and test the flags.  This is faster than a software comparison, but can
10364 get incorrect results in the presence of NaNs, or when two different small
10365 numbers are compared such that their difference is calculated as zero.
10366 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
10367 software comparisons.
10368
10369 @item -mstack-offset=@var{num}
10370 @opindex mstack-offset
10371 Set the offset between the top of the stack and the stack pointer.
10372 E.g., a value of 8 means that the eight bytes in the range sp+0@dots{}sp+7
10373 can be used by leaf functions without stack allocation.
10374 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
10375 Note also that this option changes the ABI, compiling a program with a
10376 different stack offset than the libraries have been compiled with
10377 will generally not work.
10378 This option can be useful if you want to evaluate if a different stack
10379 offset would give you better code, but to actually use a different stack
10380 offset to build working programs, it is recommended to configure the
10381 toolchain with the appropriate @samp{--with-stack-offset=@var{num}} option.
10382
10383 @item -mno-round-nearest
10384 @opindex mno-round-nearest
10385 Make the scheduler assume that the rounding mode has been set to
10386 truncating.  The default is @option{-mround-nearest}.
10387
10388 @item -mlong-calls
10389 @opindex mlong-calls
10390 If not otherwise specified by an attribute, assume all calls might be beyond
10391 the offset range of the b / bl instructions, and therefore load the
10392 function address into a register before performing a (otherwise direct) call.
10393 This is the default.
10394
10395 @item -mshort-calls
10396 @opindex short-calls
10397 If not otherwise specified by an attribute, assume all direct calls are
10398 in the range of the b / bl instructions, so use these instructions
10399 for direct calls.  The default is @option{-mlong-calls}.
10400
10401 @item -msmall16
10402 @opindex msmall16
10403 Assume addresses can be loaded as 16 bit unsigned values.  This does not
10404 apply to function addresses for which @option{-mlong-calls} semantics
10405 are in effect.
10406
10407 @item -mfp-mode=@var{mode}
10408 @opindex mfp-mode
10409 Set the prevailing mode of the floating point unit.
10410 This determines the floating point mode that is provided and expected
10411 at function call and return time.  Making this mode match the mode you
10412 predominantly need at function start can make your programs smaller and
10413 faster by avoiding unnecessary mode switches.
10414
10415 @var{mode} can be set to one the following values:
10416
10417 @table @samp
10418 @item caller
10419 Any mode at function entry is valid, and retained or restored when
10420 the function returns, and when it calls other functions.
10421 This mode is useful for compiling libraries or other compilation units
10422 you might want to incorporate into different programs with different
10423 prevailing FPU modes, and the convenience of being able to use a single
10424 object file outweighs the size and speed overhead for any extra
10425 mode switching that might be needed, compared with what would be needed
10426 with a more specific choice of prevailing FPU mode.
10427
10428 @item truncate
10429 This is the mode used for floating point calculations with
10430 truncating (i.e.@: round towards zero) rounding mode.  That includes
10431 conversion from floating point to integer.
10432
10433 @item round-nearest
10434 This is the mode used for floating point calculations with
10435 round-to-nearest-or-even rounding mode.
10436
10437 @item int
10438 This is the mode used to perform integer calculations in the FPU, e.g.@:
10439 integer multiply, or integer multiply-and-accumulate.
10440 @end table
10441
10442 The default is @option{-mfp-mode=caller}
10443
10444 @item -mnosplit-lohi
10445 @opindex mnosplit-lohi
10446 @item -mno-postinc
10447 @opindex mno-postinc
10448 @item -mno-postmodify
10449 @opindex mno-postmodify
10450 Code generation tweaks that disable, respectively, splitting of 32
10451 bit loads, generation of post-increment addresses, and generation of
10452 post-modify addresses.  The defaults are @option{msplit-lohi},
10453 @option{-mpost-inc}, and @option{-mpost-modify}.
10454
10455 @item -mnovect-double
10456 @opindex mno-vect-double
10457 Change the preferred SIMD mode to SImode.  The default is
10458 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
10459
10460 @item -max-vect-align=@var{num}
10461 @opindex max-vect-align
10462 The maximum alignment for SIMD vector mode types.
10463 @var{num} may be 4 or 8.  The default is 8.
10464 Note that this is an ABI change, even though many library function
10465 interfaces will be unaffected, if they don't use SIMD vector modes
10466 in places where they affect size and/or alignment of relevant types.
10467
10468 @item -msplit-vecmove-early
10469 @opindex msplit-vecmove-early
10470 Split vector moves into single word moves before reload.  In theory this
10471 could give better register allocation, but so far the reverse seems to be
10472 generally the case.
10473
10474 @item -m1reg-@var{reg}
10475 @opindex m1reg-
10476 Specify a register to hold the constant @minus{}1, which makes loading small negative
10477 constants and certain bitmasks faster.
10478 Allowable values for reg are r43 and r63, which specify to use that register
10479 as a fixed register, and none, which means that no register is used for this
10480 purpose.  The default is @option{-m1reg-none}.
10481
10482 @end table
10483
10484 @node ARM Options
10485 @subsection ARM Options
10486 @cindex ARM options
10487
10488 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10489 architectures:
10490
10491 @table @gcctabopt
10492 @item -mabi=@var{name}
10493 @opindex mabi
10494 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10495 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10496
10497 @item -mapcs-frame
10498 @opindex mapcs-frame
10499 Generate a stack frame that is compliant with the ARM Procedure Call
10500 Standard for all functions, even if this is not strictly necessary for
10501 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10502 with this option will cause the stack frames not to be generated for
10503 leaf functions.  The default is @option{-mno-apcs-frame}.
10504
10505 @item -mapcs
10506 @opindex mapcs
10507 This is a synonym for @option{-mapcs-frame}.
10508
10509 @ignore
10510 @c not currently implemented
10511 @item -mapcs-stack-check
10512 @opindex mapcs-stack-check
10513 Generate code to check the amount of stack space available upon entry to
10514 every function (that actually uses some stack space).  If there is
10515 insufficient space available then either the function
10516 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
10517 called, depending upon the amount of stack space required.  The run time
10518 system is required to provide these functions.  The default is
10519 @option{-mno-apcs-stack-check}, since this produces smaller code.
10520
10521 @c not currently implemented
10522 @item -mapcs-float
10523 @opindex mapcs-float
10524 Pass floating point arguments using the float point registers.  This is
10525 one of the variants of the APCS@.  This option is recommended if the
10526 target hardware has a floating point unit or if a lot of floating point
10527 arithmetic is going to be performed by the code.  The default is
10528 @option{-mno-apcs-float}, since integer only code is slightly increased in
10529 size if @option{-mapcs-float} is used.
10530
10531 @c not currently implemented
10532 @item -mapcs-reentrant
10533 @opindex mapcs-reentrant
10534 Generate reentrant, position independent code.  The default is
10535 @option{-mno-apcs-reentrant}.
10536 @end ignore
10537
10538 @item -mthumb-interwork
10539 @opindex mthumb-interwork
10540 Generate code which supports calling between the ARM and Thumb
10541 instruction sets.  Without this option, on pre-v5 architectures, the
10542 two instruction sets cannot be reliably used inside one program.  The
10543 default is @option{-mno-thumb-interwork}, since slightly larger code
10544 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
10545 configurations this option is meaningless.
10546
10547 @item -mno-sched-prolog
10548 @opindex mno-sched-prolog
10549 Prevent the reordering of instructions in the function prolog, or the
10550 merging of those instruction with the instructions in the function's
10551 body.  This means that all functions will start with a recognizable set
10552 of instructions (or in fact one of a choice from a small set of
10553 different function prologues), and this information can be used to
10554 locate the start if functions inside an executable piece of code.  The
10555 default is @option{-msched-prolog}.
10556
10557 @item -mfloat-abi=@var{name}
10558 @opindex mfloat-abi
10559 Specifies which floating-point ABI to use.  Permissible values
10560 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10561
10562 Specifying @samp{soft} causes GCC to generate output containing
10563 library calls for floating-point operations.
10564 @samp{softfp} allows the generation of code using hardware floating-point
10565 instructions, but still uses the soft-float calling conventions.
10566 @samp{hard} allows generation of floating-point instructions
10567 and uses FPU-specific calling conventions.
10568
10569 The default depends on the specific target configuration.  Note that
10570 the hard-float and soft-float ABIs are not link-compatible; you must
10571 compile your entire program with the same ABI, and link with a
10572 compatible set of libraries.
10573
10574 @item -mlittle-endian
10575 @opindex mlittle-endian
10576 Generate code for a processor running in little-endian mode.  This is
10577 the default for all standard configurations.
10578
10579 @item -mbig-endian
10580 @opindex mbig-endian
10581 Generate code for a processor running in big-endian mode; the default is
10582 to compile code for a little-endian processor.
10583
10584 @item -mwords-little-endian
10585 @opindex mwords-little-endian
10586 This option only applies when generating code for big-endian processors.
10587 Generate code for a little-endian word order but a big-endian byte
10588 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10589 option should only be used if you require compatibility with code for
10590 big-endian ARM processors generated by versions of the compiler prior to
10591 2.8.  This option is now deprecated.
10592
10593 @item -mcpu=@var{name}
10594 @opindex mcpu
10595 This specifies the name of the target ARM processor.  GCC uses this name
10596 to determine what kind of instructions it can emit when generating
10597 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10598 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10599 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10600 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10601 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10602 @samp{arm720},
10603 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10604 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10605 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10606 @samp{strongarm1110},
10607 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10608 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10609 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10610 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10611 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10612 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10613 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10614 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
10615 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
10616 @samp{cortex-m4}, @samp{cortex-m3},
10617 @samp{cortex-m1},
10618 @samp{cortex-m0},
10619 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
10620 @samp{fa526}, @samp{fa626},
10621 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
10622
10623
10624 @option{-mcpu=generic-@var{arch}} is also permissible, and is
10625 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
10626 See @option{-mtune} for more information.
10627
10628 @option{-mcpu=native} causes the compiler to auto-detect the CPU
10629 of the build computer.  At present, this feature is only supported on
10630 Linux, and not all architectures are recognised.  If the auto-detect is
10631 unsuccessful the option has no effect.
10632
10633 @item -mtune=@var{name}
10634 @opindex mtune
10635 This option is very similar to the @option{-mcpu=} option, except that
10636 instead of specifying the actual target processor type, and hence
10637 restricting which instructions can be used, it specifies that GCC should
10638 tune the performance of the code as if the target were of the type
10639 specified in this option, but still choosing the instructions that it
10640 will generate based on the CPU specified by a @option{-mcpu=} option.
10641 For some ARM implementations better performance can be obtained by using
10642 this option.
10643
10644 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
10645 performance for a blend of processors within architecture @var{arch}.
10646 The aim is to generate code that run well on the current most popular
10647 processors, balancing between optimizations that benefit some CPUs in the
10648 range, and avoiding performance pitfalls of other CPUs.  The effects of
10649 this option may change in future GCC versions as CPU models come and go.
10650
10651 @option{-mtune=native} causes the compiler to auto-detect the CPU
10652 of the build computer.  At present, this feature is only supported on
10653 Linux, and not all architectures are recognised.  If the auto-detect is
10654 unsuccessful the option has no effect.
10655
10656 @item -march=@var{name}
10657 @opindex march
10658 This specifies the name of the target ARM architecture.  GCC uses this
10659 name to determine what kind of instructions it can emit when generating
10660 assembly code.  This option can be used in conjunction with or instead
10661 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10662 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10663 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10664 @samp{armv6}, @samp{armv6j},
10665 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10666 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10667 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10668
10669 @option{-march=native} causes the compiler to auto-detect the architecture
10670 of the build computer.  At present, this feature is only supported on
10671 Linux, and not all architectures are recognised.  If the auto-detect is
10672 unsuccessful the option has no effect.
10673
10674 @item -mfpu=@var{name}
10675 @itemx -mfpe=@var{number}
10676 @itemx -mfp=@var{number}
10677 @opindex mfpu
10678 @opindex mfpe
10679 @opindex mfp
10680 This specifies what floating point hardware (or hardware emulation) is
10681 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10682 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10683 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10684 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10685 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10686 @option{-mfp} and @option{-mfpe} are synonyms for
10687 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10688 of GCC@.
10689
10690 If @option{-msoft-float} is specified this specifies the format of
10691 floating point values.
10692
10693 If the selected floating-point hardware includes the NEON extension
10694 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10695 operations will not be used by GCC's auto-vectorization pass unless
10696 @option{-funsafe-math-optimizations} is also specified.  This is
10697 because NEON hardware does not fully implement the IEEE 754 standard for
10698 floating-point arithmetic (in particular denormal values are treated as
10699 zero), so the use of NEON instructions may lead to a loss of precision.
10700
10701 @item -mfp16-format=@var{name}
10702 @opindex mfp16-format
10703 Specify the format of the @code{__fp16} half-precision floating-point type.
10704 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10705 the default is @samp{none}, in which case the @code{__fp16} type is not
10706 defined.  @xref{Half-Precision}, for more information.
10707
10708 @item -mstructure-size-boundary=@var{n}
10709 @opindex mstructure-size-boundary
10710 The size of all structures and unions will be rounded up to a multiple
10711 of the number of bits set by this option.  Permissible values are 8, 32
10712 and 64.  The default value varies for different toolchains.  For the COFF
10713 targeted toolchain the default value is 8.  A value of 64 is only allowed
10714 if the underlying ABI supports it.
10715
10716 Specifying the larger number can produce faster, more efficient code, but
10717 can also increase the size of the program.  Different values are potentially
10718 incompatible.  Code compiled with one value cannot necessarily expect to
10719 work with code or libraries compiled with another value, if they exchange
10720 information using structures or unions.
10721
10722 @item -mabort-on-noreturn
10723 @opindex mabort-on-noreturn
10724 Generate a call to the function @code{abort} at the end of a
10725 @code{noreturn} function.  It will be executed if the function tries to
10726 return.
10727
10728 @item -mlong-calls
10729 @itemx -mno-long-calls
10730 @opindex mlong-calls
10731 @opindex mno-long-calls
10732 Tells the compiler to perform function calls by first loading the
10733 address of the function into a register and then performing a subroutine
10734 call on this register.  This switch is needed if the target function
10735 will lie outside of the 64 megabyte addressing range of the offset based
10736 version of subroutine call instruction.
10737
10738 Even if this switch is enabled, not all function calls will be turned
10739 into long calls.  The heuristic is that static functions, functions
10740 which have the @samp{short-call} attribute, functions that are inside
10741 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10742 definitions have already been compiled within the current compilation
10743 unit, will not be turned into long calls.  The exception to this rule is
10744 that weak function definitions, functions with the @samp{long-call}
10745 attribute or the @samp{section} attribute, and functions that are within
10746 the scope of a @samp{#pragma long_calls} directive, will always be
10747 turned into long calls.
10748
10749 This feature is not enabled by default.  Specifying
10750 @option{-mno-long-calls} will restore the default behavior, as will
10751 placing the function calls within the scope of a @samp{#pragma
10752 long_calls_off} directive.  Note these switches have no effect on how
10753 the compiler generates code to handle function calls via function
10754 pointers.
10755
10756 @item -msingle-pic-base
10757 @opindex msingle-pic-base
10758 Treat the register used for PIC addressing as read-only, rather than
10759 loading it in the prologue for each function.  The run-time system is
10760 responsible for initializing this register with an appropriate value
10761 before execution begins.
10762
10763 @item -mpic-register=@var{reg}
10764 @opindex mpic-register
10765 Specify the register to be used for PIC addressing.  The default is R10
10766 unless stack-checking is enabled, when R9 is used.
10767
10768 @item -mcirrus-fix-invalid-insns
10769 @opindex mcirrus-fix-invalid-insns
10770 @opindex mno-cirrus-fix-invalid-insns
10771 Insert NOPs into the instruction stream to in order to work around
10772 problems with invalid Maverick instruction combinations.  This option
10773 is only valid if the @option{-mcpu=ep9312} option has been used to
10774 enable generation of instructions for the Cirrus Maverick floating
10775 point co-processor.  This option is not enabled by default, since the
10776 problem is only present in older Maverick implementations.  The default
10777 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10778 switch.
10779
10780 @item -mpoke-function-name
10781 @opindex mpoke-function-name
10782 Write the name of each function into the text section, directly
10783 preceding the function prologue.  The generated code is similar to this:
10784
10785 @smallexample
10786      t0
10787          .ascii "arm_poke_function_name", 0
10788          .align
10789      t1
10790          .word 0xff000000 + (t1 - t0)
10791      arm_poke_function_name
10792          mov     ip, sp
10793          stmfd   sp!, @{fp, ip, lr, pc@}
10794          sub     fp, ip, #4
10795 @end smallexample
10796
10797 When performing a stack backtrace, code can inspect the value of
10798 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10799 location @code{pc - 12} and the top 8 bits are set, then we know that
10800 there is a function name embedded immediately preceding this location
10801 and has length @code{((pc[-3]) & 0xff000000)}.
10802
10803 @item -mthumb
10804 @itemx -marm
10805 @opindex marm
10806 @opindex mthumb
10807
10808 Select between generating code that executes in ARM and Thumb
10809 states.  The default for most configurations is to generate code
10810 that executes in ARM state, but the default can be changed by
10811 configuring GCC with the @option{--with-mode=}@var{state}
10812 configure option.
10813
10814 @item -mtpcs-frame
10815 @opindex mtpcs-frame
10816 Generate a stack frame that is compliant with the Thumb Procedure Call
10817 Standard for all non-leaf functions.  (A leaf function is one that does
10818 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10819
10820 @item -mtpcs-leaf-frame
10821 @opindex mtpcs-leaf-frame
10822 Generate a stack frame that is compliant with the Thumb Procedure Call
10823 Standard for all leaf functions.  (A leaf function is one that does
10824 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10825
10826 @item -mcallee-super-interworking
10827 @opindex mcallee-super-interworking
10828 Gives all externally visible functions in the file being compiled an ARM
10829 instruction set header which switches to Thumb mode before executing the
10830 rest of the function.  This allows these functions to be called from
10831 non-interworking code.  This option is not valid in AAPCS configurations
10832 because interworking is enabled by default.
10833
10834 @item -mcaller-super-interworking
10835 @opindex mcaller-super-interworking
10836 Allows calls via function pointers (including virtual functions) to
10837 execute correctly regardless of whether the target code has been
10838 compiled for interworking or not.  There is a small overhead in the cost
10839 of executing a function pointer if this option is enabled.  This option
10840 is not valid in AAPCS configurations because interworking is enabled
10841 by default.
10842
10843 @item -mtp=@var{name}
10844 @opindex mtp
10845 Specify the access model for the thread local storage pointer.  The valid
10846 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10847 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10848 (supported in the arm6k architecture), and @option{auto}, which uses the
10849 best available method for the selected processor.  The default setting is
10850 @option{auto}.
10851
10852 @item -mtls-dialect=@var{dialect}
10853 @opindex mtls-dialect
10854 Specify the dialect to use for accessing thread local storage.  Two
10855 dialects are supported --- @option{gnu} and @option{gnu2}.  The
10856 @option{gnu} dialect selects the original GNU scheme for supporting
10857 local and global dynamic TLS models.  The @option{gnu2} dialect
10858 selects the GNU descriptor scheme, which provides better performance
10859 for shared libraries.  The GNU descriptor scheme is compatible with
10860 the original scheme, but does require new assembler, linker and
10861 library support.  Initial and local exec TLS models are unaffected by
10862 this option and always use the original scheme.
10863
10864 @item -mword-relocations
10865 @opindex mword-relocations
10866 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10867 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10868 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10869 is specified.
10870
10871 @item -mfix-cortex-m3-ldrd
10872 @opindex mfix-cortex-m3-ldrd
10873 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10874 with overlapping destination and base registers are used.  This option avoids
10875 generating these instructions.  This option is enabled by default when
10876 @option{-mcpu=cortex-m3} is specified.
10877
10878 @end table
10879
10880 @node AVR Options
10881 @subsection AVR Options
10882 @cindex AVR Options
10883
10884 These options are defined for AVR implementations:
10885
10886 @table @gcctabopt
10887 @item -mmcu=@var{mcu}
10888 @opindex mmcu
10889 Specify ATMEL AVR instruction set or MCU type.
10890
10891 Instruction set avr1 is for the minimal AVR core, not supported by the C
10892 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10893 attiny11, attiny12, attiny15, attiny28).
10894
10895 Instruction set avr2 (default) is for the classic AVR core with up to
10896 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10897 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10898 at90c8534, at90s8535).
10899
10900 Instruction set avr3 is for the classic AVR core with up to 128K program
10901 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10902
10903 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10904 memory space (MCU types: atmega8, atmega83, atmega85).
10905
10906 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10907 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10908 atmega64, atmega128, at43usb355, at94k).
10909
10910 @item -mno-interrupts
10911 @opindex mno-interrupts
10912 Generated code is not compatible with hardware interrupts.
10913 Code size will be smaller.
10914
10915 @item -mcall-prologues
10916 @opindex mcall-prologues
10917 Functions prologues/epilogues expanded as call to appropriate
10918 subroutines.  Code size will be smaller.
10919
10920 @item -mtiny-stack
10921 @opindex mtiny-stack
10922 Change only the low 8 bits of the stack pointer.
10923
10924 @item -mint8
10925 @opindex mint8
10926 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10927 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10928 and long long will be 4 bytes.  Please note that this option does not
10929 comply to the C standards, but it will provide you with smaller code
10930 size.
10931
10932 @item -mstrict-X
10933 @opindex mstrict-X
10934 Use register @code{X} in a way proposed by the hardware.  This means
10935 that @code{X} will only be used in indirect, post-increment or
10936 pre-decrement addressing.
10937
10938 Without this option, the @code{X} register may be used in the same way
10939 as @code{Y} or @code{Z} which then is emulated by additional
10940 instructions.  
10941 For example, loading a value with @code{X+const} addressing with a
10942 small @code{const <= 63} to a register @var{Rn} will be printed as
10943 @example
10944 adiw r26, const
10945 ld   @var{Rn}, X
10946 sbiw r26, const
10947 @end example
10948 @end table
10949
10950 @subsubsection @code{EIND} and Devices with more than 128k Bytes of Flash
10951
10952 Pointers in the implementation are 16 bits wide.
10953 The address of a function or label is represented as word address so
10954 that indirect jumps and calls can address any code address in the
10955 range of 64k words.
10956
10957 In order to faciliate indirect jump on devices with more than 128k
10958 bytes of program memory space, there is a special function register called
10959 @code{EIND} that serves as most significant part of the target address
10960 when @code{EICALL} or @code{EIJMP} instructions are used.
10961
10962 Indirect jumps and calls on these devices are handled as follows and
10963 are subject to some limitations:
10964
10965 @itemize @bullet
10966
10967 @item
10968 The compiler never sets @code{EIND}.
10969
10970 @item
10971 The startup code from libgcc never sets @code{EIND}.
10972 Notice that startup code is a blend of code from libgcc and avr-libc.
10973 For the impact of avr-libc on @code{EIND}, see the
10974 @w{@uref{http://nongnu.org/avr-libc/user-manual,avr-libc user manual}}.
10975
10976 @item
10977 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
10978 instructions or might read @code{EIND} directly.
10979
10980 @item
10981 The compiler assumes that @code{EIND} never changes during the startup
10982 code or run of the application. In particular, @code{EIND} is not
10983 saved/restored in function or interrupt service routine
10984 prologue/epilogue.
10985
10986 @item
10987 It is legitimate for user-specific startup code to set up @code{EIND}
10988 early, for example by means of initialization code located in
10989 section @code{.init3}, and thus prior to general startup code that
10990 initializes RAM and calls constructors.
10991
10992 @item
10993 For indirect calls to functions and computed goto, the linker will
10994 generate @emph{stubs}. Stubs are jump pads sometimes also called
10995 @emph{trampolines}. Thus, the indirect call/jump will jump to such a stub.
10996 The stub contains a direct jump to the desired address.
10997
10998 @item
10999 Stubs will be generated automatically by the linker if
11000 the following two conditions are met:
11001 @itemize @minus
11002
11003 @item The address of a label is taken by means of the @code{gs} modifier
11004 (short for @emph{generate stubs}) like so:
11005 @example
11006 LDI r24, lo8(gs(@var{func}))
11007 LDI r25, hi8(gs(@var{func}))
11008 @end example
11009 @item The final location of that label is in a code segment
11010 @emph{outside} the segment where the stubs are located.
11011 @end itemize
11012
11013 @item
11014 The compiler will emit such @code{gs} modifiers for code labels in the
11015 following situations:
11016 @itemize @minus
11017 @item Taking address of a function or code label.
11018 @item Computed goto.
11019 @item If prologue-save function is used, see @option{-mcall-prologues}
11020 command line option.
11021 @item Switch/case dispatch tables. If you do not want such dispatch
11022 tables you can specify the @option{-fno-jump-tables} command line option.
11023 @item C and C++ constructors/destructors called during startup/shutdown.
11024 @item If the tools hit a @code{gs()} modifier explained above.
11025 @end itemize
11026
11027 @item
11028 The default linker script is arranged for code with @code{EIND = 0}.
11029 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11030 linker script has to be used in order to place the sections whose
11031 name start with @code{.trampolines} into the segment where @code{EIND}
11032 points to.
11033
11034 @item
11035 Jumping to non-symbolic addresses like so is @emph{not} supported:
11036
11037 @example
11038 int main (void)
11039 @{
11040     /* Call function at word address 0x2 */
11041     return ((int(*)(void)) 0x2)();
11042 @}
11043 @end example
11044
11045 Instead, a stub has to be set up:
11046
11047 @example
11048 int main (void)
11049 @{
11050     extern int func_4 (void);
11051
11052     /* Call function at byte address 0x4 */
11053     return func_4();
11054 @}
11055 @end example
11056
11057 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11058 Alternatively, @code{func_4} can be defined in the linker script.
11059 @end itemize
11060
11061 @node Blackfin Options
11062 @subsection Blackfin Options
11063 @cindex Blackfin Options
11064
11065 @table @gcctabopt
11066 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
11067 @opindex mcpu=
11068 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
11069 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
11070 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
11071 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
11072 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
11073 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
11074 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
11075 @samp{bf561}, @samp{bf592}.
11076 The optional @var{sirevision} specifies the silicon revision of the target
11077 Blackfin processor.  Any workarounds available for the targeted silicon revision
11078 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
11079 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
11080 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
11081 hexadecimal digits representing the major and minor numbers in the silicon
11082 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
11083 is not defined.  If @var{sirevision} is @samp{any}, the
11084 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
11085 If this optional @var{sirevision} is not used, GCC assumes the latest known
11086 silicon revision of the targeted Blackfin processor.
11087
11088 Support for @samp{bf561} is incomplete.  For @samp{bf561},
11089 Only the processor macro is defined.
11090 Without this option, @samp{bf532} is used as the processor by default.
11091 The corresponding predefined processor macros for @var{cpu} is to
11092 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
11093 provided by libgloss to be linked in if @option{-msim} is not given.
11094
11095 @item -msim
11096 @opindex msim
11097 Specifies that the program will be run on the simulator.  This causes
11098 the simulator BSP provided by libgloss to be linked in.  This option
11099 has effect only for @samp{bfin-elf} toolchain.
11100 Certain other options, such as @option{-mid-shared-library} and
11101 @option{-mfdpic}, imply @option{-msim}.
11102
11103 @item -momit-leaf-frame-pointer
11104 @opindex momit-leaf-frame-pointer
11105 Don't keep the frame pointer in a register for leaf functions.  This
11106 avoids the instructions to save, set up and restore frame pointers and
11107 makes an extra register available in leaf functions.  The option
11108 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11109 which might make debugging harder.
11110
11111 @item -mspecld-anomaly
11112 @opindex mspecld-anomaly
11113 When enabled, the compiler will ensure that the generated code does not
11114 contain speculative loads after jump instructions. If this option is used,
11115 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
11116
11117 @item -mno-specld-anomaly
11118 @opindex mno-specld-anomaly
11119 Don't generate extra code to prevent speculative loads from occurring.
11120
11121 @item -mcsync-anomaly
11122 @opindex mcsync-anomaly
11123 When enabled, the compiler will ensure that the generated code does not
11124 contain CSYNC or SSYNC instructions too soon after conditional branches.
11125 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
11126
11127 @item -mno-csync-anomaly
11128 @opindex mno-csync-anomaly
11129 Don't generate extra code to prevent CSYNC or SSYNC instructions from
11130 occurring too soon after a conditional branch.
11131
11132 @item -mlow-64k
11133 @opindex mlow-64k
11134 When enabled, the compiler is free to take advantage of the knowledge that
11135 the entire program fits into the low 64k of memory.
11136
11137 @item -mno-low-64k
11138 @opindex mno-low-64k
11139 Assume that the program is arbitrarily large.  This is the default.
11140
11141 @item -mstack-check-l1
11142 @opindex mstack-check-l1
11143 Do stack checking using information placed into L1 scratchpad memory by the
11144 uClinux kernel.
11145
11146 @item -mid-shared-library
11147 @opindex mid-shared-library
11148 Generate code that supports shared libraries via the library ID method.
11149 This allows for execute in place and shared libraries in an environment
11150 without virtual memory management.  This option implies @option{-fPIC}.
11151 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11152
11153 @item -mno-id-shared-library
11154 @opindex mno-id-shared-library
11155 Generate code that doesn't assume ID based shared libraries are being used.
11156 This is the default.
11157
11158 @item -mleaf-id-shared-library
11159 @opindex mleaf-id-shared-library
11160 Generate code that supports shared libraries via the library ID method,
11161 but assumes that this library or executable won't link against any other
11162 ID shared libraries.  That allows the compiler to use faster code for jumps
11163 and calls.
11164
11165 @item -mno-leaf-id-shared-library
11166 @opindex mno-leaf-id-shared-library
11167 Do not assume that the code being compiled won't link against any ID shared
11168 libraries.  Slower code will be generated for jump and call insns.
11169
11170 @item -mshared-library-id=n
11171 @opindex mshared-library-id
11172 Specified the identification number of the ID based shared library being
11173 compiled.  Specifying a value of 0 will generate more compact code, specifying
11174 other values will force the allocation of that number to the current
11175 library but is no more space or time efficient than omitting this option.
11176
11177 @item -msep-data
11178 @opindex msep-data
11179 Generate code that allows the data segment to be located in a different
11180 area of memory from the text segment.  This allows for execute in place in
11181 an environment without virtual memory management by eliminating relocations
11182 against the text section.
11183
11184 @item -mno-sep-data
11185 @opindex mno-sep-data
11186 Generate code that assumes that the data segment follows the text segment.
11187 This is the default.
11188
11189 @item -mlong-calls
11190 @itemx -mno-long-calls
11191 @opindex mlong-calls
11192 @opindex mno-long-calls
11193 Tells the compiler to perform function calls by first loading the
11194 address of the function into a register and then performing a subroutine
11195 call on this register.  This switch is needed if the target function
11196 will lie outside of the 24 bit addressing range of the offset based
11197 version of subroutine call instruction.
11198
11199 This feature is not enabled by default.  Specifying
11200 @option{-mno-long-calls} will restore the default behavior.  Note these
11201 switches have no effect on how the compiler generates code to handle
11202 function calls via function pointers.
11203
11204 @item -mfast-fp
11205 @opindex mfast-fp
11206 Link with the fast floating-point library. This library relaxes some of
11207 the IEEE floating-point standard's rules for checking inputs against
11208 Not-a-Number (NAN), in the interest of performance.
11209
11210 @item -minline-plt
11211 @opindex minline-plt
11212 Enable inlining of PLT entries in function calls to functions that are
11213 not known to bind locally.  It has no effect without @option{-mfdpic}.
11214
11215 @item -mmulticore
11216 @opindex mmulticore
11217 Build standalone application for multicore Blackfin processor. Proper
11218 start files and link scripts will be used to support multicore.
11219 This option defines @code{__BFIN_MULTICORE}. It can only be used with
11220 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
11221 @option{-mcorea} or @option{-mcoreb}. If it's used without
11222 @option{-mcorea} or @option{-mcoreb}, single application/dual core
11223 programming model is used. In this model, the main function of Core B
11224 should be named as coreb_main. If it's used with @option{-mcorea} or
11225 @option{-mcoreb}, one application per core programming model is used.
11226 If this option is not used, single core application programming
11227 model is used.
11228
11229 @item -mcorea
11230 @opindex mcorea
11231 Build standalone application for Core A of BF561 when using
11232 one application per core programming model. Proper start files
11233 and link scripts will be used to support Core A. This option
11234 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
11235
11236 @item -mcoreb
11237 @opindex mcoreb
11238 Build standalone application for Core B of BF561 when using
11239 one application per core programming model. Proper start files
11240 and link scripts will be used to support Core B. This option
11241 defines @code{__BFIN_COREB}. When this option is used, coreb_main
11242 should be used instead of main. It must be used with
11243 @option{-mmulticore}.
11244
11245 @item -msdram
11246 @opindex msdram
11247 Build standalone application for SDRAM. Proper start files and
11248 link scripts will be used to put the application into SDRAM.
11249 Loader should initialize SDRAM before loading the application
11250 into SDRAM. This option defines @code{__BFIN_SDRAM}.
11251
11252 @item -micplb
11253 @opindex micplb
11254 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
11255 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
11256 are enabled; for standalone applications the default is off.
11257 @end table
11258
11259 @node C6X Options
11260 @subsection C6X Options
11261 @cindex C6X Options
11262
11263 @table @gcctabopt
11264 @item -march=@var{name}
11265 @opindex march
11266 This specifies the name of the target architecture.  GCC uses this
11267 name to determine what kind of instructions it can emit when generating
11268 assembly code.  Permissible names are: @samp{c62x},
11269 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
11270
11271 @item -mbig-endian
11272 @opindex mbig-endian
11273 Generate code for a big endian target.
11274
11275 @item -mlittle-endian
11276 @opindex mlittle-endian
11277 Generate code for a little endian target.  This is the default.
11278
11279 @item -msim
11280 @opindex msim
11281 Choose startup files and linker script suitable for the simulator.
11282
11283 @item -msdata=default
11284 @opindex msdata=default
11285 Put small global and static data in the @samp{.neardata} section,
11286 which is pointed to by register @code{B14}.  Put small uninitialized
11287 global and static data in the @samp{.bss} section, which is adjacent
11288 to the @samp{.neardata} section.  Put small read-only data into the
11289 @samp{.rodata} section.  The corresponding sections used for large
11290 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
11291
11292 @item -msdata=all
11293 @opindex msdata=all
11294 Put all data, not just small objets, into the sections reserved for
11295 small data, and use addressing relative to the @code{B14} register to
11296 access them.
11297
11298 @item -msdata=none
11299 @opindex msdata=none
11300 Make no use of the sections reserved for small data, and use absolute
11301 addresses to access all data.  Put all initialized global and static
11302 data in the @samp{.fardata} section, and all uninitialized data in the
11303 @samp{.far} section.  Put all constant data into the @samp{.const}
11304 section.
11305 @end table
11306
11307 @node CRIS Options
11308 @subsection CRIS Options
11309 @cindex CRIS Options
11310
11311 These options are defined specifically for the CRIS ports.
11312
11313 @table @gcctabopt
11314 @item -march=@var{architecture-type}
11315 @itemx -mcpu=@var{architecture-type}
11316 @opindex march
11317 @opindex mcpu
11318 Generate code for the specified architecture.  The choices for
11319 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
11320 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
11321 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
11322 @samp{v10}.
11323
11324 @item -mtune=@var{architecture-type}
11325 @opindex mtune
11326 Tune to @var{architecture-type} everything applicable about the generated
11327 code, except for the ABI and the set of available instructions.  The
11328 choices for @var{architecture-type} are the same as for
11329 @option{-march=@var{architecture-type}}.
11330
11331 @item -mmax-stack-frame=@var{n}
11332 @opindex mmax-stack-frame
11333 Warn when the stack frame of a function exceeds @var{n} bytes.
11334
11335 @item -metrax4
11336 @itemx -metrax100
11337 @opindex metrax4
11338 @opindex metrax100
11339 The options @option{-metrax4} and @option{-metrax100} are synonyms for
11340 @option{-march=v3} and @option{-march=v8} respectively.
11341
11342 @item -mmul-bug-workaround
11343 @itemx -mno-mul-bug-workaround
11344 @opindex mmul-bug-workaround
11345 @opindex mno-mul-bug-workaround
11346 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
11347 models where it applies.  This option is active by default.
11348
11349 @item -mpdebug
11350 @opindex mpdebug
11351 Enable CRIS-specific verbose debug-related information in the assembly
11352 code.  This option also has the effect to turn off the @samp{#NO_APP}
11353 formatted-code indicator to the assembler at the beginning of the
11354 assembly file.
11355
11356 @item -mcc-init
11357 @opindex mcc-init
11358 Do not use condition-code results from previous instruction; always emit
11359 compare and test instructions before use of condition codes.
11360
11361 @item -mno-side-effects
11362 @opindex mno-side-effects
11363 Do not emit instructions with side-effects in addressing modes other than
11364 post-increment.
11365
11366 @item -mstack-align
11367 @itemx -mno-stack-align
11368 @itemx -mdata-align
11369 @itemx -mno-data-align
11370 @itemx -mconst-align
11371 @itemx -mno-const-align
11372 @opindex mstack-align
11373 @opindex mno-stack-align
11374 @opindex mdata-align
11375 @opindex mno-data-align
11376 @opindex mconst-align
11377 @opindex mno-const-align
11378 These options (no-options) arranges (eliminate arrangements) for the
11379 stack-frame, individual data and constants to be aligned for the maximum
11380 single data access size for the chosen CPU model.  The default is to
11381 arrange for 32-bit alignment.  ABI details such as structure layout are
11382 not affected by these options.
11383
11384 @item -m32-bit
11385 @itemx -m16-bit
11386 @itemx -m8-bit
11387 @opindex m32-bit
11388 @opindex m16-bit
11389 @opindex m8-bit
11390 Similar to the stack- data- and const-align options above, these options
11391 arrange for stack-frame, writable data and constants to all be 32-bit,
11392 16-bit or 8-bit aligned.  The default is 32-bit alignment.
11393
11394 @item -mno-prologue-epilogue
11395 @itemx -mprologue-epilogue
11396 @opindex mno-prologue-epilogue
11397 @opindex mprologue-epilogue
11398 With @option{-mno-prologue-epilogue}, the normal function prologue and
11399 epilogue that sets up the stack-frame are omitted and no return
11400 instructions or return sequences are generated in the code.  Use this
11401 option only together with visual inspection of the compiled code: no
11402 warnings or errors are generated when call-saved registers must be saved,
11403 or storage for local variable needs to be allocated.
11404
11405 @item -mno-gotplt
11406 @itemx -mgotplt
11407 @opindex mno-gotplt
11408 @opindex mgotplt
11409 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
11410 instruction sequences that load addresses for functions from the PLT part
11411 of the GOT rather than (traditional on other architectures) calls to the
11412 PLT@.  The default is @option{-mgotplt}.
11413
11414 @item -melf
11415 @opindex melf
11416 Legacy no-op option only recognized with the cris-axis-elf and
11417 cris-axis-linux-gnu targets.
11418
11419 @item -mlinux
11420 @opindex mlinux
11421 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
11422
11423 @item -sim
11424 @opindex sim
11425 This option, recognized for the cris-axis-elf arranges
11426 to link with input-output functions from a simulator library.  Code,
11427 initialized data and zero-initialized data are allocated consecutively.
11428
11429 @item -sim2
11430 @opindex sim2
11431 Like @option{-sim}, but pass linker options to locate initialized data at
11432 0x40000000 and zero-initialized data at 0x80000000.
11433 @end table
11434
11435 @node Darwin Options
11436 @subsection Darwin Options
11437 @cindex Darwin options
11438
11439 These options are defined for all architectures running the Darwin operating
11440 system.
11441
11442 FSF GCC on Darwin does not create ``fat'' object files; it will create
11443 an object file for the single architecture that it was built to
11444 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
11445 @option{-arch} options are used; it does so by running the compiler or
11446 linker multiple times and joining the results together with
11447 @file{lipo}.
11448
11449 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
11450 @samp{i686}) is determined by the flags that specify the ISA
11451 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
11452 @option{-force_cpusubtype_ALL} option can be used to override this.
11453
11454 The Darwin tools vary in their behavior when presented with an ISA
11455 mismatch.  The assembler, @file{as}, will only permit instructions to
11456 be used that are valid for the subtype of the file it is generating,
11457 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
11458 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
11459 and print an error if asked to create a shared library with a less
11460 restrictive subtype than its input files (for instance, trying to put
11461 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
11462 for executables, @file{ld}, will quietly give the executable the most
11463 restrictive subtype of any of its input files.
11464
11465 @table @gcctabopt
11466 @item -F@var{dir}
11467 @opindex F
11468 Add the framework directory @var{dir} to the head of the list of
11469 directories to be searched for header files.  These directories are
11470 interleaved with those specified by @option{-I} options and are
11471 scanned in a left-to-right order.
11472
11473 A framework directory is a directory with frameworks in it.  A
11474 framework is a directory with a @samp{"Headers"} and/or
11475 @samp{"PrivateHeaders"} directory contained directly in it that ends
11476 in @samp{".framework"}.  The name of a framework is the name of this
11477 directory excluding the @samp{".framework"}.  Headers associated with
11478 the framework are found in one of those two directories, with
11479 @samp{"Headers"} being searched first.  A subframework is a framework
11480 directory that is in a framework's @samp{"Frameworks"} directory.
11481 Includes of subframework headers can only appear in a header of a
11482 framework that contains the subframework, or in a sibling subframework
11483 header.  Two subframeworks are siblings if they occur in the same
11484 framework.  A subframework should not have the same name as a
11485 framework, a warning will be issued if this is violated.  Currently a
11486 subframework cannot have subframeworks, in the future, the mechanism
11487 may be extended to support this.  The standard frameworks can be found
11488 in @samp{"/System/Library/Frameworks"} and
11489 @samp{"/Library/Frameworks"}.  An example include looks like
11490 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
11491 the name of the framework and header.h is found in the
11492 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
11493
11494 @item -iframework@var{dir}
11495 @opindex iframework
11496 Like @option{-F} except the directory is a treated as a system
11497 directory.  The main difference between this @option{-iframework} and
11498 @option{-F} is that with @option{-iframework} the compiler does not
11499 warn about constructs contained within header files found via
11500 @var{dir}.  This option is valid only for the C family of languages.
11501
11502 @item -gused
11503 @opindex gused
11504 Emit debugging information for symbols that are used.  For STABS
11505 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
11506 This is by default ON@.
11507
11508 @item -gfull
11509 @opindex gfull
11510 Emit debugging information for all symbols and types.
11511
11512 @item -mmacosx-version-min=@var{version}
11513 The earliest version of MacOS X that this executable will run on
11514 is @var{version}.  Typical values of @var{version} include @code{10.1},
11515 @code{10.2}, and @code{10.3.9}.
11516
11517 If the compiler was built to use the system's headers by default,
11518 then the default for this option is the system version on which the
11519 compiler is running, otherwise the default is to make choices which
11520 are compatible with as many systems and code bases as possible.
11521
11522 @item -mkernel
11523 @opindex mkernel
11524 Enable kernel development mode.  The @option{-mkernel} option sets
11525 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
11526 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
11527 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
11528 applicable.  This mode also sets @option{-mno-altivec},
11529 @option{-msoft-float}, @option{-fno-builtin} and
11530 @option{-mlong-branch} for PowerPC targets.
11531
11532 @item -mone-byte-bool
11533 @opindex mone-byte-bool
11534 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
11535 By default @samp{sizeof(bool)} is @samp{4} when compiling for
11536 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
11537 option has no effect on x86.
11538
11539 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
11540 to generate code that is not binary compatible with code generated
11541 without that switch.  Using this switch may require recompiling all
11542 other modules in a program, including system libraries.  Use this
11543 switch to conform to a non-default data model.
11544
11545 @item -mfix-and-continue
11546 @itemx -ffix-and-continue
11547 @itemx -findirect-data
11548 @opindex mfix-and-continue
11549 @opindex ffix-and-continue
11550 @opindex findirect-data
11551 Generate code suitable for fast turn around development.  Needed to
11552 enable gdb to dynamically load @code{.o} files into already running
11553 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
11554 are provided for backwards compatibility.
11555
11556 @item -all_load
11557 @opindex all_load
11558 Loads all members of static archive libraries.
11559 See man ld(1) for more information.
11560
11561 @item -arch_errors_fatal
11562 @opindex arch_errors_fatal
11563 Cause the errors having to do with files that have the wrong architecture
11564 to be fatal.
11565
11566 @item -bind_at_load
11567 @opindex bind_at_load
11568 Causes the output file to be marked such that the dynamic linker will
11569 bind all undefined references when the file is loaded or launched.
11570
11571 @item -bundle
11572 @opindex bundle
11573 Produce a Mach-o bundle format file.
11574 See man ld(1) for more information.
11575
11576 @item -bundle_loader @var{executable}
11577 @opindex bundle_loader
11578 This option specifies the @var{executable} that will be loading the build
11579 output file being linked.  See man ld(1) for more information.
11580
11581 @item -dynamiclib
11582 @opindex dynamiclib
11583 When passed this option, GCC will produce a dynamic library instead of
11584 an executable when linking, using the Darwin @file{libtool} command.
11585
11586 @item -force_cpusubtype_ALL
11587 @opindex force_cpusubtype_ALL
11588 This causes GCC's output file to have the @var{ALL} subtype, instead of
11589 one controlled by the @option{-mcpu} or @option{-march} option.
11590
11591 @item -allowable_client  @var{client_name}
11592 @itemx -client_name
11593 @itemx -compatibility_version
11594 @itemx -current_version
11595 @itemx -dead_strip
11596 @itemx -dependency-file
11597 @itemx -dylib_file
11598 @itemx -dylinker_install_name
11599 @itemx -dynamic
11600 @itemx -exported_symbols_list
11601 @itemx -filelist
11602 @need 800
11603 @itemx -flat_namespace
11604 @itemx -force_flat_namespace
11605 @itemx -headerpad_max_install_names
11606 @itemx -image_base
11607 @itemx -init
11608 @itemx -install_name
11609 @itemx -keep_private_externs
11610 @itemx -multi_module
11611 @itemx -multiply_defined
11612 @itemx -multiply_defined_unused
11613 @need 800
11614 @itemx -noall_load
11615 @itemx -no_dead_strip_inits_and_terms
11616 @itemx -nofixprebinding
11617 @itemx -nomultidefs
11618 @itemx -noprebind
11619 @itemx -noseglinkedit
11620 @itemx -pagezero_size
11621 @itemx -prebind
11622 @itemx -prebind_all_twolevel_modules
11623 @itemx -private_bundle
11624 @need 800
11625 @itemx -read_only_relocs
11626 @itemx -sectalign
11627 @itemx -sectobjectsymbols
11628 @itemx -whyload
11629 @itemx -seg1addr
11630 @itemx -sectcreate
11631 @itemx -sectobjectsymbols
11632 @itemx -sectorder
11633 @itemx -segaddr
11634 @itemx -segs_read_only_addr
11635 @need 800
11636 @itemx -segs_read_write_addr
11637 @itemx -seg_addr_table
11638 @itemx -seg_addr_table_filename
11639 @itemx -seglinkedit
11640 @itemx -segprot
11641 @itemx -segs_read_only_addr
11642 @itemx -segs_read_write_addr
11643 @itemx -single_module
11644 @itemx -static
11645 @itemx -sub_library
11646 @need 800
11647 @itemx -sub_umbrella
11648 @itemx -twolevel_namespace
11649 @itemx -umbrella
11650 @itemx -undefined
11651 @itemx -unexported_symbols_list
11652 @itemx -weak_reference_mismatches
11653 @itemx -whatsloaded
11654 @opindex allowable_client
11655 @opindex client_name
11656 @opindex compatibility_version
11657 @opindex current_version
11658 @opindex dead_strip
11659 @opindex dependency-file
11660 @opindex dylib_file
11661 @opindex dylinker_install_name
11662 @opindex dynamic
11663 @opindex exported_symbols_list
11664 @opindex filelist
11665 @opindex flat_namespace
11666 @opindex force_flat_namespace
11667 @opindex headerpad_max_install_names
11668 @opindex image_base
11669 @opindex init
11670 @opindex install_name
11671 @opindex keep_private_externs
11672 @opindex multi_module
11673 @opindex multiply_defined
11674 @opindex multiply_defined_unused
11675 @opindex noall_load
11676 @opindex no_dead_strip_inits_and_terms
11677 @opindex nofixprebinding
11678 @opindex nomultidefs
11679 @opindex noprebind
11680 @opindex noseglinkedit
11681 @opindex pagezero_size
11682 @opindex prebind
11683 @opindex prebind_all_twolevel_modules
11684 @opindex private_bundle
11685 @opindex read_only_relocs
11686 @opindex sectalign
11687 @opindex sectobjectsymbols
11688 @opindex whyload
11689 @opindex seg1addr
11690 @opindex sectcreate
11691 @opindex sectobjectsymbols
11692 @opindex sectorder
11693 @opindex segaddr
11694 @opindex segs_read_only_addr
11695 @opindex segs_read_write_addr
11696 @opindex seg_addr_table
11697 @opindex seg_addr_table_filename
11698 @opindex seglinkedit
11699 @opindex segprot
11700 @opindex segs_read_only_addr
11701 @opindex segs_read_write_addr
11702 @opindex single_module
11703 @opindex static
11704 @opindex sub_library
11705 @opindex sub_umbrella
11706 @opindex twolevel_namespace
11707 @opindex umbrella
11708 @opindex undefined
11709 @opindex unexported_symbols_list
11710 @opindex weak_reference_mismatches
11711 @opindex whatsloaded
11712 These options are passed to the Darwin linker.  The Darwin linker man page
11713 describes them in detail.
11714 @end table
11715
11716 @node DEC Alpha Options
11717 @subsection DEC Alpha Options
11718
11719 These @samp{-m} options are defined for the DEC Alpha implementations:
11720
11721 @table @gcctabopt
11722 @item -mno-soft-float
11723 @itemx -msoft-float
11724 @opindex mno-soft-float
11725 @opindex msoft-float
11726 Use (do not use) the hardware floating-point instructions for
11727 floating-point operations.  When @option{-msoft-float} is specified,
11728 functions in @file{libgcc.a} will be used to perform floating-point
11729 operations.  Unless they are replaced by routines that emulate the
11730 floating-point operations, or compiled in such a way as to call such
11731 emulations routines, these routines will issue floating-point
11732 operations.   If you are compiling for an Alpha without floating-point
11733 operations, you must ensure that the library is built so as not to call
11734 them.
11735
11736 Note that Alpha implementations without floating-point operations are
11737 required to have floating-point registers.
11738
11739 @item -mfp-reg
11740 @itemx -mno-fp-regs
11741 @opindex mfp-reg
11742 @opindex mno-fp-regs
11743 Generate code that uses (does not use) the floating-point register set.
11744 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
11745 register set is not used, floating point operands are passed in integer
11746 registers as if they were integers and floating-point results are passed
11747 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
11748 so any function with a floating-point argument or return value called by code
11749 compiled with @option{-mno-fp-regs} must also be compiled with that
11750 option.
11751
11752 A typical use of this option is building a kernel that does not use,
11753 and hence need not save and restore, any floating-point registers.
11754
11755 @item -mieee
11756 @opindex mieee
11757 The Alpha architecture implements floating-point hardware optimized for
11758 maximum performance.  It is mostly compliant with the IEEE floating
11759 point standard.  However, for full compliance, software assistance is
11760 required.  This option generates code fully IEEE compliant code
11761 @emph{except} that the @var{inexact-flag} is not maintained (see below).
11762 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
11763 defined during compilation.  The resulting code is less efficient but is
11764 able to correctly support denormalized numbers and exceptional IEEE
11765 values such as not-a-number and plus/minus infinity.  Other Alpha
11766 compilers call this option @option{-ieee_with_no_inexact}.
11767
11768 @item -mieee-with-inexact
11769 @opindex mieee-with-inexact
11770 This is like @option{-mieee} except the generated code also maintains
11771 the IEEE @var{inexact-flag}.  Turning on this option causes the
11772 generated code to implement fully-compliant IEEE math.  In addition to
11773 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
11774 macro.  On some Alpha implementations the resulting code may execute
11775 significantly slower than the code generated by default.  Since there is
11776 very little code that depends on the @var{inexact-flag}, you should
11777 normally not specify this option.  Other Alpha compilers call this
11778 option @option{-ieee_with_inexact}.
11779
11780 @item -mfp-trap-mode=@var{trap-mode}
11781 @opindex mfp-trap-mode
11782 This option controls what floating-point related traps are enabled.
11783 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
11784 The trap mode can be set to one of four values:
11785
11786 @table @samp
11787 @item n
11788 This is the default (normal) setting.  The only traps that are enabled
11789 are the ones that cannot be disabled in software (e.g., division by zero
11790 trap).
11791
11792 @item u
11793 In addition to the traps enabled by @samp{n}, underflow traps are enabled
11794 as well.
11795
11796 @item su
11797 Like @samp{u}, but the instructions are marked to be safe for software
11798 completion (see Alpha architecture manual for details).
11799
11800 @item sui
11801 Like @samp{su}, but inexact traps are enabled as well.
11802 @end table
11803
11804 @item -mfp-rounding-mode=@var{rounding-mode}
11805 @opindex mfp-rounding-mode
11806 Selects the IEEE rounding mode.  Other Alpha compilers call this option
11807 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
11808 of:
11809
11810 @table @samp
11811 @item n
11812 Normal IEEE rounding mode.  Floating point numbers are rounded towards
11813 the nearest machine number or towards the even machine number in case
11814 of a tie.
11815
11816 @item m
11817 Round towards minus infinity.
11818
11819 @item c
11820 Chopped rounding mode.  Floating point numbers are rounded towards zero.
11821
11822 @item d
11823 Dynamic rounding mode.  A field in the floating point control register
11824 (@var{fpcr}, see Alpha architecture reference manual) controls the
11825 rounding mode in effect.  The C library initializes this register for
11826 rounding towards plus infinity.  Thus, unless your program modifies the
11827 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
11828 @end table
11829
11830 @item -mtrap-precision=@var{trap-precision}
11831 @opindex mtrap-precision
11832 In the Alpha architecture, floating point traps are imprecise.  This
11833 means without software assistance it is impossible to recover from a
11834 floating trap and program execution normally needs to be terminated.
11835 GCC can generate code that can assist operating system trap handlers
11836 in determining the exact location that caused a floating point trap.
11837 Depending on the requirements of an application, different levels of
11838 precisions can be selected:
11839
11840 @table @samp
11841 @item p
11842 Program precision.  This option is the default and means a trap handler
11843 can only identify which program caused a floating point exception.
11844
11845 @item f
11846 Function precision.  The trap handler can determine the function that
11847 caused a floating point exception.
11848
11849 @item i
11850 Instruction precision.  The trap handler can determine the exact
11851 instruction that caused a floating point exception.
11852 @end table
11853
11854 Other Alpha compilers provide the equivalent options called
11855 @option{-scope_safe} and @option{-resumption_safe}.
11856
11857 @item -mieee-conformant
11858 @opindex mieee-conformant
11859 This option marks the generated code as IEEE conformant.  You must not
11860 use this option unless you also specify @option{-mtrap-precision=i} and either
11861 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
11862 is to emit the line @samp{.eflag 48} in the function prologue of the
11863 generated assembly file.  Under DEC Unix, this has the effect that
11864 IEEE-conformant math library routines will be linked in.
11865
11866 @item -mbuild-constants
11867 @opindex mbuild-constants
11868 Normally GCC examines a 32- or 64-bit integer constant to
11869 see if it can construct it from smaller constants in two or three
11870 instructions.  If it cannot, it will output the constant as a literal and
11871 generate code to load it from the data segment at runtime.
11872
11873 Use this option to require GCC to construct @emph{all} integer constants
11874 using code, even if it takes more instructions (the maximum is six).
11875
11876 You would typically use this option to build a shared library dynamic
11877 loader.  Itself a shared library, it must relocate itself in memory
11878 before it can find the variables and constants in its own data segment.
11879
11880 @item -malpha-as
11881 @itemx -mgas
11882 @opindex malpha-as
11883 @opindex mgas
11884 Select whether to generate code to be assembled by the vendor-supplied
11885 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11886
11887 @item -mbwx
11888 @itemx -mno-bwx
11889 @itemx -mcix
11890 @itemx -mno-cix
11891 @itemx -mfix
11892 @itemx -mno-fix
11893 @itemx -mmax
11894 @itemx -mno-max
11895 @opindex mbwx
11896 @opindex mno-bwx
11897 @opindex mcix
11898 @opindex mno-cix
11899 @opindex mfix
11900 @opindex mno-fix
11901 @opindex mmax
11902 @opindex mno-max
11903 Indicate whether GCC should generate code to use the optional BWX,
11904 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11905 sets supported by the CPU type specified via @option{-mcpu=} option or that
11906 of the CPU on which GCC was built if none was specified.
11907
11908 @item -mfloat-vax
11909 @itemx -mfloat-ieee
11910 @opindex mfloat-vax
11911 @opindex mfloat-ieee
11912 Generate code that uses (does not use) VAX F and G floating point
11913 arithmetic instead of IEEE single and double precision.
11914
11915 @item -mexplicit-relocs
11916 @itemx -mno-explicit-relocs
11917 @opindex mexplicit-relocs
11918 @opindex mno-explicit-relocs
11919 Older Alpha assemblers provided no way to generate symbol relocations
11920 except via assembler macros.  Use of these macros does not allow
11921 optimal instruction scheduling.  GNU binutils as of version 2.12
11922 supports a new syntax that allows the compiler to explicitly mark
11923 which relocations should apply to which instructions.  This option
11924 is mostly useful for debugging, as GCC detects the capabilities of
11925 the assembler when it is built and sets the default accordingly.
11926
11927 @item -msmall-data
11928 @itemx -mlarge-data
11929 @opindex msmall-data
11930 @opindex mlarge-data
11931 When @option{-mexplicit-relocs} is in effect, static data is
11932 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11933 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11934 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11935 16-bit relocations off of the @code{$gp} register.  This limits the
11936 size of the small data area to 64KB, but allows the variables to be
11937 directly accessed via a single instruction.
11938
11939 The default is @option{-mlarge-data}.  With this option the data area
11940 is limited to just below 2GB@.  Programs that require more than 2GB of
11941 data must use @code{malloc} or @code{mmap} to allocate the data in the
11942 heap instead of in the program's data segment.
11943
11944 When generating code for shared libraries, @option{-fpic} implies
11945 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11946
11947 @item -msmall-text
11948 @itemx -mlarge-text
11949 @opindex msmall-text
11950 @opindex mlarge-text
11951 When @option{-msmall-text} is used, the compiler assumes that the
11952 code of the entire program (or shared library) fits in 4MB, and is
11953 thus reachable with a branch instruction.  When @option{-msmall-data}
11954 is used, the compiler can assume that all local symbols share the
11955 same @code{$gp} value, and thus reduce the number of instructions
11956 required for a function call from 4 to 1.
11957
11958 The default is @option{-mlarge-text}.
11959
11960 @item -mcpu=@var{cpu_type}
11961 @opindex mcpu
11962 Set the instruction set and instruction scheduling parameters for
11963 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11964 style name or the corresponding chip number.  GCC supports scheduling
11965 parameters for the EV4, EV5 and EV6 family of processors and will
11966 choose the default values for the instruction set from the processor
11967 you specify.  If you do not specify a processor type, GCC will default
11968 to the processor on which the compiler was built.
11969
11970 Supported values for @var{cpu_type} are
11971
11972 @table @samp
11973 @item ev4
11974 @itemx ev45
11975 @itemx 21064
11976 Schedules as an EV4 and has no instruction set extensions.
11977
11978 @item ev5
11979 @itemx 21164
11980 Schedules as an EV5 and has no instruction set extensions.
11981
11982 @item ev56
11983 @itemx 21164a
11984 Schedules as an EV5 and supports the BWX extension.
11985
11986 @item pca56
11987 @itemx 21164pc
11988 @itemx 21164PC
11989 Schedules as an EV5 and supports the BWX and MAX extensions.
11990
11991 @item ev6
11992 @itemx 21264
11993 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11994
11995 @item ev67
11996 @itemx 21264a
11997 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11998 @end table
11999
12000 Native toolchains also support the value @samp{native},
12001 which selects the best architecture option for the host processor.
12002 @option{-mcpu=native} has no effect if GCC does not recognize
12003 the processor.
12004
12005 @item -mtune=@var{cpu_type}
12006 @opindex mtune
12007 Set only the instruction scheduling parameters for machine type
12008 @var{cpu_type}.  The instruction set is not changed.
12009
12010 Native toolchains also support the value @samp{native},
12011 which selects the best architecture option for the host processor.
12012 @option{-mtune=native} has no effect if GCC does not recognize
12013 the processor.
12014
12015 @item -mmemory-latency=@var{time}
12016 @opindex mmemory-latency
12017 Sets the latency the scheduler should assume for typical memory
12018 references as seen by the application.  This number is highly
12019 dependent on the memory access patterns used by the application
12020 and the size of the external cache on the machine.
12021
12022 Valid options for @var{time} are
12023
12024 @table @samp
12025 @item @var{number}
12026 A decimal number representing clock cycles.
12027
12028 @item L1
12029 @itemx L2
12030 @itemx L3
12031 @itemx main
12032 The compiler contains estimates of the number of clock cycles for
12033 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
12034 (also called Dcache, Scache, and Bcache), as well as to main memory.
12035 Note that L3 is only valid for EV5.
12036
12037 @end table
12038 @end table
12039
12040 @node DEC Alpha/VMS Options
12041 @subsection DEC Alpha/VMS Options
12042
12043 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
12044
12045 @table @gcctabopt
12046 @item -mvms-return-codes
12047 @opindex mvms-return-codes
12048 Return VMS condition codes from main.  The default is to return POSIX
12049 style condition (e.g.@: error) codes.
12050
12051 @item -mdebug-main=@var{prefix}
12052 @opindex mdebug-main=@var{prefix}
12053 Flag the first routine whose name starts with @var{prefix} as the main
12054 routine for the debugger.
12055
12056 @item -mmalloc64
12057 @opindex mmalloc64
12058 Default to 64bit memory allocation routines.
12059 @end table
12060
12061 @node FR30 Options
12062 @subsection FR30 Options
12063 @cindex FR30 Options
12064
12065 These options are defined specifically for the FR30 port.
12066
12067 @table @gcctabopt
12068
12069 @item -msmall-model
12070 @opindex msmall-model
12071 Use the small address space model.  This can produce smaller code, but
12072 it does assume that all symbolic values and addresses will fit into a
12073 20-bit range.
12074
12075 @item -mno-lsim
12076 @opindex mno-lsim
12077 Assume that run-time support has been provided and so there is no need
12078 to include the simulator library (@file{libsim.a}) on the linker
12079 command line.
12080
12081 @end table
12082
12083 @node FRV Options
12084 @subsection FRV Options
12085 @cindex FRV Options
12086
12087 @table @gcctabopt
12088 @item -mgpr-32
12089 @opindex mgpr-32
12090
12091 Only use the first 32 general purpose registers.
12092
12093 @item -mgpr-64
12094 @opindex mgpr-64
12095
12096 Use all 64 general purpose registers.
12097
12098 @item -mfpr-32
12099 @opindex mfpr-32
12100
12101 Use only the first 32 floating point registers.
12102
12103 @item -mfpr-64
12104 @opindex mfpr-64
12105
12106 Use all 64 floating point registers
12107
12108 @item -mhard-float
12109 @opindex mhard-float
12110
12111 Use hardware instructions for floating point operations.
12112
12113 @item -msoft-float
12114 @opindex msoft-float
12115
12116 Use library routines for floating point operations.
12117
12118 @item -malloc-cc
12119 @opindex malloc-cc
12120
12121 Dynamically allocate condition code registers.
12122
12123 @item -mfixed-cc
12124 @opindex mfixed-cc
12125
12126 Do not try to dynamically allocate condition code registers, only
12127 use @code{icc0} and @code{fcc0}.
12128
12129 @item -mdword
12130 @opindex mdword
12131
12132 Change ABI to use double word insns.
12133
12134 @item -mno-dword
12135 @opindex mno-dword
12136
12137 Do not use double word instructions.
12138
12139 @item -mdouble
12140 @opindex mdouble
12141
12142 Use floating point double instructions.
12143
12144 @item -mno-double
12145 @opindex mno-double
12146
12147 Do not use floating point double instructions.
12148
12149 @item -mmedia
12150 @opindex mmedia
12151
12152 Use media instructions.
12153
12154 @item -mno-media
12155 @opindex mno-media
12156
12157 Do not use media instructions.
12158
12159 @item -mmuladd
12160 @opindex mmuladd
12161
12162 Use multiply and add/subtract instructions.
12163
12164 @item -mno-muladd
12165 @opindex mno-muladd
12166
12167 Do not use multiply and add/subtract instructions.
12168
12169 @item -mfdpic
12170 @opindex mfdpic
12171
12172 Select the FDPIC ABI, that uses function descriptors to represent
12173 pointers to functions.  Without any PIC/PIE-related options, it
12174 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
12175 assumes GOT entries and small data are within a 12-bit range from the
12176 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
12177 are computed with 32 bits.
12178 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12179
12180 @item -minline-plt
12181 @opindex minline-plt
12182
12183 Enable inlining of PLT entries in function calls to functions that are
12184 not known to bind locally.  It has no effect without @option{-mfdpic}.
12185 It's enabled by default if optimizing for speed and compiling for
12186 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
12187 optimization option such as @option{-O3} or above is present in the
12188 command line.
12189
12190 @item -mTLS
12191 @opindex mTLS
12192
12193 Assume a large TLS segment when generating thread-local code.
12194
12195 @item -mtls
12196 @opindex mtls
12197
12198 Do not assume a large TLS segment when generating thread-local code.
12199
12200 @item -mgprel-ro
12201 @opindex mgprel-ro
12202
12203 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
12204 that is known to be in read-only sections.  It's enabled by default,
12205 except for @option{-fpic} or @option{-fpie}: even though it may help
12206 make the global offset table smaller, it trades 1 instruction for 4.
12207 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
12208 one of which may be shared by multiple symbols, and it avoids the need
12209 for a GOT entry for the referenced symbol, so it's more likely to be a
12210 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
12211
12212 @item -multilib-library-pic
12213 @opindex multilib-library-pic
12214
12215 Link with the (library, not FD) pic libraries.  It's implied by
12216 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
12217 @option{-fpic} without @option{-mfdpic}.  You should never have to use
12218 it explicitly.
12219
12220 @item -mlinked-fp
12221 @opindex mlinked-fp
12222
12223 Follow the EABI requirement of always creating a frame pointer whenever
12224 a stack frame is allocated.  This option is enabled by default and can
12225 be disabled with @option{-mno-linked-fp}.
12226
12227 @item -mlong-calls
12228 @opindex mlong-calls
12229
12230 Use indirect addressing to call functions outside the current
12231 compilation unit.  This allows the functions to be placed anywhere
12232 within the 32-bit address space.
12233
12234 @item -malign-labels
12235 @opindex malign-labels
12236
12237 Try to align labels to an 8-byte boundary by inserting nops into the
12238 previous packet.  This option only has an effect when VLIW packing
12239 is enabled.  It doesn't create new packets; it merely adds nops to
12240 existing ones.
12241
12242 @item -mlibrary-pic
12243 @opindex mlibrary-pic
12244
12245 Generate position-independent EABI code.
12246
12247 @item -macc-4
12248 @opindex macc-4
12249
12250 Use only the first four media accumulator registers.
12251
12252 @item -macc-8
12253 @opindex macc-8
12254
12255 Use all eight media accumulator registers.
12256
12257 @item -mpack
12258 @opindex mpack
12259
12260 Pack VLIW instructions.
12261
12262 @item -mno-pack
12263 @opindex mno-pack
12264
12265 Do not pack VLIW instructions.
12266
12267 @item -mno-eflags
12268 @opindex mno-eflags
12269
12270 Do not mark ABI switches in e_flags.
12271
12272 @item -mcond-move
12273 @opindex mcond-move
12274
12275 Enable the use of conditional-move instructions (default).
12276
12277 This switch is mainly for debugging the compiler and will likely be removed
12278 in a future version.
12279
12280 @item -mno-cond-move
12281 @opindex mno-cond-move
12282
12283 Disable the use of conditional-move instructions.
12284
12285 This switch is mainly for debugging the compiler and will likely be removed
12286 in a future version.
12287
12288 @item -mscc
12289 @opindex mscc
12290
12291 Enable the use of conditional set instructions (default).
12292
12293 This switch is mainly for debugging the compiler and will likely be removed
12294 in a future version.
12295
12296 @item -mno-scc
12297 @opindex mno-scc
12298
12299 Disable the use of conditional set instructions.
12300
12301 This switch is mainly for debugging the compiler and will likely be removed
12302 in a future version.
12303
12304 @item -mcond-exec
12305 @opindex mcond-exec
12306
12307 Enable the use of conditional execution (default).
12308
12309 This switch is mainly for debugging the compiler and will likely be removed
12310 in a future version.
12311
12312 @item -mno-cond-exec
12313 @opindex mno-cond-exec
12314
12315 Disable the use of conditional execution.
12316
12317 This switch is mainly for debugging the compiler and will likely be removed
12318 in a future version.
12319
12320 @item -mvliw-branch
12321 @opindex mvliw-branch
12322
12323 Run a pass to pack branches into VLIW instructions (default).
12324
12325 This switch is mainly for debugging the compiler and will likely be removed
12326 in a future version.
12327
12328 @item -mno-vliw-branch
12329 @opindex mno-vliw-branch
12330
12331 Do not run a pass to pack branches into VLIW instructions.
12332
12333 This switch is mainly for debugging the compiler and will likely be removed
12334 in a future version.
12335
12336 @item -mmulti-cond-exec
12337 @opindex mmulti-cond-exec
12338
12339 Enable optimization of @code{&&} and @code{||} in conditional execution
12340 (default).
12341
12342 This switch is mainly for debugging the compiler and will likely be removed
12343 in a future version.
12344
12345 @item -mno-multi-cond-exec
12346 @opindex mno-multi-cond-exec
12347
12348 Disable optimization of @code{&&} and @code{||} in conditional execution.
12349
12350 This switch is mainly for debugging the compiler and will likely be removed
12351 in a future version.
12352
12353 @item -mnested-cond-exec
12354 @opindex mnested-cond-exec
12355
12356 Enable nested conditional execution optimizations (default).
12357
12358 This switch is mainly for debugging the compiler and will likely be removed
12359 in a future version.
12360
12361 @item -mno-nested-cond-exec
12362 @opindex mno-nested-cond-exec
12363
12364 Disable nested conditional execution optimizations.
12365
12366 This switch is mainly for debugging the compiler and will likely be removed
12367 in a future version.
12368
12369 @item -moptimize-membar
12370 @opindex moptimize-membar
12371
12372 This switch removes redundant @code{membar} instructions from the
12373 compiler generated code.  It is enabled by default.
12374
12375 @item -mno-optimize-membar
12376 @opindex mno-optimize-membar
12377
12378 This switch disables the automatic removal of redundant @code{membar}
12379 instructions from the generated code.
12380
12381 @item -mtomcat-stats
12382 @opindex mtomcat-stats
12383
12384 Cause gas to print out tomcat statistics.
12385
12386 @item -mcpu=@var{cpu}
12387 @opindex mcpu
12388
12389 Select the processor type for which to generate code.  Possible values are
12390 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
12391 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
12392
12393 @end table
12394
12395 @node GNU/Linux Options
12396 @subsection GNU/Linux Options
12397
12398 These @samp{-m} options are defined for GNU/Linux targets:
12399
12400 @table @gcctabopt
12401 @item -mglibc
12402 @opindex mglibc
12403 Use the GNU C library.  This is the default except
12404 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
12405
12406 @item -muclibc
12407 @opindex muclibc
12408 Use uClibc C library.  This is the default on
12409 @samp{*-*-linux-*uclibc*} targets.
12410
12411 @item -mbionic
12412 @opindex mbionic
12413 Use Bionic C library.  This is the default on
12414 @samp{*-*-linux-*android*} targets.
12415
12416 @item -mandroid
12417 @opindex mandroid
12418 Compile code compatible with Android platform.  This is the default on
12419 @samp{*-*-linux-*android*} targets.
12420
12421 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
12422 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
12423 this option makes the GCC driver pass Android-specific options to the linker.
12424 Finally, this option causes the preprocessor macro @code{__ANDROID__}
12425 to be defined.
12426
12427 @item -tno-android-cc
12428 @opindex tno-android-cc
12429 Disable compilation effects of @option{-mandroid}, i.e., do not enable
12430 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
12431 @option{-fno-rtti} by default.
12432
12433 @item -tno-android-ld
12434 @opindex tno-android-ld
12435 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
12436 linking options to the linker.
12437
12438 @end table
12439
12440 @node H8/300 Options
12441 @subsection H8/300 Options
12442
12443 These @samp{-m} options are defined for the H8/300 implementations:
12444
12445 @table @gcctabopt
12446 @item -mrelax
12447 @opindex mrelax
12448 Shorten some address references at link time, when possible; uses the
12449 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
12450 ld, Using ld}, for a fuller description.
12451
12452 @item -mh
12453 @opindex mh
12454 Generate code for the H8/300H@.
12455
12456 @item -ms
12457 @opindex ms
12458 Generate code for the H8S@.
12459
12460 @item -mn
12461 @opindex mn
12462 Generate code for the H8S and H8/300H in the normal mode.  This switch
12463 must be used either with @option{-mh} or @option{-ms}.
12464
12465 @item -ms2600
12466 @opindex ms2600
12467 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
12468
12469 @item -mint32
12470 @opindex mint32
12471 Make @code{int} data 32 bits by default.
12472
12473 @item -malign-300
12474 @opindex malign-300
12475 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
12476 The default for the H8/300H and H8S is to align longs and floats on 4
12477 byte boundaries.
12478 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
12479 This option has no effect on the H8/300.
12480 @end table
12481
12482 @node HPPA Options
12483 @subsection HPPA Options
12484 @cindex HPPA Options
12485
12486 These @samp{-m} options are defined for the HPPA family of computers:
12487
12488 @table @gcctabopt
12489 @item -march=@var{architecture-type}
12490 @opindex march
12491 Generate code for the specified architecture.  The choices for
12492 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
12493 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
12494 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
12495 architecture option for your machine.  Code compiled for lower numbered
12496 architectures will run on higher numbered architectures, but not the
12497 other way around.
12498
12499 @item -mpa-risc-1-0
12500 @itemx -mpa-risc-1-1
12501 @itemx -mpa-risc-2-0
12502 @opindex mpa-risc-1-0
12503 @opindex mpa-risc-1-1
12504 @opindex mpa-risc-2-0
12505 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
12506
12507 @item -mbig-switch
12508 @opindex mbig-switch
12509 Generate code suitable for big switch tables.  Use this option only if
12510 the assembler/linker complain about out of range branches within a switch
12511 table.
12512
12513 @item -mjump-in-delay
12514 @opindex mjump-in-delay
12515 Fill delay slots of function calls with unconditional jump instructions
12516 by modifying the return pointer for the function call to be the target
12517 of the conditional jump.
12518
12519 @item -mdisable-fpregs
12520 @opindex mdisable-fpregs
12521 Prevent floating point registers from being used in any manner.  This is
12522 necessary for compiling kernels which perform lazy context switching of
12523 floating point registers.  If you use this option and attempt to perform
12524 floating point operations, the compiler will abort.
12525
12526 @item -mdisable-indexing
12527 @opindex mdisable-indexing
12528 Prevent the compiler from using indexing address modes.  This avoids some
12529 rather obscure problems when compiling MIG generated code under MACH@.
12530
12531 @item -mno-space-regs
12532 @opindex mno-space-regs
12533 Generate code that assumes the target has no space registers.  This allows
12534 GCC to generate faster indirect calls and use unscaled index address modes.
12535
12536 Such code is suitable for level 0 PA systems and kernels.
12537
12538 @item -mfast-indirect-calls
12539 @opindex mfast-indirect-calls
12540 Generate code that assumes calls never cross space boundaries.  This
12541 allows GCC to emit code which performs faster indirect calls.
12542
12543 This option will not work in the presence of shared libraries or nested
12544 functions.
12545
12546 @item -mfixed-range=@var{register-range}
12547 @opindex mfixed-range
12548 Generate code treating the given register range as fixed registers.
12549 A fixed register is one that the register allocator can not use.  This is
12550 useful when compiling kernel code.  A register range is specified as
12551 two registers separated by a dash.  Multiple register ranges can be
12552 specified separated by a comma.
12553
12554 @item -mlong-load-store
12555 @opindex mlong-load-store
12556 Generate 3-instruction load and store sequences as sometimes required by
12557 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
12558 the HP compilers.
12559
12560 @item -mportable-runtime
12561 @opindex mportable-runtime
12562 Use the portable calling conventions proposed by HP for ELF systems.
12563
12564 @item -mgas
12565 @opindex mgas
12566 Enable the use of assembler directives only GAS understands.
12567
12568 @item -mschedule=@var{cpu-type}
12569 @opindex mschedule
12570 Schedule code according to the constraints for the machine type
12571 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
12572 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
12573 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
12574 proper scheduling option for your machine.  The default scheduling is
12575 @samp{8000}.
12576
12577 @item -mlinker-opt
12578 @opindex mlinker-opt
12579 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
12580 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
12581 linkers in which they give bogus error messages when linking some programs.
12582
12583 @item -msoft-float
12584 @opindex msoft-float
12585 Generate output containing library calls for floating point.
12586 @strong{Warning:} the requisite libraries are not available for all HPPA
12587 targets.  Normally the facilities of the machine's usual C compiler are
12588 used, but this cannot be done directly in cross-compilation.  You must make
12589 your own arrangements to provide suitable library functions for
12590 cross-compilation.
12591
12592 @option{-msoft-float} changes the calling convention in the output file;
12593 therefore, it is only useful if you compile @emph{all} of a program with
12594 this option.  In particular, you need to compile @file{libgcc.a}, the
12595 library that comes with GCC, with @option{-msoft-float} in order for
12596 this to work.
12597
12598 @item -msio
12599 @opindex msio
12600 Generate the predefine, @code{_SIO}, for server IO@.  The default is
12601 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
12602 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
12603 options are available under HP-UX and HI-UX@.
12604
12605 @item -mgnu-ld
12606 @opindex mgnu-ld
12607 Use GNU ld specific options.  This passes @option{-shared} to ld when
12608 building a shared library.  It is the default when GCC is configured,
12609 explicitly or implicitly, with the GNU linker.  This option does not
12610 have any affect on which ld is called, it only changes what parameters
12611 are passed to that ld.  The ld that is called is determined by the
12612 @option{--with-ld} configure option, GCC's program search path, and
12613 finally by the user's @env{PATH}.  The linker used by GCC can be printed
12614 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
12615 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12616
12617 @item -mhp-ld
12618 @opindex mhp-ld
12619 Use HP ld specific options.  This passes @option{-b} to ld when building
12620 a shared library and passes @option{+Accept TypeMismatch} to ld on all
12621 links.  It is the default when GCC is configured, explicitly or
12622 implicitly, with the HP linker.  This option does not have any affect on
12623 which ld is called, it only changes what parameters are passed to that
12624 ld.  The ld that is called is determined by the @option{--with-ld}
12625 configure option, GCC's program search path, and finally by the user's
12626 @env{PATH}.  The linker used by GCC can be printed using @samp{which
12627 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
12628 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12629
12630 @item -mlong-calls
12631 @opindex mno-long-calls
12632 Generate code that uses long call sequences.  This ensures that a call
12633 is always able to reach linker generated stubs.  The default is to generate
12634 long calls only when the distance from the call site to the beginning
12635 of the function or translation unit, as the case may be, exceeds a
12636 predefined limit set by the branch type being used.  The limits for
12637 normal calls are 7,600,000 and 240,000 bytes, respectively for the
12638 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
12639 240,000 bytes.
12640
12641 Distances are measured from the beginning of functions when using the
12642 @option{-ffunction-sections} option, or when using the @option{-mgas}
12643 and @option{-mno-portable-runtime} options together under HP-UX with
12644 the SOM linker.
12645
12646 It is normally not desirable to use this option as it will degrade
12647 performance.  However, it may be useful in large applications,
12648 particularly when partial linking is used to build the application.
12649
12650 The types of long calls used depends on the capabilities of the
12651 assembler and linker, and the type of code being generated.  The
12652 impact on systems that support long absolute calls, and long pic
12653 symbol-difference or pc-relative calls should be relatively small.
12654 However, an indirect call is used on 32-bit ELF systems in pic code
12655 and it is quite long.
12656
12657 @item -munix=@var{unix-std}
12658 @opindex march
12659 Generate compiler predefines and select a startfile for the specified
12660 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
12661 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
12662 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
12663 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
12664 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
12665 and later.
12666
12667 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
12668 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
12669 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
12670 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
12671 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
12672 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
12673
12674 It is @emph{important} to note that this option changes the interfaces
12675 for various library routines.  It also affects the operational behavior
12676 of the C library.  Thus, @emph{extreme} care is needed in using this
12677 option.
12678
12679 Library code that is intended to operate with more than one UNIX
12680 standard must test, set and restore the variable @var{__xpg4_extended_mask}
12681 as appropriate.  Most GNU software doesn't provide this capability.
12682
12683 @item -nolibdld
12684 @opindex nolibdld
12685 Suppress the generation of link options to search libdld.sl when the
12686 @option{-static} option is specified on HP-UX 10 and later.
12687
12688 @item -static
12689 @opindex static
12690 The HP-UX implementation of setlocale in libc has a dependency on
12691 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
12692 when the @option{-static} option is specified, special link options
12693 are needed to resolve this dependency.
12694
12695 On HP-UX 10 and later, the GCC driver adds the necessary options to
12696 link with libdld.sl when the @option{-static} option is specified.
12697 This causes the resulting binary to be dynamic.  On the 64-bit port,
12698 the linkers generate dynamic binaries by default in any case.  The
12699 @option{-nolibdld} option can be used to prevent the GCC driver from
12700 adding these link options.
12701
12702 @item -threads
12703 @opindex threads
12704 Add support for multithreading with the @dfn{dce thread} library
12705 under HP-UX@.  This option sets flags for both the preprocessor and
12706 linker.
12707 @end table
12708
12709 @node i386 and x86-64 Options
12710 @subsection Intel 386 and AMD x86-64 Options
12711 @cindex i386 Options
12712 @cindex x86-64 Options
12713 @cindex Intel 386 Options
12714 @cindex AMD x86-64 Options
12715
12716 These @samp{-m} options are defined for the i386 and x86-64 family of
12717 computers:
12718
12719 @table @gcctabopt
12720 @item -mtune=@var{cpu-type}
12721 @opindex mtune
12722 Tune to @var{cpu-type} everything applicable about the generated code, except
12723 for the ABI and the set of available instructions.  The choices for
12724 @var{cpu-type} are:
12725 @table @emph
12726 @item generic
12727 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
12728 If you know the CPU on which your code will run, then you should use
12729 the corresponding @option{-mtune} option instead of
12730 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
12731 of your application will have, then you should use this option.
12732
12733 As new processors are deployed in the marketplace, the behavior of this
12734 option will change.  Therefore, if you upgrade to a newer version of
12735 GCC, the code generated option will change to reflect the processors
12736 that were most common when that version of GCC was released.
12737
12738 There is no @option{-march=generic} option because @option{-march}
12739 indicates the instruction set the compiler can use, and there is no
12740 generic instruction set applicable to all processors.  In contrast,
12741 @option{-mtune} indicates the processor (or, in this case, collection of
12742 processors) for which the code is optimized.
12743 @item native
12744 This selects the CPU to tune for at compilation time by determining
12745 the processor type of the compiling machine.  Using @option{-mtune=native}
12746 will produce code optimized for the local machine under the constraints
12747 of the selected instruction set.  Using @option{-march=native} will
12748 enable all instruction subsets supported by the local machine (hence
12749 the result might not run on different machines).
12750 @item i386
12751 Original Intel's i386 CPU@.
12752 @item i486
12753 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
12754 @item i586, pentium
12755 Intel Pentium CPU with no MMX support.
12756 @item pentium-mmx
12757 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
12758 @item pentiumpro
12759 Intel PentiumPro CPU@.
12760 @item i686
12761 Same as @code{generic}, but when used as @code{march} option, PentiumPro
12762 instruction set will be used, so the code will run on all i686 family chips.
12763 @item pentium2
12764 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
12765 @item pentium3, pentium3m
12766 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
12767 support.
12768 @item pentium-m
12769 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
12770 support.  Used by Centrino notebooks.
12771 @item pentium4, pentium4m
12772 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
12773 @item prescott
12774 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
12775 set support.
12776 @item nocona
12777 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
12778 SSE2 and SSE3 instruction set support.
12779 @item core2
12780 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12781 instruction set support.
12782 @item corei7
12783 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
12784 and SSE4.2 instruction set support.
12785 @item corei7-avx
12786 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12787 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
12788 @item core-avx-i
12789 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12790 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
12791 set support.
12792 @item atom
12793 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12794 instruction set support.
12795 @item k6
12796 AMD K6 CPU with MMX instruction set support.
12797 @item k6-2, k6-3
12798 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
12799 @item athlon, athlon-tbird
12800 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
12801 support.
12802 @item athlon-4, athlon-xp, athlon-mp
12803 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
12804 instruction set support.
12805 @item k8, opteron, athlon64, athlon-fx
12806 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
12807 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
12808 @item k8-sse3, opteron-sse3, athlon64-sse3
12809 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
12810 @item amdfam10, barcelona
12811 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
12812 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12813 instruction set extensions.)
12814 @item bdver1
12815 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
12816 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
12817 SSSE3, SSE4.1, SSE4.2, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12818 instruction set extensions.)
12819 @item btver1
12820 AMD Family 14h core based CPUs with x86-64 instruction set support.  (This
12821 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
12822 instruction set extensions.)
12823 @item winchip-c6
12824 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
12825 set support.
12826 @item winchip2
12827 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
12828 instruction set support.
12829 @item c3
12830 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
12831 implemented for this chip.)
12832 @item c3-2
12833 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
12834 implemented for this chip.)
12835 @item geode
12836 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
12837 @end table
12838
12839 While picking a specific @var{cpu-type} will schedule things appropriately
12840 for that particular chip, the compiler will not generate any code that
12841 does not run on the i386 without the @option{-march=@var{cpu-type}} option
12842 being used.
12843
12844 @item -march=@var{cpu-type}
12845 @opindex march
12846 Generate instructions for the machine type @var{cpu-type}.  The choices
12847 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
12848 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
12849
12850 @item -mcpu=@var{cpu-type}
12851 @opindex mcpu
12852 A deprecated synonym for @option{-mtune}.
12853
12854 @item -mfpmath=@var{unit}
12855 @opindex mfpmath
12856 Generate floating point arithmetics for selected unit @var{unit}.  The choices
12857 for @var{unit} are:
12858
12859 @table @samp
12860 @item 387
12861 Use the standard 387 floating point coprocessor present majority of chips and
12862 emulated otherwise.  Code compiled with this option will run almost everywhere.
12863 The temporary results are computed in 80bit precision instead of precision
12864 specified by the type resulting in slightly different results compared to most
12865 of other chips.  See @option{-ffloat-store} for more detailed description.
12866
12867 This is the default choice for i386 compiler.
12868
12869 @item sse
12870 Use scalar floating point instructions present in the SSE instruction set.
12871 This instruction set is supported by Pentium3 and newer chips, in the AMD line
12872 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
12873 instruction set supports only single precision arithmetics, thus the double and
12874 extended precision arithmetics is still done using 387.  Later version, present
12875 only in Pentium4 and the future AMD x86-64 chips supports double precision
12876 arithmetics too.
12877
12878 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
12879 or @option{-msse2} switches to enable SSE extensions and make this option
12880 effective.  For the x86-64 compiler, these extensions are enabled by default.
12881
12882 The resulting code should be considerably faster in the majority of cases and avoid
12883 the numerical instability problems of 387 code, but may break some existing
12884 code that expects temporaries to be 80bit.
12885
12886 This is the default choice for the x86-64 compiler.
12887
12888 @item sse,387
12889 @itemx sse+387
12890 @itemx both
12891 Attempt to utilize both instruction sets at once.  This effectively double the
12892 amount of available registers and on chips with separate execution units for
12893 387 and SSE the execution resources too.  Use this option with care, as it is
12894 still experimental, because the GCC register allocator does not model separate
12895 functional units well resulting in instable performance.
12896 @end table
12897
12898 @item -masm=@var{dialect}
12899 @opindex masm=@var{dialect}
12900 Output asm instructions using selected @var{dialect}.  Supported
12901 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
12902 not support @samp{intel}.
12903
12904 @item -mieee-fp
12905 @itemx -mno-ieee-fp
12906 @opindex mieee-fp
12907 @opindex mno-ieee-fp
12908 Control whether or not the compiler uses IEEE floating point
12909 comparisons.  These handle correctly the case where the result of a
12910 comparison is unordered.
12911
12912 @item -msoft-float
12913 @opindex msoft-float
12914 Generate output containing library calls for floating point.
12915 @strong{Warning:} the requisite libraries are not part of GCC@.
12916 Normally the facilities of the machine's usual C compiler are used, but
12917 this can't be done directly in cross-compilation.  You must make your
12918 own arrangements to provide suitable library functions for
12919 cross-compilation.
12920
12921 On machines where a function returns floating point results in the 80387
12922 register stack, some floating point opcodes may be emitted even if
12923 @option{-msoft-float} is used.
12924
12925 @item -mno-fp-ret-in-387
12926 @opindex mno-fp-ret-in-387
12927 Do not use the FPU registers for return values of functions.
12928
12929 The usual calling convention has functions return values of types
12930 @code{float} and @code{double} in an FPU register, even if there
12931 is no FPU@.  The idea is that the operating system should emulate
12932 an FPU@.
12933
12934 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12935 in ordinary CPU registers instead.
12936
12937 @item -mno-fancy-math-387
12938 @opindex mno-fancy-math-387
12939 Some 387 emulators do not support the @code{sin}, @code{cos} and
12940 @code{sqrt} instructions for the 387.  Specify this option to avoid
12941 generating those instructions.  This option is the default on FreeBSD,
12942 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12943 indicates that the target CPU will always have an FPU and so the
12944 instruction will not need emulation.  As of revision 2.6.1, these
12945 instructions are not generated unless you also use the
12946 @option{-funsafe-math-optimizations} switch.
12947
12948 @item -malign-double
12949 @itemx -mno-align-double
12950 @opindex malign-double
12951 @opindex mno-align-double
12952 Control whether GCC aligns @code{double}, @code{long double}, and
12953 @code{long long} variables on a two word boundary or a one word
12954 boundary.  Aligning @code{double} variables on a two word boundary will
12955 produce code that runs somewhat faster on a @samp{Pentium} at the
12956 expense of more memory.
12957
12958 On x86-64, @option{-malign-double} is enabled by default.
12959
12960 @strong{Warning:} if you use the @option{-malign-double} switch,
12961 structures containing the above types will be aligned differently than
12962 the published application binary interface specifications for the 386
12963 and will not be binary compatible with structures in code compiled
12964 without that switch.
12965
12966 @item -m96bit-long-double
12967 @itemx -m128bit-long-double
12968 @opindex m96bit-long-double
12969 @opindex m128bit-long-double
12970 These switches control the size of @code{long double} type.  The i386
12971 application binary interface specifies the size to be 96 bits,
12972 so @option{-m96bit-long-double} is the default in 32 bit mode.
12973
12974 Modern architectures (Pentium and newer) would prefer @code{long double}
12975 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12976 conforming to the ABI, this would not be possible.  So specifying a
12977 @option{-m128bit-long-double} will align @code{long double}
12978 to a 16 byte boundary by padding the @code{long double} with an additional
12979 32 bit zero.
12980
12981 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12982 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12983
12984 Notice that neither of these options enable any extra precision over the x87
12985 standard of 80 bits for a @code{long double}.
12986
12987 @strong{Warning:} if you override the default value for your target ABI, the
12988 structures and arrays containing @code{long double} variables will change
12989 their size as well as function calling convention for function taking
12990 @code{long double} will be modified.  Hence they will not be binary
12991 compatible with arrays or structures in code compiled without that switch.
12992
12993 @item -mlarge-data-threshold=@var{number}
12994 @opindex mlarge-data-threshold=@var{number}
12995 When @option{-mcmodel=medium} is specified, the data greater than
12996 @var{threshold} are placed in large data section.  This value must be the
12997 same across all object linked into the binary and defaults to 65535.
12998
12999 @item -mrtd
13000 @opindex mrtd
13001 Use a different function-calling convention, in which functions that
13002 take a fixed number of arguments return with the @code{ret} @var{num}
13003 instruction, which pops their arguments while returning.  This saves one
13004 instruction in the caller since there is no need to pop the arguments
13005 there.
13006
13007 You can specify that an individual function is called with this calling
13008 sequence with the function attribute @samp{stdcall}.  You can also
13009 override the @option{-mrtd} option by using the function attribute
13010 @samp{cdecl}.  @xref{Function Attributes}.
13011
13012 @strong{Warning:} this calling convention is incompatible with the one
13013 normally used on Unix, so you cannot use it if you need to call
13014 libraries compiled with the Unix compiler.
13015
13016 Also, you must provide function prototypes for all functions that
13017 take variable numbers of arguments (including @code{printf});
13018 otherwise incorrect code will be generated for calls to those
13019 functions.
13020
13021 In addition, seriously incorrect code will result if you call a
13022 function with too many arguments.  (Normally, extra arguments are
13023 harmlessly ignored.)
13024
13025 @item -mregparm=@var{num}
13026 @opindex mregparm
13027 Control how many registers are used to pass integer arguments.  By
13028 default, no registers are used to pass arguments, and at most 3
13029 registers can be used.  You can control this behavior for a specific
13030 function by using the function attribute @samp{regparm}.
13031 @xref{Function Attributes}.
13032
13033 @strong{Warning:} if you use this switch, and
13034 @var{num} is nonzero, then you must build all modules with the same
13035 value, including any libraries.  This includes the system libraries and
13036 startup modules.
13037
13038 @item -msseregparm
13039 @opindex msseregparm
13040 Use SSE register passing conventions for float and double arguments
13041 and return values.  You can control this behavior for a specific
13042 function by using the function attribute @samp{sseregparm}.
13043 @xref{Function Attributes}.
13044
13045 @strong{Warning:} if you use this switch then you must build all
13046 modules with the same value, including any libraries.  This includes
13047 the system libraries and startup modules.
13048
13049 @item -mvect8-ret-in-mem
13050 @opindex mvect8-ret-in-mem
13051 Return 8-byte vectors in memory instead of MMX registers.  This is the
13052 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
13053 Studio compilers until version 12.  Later compiler versions (starting
13054 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
13055 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
13056 you need to remain compatible with existing code produced by those
13057 previous compiler versions or older versions of GCC.
13058
13059 @item -mpc32
13060 @itemx -mpc64
13061 @itemx -mpc80
13062 @opindex mpc32
13063 @opindex mpc64
13064 @opindex mpc80
13065
13066 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
13067 is specified, the significands of results of floating-point operations are
13068 rounded to 24 bits (single precision); @option{-mpc64} rounds the
13069 significands of results of floating-point operations to 53 bits (double
13070 precision) and @option{-mpc80} rounds the significands of results of
13071 floating-point operations to 64 bits (extended double precision), which is
13072 the default.  When this option is used, floating-point operations in higher
13073 precisions are not available to the programmer without setting the FPU
13074 control word explicitly.
13075
13076 Setting the rounding of floating-point operations to less than the default
13077 80 bits can speed some programs by 2% or more.  Note that some mathematical
13078 libraries assume that extended precision (80 bit) floating-point operations
13079 are enabled by default; routines in such libraries could suffer significant
13080 loss of accuracy, typically through so-called "catastrophic cancellation",
13081 when this option is used to set the precision to less than extended precision.
13082
13083 @item -mstackrealign
13084 @opindex mstackrealign
13085 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
13086 option will generate an alternate prologue and epilogue that realigns the
13087 runtime stack if necessary.  This supports mixing legacy codes that keep
13088 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
13089 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
13090 applicable to individual functions.
13091
13092 @item -mpreferred-stack-boundary=@var{num}
13093 @opindex mpreferred-stack-boundary
13094 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
13095 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
13096 the default is 4 (16 bytes or 128 bits).
13097
13098 @item -mincoming-stack-boundary=@var{num}
13099 @opindex mincoming-stack-boundary
13100 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
13101 boundary.  If @option{-mincoming-stack-boundary} is not specified,
13102 the one specified by @option{-mpreferred-stack-boundary} will be used.
13103
13104 On Pentium and PentiumPro, @code{double} and @code{long double} values
13105 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
13106 suffer significant run time performance penalties.  On Pentium III, the
13107 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
13108 properly if it is not 16 byte aligned.
13109
13110 To ensure proper alignment of this values on the stack, the stack boundary
13111 must be as aligned as that required by any value stored on the stack.
13112 Further, every function must be generated such that it keeps the stack
13113 aligned.  Thus calling a function compiled with a higher preferred
13114 stack boundary from a function compiled with a lower preferred stack
13115 boundary will most likely misalign the stack.  It is recommended that
13116 libraries that use callbacks always use the default setting.
13117
13118 This extra alignment does consume extra stack space, and generally
13119 increases code size.  Code that is sensitive to stack space usage, such
13120 as embedded systems and operating system kernels, may want to reduce the
13121 preferred alignment to @option{-mpreferred-stack-boundary=2}.
13122
13123 @item -mmmx
13124 @itemx -mno-mmx
13125 @itemx -msse
13126 @itemx -mno-sse
13127 @itemx -msse2
13128 @itemx -mno-sse2
13129 @itemx -msse3
13130 @itemx -mno-sse3
13131 @itemx -mssse3
13132 @itemx -mno-ssse3
13133 @itemx -msse4.1
13134 @need 800
13135 @itemx -mno-sse4.1
13136 @itemx -msse4.2
13137 @itemx -mno-sse4.2
13138 @itemx -msse4
13139 @itemx -mno-sse4
13140 @itemx -mavx
13141 @itemx -mno-avx
13142 @itemx -mavx2
13143 @itemx -mno-avx2
13144 @itemx -maes
13145 @itemx -mno-aes
13146 @itemx -mpclmul
13147 @need 800
13148 @itemx -mno-pclmul
13149 @itemx -mfsgsbase
13150 @itemx -mno-fsgsbase
13151 @itemx -mrdrnd
13152 @itemx -mno-rdrnd
13153 @itemx -mf16c
13154 @itemx -mno-f16c
13155 @itemx -mfma
13156 @itemx -mno-fma
13157 @itemx -msse4a
13158 @itemx -mno-sse4a
13159 @itemx -mfma4
13160 @need 800
13161 @itemx -mno-fma4
13162 @itemx -mxop
13163 @itemx -mno-xop
13164 @itemx -mlwp
13165 @itemx -mno-lwp
13166 @itemx -m3dnow
13167 @itemx -mno-3dnow
13168 @itemx -mpopcnt
13169 @itemx -mno-popcnt
13170 @itemx -mabm
13171 @itemx -mno-abm
13172 @itemx -mbmi
13173 @itemx -mbmi2
13174 @itemx -mno-bmi
13175 @itemx -mno-bmi2
13176 @itemx -mlzcnt
13177 @itemx -mno-lzcnt
13178 @itemx -mtbm
13179 @itemx -mno-tbm
13180 @opindex mmmx
13181 @opindex mno-mmx
13182 @opindex msse
13183 @opindex mno-sse
13184 @opindex m3dnow
13185 @opindex mno-3dnow
13186 These switches enable or disable the use of instructions in the MMX, SSE,
13187 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
13188 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT or 3DNow!
13189 @: extended instruction sets.
13190 These extensions are also available as built-in functions: see
13191 @ref{X86 Built-in Functions}, for details of the functions enabled and
13192 disabled by these switches.
13193
13194 To have SSE/SSE2 instructions generated automatically from floating-point
13195 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
13196
13197 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
13198 generates new AVX instructions or AVX equivalence for all SSEx instructions
13199 when needed.
13200
13201 These options will enable GCC to use these extended instructions in
13202 generated code, even without @option{-mfpmath=sse}.  Applications which
13203 perform runtime CPU detection must compile separate files for each
13204 supported architecture, using the appropriate flags.  In particular,
13205 the file containing the CPU detection code should be compiled without
13206 these options.
13207
13208 @item -mcld
13209 @opindex mcld
13210 This option instructs GCC to emit a @code{cld} instruction in the prologue
13211 of functions that use string instructions.  String instructions depend on
13212 the DF flag to select between autoincrement or autodecrement mode.  While the
13213 ABI specifies the DF flag to be cleared on function entry, some operating
13214 systems violate this specification by not clearing the DF flag in their
13215 exception dispatchers.  The exception handler can be invoked with the DF flag
13216 set which leads to wrong direction mode, when string instructions are used.
13217 This option can be enabled by default on 32-bit x86 targets by configuring
13218 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
13219 instructions can be suppressed with the @option{-mno-cld} compiler option
13220 in this case.
13221
13222 @item -mvzeroupper
13223 @opindex mvzeroupper
13224 This option instructs GCC to emit a @code{vzeroupper} instruction
13225 before a transfer of control flow out of the function to minimize
13226 AVX to SSE transition penalty as well as remove unnecessary zeroupper
13227 intrinsics.
13228
13229 @item -mcx16
13230 @opindex mcx16
13231 This option will enable GCC to use CMPXCHG16B instruction in generated code.
13232 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
13233 data types.  This is useful for high resolution counters that could be updated
13234 by multiple processors (or cores).  This instruction is generated as part of
13235 atomic built-in functions: see @ref{__sync Builtins} or
13236 @ref{__atomic Builtins} for details.
13237
13238 @item -msahf
13239 @opindex msahf
13240 This option will enable GCC to use SAHF instruction in generated 64-bit code.
13241 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
13242 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
13243 SAHF are load and store instructions, respectively, for certain status flags.
13244 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
13245 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
13246
13247 @item -mmovbe
13248 @opindex mmovbe
13249 This option will enable GCC to use movbe instruction to implement
13250 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
13251
13252 @item -mcrc32
13253 @opindex mcrc32
13254 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
13255 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
13256 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
13257
13258 @item -mrecip
13259 @opindex mrecip
13260 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
13261 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
13262 to increase precision instead of DIVSS and SQRTSS (and their vectorized
13263 variants) for single precision floating point arguments.  These instructions
13264 are generated only when @option{-funsafe-math-optimizations} is enabled
13265 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
13266 Note that while the throughput of the sequence is higher than the throughput
13267 of the non-reciprocal instruction, the precision of the sequence can be
13268 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
13269
13270 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of RSQRTSS
13271 (or RSQRTPS) already with @option{-ffast-math} (or the above option
13272 combination), and doesn't need @option{-mrecip}.
13273
13274 Also note that GCC emits the above sequence with additional Newton-Raphson step
13275 for vectorized single float division and vectorized @code{sqrtf(@var{x})}
13276 already with @option{-ffast-math} (or the above option combination), and
13277 doesn't need @option{-mrecip}.
13278
13279 @item -mrecip=@var{opt}
13280 @opindex mrecip=opt
13281 This option allows to control which reciprocal estimate instructions
13282 may be used.  @var{opt} is a comma separated list of options, that may
13283 be preceded by a @code{!} to invert the option:
13284 @code{all}: enable all estimate instructions,
13285 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
13286 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip},
13287 @code{div}: enable the approximation for scalar division,
13288 @code{vec-div}: enable the approximation for vectorized division,
13289 @code{sqrt}: enable the approximation for scalar square root,
13290 @code{vec-sqrt}: enable the approximation for vectorized square root.
13291
13292 So for example, @option{-mrecip=all,!sqrt} would enable
13293 all of the reciprocal approximations, except for square root.
13294
13295 @item -mveclibabi=@var{type}
13296 @opindex mveclibabi
13297 Specifies the ABI type to use for vectorizing intrinsics using an
13298 external library.  Supported types are @code{svml} for the Intel short
13299 vector math library and @code{acml} for the AMD math core library style
13300 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
13301 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
13302 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
13303 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
13304 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
13305 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
13306 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
13307 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
13308 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
13309 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
13310 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
13311 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
13312 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
13313 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
13314 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
13315 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
13316 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
13317 compatible library will have to be specified at link time.
13318
13319 @item -mabi=@var{name}
13320 @opindex mabi
13321 Generate code for the specified calling convention.  Permissible values
13322 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
13323 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
13324 ABI when targeting Windows.  On all other systems, the default is the
13325 SYSV ABI.  You can control this behavior for a specific function by
13326 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
13327 @xref{Function Attributes}.
13328
13329 @item -mtls-dialect=@var{type}
13330 @opindex mtls-dialect
13331 Generate code to access thread-local storage using the @samp{gnu} or
13332 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
13333 @samp{gnu2} is more efficient, but it may add compile- and run-time
13334 requirements that cannot be satisfied on all systems.
13335
13336 @item -mpush-args
13337 @itemx -mno-push-args
13338 @opindex mpush-args
13339 @opindex mno-push-args
13340 Use PUSH operations to store outgoing parameters.  This method is shorter
13341 and usually equally fast as method using SUB/MOV operations and is enabled
13342 by default.  In some cases disabling it may improve performance because of
13343 improved scheduling and reduced dependencies.
13344
13345 @item -maccumulate-outgoing-args
13346 @opindex maccumulate-outgoing-args
13347 If enabled, the maximum amount of space required for outgoing arguments will be
13348 computed in the function prologue.  This is faster on most modern CPUs
13349 because of reduced dependencies, improved scheduling and reduced stack usage
13350 when preferred stack boundary is not equal to 2.  The drawback is a notable
13351 increase in code size.  This switch implies @option{-mno-push-args}.
13352
13353 @item -mthreads
13354 @opindex mthreads
13355 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
13356 on thread-safe exception handling must compile and link all code with the
13357 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
13358 @option{-D_MT}; when linking, it links in a special thread helper library
13359 @option{-lmingwthrd} which cleans up per thread exception handling data.
13360
13361 @item -mno-align-stringops
13362 @opindex mno-align-stringops
13363 Do not align destination of inlined string operations.  This switch reduces
13364 code size and improves performance in case the destination is already aligned,
13365 but GCC doesn't know about it.
13366
13367 @item -minline-all-stringops
13368 @opindex minline-all-stringops
13369 By default GCC inlines string operations only when destination is known to be
13370 aligned at least to 4 byte boundary.  This enables more inlining, increase code
13371 size, but may improve performance of code that depends on fast memcpy, strlen
13372 and memset for short lengths.
13373
13374 @item -minline-stringops-dynamically
13375 @opindex minline-stringops-dynamically
13376 For string operation of unknown size, inline runtime checks so for small
13377 blocks inline code is used, while for large blocks library call is used.
13378
13379 @item -mstringop-strategy=@var{alg}
13380 @opindex mstringop-strategy=@var{alg}
13381 Overwrite internal decision heuristic about particular algorithm to inline
13382 string operation with.  The allowed values are @code{rep_byte},
13383 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
13384 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
13385 expanding inline loop, @code{libcall} for always expanding library call.
13386
13387 @item -momit-leaf-frame-pointer
13388 @opindex momit-leaf-frame-pointer
13389 Don't keep the frame pointer in a register for leaf functions.  This
13390 avoids the instructions to save, set up and restore frame pointers and
13391 makes an extra register available in leaf functions.  The option
13392 @option{-fomit-frame-pointer} removes the frame pointer for all functions
13393 which might make debugging harder.
13394
13395 @item -mtls-direct-seg-refs
13396 @itemx -mno-tls-direct-seg-refs
13397 @opindex mtls-direct-seg-refs
13398 Controls whether TLS variables may be accessed with offsets from the
13399 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
13400 or whether the thread base pointer must be added.  Whether or not this
13401 is legal depends on the operating system, and whether it maps the
13402 segment to cover the entire TLS area.
13403
13404 For systems that use GNU libc, the default is on.
13405
13406 @item -msse2avx
13407 @itemx -mno-sse2avx
13408 @opindex msse2avx
13409 Specify that the assembler should encode SSE instructions with VEX
13410 prefix.  The option @option{-mavx} turns this on by default.
13411
13412 @item -mfentry
13413 @itemx -mno-fentry
13414 @opindex mfentry
13415 If profiling is active @option{-pg} put the profiling
13416 counter call before prologue.
13417 Note: On x86 architectures the attribute @code{ms_hook_prologue}
13418 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
13419
13420 @item -m8bit-idiv
13421 @itemx -mno-8bit-idiv
13422 @opindex 8bit-idiv
13423 On some processors, like Intel Atom, 8bit unsigned integer divide is
13424 much faster than 32bit/64bit integer divide.  This option will generate a
13425 runt-time check.  If both dividend and divisor are within range of 0
13426 to 255, 8bit unsigned integer divide will be used instead of
13427 32bit/64bit integer divide.
13428
13429 @item -mavx256-split-unaligned-load
13430 @item -mavx256-split-unaligned-store
13431 @opindex avx256-split-unaligned-load
13432 @opindex avx256-split-unaligned-store
13433 Split 32-byte AVX unaligned load and store.
13434
13435 @end table
13436
13437 These @samp{-m} switches are supported in addition to the above
13438 on AMD x86-64 processors in 64-bit environments.
13439
13440 @table @gcctabopt
13441 @item -m32
13442 @itemx -m64
13443 @itemx -mx32
13444 @opindex m32
13445 @opindex m64
13446 @opindex mx32
13447 Generate code for a 32-bit or 64-bit environment.
13448 The @option{-m32} option sets int, long and pointer to 32 bits and
13449 generates code that runs on any i386 system.
13450 The @option{-m64} option sets int to 32 bits and long and pointer
13451 to 64 bits and generates code for AMD's x86-64 architecture.
13452 The @option{-mx32} option sets int, long and pointer to 32 bits and
13453 generates code for AMD's x86-64 architecture.
13454 For darwin only the @option{-m64} option turns off the @option{-fno-pic}
13455 and @option{-mdynamic-no-pic} options.
13456
13457 @item -mno-red-zone
13458 @opindex mno-red-zone
13459 Do not use a so called red zone for x86-64 code.  The red zone is mandated
13460 by the x86-64 ABI, it is a 128-byte area beyond the location of the
13461 stack pointer that will not be modified by signal or interrupt handlers
13462 and therefore can be used for temporary data without adjusting the stack
13463 pointer.  The flag @option{-mno-red-zone} disables this red zone.
13464
13465 @item -mcmodel=small
13466 @opindex mcmodel=small
13467 Generate code for the small code model: the program and its symbols must
13468 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
13469 Programs can be statically or dynamically linked.  This is the default
13470 code model.
13471
13472 @item -mcmodel=kernel
13473 @opindex mcmodel=kernel
13474 Generate code for the kernel code model.  The kernel runs in the
13475 negative 2 GB of the address space.
13476 This model has to be used for Linux kernel code.
13477
13478 @item -mcmodel=medium
13479 @opindex mcmodel=medium
13480 Generate code for the medium model: The program is linked in the lower 2
13481 GB of the address space.  Small symbols are also placed there.  Symbols
13482 with sizes larger than @option{-mlarge-data-threshold} are put into
13483 large data or bss sections and can be located above 2GB.  Programs can
13484 be statically or dynamically linked.
13485
13486 @item -mcmodel=large
13487 @opindex mcmodel=large
13488 Generate code for the large model: This model makes no assumptions
13489 about addresses and sizes of sections.
13490 @end table
13491
13492 @node i386 and x86-64 Windows Options
13493 @subsection i386 and x86-64 Windows Options
13494 @cindex i386 and x86-64 Windows Options
13495
13496 These additional options are available for Windows targets:
13497
13498 @table @gcctabopt
13499 @item -mconsole
13500 @opindex mconsole
13501 This option is available for Cygwin and MinGW targets.  It
13502 specifies that a console application is to be generated, by
13503 instructing the linker to set the PE header subsystem type
13504 required for console applications.
13505 This is the default behavior for Cygwin and MinGW targets.
13506
13507 @item -mdll
13508 @opindex mdll
13509 This option is available for Cygwin and MinGW targets.  It
13510 specifies that a DLL - a dynamic link library - is to be
13511 generated, enabling the selection of the required runtime
13512 startup object and entry point.
13513
13514 @item -mnop-fun-dllimport
13515 @opindex mnop-fun-dllimport
13516 This option is available for Cygwin and MinGW targets.  It
13517 specifies that the dllimport attribute should be ignored.
13518
13519 @item -mthread
13520 @opindex mthread
13521 This option is available for MinGW targets. It specifies
13522 that MinGW-specific thread support is to be used.
13523
13524 @item -municode
13525 @opindex municode
13526 This option is available for mingw-w64 targets.  It specifies
13527 that the UNICODE macro is getting pre-defined and that the
13528 unicode capable runtime startup code is chosen.
13529
13530 @item -mwin32
13531 @opindex mwin32
13532 This option is available for Cygwin and MinGW targets.  It
13533 specifies that the typical Windows pre-defined macros are to
13534 be set in the pre-processor, but does not influence the choice
13535 of runtime library/startup code.
13536
13537 @item -mwindows
13538 @opindex mwindows
13539 This option is available for Cygwin and MinGW targets.  It
13540 specifies that a GUI application is to be generated by
13541 instructing the linker to set the PE header subsystem type
13542 appropriately.
13543
13544 @item -fno-set-stack-executable
13545 @opindex fno-set-stack-executable
13546 This option is available for MinGW targets. It specifies that
13547 the executable flag for stack used by nested functions isn't
13548 set. This is necessary for binaries running in kernel mode of
13549 Windows, as there the user32 API, which is used to set executable
13550 privileges, isn't available.
13551
13552 @item -mpe-aligned-commons
13553 @opindex mpe-aligned-commons
13554 This option is available for Cygwin and MinGW targets.  It
13555 specifies that the GNU extension to the PE file format that
13556 permits the correct alignment of COMMON variables should be
13557 used when generating code.  It will be enabled by default if
13558 GCC detects that the target assembler found during configuration
13559 supports the feature.
13560 @end table
13561
13562 See also under @ref{i386 and x86-64 Options} for standard options.
13563
13564 @node IA-64 Options
13565 @subsection IA-64 Options
13566 @cindex IA-64 Options
13567
13568 These are the @samp{-m} options defined for the Intel IA-64 architecture.
13569
13570 @table @gcctabopt
13571 @item -mbig-endian
13572 @opindex mbig-endian
13573 Generate code for a big endian target.  This is the default for HP-UX@.
13574
13575 @item -mlittle-endian
13576 @opindex mlittle-endian
13577 Generate code for a little endian target.  This is the default for AIX5
13578 and GNU/Linux.
13579
13580 @item -mgnu-as
13581 @itemx -mno-gnu-as
13582 @opindex mgnu-as
13583 @opindex mno-gnu-as
13584 Generate (or don't) code for the GNU assembler.  This is the default.
13585 @c Also, this is the default if the configure option @option{--with-gnu-as}
13586 @c is used.
13587
13588 @item -mgnu-ld
13589 @itemx -mno-gnu-ld
13590 @opindex mgnu-ld
13591 @opindex mno-gnu-ld
13592 Generate (or don't) code for the GNU linker.  This is the default.
13593 @c Also, this is the default if the configure option @option{--with-gnu-ld}
13594 @c is used.
13595
13596 @item -mno-pic
13597 @opindex mno-pic
13598 Generate code that does not use a global pointer register.  The result
13599 is not position independent code, and violates the IA-64 ABI@.
13600
13601 @item -mvolatile-asm-stop
13602 @itemx -mno-volatile-asm-stop
13603 @opindex mvolatile-asm-stop
13604 @opindex mno-volatile-asm-stop
13605 Generate (or don't) a stop bit immediately before and after volatile asm
13606 statements.
13607
13608 @item -mregister-names
13609 @itemx -mno-register-names
13610 @opindex mregister-names
13611 @opindex mno-register-names
13612 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
13613 the stacked registers.  This may make assembler output more readable.
13614
13615 @item -mno-sdata
13616 @itemx -msdata
13617 @opindex mno-sdata
13618 @opindex msdata
13619 Disable (or enable) optimizations that use the small data section.  This may
13620 be useful for working around optimizer bugs.
13621
13622 @item -mconstant-gp
13623 @opindex mconstant-gp
13624 Generate code that uses a single constant global pointer value.  This is
13625 useful when compiling kernel code.
13626
13627 @item -mauto-pic
13628 @opindex mauto-pic
13629 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
13630 This is useful when compiling firmware code.
13631
13632 @item -minline-float-divide-min-latency
13633 @opindex minline-float-divide-min-latency
13634 Generate code for inline divides of floating point values
13635 using the minimum latency algorithm.
13636
13637 @item -minline-float-divide-max-throughput
13638 @opindex minline-float-divide-max-throughput
13639 Generate code for inline divides of floating point values
13640 using the maximum throughput algorithm.
13641
13642 @item -mno-inline-float-divide
13643 @opindex mno-inline-float-divide
13644 Do not generate inline code for divides of floating point values.
13645
13646 @item -minline-int-divide-min-latency
13647 @opindex minline-int-divide-min-latency
13648 Generate code for inline divides of integer values
13649 using the minimum latency algorithm.
13650
13651 @item -minline-int-divide-max-throughput
13652 @opindex minline-int-divide-max-throughput
13653 Generate code for inline divides of integer values
13654 using the maximum throughput algorithm.
13655
13656 @item -mno-inline-int-divide
13657 @opindex mno-inline-int-divide
13658 Do not generate inline code for divides of integer values.
13659
13660 @item -minline-sqrt-min-latency
13661 @opindex minline-sqrt-min-latency
13662 Generate code for inline square roots
13663 using the minimum latency algorithm.
13664
13665 @item -minline-sqrt-max-throughput
13666 @opindex minline-sqrt-max-throughput
13667 Generate code for inline square roots
13668 using the maximum throughput algorithm.
13669
13670 @item -mno-inline-sqrt
13671 @opindex mno-inline-sqrt
13672 Do not generate inline code for sqrt.
13673
13674 @item -mfused-madd
13675 @itemx -mno-fused-madd
13676 @opindex mfused-madd
13677 @opindex mno-fused-madd
13678 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
13679 instructions.  The default is to use these instructions.
13680
13681 @item -mno-dwarf2-asm
13682 @itemx -mdwarf2-asm
13683 @opindex mno-dwarf2-asm
13684 @opindex mdwarf2-asm
13685 Don't (or do) generate assembler code for the DWARF2 line number debugging
13686 info.  This may be useful when not using the GNU assembler.
13687
13688 @item -mearly-stop-bits
13689 @itemx -mno-early-stop-bits
13690 @opindex mearly-stop-bits
13691 @opindex mno-early-stop-bits
13692 Allow stop bits to be placed earlier than immediately preceding the
13693 instruction that triggered the stop bit.  This can improve instruction
13694 scheduling, but does not always do so.
13695
13696 @item -mfixed-range=@var{register-range}
13697 @opindex mfixed-range
13698 Generate code treating the given register range as fixed registers.
13699 A fixed register is one that the register allocator can not use.  This is
13700 useful when compiling kernel code.  A register range is specified as
13701 two registers separated by a dash.  Multiple register ranges can be
13702 specified separated by a comma.
13703
13704 @item -mtls-size=@var{tls-size}
13705 @opindex mtls-size
13706 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
13707 64.
13708
13709 @item -mtune=@var{cpu-type}
13710 @opindex mtune
13711 Tune the instruction scheduling for a particular CPU, Valid values are
13712 itanium, itanium1, merced, itanium2, and mckinley.
13713
13714 @item -milp32
13715 @itemx -mlp64
13716 @opindex milp32
13717 @opindex mlp64
13718 Generate code for a 32-bit or 64-bit environment.
13719 The 32-bit environment sets int, long and pointer to 32 bits.
13720 The 64-bit environment sets int to 32 bits and long and pointer
13721 to 64 bits.  These are HP-UX specific flags.
13722
13723 @item -mno-sched-br-data-spec
13724 @itemx -msched-br-data-spec
13725 @opindex mno-sched-br-data-spec
13726 @opindex msched-br-data-spec
13727 (Dis/En)able data speculative scheduling before reload.
13728 This will result in generation of the ld.a instructions and
13729 the corresponding check instructions (ld.c / chk.a).
13730 The default is 'disable'.
13731
13732 @item -msched-ar-data-spec
13733 @itemx -mno-sched-ar-data-spec
13734 @opindex msched-ar-data-spec
13735 @opindex mno-sched-ar-data-spec
13736 (En/Dis)able data speculative scheduling after reload.
13737 This will result in generation of the ld.a instructions and
13738 the corresponding check instructions (ld.c / chk.a).
13739 The default is 'enable'.
13740
13741 @item -mno-sched-control-spec
13742 @itemx -msched-control-spec
13743 @opindex mno-sched-control-spec
13744 @opindex msched-control-spec
13745 (Dis/En)able control speculative scheduling.  This feature is
13746 available only during region scheduling (i.e.@: before reload).
13747 This will result in generation of the ld.s instructions and
13748 the corresponding check instructions chk.s .
13749 The default is 'disable'.
13750
13751 @item -msched-br-in-data-spec
13752 @itemx -mno-sched-br-in-data-spec
13753 @opindex msched-br-in-data-spec
13754 @opindex mno-sched-br-in-data-spec
13755 (En/Dis)able speculative scheduling of the instructions that
13756 are dependent on the data speculative loads before reload.
13757 This is effective only with @option{-msched-br-data-spec} enabled.
13758 The default is 'enable'.
13759
13760 @item -msched-ar-in-data-spec
13761 @itemx -mno-sched-ar-in-data-spec
13762 @opindex msched-ar-in-data-spec
13763 @opindex mno-sched-ar-in-data-spec
13764 (En/Dis)able speculative scheduling of the instructions that
13765 are dependent on the data speculative loads after reload.
13766 This is effective only with @option{-msched-ar-data-spec} enabled.
13767 The default is 'enable'.
13768
13769 @item -msched-in-control-spec
13770 @itemx -mno-sched-in-control-spec
13771 @opindex msched-in-control-spec
13772 @opindex mno-sched-in-control-spec
13773 (En/Dis)able speculative scheduling of the instructions that
13774 are dependent on the control speculative loads.
13775 This is effective only with @option{-msched-control-spec} enabled.
13776 The default is 'enable'.
13777
13778 @item -mno-sched-prefer-non-data-spec-insns
13779 @itemx -msched-prefer-non-data-spec-insns
13780 @opindex mno-sched-prefer-non-data-spec-insns
13781 @opindex msched-prefer-non-data-spec-insns
13782 If enabled, data speculative instructions will be chosen for schedule
13783 only if there are no other choices at the moment.  This will make
13784 the use of the data speculation much more conservative.
13785 The default is 'disable'.
13786
13787 @item -mno-sched-prefer-non-control-spec-insns
13788 @itemx -msched-prefer-non-control-spec-insns
13789 @opindex mno-sched-prefer-non-control-spec-insns
13790 @opindex msched-prefer-non-control-spec-insns
13791 If enabled, control speculative instructions will be chosen for schedule
13792 only if there are no other choices at the moment.  This will make
13793 the use of the control speculation much more conservative.
13794 The default is 'disable'.
13795
13796 @item -mno-sched-count-spec-in-critical-path
13797 @itemx -msched-count-spec-in-critical-path
13798 @opindex mno-sched-count-spec-in-critical-path
13799 @opindex msched-count-spec-in-critical-path
13800 If enabled, speculative dependencies will be considered during
13801 computation of the instructions priorities.  This will make the use of the
13802 speculation a bit more conservative.
13803 The default is 'disable'.
13804
13805 @item -msched-spec-ldc
13806 @opindex msched-spec-ldc
13807 Use a simple data speculation check.  This option is on by default.
13808
13809 @item -msched-control-spec-ldc
13810 @opindex msched-spec-ldc
13811 Use a simple check for control speculation.  This option is on by default.
13812
13813 @item -msched-stop-bits-after-every-cycle
13814 @opindex msched-stop-bits-after-every-cycle
13815 Place a stop bit after every cycle when scheduling.  This option is on
13816 by default.
13817
13818 @item -msched-fp-mem-deps-zero-cost
13819 @opindex msched-fp-mem-deps-zero-cost
13820 Assume that floating-point stores and loads are not likely to cause a conflict
13821 when placed into the same instruction group.  This option is disabled by
13822 default.
13823
13824 @item -msel-sched-dont-check-control-spec
13825 @opindex msel-sched-dont-check-control-spec
13826 Generate checks for control speculation in selective scheduling.
13827 This flag is disabled by default.
13828
13829 @item -msched-max-memory-insns=@var{max-insns}
13830 @opindex msched-max-memory-insns
13831 Limit on the number of memory insns per instruction group, giving lower
13832 priority to subsequent memory insns attempting to schedule in the same
13833 instruction group. Frequently useful to prevent cache bank conflicts.
13834 The default value is 1.
13835
13836 @item -msched-max-memory-insns-hard-limit
13837 @opindex msched-max-memory-insns-hard-limit
13838 Disallow more than `msched-max-memory-insns' in instruction group.
13839 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
13840 when limit is reached but may still schedule memory operations.
13841
13842 @end table
13843
13844 @node IA-64/VMS Options
13845 @subsection IA-64/VMS Options
13846
13847 These @samp{-m} options are defined for the IA-64/VMS implementations:
13848
13849 @table @gcctabopt
13850 @item -mvms-return-codes
13851 @opindex mvms-return-codes
13852 Return VMS condition codes from main. The default is to return POSIX
13853 style condition (e.g.@ error) codes.
13854
13855 @item -mdebug-main=@var{prefix}
13856 @opindex mdebug-main=@var{prefix}
13857 Flag the first routine whose name starts with @var{prefix} as the main
13858 routine for the debugger.
13859
13860 @item -mmalloc64
13861 @opindex mmalloc64
13862 Default to 64bit memory allocation routines.
13863 @end table
13864
13865 @node LM32 Options
13866 @subsection LM32 Options
13867 @cindex LM32 options
13868
13869 These @option{-m} options are defined for the Lattice Mico32 architecture:
13870
13871 @table @gcctabopt
13872 @item -mbarrel-shift-enabled
13873 @opindex mbarrel-shift-enabled
13874 Enable barrel-shift instructions.
13875
13876 @item -mdivide-enabled
13877 @opindex mdivide-enabled
13878 Enable divide and modulus instructions.
13879
13880 @item -mmultiply-enabled
13881 @opindex multiply-enabled
13882 Enable multiply instructions.
13883
13884 @item -msign-extend-enabled
13885 @opindex msign-extend-enabled
13886 Enable sign extend instructions.
13887
13888 @item -muser-enabled
13889 @opindex muser-enabled
13890 Enable user-defined instructions.
13891
13892 @end table
13893
13894 @node M32C Options
13895 @subsection M32C Options
13896 @cindex M32C options
13897
13898 @table @gcctabopt
13899 @item -mcpu=@var{name}
13900 @opindex mcpu=
13901 Select the CPU for which code is generated.  @var{name} may be one of
13902 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
13903 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
13904 the M32C/80 series.
13905
13906 @item -msim
13907 @opindex msim
13908 Specifies that the program will be run on the simulator.  This causes
13909 an alternate runtime library to be linked in which supports, for
13910 example, file I/O@.  You must not use this option when generating
13911 programs that will run on real hardware; you must provide your own
13912 runtime library for whatever I/O functions are needed.
13913
13914 @item -memregs=@var{number}
13915 @opindex memregs=
13916 Specifies the number of memory-based pseudo-registers GCC will use
13917 during code generation.  These pseudo-registers will be used like real
13918 registers, so there is a tradeoff between GCC's ability to fit the
13919 code into available registers, and the performance penalty of using
13920 memory instead of registers.  Note that all modules in a program must
13921 be compiled with the same value for this option.  Because of that, you
13922 must not use this option with the default runtime libraries gcc
13923 builds.
13924
13925 @end table
13926
13927 @node M32R/D Options
13928 @subsection M32R/D Options
13929 @cindex M32R/D options
13930
13931 These @option{-m} options are defined for Renesas M32R/D architectures:
13932
13933 @table @gcctabopt
13934 @item -m32r2
13935 @opindex m32r2
13936 Generate code for the M32R/2@.
13937
13938 @item -m32rx
13939 @opindex m32rx
13940 Generate code for the M32R/X@.
13941
13942 @item -m32r
13943 @opindex m32r
13944 Generate code for the M32R@.  This is the default.
13945
13946 @item -mmodel=small
13947 @opindex mmodel=small
13948 Assume all objects live in the lower 16MB of memory (so that their addresses
13949 can be loaded with the @code{ld24} instruction), and assume all subroutines
13950 are reachable with the @code{bl} instruction.
13951 This is the default.
13952
13953 The addressability of a particular object can be set with the
13954 @code{model} attribute.
13955
13956 @item -mmodel=medium
13957 @opindex mmodel=medium
13958 Assume objects may be anywhere in the 32-bit address space (the compiler
13959 will generate @code{seth/add3} instructions to load their addresses), and
13960 assume all subroutines are reachable with the @code{bl} instruction.
13961
13962 @item -mmodel=large
13963 @opindex mmodel=large
13964 Assume objects may be anywhere in the 32-bit address space (the compiler
13965 will generate @code{seth/add3} instructions to load their addresses), and
13966 assume subroutines may not be reachable with the @code{bl} instruction
13967 (the compiler will generate the much slower @code{seth/add3/jl}
13968 instruction sequence).
13969
13970 @item -msdata=none
13971 @opindex msdata=none
13972 Disable use of the small data area.  Variables will be put into
13973 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
13974 @code{section} attribute has been specified).
13975 This is the default.
13976
13977 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
13978 Objects may be explicitly put in the small data area with the
13979 @code{section} attribute using one of these sections.
13980
13981 @item -msdata=sdata
13982 @opindex msdata=sdata
13983 Put small global and static data in the small data area, but do not
13984 generate special code to reference them.
13985
13986 @item -msdata=use
13987 @opindex msdata=use
13988 Put small global and static data in the small data area, and generate
13989 special instructions to reference them.
13990
13991 @item -G @var{num}
13992 @opindex G
13993 @cindex smaller data references
13994 Put global and static objects less than or equal to @var{num} bytes
13995 into the small data or bss sections instead of the normal data or bss
13996 sections.  The default value of @var{num} is 8.
13997 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
13998 for this option to have any effect.
13999
14000 All modules should be compiled with the same @option{-G @var{num}} value.
14001 Compiling with different values of @var{num} may or may not work; if it
14002 doesn't the linker will give an error message---incorrect code will not be
14003 generated.
14004
14005 @item -mdebug
14006 @opindex mdebug
14007 Makes the M32R specific code in the compiler display some statistics
14008 that might help in debugging programs.
14009
14010 @item -malign-loops
14011 @opindex malign-loops
14012 Align all loops to a 32-byte boundary.
14013
14014 @item -mno-align-loops
14015 @opindex mno-align-loops
14016 Do not enforce a 32-byte alignment for loops.  This is the default.
14017
14018 @item -missue-rate=@var{number}
14019 @opindex missue-rate=@var{number}
14020 Issue @var{number} instructions per cycle.  @var{number} can only be 1
14021 or 2.
14022
14023 @item -mbranch-cost=@var{number}
14024 @opindex mbranch-cost=@var{number}
14025 @var{number} can only be 1 or 2.  If it is 1 then branches will be
14026 preferred over conditional code, if it is 2, then the opposite will
14027 apply.
14028
14029 @item -mflush-trap=@var{number}
14030 @opindex mflush-trap=@var{number}
14031 Specifies the trap number to use to flush the cache.  The default is
14032 12.  Valid numbers are between 0 and 15 inclusive.
14033
14034 @item -mno-flush-trap
14035 @opindex mno-flush-trap
14036 Specifies that the cache cannot be flushed by using a trap.
14037
14038 @item -mflush-func=@var{name}
14039 @opindex mflush-func=@var{name}
14040 Specifies the name of the operating system function to call to flush
14041 the cache.  The default is @emph{_flush_cache}, but a function call
14042 will only be used if a trap is not available.
14043
14044 @item -mno-flush-func
14045 @opindex mno-flush-func
14046 Indicates that there is no OS function for flushing the cache.
14047
14048 @end table
14049
14050 @node M680x0 Options
14051 @subsection M680x0 Options
14052 @cindex M680x0 options
14053
14054 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
14055 The default settings depend on which architecture was selected when
14056 the compiler was configured; the defaults for the most common choices
14057 are given below.
14058
14059 @table @gcctabopt
14060 @item -march=@var{arch}
14061 @opindex march
14062 Generate code for a specific M680x0 or ColdFire instruction set
14063 architecture.  Permissible values of @var{arch} for M680x0
14064 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
14065 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
14066 architectures are selected according to Freescale's ISA classification
14067 and the permissible values are: @samp{isaa}, @samp{isaaplus},
14068 @samp{isab} and @samp{isac}.
14069
14070 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
14071 code for a ColdFire target.  The @var{arch} in this macro is one of the
14072 @option{-march} arguments given above.
14073
14074 When used together, @option{-march} and @option{-mtune} select code
14075 that runs on a family of similar processors but that is optimized
14076 for a particular microarchitecture.
14077
14078 @item -mcpu=@var{cpu}
14079 @opindex mcpu
14080 Generate code for a specific M680x0 or ColdFire processor.
14081 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
14082 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
14083 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
14084 below, which also classifies the CPUs into families:
14085
14086 @multitable @columnfractions 0.20 0.80
14087 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
14088 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
14089 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
14090 @item @samp{5206e} @tab @samp{5206e}
14091 @item @samp{5208} @tab @samp{5207} @samp{5208}
14092 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
14093 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
14094 @item @samp{5216} @tab @samp{5214} @samp{5216}
14095 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
14096 @item @samp{5225} @tab @samp{5224} @samp{5225}
14097 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
14098 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
14099 @item @samp{5249} @tab @samp{5249}
14100 @item @samp{5250} @tab @samp{5250}
14101 @item @samp{5271} @tab @samp{5270} @samp{5271}
14102 @item @samp{5272} @tab @samp{5272}
14103 @item @samp{5275} @tab @samp{5274} @samp{5275}
14104 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
14105 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
14106 @item @samp{5307} @tab @samp{5307}
14107 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
14108 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
14109 @item @samp{5407} @tab @samp{5407}
14110 @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}
14111 @end multitable
14112
14113 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
14114 @var{arch} is compatible with @var{cpu}.  Other combinations of
14115 @option{-mcpu} and @option{-march} are rejected.
14116
14117 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
14118 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
14119 where the value of @var{family} is given by the table above.
14120
14121 @item -mtune=@var{tune}
14122 @opindex mtune
14123 Tune the code for a particular microarchitecture, within the
14124 constraints set by @option{-march} and @option{-mcpu}.
14125 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
14126 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
14127 and @samp{cpu32}.  The ColdFire microarchitectures
14128 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
14129
14130 You can also use @option{-mtune=68020-40} for code that needs
14131 to run relatively well on 68020, 68030 and 68040 targets.
14132 @option{-mtune=68020-60} is similar but includes 68060 targets
14133 as well.  These two options select the same tuning decisions as
14134 @option{-m68020-40} and @option{-m68020-60} respectively.
14135
14136 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
14137 when tuning for 680x0 architecture @var{arch}.  It also defines
14138 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
14139 option is used.  If gcc is tuning for a range of architectures,
14140 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
14141 it defines the macros for every architecture in the range.
14142
14143 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
14144 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
14145 of the arguments given above.
14146
14147 @item -m68000
14148 @itemx -mc68000
14149 @opindex m68000
14150 @opindex mc68000
14151 Generate output for a 68000.  This is the default
14152 when the compiler is configured for 68000-based systems.
14153 It is equivalent to @option{-march=68000}.
14154
14155 Use this option for microcontrollers with a 68000 or EC000 core,
14156 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
14157
14158 @item -m68010
14159 @opindex m68010
14160 Generate output for a 68010.  This is the default
14161 when the compiler is configured for 68010-based systems.
14162 It is equivalent to @option{-march=68010}.
14163
14164 @item -m68020
14165 @itemx -mc68020
14166 @opindex m68020
14167 @opindex mc68020
14168 Generate output for a 68020.  This is the default
14169 when the compiler is configured for 68020-based systems.
14170 It is equivalent to @option{-march=68020}.
14171
14172 @item -m68030
14173 @opindex m68030
14174 Generate output for a 68030.  This is the default when the compiler is
14175 configured for 68030-based systems.  It is equivalent to
14176 @option{-march=68030}.
14177
14178 @item -m68040
14179 @opindex m68040
14180 Generate output for a 68040.  This is the default when the compiler is
14181 configured for 68040-based systems.  It is equivalent to
14182 @option{-march=68040}.
14183
14184 This option inhibits the use of 68881/68882 instructions that have to be
14185 emulated by software on the 68040.  Use this option if your 68040 does not
14186 have code to emulate those instructions.
14187
14188 @item -m68060
14189 @opindex m68060
14190 Generate output for a 68060.  This is the default when the compiler is
14191 configured for 68060-based systems.  It is equivalent to
14192 @option{-march=68060}.
14193
14194 This option inhibits the use of 68020 and 68881/68882 instructions that
14195 have to be emulated by software on the 68060.  Use this option if your 68060
14196 does not have code to emulate those instructions.
14197
14198 @item -mcpu32
14199 @opindex mcpu32
14200 Generate output for a CPU32.  This is the default
14201 when the compiler is configured for CPU32-based systems.
14202 It is equivalent to @option{-march=cpu32}.
14203
14204 Use this option for microcontrollers with a
14205 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
14206 68336, 68340, 68341, 68349 and 68360.
14207
14208 @item -m5200
14209 @opindex m5200
14210 Generate output for a 520X ColdFire CPU@.  This is the default
14211 when the compiler is configured for 520X-based systems.
14212 It is equivalent to @option{-mcpu=5206}, and is now deprecated
14213 in favor of that option.
14214
14215 Use this option for microcontroller with a 5200 core, including
14216 the MCF5202, MCF5203, MCF5204 and MCF5206.
14217
14218 @item -m5206e
14219 @opindex m5206e
14220 Generate output for a 5206e ColdFire CPU@.  The option is now
14221 deprecated in favor of the equivalent @option{-mcpu=5206e}.
14222
14223 @item -m528x
14224 @opindex m528x
14225 Generate output for a member of the ColdFire 528X family.
14226 The option is now deprecated in favor of the equivalent
14227 @option{-mcpu=528x}.
14228
14229 @item -m5307
14230 @opindex m5307
14231 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
14232 in favor of the equivalent @option{-mcpu=5307}.
14233
14234 @item -m5407
14235 @opindex m5407
14236 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
14237 in favor of the equivalent @option{-mcpu=5407}.
14238
14239 @item -mcfv4e
14240 @opindex mcfv4e
14241 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
14242 This includes use of hardware floating point instructions.
14243 The option is equivalent to @option{-mcpu=547x}, and is now
14244 deprecated in favor of that option.
14245
14246 @item -m68020-40
14247 @opindex m68020-40
14248 Generate output for a 68040, without using any of the new instructions.
14249 This results in code which can run relatively efficiently on either a
14250 68020/68881 or a 68030 or a 68040.  The generated code does use the
14251 68881 instructions that are emulated on the 68040.
14252
14253 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
14254
14255 @item -m68020-60
14256 @opindex m68020-60
14257 Generate output for a 68060, without using any of the new instructions.
14258 This results in code which can run relatively efficiently on either a
14259 68020/68881 or a 68030 or a 68040.  The generated code does use the
14260 68881 instructions that are emulated on the 68060.
14261
14262 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
14263
14264 @item -mhard-float
14265 @itemx -m68881
14266 @opindex mhard-float
14267 @opindex m68881
14268 Generate floating-point instructions.  This is the default for 68020
14269 and above, and for ColdFire devices that have an FPU@.  It defines the
14270 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
14271 on ColdFire targets.
14272
14273 @item -msoft-float
14274 @opindex msoft-float
14275 Do not generate floating-point instructions; use library calls instead.
14276 This is the default for 68000, 68010, and 68832 targets.  It is also
14277 the default for ColdFire devices that have no FPU.
14278
14279 @item -mdiv
14280 @itemx -mno-div
14281 @opindex mdiv
14282 @opindex mno-div
14283 Generate (do not generate) ColdFire hardware divide and remainder
14284 instructions.  If @option{-march} is used without @option{-mcpu},
14285 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
14286 architectures.  Otherwise, the default is taken from the target CPU
14287 (either the default CPU, or the one specified by @option{-mcpu}).  For
14288 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
14289 @option{-mcpu=5206e}.
14290
14291 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
14292
14293 @item -mshort
14294 @opindex mshort
14295 Consider type @code{int} to be 16 bits wide, like @code{short int}.
14296 Additionally, parameters passed on the stack are also aligned to a
14297 16-bit boundary even on targets whose API mandates promotion to 32-bit.
14298
14299 @item -mno-short
14300 @opindex mno-short
14301 Do not consider type @code{int} to be 16 bits wide.  This is the default.
14302
14303 @item -mnobitfield
14304 @itemx -mno-bitfield
14305 @opindex mnobitfield
14306 @opindex mno-bitfield
14307 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
14308 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
14309
14310 @item -mbitfield
14311 @opindex mbitfield
14312 Do use the bit-field instructions.  The @option{-m68020} option implies
14313 @option{-mbitfield}.  This is the default if you use a configuration
14314 designed for a 68020.
14315
14316 @item -mrtd
14317 @opindex mrtd
14318 Use a different function-calling convention, in which functions
14319 that take a fixed number of arguments return with the @code{rtd}
14320 instruction, which pops their arguments while returning.  This
14321 saves one instruction in the caller since there is no need to pop
14322 the arguments there.
14323
14324 This calling convention is incompatible with the one normally
14325 used on Unix, so you cannot use it if you need to call libraries
14326 compiled with the Unix compiler.
14327
14328 Also, you must provide function prototypes for all functions that
14329 take variable numbers of arguments (including @code{printf});
14330 otherwise incorrect code will be generated for calls to those
14331 functions.
14332
14333 In addition, seriously incorrect code will result if you call a
14334 function with too many arguments.  (Normally, extra arguments are
14335 harmlessly ignored.)
14336
14337 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
14338 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
14339
14340 @item -mno-rtd
14341 @opindex mno-rtd
14342 Do not use the calling conventions selected by @option{-mrtd}.
14343 This is the default.
14344
14345 @item -malign-int
14346 @itemx -mno-align-int
14347 @opindex malign-int
14348 @opindex mno-align-int
14349 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
14350 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
14351 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
14352 Aligning variables on 32-bit boundaries produces code that runs somewhat
14353 faster on processors with 32-bit busses at the expense of more memory.
14354
14355 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
14356 align structures containing the above types  differently than
14357 most published application binary interface specifications for the m68k.
14358
14359 @item -mpcrel
14360 @opindex mpcrel
14361 Use the pc-relative addressing mode of the 68000 directly, instead of
14362 using a global offset table.  At present, this option implies @option{-fpic},
14363 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
14364 not presently supported with @option{-mpcrel}, though this could be supported for
14365 68020 and higher processors.
14366
14367 @item -mno-strict-align
14368 @itemx -mstrict-align
14369 @opindex mno-strict-align
14370 @opindex mstrict-align
14371 Do not (do) assume that unaligned memory references will be handled by
14372 the system.
14373
14374 @item -msep-data
14375 Generate code that allows the data segment to be located in a different
14376 area of memory from the text segment.  This allows for execute in place in
14377 an environment without virtual memory management.  This option implies
14378 @option{-fPIC}.
14379
14380 @item -mno-sep-data
14381 Generate code that assumes that the data segment follows the text segment.
14382 This is the default.
14383
14384 @item -mid-shared-library
14385 Generate code that supports shared libraries via the library ID method.
14386 This allows for execute in place and shared libraries in an environment
14387 without virtual memory management.  This option implies @option{-fPIC}.
14388
14389 @item -mno-id-shared-library
14390 Generate code that doesn't assume ID based shared libraries are being used.
14391 This is the default.
14392
14393 @item -mshared-library-id=n
14394 Specified the identification number of the ID based shared library being
14395 compiled.  Specifying a value of 0 will generate more compact code, specifying
14396 other values will force the allocation of that number to the current
14397 library but is no more space or time efficient than omitting this option.
14398
14399 @item -mxgot
14400 @itemx -mno-xgot
14401 @opindex mxgot
14402 @opindex mno-xgot
14403 When generating position-independent code for ColdFire, generate code
14404 that works if the GOT has more than 8192 entries.  This code is
14405 larger and slower than code generated without this option.  On M680x0
14406 processors, this option is not needed; @option{-fPIC} suffices.
14407
14408 GCC normally uses a single instruction to load values from the GOT@.
14409 While this is relatively efficient, it only works if the GOT
14410 is smaller than about 64k.  Anything larger causes the linker
14411 to report an error such as:
14412
14413 @cindex relocation truncated to fit (ColdFire)
14414 @smallexample
14415 relocation truncated to fit: R_68K_GOT16O foobar
14416 @end smallexample
14417
14418 If this happens, you should recompile your code with @option{-mxgot}.
14419 It should then work with very large GOTs.  However, code generated with
14420 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
14421 the value of a global symbol.
14422
14423 Note that some linkers, including newer versions of the GNU linker,
14424 can create multiple GOTs and sort GOT entries.  If you have such a linker,
14425 you should only need to use @option{-mxgot} when compiling a single
14426 object file that accesses more than 8192 GOT entries.  Very few do.
14427
14428 These options have no effect unless GCC is generating
14429 position-independent code.
14430
14431 @end table
14432
14433 @node MCore Options
14434 @subsection MCore Options
14435 @cindex MCore options
14436
14437 These are the @samp{-m} options defined for the Motorola M*Core
14438 processors.
14439
14440 @table @gcctabopt
14441
14442 @item -mhardlit
14443 @itemx -mno-hardlit
14444 @opindex mhardlit
14445 @opindex mno-hardlit
14446 Inline constants into the code stream if it can be done in two
14447 instructions or less.
14448
14449 @item -mdiv
14450 @itemx -mno-div
14451 @opindex mdiv
14452 @opindex mno-div
14453 Use the divide instruction.  (Enabled by default).
14454
14455 @item -mrelax-immediate
14456 @itemx -mno-relax-immediate
14457 @opindex mrelax-immediate
14458 @opindex mno-relax-immediate
14459 Allow arbitrary sized immediates in bit operations.
14460
14461 @item -mwide-bitfields
14462 @itemx -mno-wide-bitfields
14463 @opindex mwide-bitfields
14464 @opindex mno-wide-bitfields
14465 Always treat bit-fields as int-sized.
14466
14467 @item -m4byte-functions
14468 @itemx -mno-4byte-functions
14469 @opindex m4byte-functions
14470 @opindex mno-4byte-functions
14471 Force all functions to be aligned to a four byte boundary.
14472
14473 @item -mcallgraph-data
14474 @itemx -mno-callgraph-data
14475 @opindex mcallgraph-data
14476 @opindex mno-callgraph-data
14477 Emit callgraph information.
14478
14479 @item -mslow-bytes
14480 @itemx -mno-slow-bytes
14481 @opindex mslow-bytes
14482 @opindex mno-slow-bytes
14483 Prefer word access when reading byte quantities.
14484
14485 @item -mlittle-endian
14486 @itemx -mbig-endian
14487 @opindex mlittle-endian
14488 @opindex mbig-endian
14489 Generate code for a little endian target.
14490
14491 @item -m210
14492 @itemx -m340
14493 @opindex m210
14494 @opindex m340
14495 Generate code for the 210 processor.
14496
14497 @item -mno-lsim
14498 @opindex mno-lsim
14499 Assume that run-time support has been provided and so omit the
14500 simulator library (@file{libsim.a)} from the linker command line.
14501
14502 @item -mstack-increment=@var{size}
14503 @opindex mstack-increment
14504 Set the maximum amount for a single stack increment operation.  Large
14505 values can increase the speed of programs which contain functions
14506 that need a large amount of stack space, but they can also trigger a
14507 segmentation fault if the stack is extended too much.  The default
14508 value is 0x1000.
14509
14510 @end table
14511
14512 @node MeP Options
14513 @subsection MeP Options
14514 @cindex MeP options
14515
14516 @table @gcctabopt
14517
14518 @item -mabsdiff
14519 @opindex mabsdiff
14520 Enables the @code{abs} instruction, which is the absolute difference
14521 between two registers.
14522
14523 @item -mall-opts
14524 @opindex mall-opts
14525 Enables all the optional instructions - average, multiply, divide, bit
14526 operations, leading zero, absolute difference, min/max, clip, and
14527 saturation.
14528
14529
14530 @item -maverage
14531 @opindex maverage
14532 Enables the @code{ave} instruction, which computes the average of two
14533 registers.
14534
14535 @item -mbased=@var{n}
14536 @opindex mbased=
14537 Variables of size @var{n} bytes or smaller will be placed in the
14538 @code{.based} section by default.  Based variables use the @code{$tp}
14539 register as a base register, and there is a 128 byte limit to the
14540 @code{.based} section.
14541
14542 @item -mbitops
14543 @opindex mbitops
14544 Enables the bit operation instructions - bit test (@code{btstm}), set
14545 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
14546 test-and-set (@code{tas}).
14547
14548 @item -mc=@var{name}
14549 @opindex mc=
14550 Selects which section constant data will be placed in.  @var{name} may
14551 be @code{tiny}, @code{near}, or @code{far}.
14552
14553 @item -mclip
14554 @opindex mclip
14555 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
14556 useful unless you also provide @code{-mminmax}.
14557
14558 @item -mconfig=@var{name}
14559 @opindex mconfig=
14560 Selects one of the build-in core configurations.  Each MeP chip has
14561 one or more modules in it; each module has a core CPU and a variety of
14562 coprocessors, optional instructions, and peripherals.  The
14563 @code{MeP-Integrator} tool, not part of GCC, provides these
14564 configurations through this option; using this option is the same as
14565 using all the corresponding command line options.  The default
14566 configuration is @code{default}.
14567
14568 @item -mcop
14569 @opindex mcop
14570 Enables the coprocessor instructions.  By default, this is a 32-bit
14571 coprocessor.  Note that the coprocessor is normally enabled via the
14572 @code{-mconfig=} option.
14573
14574 @item -mcop32
14575 @opindex mcop32
14576 Enables the 32-bit coprocessor's instructions.
14577
14578 @item -mcop64
14579 @opindex mcop64
14580 Enables the 64-bit coprocessor's instructions.
14581
14582 @item -mivc2
14583 @opindex mivc2
14584 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
14585
14586 @item -mdc
14587 @opindex mdc
14588 Causes constant variables to be placed in the @code{.near} section.
14589
14590 @item -mdiv
14591 @opindex mdiv
14592 Enables the @code{div} and @code{divu} instructions.
14593
14594 @item -meb
14595 @opindex meb
14596 Generate big-endian code.
14597
14598 @item -mel
14599 @opindex mel
14600 Generate little-endian code.
14601
14602 @item -mio-volatile
14603 @opindex mio-volatile
14604 Tells the compiler that any variable marked with the @code{io}
14605 attribute is to be considered volatile.
14606
14607 @item -ml
14608 @opindex ml
14609 Causes variables to be assigned to the @code{.far} section by default.
14610
14611 @item -mleadz
14612 @opindex mleadz
14613 Enables the @code{leadz} (leading zero) instruction.
14614
14615 @item -mm
14616 @opindex mm
14617 Causes variables to be assigned to the @code{.near} section by default.
14618
14619 @item -mminmax
14620 @opindex mminmax
14621 Enables the @code{min} and @code{max} instructions.
14622
14623 @item -mmult
14624 @opindex mmult
14625 Enables the multiplication and multiply-accumulate instructions.
14626
14627 @item -mno-opts
14628 @opindex mno-opts
14629 Disables all the optional instructions enabled by @code{-mall-opts}.
14630
14631 @item -mrepeat
14632 @opindex mrepeat
14633 Enables the @code{repeat} and @code{erepeat} instructions, used for
14634 low-overhead looping.
14635
14636 @item -ms
14637 @opindex ms
14638 Causes all variables to default to the @code{.tiny} section.  Note
14639 that there is a 65536 byte limit to this section.  Accesses to these
14640 variables use the @code{%gp} base register.
14641
14642 @item -msatur
14643 @opindex msatur
14644 Enables the saturation instructions.  Note that the compiler does not
14645 currently generate these itself, but this option is included for
14646 compatibility with other tools, like @code{as}.
14647
14648 @item -msdram
14649 @opindex msdram
14650 Link the SDRAM-based runtime instead of the default ROM-based runtime.
14651
14652 @item -msim
14653 @opindex msim
14654 Link the simulator runtime libraries.
14655
14656 @item -msimnovec
14657 @opindex msimnovec
14658 Link the simulator runtime libraries, excluding built-in support
14659 for reset and exception vectors and tables.
14660
14661 @item -mtf
14662 @opindex mtf
14663 Causes all functions to default to the @code{.far} section.  Without
14664 this option, functions default to the @code{.near} section.
14665
14666 @item -mtiny=@var{n}
14667 @opindex mtiny=
14668 Variables that are @var{n} bytes or smaller will be allocated to the
14669 @code{.tiny} section.  These variables use the @code{$gp} base
14670 register.  The default for this option is 4, but note that there's a
14671 65536 byte limit to the @code{.tiny} section.
14672
14673 @end table
14674
14675 @node MicroBlaze Options
14676 @subsection MicroBlaze Options
14677 @cindex MicroBlaze Options
14678
14679 @table @gcctabopt
14680
14681 @item -msoft-float
14682 @opindex msoft-float
14683 Use software emulation for floating point (default).
14684
14685 @item -mhard-float
14686 @opindex mhard-float
14687 Use hardware floating point instructions.
14688
14689 @item -mmemcpy
14690 @opindex mmemcpy
14691 Do not optimize block moves, use @code{memcpy}.
14692
14693 @item -mno-clearbss
14694 @opindex mno-clearbss
14695 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
14696
14697 @item -mcpu=@var{cpu-type}
14698 @opindex mcpu=
14699 Use features of and schedule code for given CPU.
14700 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
14701 where @var{X} is a major version, @var{YY} is the minor version, and
14702 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
14703 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
14704
14705 @item -mxl-soft-mul
14706 @opindex mxl-soft-mul
14707 Use software multiply emulation (default).
14708
14709 @item -mxl-soft-div
14710 @opindex mxl-soft-div
14711 Use software emulation for divides (default).
14712
14713 @item -mxl-barrel-shift
14714 @opindex mxl-barrel-shift
14715 Use the hardware barrel shifter.
14716
14717 @item -mxl-pattern-compare
14718 @opindex mxl-pattern-compare
14719 Use pattern compare instructions.
14720
14721 @item -msmall-divides
14722 @opindex msmall-divides
14723 Use table lookup optimization for small signed integer divisions.
14724
14725 @item -mxl-stack-check
14726 @opindex mxl-stack-check
14727 This option is deprecated.  Use -fstack-check instead.
14728
14729 @item -mxl-gp-opt
14730 @opindex mxl-gp-opt
14731 Use GP relative sdata/sbss sections.
14732
14733 @item -mxl-multiply-high
14734 @opindex mxl-multiply-high
14735 Use multiply high instructions for high part of 32x32 multiply.
14736
14737 @item -mxl-float-convert
14738 @opindex mxl-float-convert
14739 Use hardware floating point conversion instructions.
14740
14741 @item -mxl-float-sqrt
14742 @opindex mxl-float-sqrt
14743 Use hardware floating point square root instruction.
14744
14745 @item -mxl-mode-@var{app-model}
14746 Select application model @var{app-model}.  Valid models are
14747 @table @samp
14748 @item executable
14749 normal executable (default), uses startup code @file{crt0.o}.
14750
14751 @item xmdstub
14752 for use with Xilinx Microprocessor Debugger (XMD) based
14753 software intrusive debug agent called xmdstub. This uses startup file
14754 @file{crt1.o} and sets the start address of the program to be 0x800.
14755
14756 @item bootstrap
14757 for applications that are loaded using a bootloader.
14758 This model uses startup file @file{crt2.o} which does not contain a processor
14759 reset vector handler. This is suitable for transferring control on a
14760 processor reset to the bootloader rather than the application.
14761
14762 @item novectors
14763 for applications that do not require any of the
14764 MicroBlaze vectors. This option may be useful for applications running
14765 within a monitoring application. This model uses @file{crt3.o} as a startup file.
14766 @end table
14767
14768 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
14769 @option{-mxl-mode-@var{app-model}}.
14770
14771 @end table
14772
14773 @node MIPS Options
14774 @subsection MIPS Options
14775 @cindex MIPS options
14776
14777 @table @gcctabopt
14778
14779 @item -EB
14780 @opindex EB
14781 Generate big-endian code.
14782
14783 @item -EL
14784 @opindex EL
14785 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
14786 configurations.
14787
14788 @item -march=@var{arch}
14789 @opindex march
14790 Generate code that will run on @var{arch}, which can be the name of a
14791 generic MIPS ISA, or the name of a particular processor.
14792 The ISA names are:
14793 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
14794 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
14795 The processor names are:
14796 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
14797 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
14798 @samp{5kc}, @samp{5kf},
14799 @samp{20kc},
14800 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
14801 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
14802 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
14803 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
14804 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
14805 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
14806 @samp{m4k},
14807 @samp{octeon},
14808 @samp{orion},
14809 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
14810 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
14811 @samp{rm7000}, @samp{rm9000},
14812 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
14813 @samp{sb1},
14814 @samp{sr71000},
14815 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
14816 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
14817 and @samp{xlr}.
14818 The special value @samp{from-abi} selects the
14819 most compatible architecture for the selected ABI (that is,
14820 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
14821
14822 Native Linux/GNU and IRIX toolchains also support the value @samp{native},
14823 which selects the best architecture option for the host processor.
14824 @option{-march=native} has no effect if GCC does not recognize
14825 the processor.
14826
14827 In processor names, a final @samp{000} can be abbreviated as @samp{k}
14828 (for example, @samp{-march=r2k}).  Prefixes are optional, and
14829 @samp{vr} may be written @samp{r}.
14830
14831 Names of the form @samp{@var{n}f2_1} refer to processors with
14832 FPUs clocked at half the rate of the core, names of the form
14833 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
14834 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
14835 processors with FPUs clocked a ratio of 3:2 with respect to the core.
14836 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
14837 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
14838 accepted as synonyms for @samp{@var{n}f1_1}.
14839
14840 GCC defines two macros based on the value of this option.  The first
14841 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
14842 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
14843 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
14844 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
14845 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
14846
14847 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
14848 above.  In other words, it will have the full prefix and will not
14849 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
14850 the macro names the resolved architecture (either @samp{"mips1"} or
14851 @samp{"mips3"}).  It names the default architecture when no
14852 @option{-march} option is given.
14853
14854 @item -mtune=@var{arch}
14855 @opindex mtune
14856 Optimize for @var{arch}.  Among other things, this option controls
14857 the way instructions are scheduled, and the perceived cost of arithmetic
14858 operations.  The list of @var{arch} values is the same as for
14859 @option{-march}.
14860
14861 When this option is not used, GCC will optimize for the processor
14862 specified by @option{-march}.  By using @option{-march} and
14863 @option{-mtune} together, it is possible to generate code that will
14864 run on a family of processors, but optimize the code for one
14865 particular member of that family.
14866
14867 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
14868 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
14869 @samp{-march} ones described above.
14870
14871 @item -mips1
14872 @opindex mips1
14873 Equivalent to @samp{-march=mips1}.
14874
14875 @item -mips2
14876 @opindex mips2
14877 Equivalent to @samp{-march=mips2}.
14878
14879 @item -mips3
14880 @opindex mips3
14881 Equivalent to @samp{-march=mips3}.
14882
14883 @item -mips4
14884 @opindex mips4
14885 Equivalent to @samp{-march=mips4}.
14886
14887 @item -mips32
14888 @opindex mips32
14889 Equivalent to @samp{-march=mips32}.
14890
14891 @item -mips32r2
14892 @opindex mips32r2
14893 Equivalent to @samp{-march=mips32r2}.
14894
14895 @item -mips64
14896 @opindex mips64
14897 Equivalent to @samp{-march=mips64}.
14898
14899 @item -mips64r2
14900 @opindex mips64r2
14901 Equivalent to @samp{-march=mips64r2}.
14902
14903 @item -mips16
14904 @itemx -mno-mips16
14905 @opindex mips16
14906 @opindex mno-mips16
14907 Generate (do not generate) MIPS16 code.  If GCC is targetting a
14908 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
14909
14910 MIPS16 code generation can also be controlled on a per-function basis
14911 by means of @code{mips16} and @code{nomips16} attributes.
14912 @xref{Function Attributes}, for more information.
14913
14914 @item -mflip-mips16
14915 @opindex mflip-mips16
14916 Generate MIPS16 code on alternating functions.  This option is provided
14917 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
14918 not intended for ordinary use in compiling user code.
14919
14920 @item -minterlink-mips16
14921 @itemx -mno-interlink-mips16
14922 @opindex minterlink-mips16
14923 @opindex mno-interlink-mips16
14924 Require (do not require) that non-MIPS16 code be link-compatible with
14925 MIPS16 code.
14926
14927 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
14928 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
14929 therefore disables direct jumps unless GCC knows that the target of the
14930 jump is not MIPS16.
14931
14932 @item -mabi=32
14933 @itemx -mabi=o64
14934 @itemx -mabi=n32
14935 @itemx -mabi=64
14936 @itemx -mabi=eabi
14937 @opindex mabi=32
14938 @opindex mabi=o64
14939 @opindex mabi=n32
14940 @opindex mabi=64
14941 @opindex mabi=eabi
14942 Generate code for the given ABI@.
14943
14944 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
14945 generates 64-bit code when you select a 64-bit architecture, but you
14946 can use @option{-mgp32} to get 32-bit code instead.
14947
14948 For information about the O64 ABI, see
14949 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
14950
14951 GCC supports a variant of the o32 ABI in which floating-point registers
14952 are 64 rather than 32 bits wide.  You can select this combination with
14953 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
14954 and @samp{mfhc1} instructions and is therefore only supported for
14955 MIPS32R2 processors.
14956
14957 The register assignments for arguments and return values remain the
14958 same, but each scalar value is passed in a single 64-bit register
14959 rather than a pair of 32-bit registers.  For example, scalar
14960 floating-point values are returned in @samp{$f0} only, not a
14961 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
14962 remains the same, but all 64 bits are saved.
14963
14964 @item -mabicalls
14965 @itemx -mno-abicalls
14966 @opindex mabicalls
14967 @opindex mno-abicalls
14968 Generate (do not generate) code that is suitable for SVR4-style
14969 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
14970 systems.
14971
14972 @item -mshared
14973 @itemx -mno-shared
14974 Generate (do not generate) code that is fully position-independent,
14975 and that can therefore be linked into shared libraries.  This option
14976 only affects @option{-mabicalls}.
14977
14978 All @option{-mabicalls} code has traditionally been position-independent,
14979 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
14980 as an extension, the GNU toolchain allows executables to use absolute
14981 accesses for locally-binding symbols.  It can also use shorter GP
14982 initialization sequences and generate direct calls to locally-defined
14983 functions.  This mode is selected by @option{-mno-shared}.
14984
14985 @option{-mno-shared} depends on binutils 2.16 or higher and generates
14986 objects that can only be linked by the GNU linker.  However, the option
14987 does not affect the ABI of the final executable; it only affects the ABI
14988 of relocatable objects.  Using @option{-mno-shared} will generally make
14989 executables both smaller and quicker.
14990
14991 @option{-mshared} is the default.
14992
14993 @item -mplt
14994 @itemx -mno-plt
14995 @opindex mplt
14996 @opindex mno-plt
14997 Assume (do not assume) that the static and dynamic linkers
14998 support PLTs and copy relocations.  This option only affects
14999 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
15000 has no effect without @samp{-msym32}.
15001
15002 You can make @option{-mplt} the default by configuring
15003 GCC with @option{--with-mips-plt}.  The default is
15004 @option{-mno-plt} otherwise.
15005
15006 @item -mxgot
15007 @itemx -mno-xgot
15008 @opindex mxgot
15009 @opindex mno-xgot
15010 Lift (do not lift) the usual restrictions on the size of the global
15011 offset table.
15012
15013 GCC normally uses a single instruction to load values from the GOT@.
15014 While this is relatively efficient, it will only work if the GOT
15015 is smaller than about 64k.  Anything larger will cause the linker
15016 to report an error such as:
15017
15018 @cindex relocation truncated to fit (MIPS)
15019 @smallexample
15020 relocation truncated to fit: R_MIPS_GOT16 foobar
15021 @end smallexample
15022
15023 If this happens, you should recompile your code with @option{-mxgot}.
15024 It should then work with very large GOTs, although it will also be
15025 less efficient, since it will take three instructions to fetch the
15026 value of a global symbol.
15027
15028 Note that some linkers can create multiple GOTs.  If you have such a
15029 linker, you should only need to use @option{-mxgot} when a single object
15030 file accesses more than 64k's worth of GOT entries.  Very few do.
15031
15032 These options have no effect unless GCC is generating position
15033 independent code.
15034
15035 @item -mgp32
15036 @opindex mgp32
15037 Assume that general-purpose registers are 32 bits wide.
15038
15039 @item -mgp64
15040 @opindex mgp64
15041 Assume that general-purpose registers are 64 bits wide.
15042
15043 @item -mfp32
15044 @opindex mfp32
15045 Assume that floating-point registers are 32 bits wide.
15046
15047 @item -mfp64
15048 @opindex mfp64
15049 Assume that floating-point registers are 64 bits wide.
15050
15051 @item -mhard-float
15052 @opindex mhard-float
15053 Use floating-point coprocessor instructions.
15054
15055 @item -msoft-float
15056 @opindex msoft-float
15057 Do not use floating-point coprocessor instructions.  Implement
15058 floating-point calculations using library calls instead.
15059
15060 @item -msingle-float
15061 @opindex msingle-float
15062 Assume that the floating-point coprocessor only supports single-precision
15063 operations.
15064
15065 @item -mdouble-float
15066 @opindex mdouble-float
15067 Assume that the floating-point coprocessor supports double-precision
15068 operations.  This is the default.
15069
15070 @item -mllsc
15071 @itemx -mno-llsc
15072 @opindex mllsc
15073 @opindex mno-llsc
15074 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
15075 implement atomic memory built-in functions.  When neither option is
15076 specified, GCC will use the instructions if the target architecture
15077 supports them.
15078
15079 @option{-mllsc} is useful if the runtime environment can emulate the
15080 instructions and @option{-mno-llsc} can be useful when compiling for
15081 nonstandard ISAs.  You can make either option the default by
15082 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
15083 respectively.  @option{--with-llsc} is the default for some
15084 configurations; see the installation documentation for details.
15085
15086 @item -mdsp
15087 @itemx -mno-dsp
15088 @opindex mdsp
15089 @opindex mno-dsp
15090 Use (do not use) revision 1 of the MIPS DSP ASE@.
15091 @xref{MIPS DSP Built-in Functions}.  This option defines the
15092 preprocessor macro @samp{__mips_dsp}.  It also defines
15093 @samp{__mips_dsp_rev} to 1.
15094
15095 @item -mdspr2
15096 @itemx -mno-dspr2
15097 @opindex mdspr2
15098 @opindex mno-dspr2
15099 Use (do not use) revision 2 of the MIPS DSP ASE@.
15100 @xref{MIPS DSP Built-in Functions}.  This option defines the
15101 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
15102 It also defines @samp{__mips_dsp_rev} to 2.
15103
15104 @item -msmartmips
15105 @itemx -mno-smartmips
15106 @opindex msmartmips
15107 @opindex mno-smartmips
15108 Use (do not use) the MIPS SmartMIPS ASE.
15109
15110 @item -mpaired-single
15111 @itemx -mno-paired-single
15112 @opindex mpaired-single
15113 @opindex mno-paired-single
15114 Use (do not use) paired-single floating-point instructions.
15115 @xref{MIPS Paired-Single Support}.  This option requires
15116 hardware floating-point support to be enabled.
15117
15118 @item -mdmx
15119 @itemx -mno-mdmx
15120 @opindex mdmx
15121 @opindex mno-mdmx
15122 Use (do not use) MIPS Digital Media Extension instructions.
15123 This option can only be used when generating 64-bit code and requires
15124 hardware floating-point support to be enabled.
15125
15126 @item -mips3d
15127 @itemx -mno-mips3d
15128 @opindex mips3d
15129 @opindex mno-mips3d
15130 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
15131 The option @option{-mips3d} implies @option{-mpaired-single}.
15132
15133 @item -mmt
15134 @itemx -mno-mt
15135 @opindex mmt
15136 @opindex mno-mt
15137 Use (do not use) MT Multithreading instructions.
15138
15139 @item -mlong64
15140 @opindex mlong64
15141 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
15142 an explanation of the default and the way that the pointer size is
15143 determined.
15144
15145 @item -mlong32
15146 @opindex mlong32
15147 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
15148
15149 The default size of @code{int}s, @code{long}s and pointers depends on
15150 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
15151 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
15152 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
15153 or the same size as integer registers, whichever is smaller.
15154
15155 @item -msym32
15156 @itemx -mno-sym32
15157 @opindex msym32
15158 @opindex mno-sym32
15159 Assume (do not assume) that all symbols have 32-bit values, regardless
15160 of the selected ABI@.  This option is useful in combination with
15161 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
15162 to generate shorter and faster references to symbolic addresses.
15163
15164 @item -G @var{num}
15165 @opindex G
15166 Put definitions of externally-visible data in a small data section
15167 if that data is no bigger than @var{num} bytes.  GCC can then access
15168 the data more efficiently; see @option{-mgpopt} for details.
15169
15170 The default @option{-G} option depends on the configuration.
15171
15172 @item -mlocal-sdata
15173 @itemx -mno-local-sdata
15174 @opindex mlocal-sdata
15175 @opindex mno-local-sdata
15176 Extend (do not extend) the @option{-G} behavior to local data too,
15177 such as to static variables in C@.  @option{-mlocal-sdata} is the
15178 default for all configurations.
15179
15180 If the linker complains that an application is using too much small data,
15181 you might want to try rebuilding the less performance-critical parts with
15182 @option{-mno-local-sdata}.  You might also want to build large
15183 libraries with @option{-mno-local-sdata}, so that the libraries leave
15184 more room for the main program.
15185
15186 @item -mextern-sdata
15187 @itemx -mno-extern-sdata
15188 @opindex mextern-sdata
15189 @opindex mno-extern-sdata
15190 Assume (do not assume) that externally-defined data will be in
15191 a small data section if that data is within the @option{-G} limit.
15192 @option{-mextern-sdata} is the default for all configurations.
15193
15194 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
15195 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
15196 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
15197 is placed in a small data section.  If @var{Var} is defined by another
15198 module, you must either compile that module with a high-enough
15199 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
15200 definition.  If @var{Var} is common, you must link the application
15201 with a high-enough @option{-G} setting.
15202
15203 The easiest way of satisfying these restrictions is to compile
15204 and link every module with the same @option{-G} option.  However,
15205 you may wish to build a library that supports several different
15206 small data limits.  You can do this by compiling the library with
15207 the highest supported @option{-G} setting and additionally using
15208 @option{-mno-extern-sdata} to stop the library from making assumptions
15209 about externally-defined data.
15210
15211 @item -mgpopt
15212 @itemx -mno-gpopt
15213 @opindex mgpopt
15214 @opindex mno-gpopt
15215 Use (do not use) GP-relative accesses for symbols that are known to be
15216 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
15217 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
15218 configurations.
15219
15220 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
15221 might not hold the value of @code{_gp}.  For example, if the code is
15222 part of a library that might be used in a boot monitor, programs that
15223 call boot monitor routines will pass an unknown value in @code{$gp}.
15224 (In such situations, the boot monitor itself would usually be compiled
15225 with @option{-G0}.)
15226
15227 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
15228 @option{-mno-extern-sdata}.
15229
15230 @item -membedded-data
15231 @itemx -mno-embedded-data
15232 @opindex membedded-data
15233 @opindex mno-embedded-data
15234 Allocate variables to the read-only data section first if possible, then
15235 next in the small data section if possible, otherwise in data.  This gives
15236 slightly slower code than the default, but reduces the amount of RAM required
15237 when executing, and thus may be preferred for some embedded systems.
15238
15239 @item -muninit-const-in-rodata
15240 @itemx -mno-uninit-const-in-rodata
15241 @opindex muninit-const-in-rodata
15242 @opindex mno-uninit-const-in-rodata
15243 Put uninitialized @code{const} variables in the read-only data section.
15244 This option is only meaningful in conjunction with @option{-membedded-data}.
15245
15246 @item -mcode-readable=@var{setting}
15247 @opindex mcode-readable
15248 Specify whether GCC may generate code that reads from executable sections.
15249 There are three possible settings:
15250
15251 @table @gcctabopt
15252 @item -mcode-readable=yes
15253 Instructions may freely access executable sections.  This is the
15254 default setting.
15255
15256 @item -mcode-readable=pcrel
15257 MIPS16 PC-relative load instructions can access executable sections,
15258 but other instructions must not do so.  This option is useful on 4KSc
15259 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
15260 It is also useful on processors that can be configured to have a dual
15261 instruction/data SRAM interface and that, like the M4K, automatically
15262 redirect PC-relative loads to the instruction RAM.
15263
15264 @item -mcode-readable=no
15265 Instructions must not access executable sections.  This option can be
15266 useful on targets that are configured to have a dual instruction/data
15267 SRAM interface but that (unlike the M4K) do not automatically redirect
15268 PC-relative loads to the instruction RAM.
15269 @end table
15270
15271 @item -msplit-addresses
15272 @itemx -mno-split-addresses
15273 @opindex msplit-addresses
15274 @opindex mno-split-addresses
15275 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
15276 relocation operators.  This option has been superseded by
15277 @option{-mexplicit-relocs} but is retained for backwards compatibility.
15278
15279 @item -mexplicit-relocs
15280 @itemx -mno-explicit-relocs
15281 @opindex mexplicit-relocs
15282 @opindex mno-explicit-relocs
15283 Use (do not use) assembler relocation operators when dealing with symbolic
15284 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
15285 is to use assembler macros instead.
15286
15287 @option{-mexplicit-relocs} is the default if GCC was configured
15288 to use an assembler that supports relocation operators.
15289
15290 @item -mcheck-zero-division
15291 @itemx -mno-check-zero-division
15292 @opindex mcheck-zero-division
15293 @opindex mno-check-zero-division
15294 Trap (do not trap) on integer division by zero.
15295
15296 The default is @option{-mcheck-zero-division}.
15297
15298 @item -mdivide-traps
15299 @itemx -mdivide-breaks
15300 @opindex mdivide-traps
15301 @opindex mdivide-breaks
15302 MIPS systems check for division by zero by generating either a
15303 conditional trap or a break instruction.  Using traps results in
15304 smaller code, but is only supported on MIPS II and later.  Also, some
15305 versions of the Linux kernel have a bug that prevents trap from
15306 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
15307 allow conditional traps on architectures that support them and
15308 @option{-mdivide-breaks} to force the use of breaks.
15309
15310 The default is usually @option{-mdivide-traps}, but this can be
15311 overridden at configure time using @option{--with-divide=breaks}.
15312 Divide-by-zero checks can be completely disabled using
15313 @option{-mno-check-zero-division}.
15314
15315 @item -mmemcpy
15316 @itemx -mno-memcpy
15317 @opindex mmemcpy
15318 @opindex mno-memcpy
15319 Force (do not force) the use of @code{memcpy()} for non-trivial block
15320 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
15321 most constant-sized copies.
15322
15323 @item -mlong-calls
15324 @itemx -mno-long-calls
15325 @opindex mlong-calls
15326 @opindex mno-long-calls
15327 Disable (do not disable) use of the @code{jal} instruction.  Calling
15328 functions using @code{jal} is more efficient but requires the caller
15329 and callee to be in the same 256 megabyte segment.
15330
15331 This option has no effect on abicalls code.  The default is
15332 @option{-mno-long-calls}.
15333
15334 @item -mmad
15335 @itemx -mno-mad
15336 @opindex mmad
15337 @opindex mno-mad
15338 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
15339 instructions, as provided by the R4650 ISA@.
15340
15341 @item -mfused-madd
15342 @itemx -mno-fused-madd
15343 @opindex mfused-madd
15344 @opindex mno-fused-madd
15345 Enable (disable) use of the floating point multiply-accumulate
15346 instructions, when they are available.  The default is
15347 @option{-mfused-madd}.
15348
15349 When multiply-accumulate instructions are used, the intermediate
15350 product is calculated to infinite precision and is not subject to
15351 the FCSR Flush to Zero bit.  This may be undesirable in some
15352 circumstances.
15353
15354 @item -nocpp
15355 @opindex nocpp
15356 Tell the MIPS assembler to not run its preprocessor over user
15357 assembler files (with a @samp{.s} suffix) when assembling them.
15358
15359 @item -mfix-24k
15360 @item -mno-fix-24k
15361 @opindex mfix-24k
15362 @opindex mno-fix-24k
15363 Work around the 24K E48 (lost data on stores during refill) errata.
15364 The workarounds are implemented by the assembler rather than by GCC.
15365
15366 @item -mfix-r4000
15367 @itemx -mno-fix-r4000
15368 @opindex mfix-r4000
15369 @opindex mno-fix-r4000
15370 Work around certain R4000 CPU errata:
15371 @itemize @minus
15372 @item
15373 A double-word or a variable shift may give an incorrect result if executed
15374 immediately after starting an integer division.
15375 @item
15376 A double-word or a variable shift may give an incorrect result if executed
15377 while an integer multiplication is in progress.
15378 @item
15379 An integer division may give an incorrect result if started in a delay slot
15380 of a taken branch or a jump.
15381 @end itemize
15382
15383 @item -mfix-r4400
15384 @itemx -mno-fix-r4400
15385 @opindex mfix-r4400
15386 @opindex mno-fix-r4400
15387 Work around certain R4400 CPU errata:
15388 @itemize @minus
15389 @item
15390 A double-word or a variable shift may give an incorrect result if executed
15391 immediately after starting an integer division.
15392 @end itemize
15393
15394 @item -mfix-r10000
15395 @itemx -mno-fix-r10000
15396 @opindex mfix-r10000
15397 @opindex mno-fix-r10000
15398 Work around certain R10000 errata:
15399 @itemize @minus
15400 @item
15401 @code{ll}/@code{sc} sequences may not behave atomically on revisions
15402 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
15403 @end itemize
15404
15405 This option can only be used if the target architecture supports
15406 branch-likely instructions.  @option{-mfix-r10000} is the default when
15407 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
15408 otherwise.
15409
15410 @item -mfix-vr4120
15411 @itemx -mno-fix-vr4120
15412 @opindex mfix-vr4120
15413 Work around certain VR4120 errata:
15414 @itemize @minus
15415 @item
15416 @code{dmultu} does not always produce the correct result.
15417 @item
15418 @code{div} and @code{ddiv} do not always produce the correct result if one
15419 of the operands is negative.
15420 @end itemize
15421 The workarounds for the division errata rely on special functions in
15422 @file{libgcc.a}.  At present, these functions are only provided by
15423 the @code{mips64vr*-elf} configurations.
15424
15425 Other VR4120 errata require a nop to be inserted between certain pairs of
15426 instructions.  These errata are handled by the assembler, not by GCC itself.
15427
15428 @item -mfix-vr4130
15429 @opindex mfix-vr4130
15430 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
15431 workarounds are implemented by the assembler rather than by GCC,
15432 although GCC will avoid using @code{mflo} and @code{mfhi} if the
15433 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
15434 instructions are available instead.
15435
15436 @item -mfix-sb1
15437 @itemx -mno-fix-sb1
15438 @opindex mfix-sb1
15439 Work around certain SB-1 CPU core errata.
15440 (This flag currently works around the SB-1 revision 2
15441 ``F1'' and ``F2'' floating point errata.)
15442
15443 @item -mr10k-cache-barrier=@var{setting}
15444 @opindex mr10k-cache-barrier
15445 Specify whether GCC should insert cache barriers to avoid the
15446 side-effects of speculation on R10K processors.
15447
15448 In common with many processors, the R10K tries to predict the outcome
15449 of a conditional branch and speculatively executes instructions from
15450 the ``taken'' branch.  It later aborts these instructions if the
15451 predicted outcome was wrong.  However, on the R10K, even aborted
15452 instructions can have side effects.
15453
15454 This problem only affects kernel stores and, depending on the system,
15455 kernel loads.  As an example, a speculatively-executed store may load
15456 the target memory into cache and mark the cache line as dirty, even if
15457 the store itself is later aborted.  If a DMA operation writes to the
15458 same area of memory before the ``dirty'' line is flushed, the cached
15459 data will overwrite the DMA-ed data.  See the R10K processor manual
15460 for a full description, including other potential problems.
15461
15462 One workaround is to insert cache barrier instructions before every memory
15463 access that might be speculatively executed and that might have side
15464 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
15465 controls GCC's implementation of this workaround.  It assumes that
15466 aborted accesses to any byte in the following regions will not have
15467 side effects:
15468
15469 @enumerate
15470 @item
15471 the memory occupied by the current function's stack frame;
15472
15473 @item
15474 the memory occupied by an incoming stack argument;
15475
15476 @item
15477 the memory occupied by an object with a link-time-constant address.
15478 @end enumerate
15479
15480 It is the kernel's responsibility to ensure that speculative
15481 accesses to these regions are indeed safe.
15482
15483 If the input program contains a function declaration such as:
15484
15485 @smallexample
15486 void foo (void);
15487 @end smallexample
15488
15489 then the implementation of @code{foo} must allow @code{j foo} and
15490 @code{jal foo} to be executed speculatively.  GCC honors this
15491 restriction for functions it compiles itself.  It expects non-GCC
15492 functions (such as hand-written assembly code) to do the same.
15493
15494 The option has three forms:
15495
15496 @table @gcctabopt
15497 @item -mr10k-cache-barrier=load-store
15498 Insert a cache barrier before a load or store that might be
15499 speculatively executed and that might have side effects even
15500 if aborted.
15501
15502 @item -mr10k-cache-barrier=store
15503 Insert a cache barrier before a store that might be speculatively
15504 executed and that might have side effects even if aborted.
15505
15506 @item -mr10k-cache-barrier=none
15507 Disable the insertion of cache barriers.  This is the default setting.
15508 @end table
15509
15510 @item -mflush-func=@var{func}
15511 @itemx -mno-flush-func
15512 @opindex mflush-func
15513 Specifies the function to call to flush the I and D caches, or to not
15514 call any such function.  If called, the function must take the same
15515 arguments as the common @code{_flush_func()}, that is, the address of the
15516 memory range for which the cache is being flushed, the size of the
15517 memory range, and the number 3 (to flush both caches).  The default
15518 depends on the target GCC was configured for, but commonly is either
15519 @samp{_flush_func} or @samp{__cpu_flush}.
15520
15521 @item mbranch-cost=@var{num}
15522 @opindex mbranch-cost
15523 Set the cost of branches to roughly @var{num} ``simple'' instructions.
15524 This cost is only a heuristic and is not guaranteed to produce
15525 consistent results across releases.  A zero cost redundantly selects
15526 the default, which is based on the @option{-mtune} setting.
15527
15528 @item -mbranch-likely
15529 @itemx -mno-branch-likely
15530 @opindex mbranch-likely
15531 @opindex mno-branch-likely
15532 Enable or disable use of Branch Likely instructions, regardless of the
15533 default for the selected architecture.  By default, Branch Likely
15534 instructions may be generated if they are supported by the selected
15535 architecture.  An exception is for the MIPS32 and MIPS64 architectures
15536 and processors which implement those architectures; for those, Branch
15537 Likely instructions will not be generated by default because the MIPS32
15538 and MIPS64 architectures specifically deprecate their use.
15539
15540 @item -mfp-exceptions
15541 @itemx -mno-fp-exceptions
15542 @opindex mfp-exceptions
15543 Specifies whether FP exceptions are enabled.  This affects how we schedule
15544 FP instructions for some processors.  The default is that FP exceptions are
15545 enabled.
15546
15547 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
15548 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
15549 FP pipe.
15550
15551 @item -mvr4130-align
15552 @itemx -mno-vr4130-align
15553 @opindex mvr4130-align
15554 The VR4130 pipeline is two-way superscalar, but can only issue two
15555 instructions together if the first one is 8-byte aligned.  When this
15556 option is enabled, GCC will align pairs of instructions that it
15557 thinks should execute in parallel.
15558
15559 This option only has an effect when optimizing for the VR4130.
15560 It normally makes code faster, but at the expense of making it bigger.
15561 It is enabled by default at optimization level @option{-O3}.
15562
15563 @item -msynci
15564 @itemx -mno-synci
15565 @opindex msynci
15566 Enable (disable) generation of @code{synci} instructions on
15567 architectures that support it.  The @code{synci} instructions (if
15568 enabled) will be generated when @code{__builtin___clear_cache()} is
15569 compiled.
15570
15571 This option defaults to @code{-mno-synci}, but the default can be
15572 overridden by configuring with @code{--with-synci}.
15573
15574 When compiling code for single processor systems, it is generally safe
15575 to use @code{synci}.  However, on many multi-core (SMP) systems, it
15576 will not invalidate the instruction caches on all cores and may lead
15577 to undefined behavior.
15578
15579 @item -mrelax-pic-calls
15580 @itemx -mno-relax-pic-calls
15581 @opindex mrelax-pic-calls
15582 Try to turn PIC calls that are normally dispatched via register
15583 @code{$25} into direct calls.  This is only possible if the linker can
15584 resolve the destination at link-time and if the destination is within
15585 range for a direct call.
15586
15587 @option{-mrelax-pic-calls} is the default if GCC was configured to use
15588 an assembler and a linker that supports the @code{.reloc} assembly
15589 directive and @code{-mexplicit-relocs} is in effect.  With
15590 @code{-mno-explicit-relocs}, this optimization can be performed by the
15591 assembler and the linker alone without help from the compiler.
15592
15593 @item -mmcount-ra-address
15594 @itemx -mno-mcount-ra-address
15595 @opindex mmcount-ra-address
15596 @opindex mno-mcount-ra-address
15597 Emit (do not emit) code that allows @code{_mcount} to modify the
15598 calling function's return address.  When enabled, this option extends
15599 the usual @code{_mcount} interface with a new @var{ra-address}
15600 parameter, which has type @code{intptr_t *} and is passed in register
15601 @code{$12}.  @code{_mcount} can then modify the return address by
15602 doing both of the following:
15603 @itemize
15604 @item
15605 Returning the new address in register @code{$31}.
15606 @item
15607 Storing the new address in @code{*@var{ra-address}},
15608 if @var{ra-address} is nonnull.
15609 @end itemize
15610
15611 The default is @option{-mno-mcount-ra-address}.
15612
15613 @end table
15614
15615 @node MMIX Options
15616 @subsection MMIX Options
15617 @cindex MMIX Options
15618
15619 These options are defined for the MMIX:
15620
15621 @table @gcctabopt
15622 @item -mlibfuncs
15623 @itemx -mno-libfuncs
15624 @opindex mlibfuncs
15625 @opindex mno-libfuncs
15626 Specify that intrinsic library functions are being compiled, passing all
15627 values in registers, no matter the size.
15628
15629 @item -mepsilon
15630 @itemx -mno-epsilon
15631 @opindex mepsilon
15632 @opindex mno-epsilon
15633 Generate floating-point comparison instructions that compare with respect
15634 to the @code{rE} epsilon register.
15635
15636 @item -mabi=mmixware
15637 @itemx -mabi=gnu
15638 @opindex mabi=mmixware
15639 @opindex mabi=gnu
15640 Generate code that passes function parameters and return values that (in
15641 the called function) are seen as registers @code{$0} and up, as opposed to
15642 the GNU ABI which uses global registers @code{$231} and up.
15643
15644 @item -mzero-extend
15645 @itemx -mno-zero-extend
15646 @opindex mzero-extend
15647 @opindex mno-zero-extend
15648 When reading data from memory in sizes shorter than 64 bits, use (do not
15649 use) zero-extending load instructions by default, rather than
15650 sign-extending ones.
15651
15652 @item -mknuthdiv
15653 @itemx -mno-knuthdiv
15654 @opindex mknuthdiv
15655 @opindex mno-knuthdiv
15656 Make the result of a division yielding a remainder have the same sign as
15657 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
15658 remainder follows the sign of the dividend.  Both methods are
15659 arithmetically valid, the latter being almost exclusively used.
15660
15661 @item -mtoplevel-symbols
15662 @itemx -mno-toplevel-symbols
15663 @opindex mtoplevel-symbols
15664 @opindex mno-toplevel-symbols
15665 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
15666 code can be used with the @code{PREFIX} assembly directive.
15667
15668 @item -melf
15669 @opindex melf
15670 Generate an executable in the ELF format, rather than the default
15671 @samp{mmo} format used by the @command{mmix} simulator.
15672
15673 @item -mbranch-predict
15674 @itemx -mno-branch-predict
15675 @opindex mbranch-predict
15676 @opindex mno-branch-predict
15677 Use (do not use) the probable-branch instructions, when static branch
15678 prediction indicates a probable branch.
15679
15680 @item -mbase-addresses
15681 @itemx -mno-base-addresses
15682 @opindex mbase-addresses
15683 @opindex mno-base-addresses
15684 Generate (do not generate) code that uses @emph{base addresses}.  Using a
15685 base address automatically generates a request (handled by the assembler
15686 and the linker) for a constant to be set up in a global register.  The
15687 register is used for one or more base address requests within the range 0
15688 to 255 from the value held in the register.  The generally leads to short
15689 and fast code, but the number of different data items that can be
15690 addressed is limited.  This means that a program that uses lots of static
15691 data may require @option{-mno-base-addresses}.
15692
15693 @item -msingle-exit
15694 @itemx -mno-single-exit
15695 @opindex msingle-exit
15696 @opindex mno-single-exit
15697 Force (do not force) generated code to have a single exit point in each
15698 function.
15699 @end table
15700
15701 @node MN10300 Options
15702 @subsection MN10300 Options
15703 @cindex MN10300 options
15704
15705 These @option{-m} options are defined for Matsushita MN10300 architectures:
15706
15707 @table @gcctabopt
15708 @item -mmult-bug
15709 @opindex mmult-bug
15710 Generate code to avoid bugs in the multiply instructions for the MN10300
15711 processors.  This is the default.
15712
15713 @item -mno-mult-bug
15714 @opindex mno-mult-bug
15715 Do not generate code to avoid bugs in the multiply instructions for the
15716 MN10300 processors.
15717
15718 @item -mam33
15719 @opindex mam33
15720 Generate code which uses features specific to the AM33 processor.
15721
15722 @item -mno-am33
15723 @opindex mno-am33
15724 Do not generate code which uses features specific to the AM33 processor.  This
15725 is the default.
15726
15727 @item -mam33-2
15728 @opindex mam33-2
15729 Generate code which uses features specific to the AM33/2.0 processor.
15730
15731 @item -mam34
15732 @opindex mam34
15733 Generate code which uses features specific to the AM34 processor.
15734
15735 @item -mtune=@var{cpu-type}
15736 @opindex mtune
15737 Use the timing characteristics of the indicated CPU type when
15738 scheduling instructions.  This does not change the targeted processor
15739 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
15740 @samp{am33-2} or @samp{am34}.
15741
15742 @item -mreturn-pointer-on-d0
15743 @opindex mreturn-pointer-on-d0
15744 When generating a function which returns a pointer, return the pointer
15745 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
15746 only in a0, and attempts to call such functions without a prototype
15747 would result in errors.  Note that this option is on by default; use
15748 @option{-mno-return-pointer-on-d0} to disable it.
15749
15750 @item -mno-crt0
15751 @opindex mno-crt0
15752 Do not link in the C run-time initialization object file.
15753
15754 @item -mrelax
15755 @opindex mrelax
15756 Indicate to the linker that it should perform a relaxation optimization pass
15757 to shorten branches, calls and absolute memory addresses.  This option only
15758 has an effect when used on the command line for the final link step.
15759
15760 This option makes symbolic debugging impossible.
15761
15762 @item -mliw
15763 @opindex mliw
15764 Allow the compiler to generate @emph{Long Instruction Word}
15765 instructions if the target is the @samp{AM33} or later.  This is the
15766 default.  This option defines the preprocessor macro @samp{__LIW__}.
15767
15768 @item -mnoliw
15769 @opindex mnoliw
15770 Do not allow the compiler to generate @emph{Long Instruction Word}
15771 instructions.  This option defines the preprocessor macro
15772 @samp{__NO_LIW__}.
15773
15774 @item -msetlb
15775 @opindex msetlb
15776 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
15777 instructions if the target is the @samp{AM33} or later.  This is the
15778 default.  This option defines the preprocessor macro @samp{__SETLB__}.
15779
15780 @item -mnosetlb
15781 @opindex mnosetlb
15782 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
15783 instructions.  This option defines the preprocessor macro
15784 @samp{__NO_SETLB__}.
15785
15786 @end table
15787
15788 @node PDP-11 Options
15789 @subsection PDP-11 Options
15790 @cindex PDP-11 Options
15791
15792 These options are defined for the PDP-11:
15793
15794 @table @gcctabopt
15795 @item -mfpu
15796 @opindex mfpu
15797 Use hardware FPP floating point.  This is the default.  (FIS floating
15798 point on the PDP-11/40 is not supported.)
15799
15800 @item -msoft-float
15801 @opindex msoft-float
15802 Do not use hardware floating point.
15803
15804 @item -mac0
15805 @opindex mac0
15806 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
15807
15808 @item -mno-ac0
15809 @opindex mno-ac0
15810 Return floating-point results in memory.  This is the default.
15811
15812 @item -m40
15813 @opindex m40
15814 Generate code for a PDP-11/40.
15815
15816 @item -m45
15817 @opindex m45
15818 Generate code for a PDP-11/45.  This is the default.
15819
15820 @item -m10
15821 @opindex m10
15822 Generate code for a PDP-11/10.
15823
15824 @item -mbcopy-builtin
15825 @opindex mbcopy-builtin
15826 Use inline @code{movmemhi} patterns for copying memory.  This is the
15827 default.
15828
15829 @item -mbcopy
15830 @opindex mbcopy
15831 Do not use inline @code{movmemhi} patterns for copying memory.
15832
15833 @item -mint16
15834 @itemx -mno-int32
15835 @opindex mint16
15836 @opindex mno-int32
15837 Use 16-bit @code{int}.  This is the default.
15838
15839 @item -mint32
15840 @itemx -mno-int16
15841 @opindex mint32
15842 @opindex mno-int16
15843 Use 32-bit @code{int}.
15844
15845 @item -mfloat64
15846 @itemx -mno-float32
15847 @opindex mfloat64
15848 @opindex mno-float32
15849 Use 64-bit @code{float}.  This is the default.
15850
15851 @item -mfloat32
15852 @itemx -mno-float64
15853 @opindex mfloat32
15854 @opindex mno-float64
15855 Use 32-bit @code{float}.
15856
15857 @item -mabshi
15858 @opindex mabshi
15859 Use @code{abshi2} pattern.  This is the default.
15860
15861 @item -mno-abshi
15862 @opindex mno-abshi
15863 Do not use @code{abshi2} pattern.
15864
15865 @item -mbranch-expensive
15866 @opindex mbranch-expensive
15867 Pretend that branches are expensive.  This is for experimenting with
15868 code generation only.
15869
15870 @item -mbranch-cheap
15871 @opindex mbranch-cheap
15872 Do not pretend that branches are expensive.  This is the default.
15873
15874 @item -munix-asm
15875 @opindex munix-asm
15876 Use Unix assembler syntax.  This is the default when configured for
15877 @samp{pdp11-*-bsd}.
15878
15879 @item -mdec-asm
15880 @opindex mdec-asm
15881 Use DEC assembler syntax.  This is the default when configured for any
15882 PDP-11 target other than @samp{pdp11-*-bsd}.
15883 @end table
15884
15885 @node picoChip Options
15886 @subsection picoChip Options
15887 @cindex picoChip options
15888
15889 These @samp{-m} options are defined for picoChip implementations:
15890
15891 @table @gcctabopt
15892
15893 @item -mae=@var{ae_type}
15894 @opindex mcpu
15895 Set the instruction set, register set, and instruction scheduling
15896 parameters for array element type @var{ae_type}.  Supported values
15897 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
15898
15899 @option{-mae=ANY} selects a completely generic AE type.  Code
15900 generated with this option will run on any of the other AE types.  The
15901 code will not be as efficient as it would be if compiled for a specific
15902 AE type, and some types of operation (e.g., multiplication) will not
15903 work properly on all types of AE.
15904
15905 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
15906 for compiled code, and is the default.
15907
15908 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
15909 option may suffer from poor performance of byte (char) manipulation,
15910 since the DSP AE does not provide hardware support for byte load/stores.
15911
15912 @item -msymbol-as-address
15913 Enable the compiler to directly use a symbol name as an address in a
15914 load/store instruction, without first loading it into a
15915 register.  Typically, the use of this option will generate larger
15916 programs, which run faster than when the option isn't used.  However, the
15917 results vary from program to program, so it is left as a user option,
15918 rather than being permanently enabled.
15919
15920 @item -mno-inefficient-warnings
15921 Disables warnings about the generation of inefficient code.  These
15922 warnings can be generated, for example, when compiling code which
15923 performs byte-level memory operations on the MAC AE type.  The MAC AE has
15924 no hardware support for byte-level memory operations, so all byte
15925 load/stores must be synthesized from word load/store operations.  This is
15926 inefficient and a warning will be generated indicating to the programmer
15927 that they should rewrite the code to avoid byte operations, or to target
15928 an AE type which has the necessary hardware support.  This option enables
15929 the warning to be turned off.
15930
15931 @end table
15932
15933 @node PowerPC Options
15934 @subsection PowerPC Options
15935 @cindex PowerPC options
15936
15937 These are listed under @xref{RS/6000 and PowerPC Options}.
15938
15939 @node RL78 Options
15940 @subsection RL78 Options
15941 @cindex RL78 Options
15942
15943 @table @gcctabopt
15944
15945 @item -msim
15946 @opindex msim
15947 Links in additional target libraries to support operation within a
15948 simulator.
15949
15950 @item -mmul=none
15951 @itemx -mmul=g13
15952 @itemx -mmul=rl78
15953 @opindex mmul
15954 Specifies the type of hardware multiplication support to be used.  The
15955 default is @code{none}, which uses software multiplication functions.
15956 The @code{g13} option is for the hardware multiply/divide peripheral
15957 only on the RL78/G13 targets.  The @code{rl78} option is for the
15958 standard hardware multiplication defined in the RL78 software manual.
15959
15960 @end table
15961
15962 @node RS/6000 and PowerPC Options
15963 @subsection IBM RS/6000 and PowerPC Options
15964 @cindex RS/6000 and PowerPC Options
15965 @cindex IBM RS/6000 and PowerPC Options
15966
15967 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
15968 @table @gcctabopt
15969 @item -mpower
15970 @itemx -mno-power
15971 @itemx -mpower2
15972 @itemx -mno-power2
15973 @itemx -mpowerpc
15974 @itemx -mno-powerpc
15975 @itemx -mpowerpc-gpopt
15976 @itemx -mno-powerpc-gpopt
15977 @itemx -mpowerpc-gfxopt
15978 @itemx -mno-powerpc-gfxopt
15979 @need 800
15980 @itemx -mpowerpc64
15981 @itemx -mno-powerpc64
15982 @itemx -mmfcrf
15983 @itemx -mno-mfcrf
15984 @itemx -mpopcntb
15985 @itemx -mno-popcntb
15986 @itemx -mpopcntd
15987 @itemx -mno-popcntd
15988 @itemx -mfprnd
15989 @itemx -mno-fprnd
15990 @need 800
15991 @itemx -mcmpb
15992 @itemx -mno-cmpb
15993 @itemx -mmfpgpr
15994 @itemx -mno-mfpgpr
15995 @itemx -mhard-dfp
15996 @itemx -mno-hard-dfp
15997 @opindex mpower
15998 @opindex mno-power
15999 @opindex mpower2
16000 @opindex mno-power2
16001 @opindex mpowerpc
16002 @opindex mno-powerpc
16003 @opindex mpowerpc-gpopt
16004 @opindex mno-powerpc-gpopt
16005 @opindex mpowerpc-gfxopt
16006 @opindex mno-powerpc-gfxopt
16007 @opindex mpowerpc64
16008 @opindex mno-powerpc64
16009 @opindex mmfcrf
16010 @opindex mno-mfcrf
16011 @opindex mpopcntb
16012 @opindex mno-popcntb
16013 @opindex mpopcntd
16014 @opindex mno-popcntd
16015 @opindex mfprnd
16016 @opindex mno-fprnd
16017 @opindex mcmpb
16018 @opindex mno-cmpb
16019 @opindex mmfpgpr
16020 @opindex mno-mfpgpr
16021 @opindex mhard-dfp
16022 @opindex mno-hard-dfp
16023 GCC supports two related instruction set architectures for the
16024 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
16025 instructions supported by the @samp{rios} chip set used in the original
16026 RS/6000 systems and the @dfn{PowerPC} instruction set is the
16027 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
16028 the IBM 4xx, 6xx, and follow-on microprocessors.
16029
16030 Neither architecture is a subset of the other.  However there is a
16031 large common subset of instructions supported by both.  An MQ
16032 register is included in processors supporting the POWER architecture.
16033
16034 You use these options to specify which instructions are available on the
16035 processor you are using.  The default value of these options is
16036 determined when configuring GCC@.  Specifying the
16037 @option{-mcpu=@var{cpu_type}} overrides the specification of these
16038 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
16039 rather than the options listed above.
16040
16041 The @option{-mpower} option allows GCC to generate instructions that
16042 are found only in the POWER architecture and to use the MQ register.
16043 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
16044 to generate instructions that are present in the POWER2 architecture but
16045 not the original POWER architecture.
16046
16047 The @option{-mpowerpc} option allows GCC to generate instructions that
16048 are found only in the 32-bit subset of the PowerPC architecture.
16049 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
16050 GCC to use the optional PowerPC architecture instructions in the
16051 General Purpose group, including floating-point square root.  Specifying
16052 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
16053 use the optional PowerPC architecture instructions in the Graphics
16054 group, including floating-point select.
16055
16056 The @option{-mmfcrf} option allows GCC to generate the move from
16057 condition register field instruction implemented on the POWER4
16058 processor and other processors that support the PowerPC V2.01
16059 architecture.
16060 The @option{-mpopcntb} option allows GCC to generate the popcount and
16061 double precision FP reciprocal estimate instruction implemented on the
16062 POWER5 processor and other processors that support the PowerPC V2.02
16063 architecture.
16064 The @option{-mpopcntd} option allows GCC to generate the popcount
16065 instruction implemented on the POWER7 processor and other processors
16066 that support the PowerPC V2.06 architecture.
16067 The @option{-mfprnd} option allows GCC to generate the FP round to
16068 integer instructions implemented on the POWER5+ processor and other
16069 processors that support the PowerPC V2.03 architecture.
16070 The @option{-mcmpb} option allows GCC to generate the compare bytes
16071 instruction implemented on the POWER6 processor and other processors
16072 that support the PowerPC V2.05 architecture.
16073 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
16074 general purpose register instructions implemented on the POWER6X
16075 processor and other processors that support the extended PowerPC V2.05
16076 architecture.
16077 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
16078 point instructions implemented on some POWER processors.
16079
16080 The @option{-mpowerpc64} option allows GCC to generate the additional
16081 64-bit instructions that are found in the full PowerPC64 architecture
16082 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
16083 @option{-mno-powerpc64}.
16084
16085 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
16086 will use only the instructions in the common subset of both
16087 architectures plus some special AIX common-mode calls, and will not use
16088 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
16089 permits GCC to use any instruction from either architecture and to
16090 allow use of the MQ register; specify this for the Motorola MPC601.
16091
16092 @item -mnew-mnemonics
16093 @itemx -mold-mnemonics
16094 @opindex mnew-mnemonics
16095 @opindex mold-mnemonics
16096 Select which mnemonics to use in the generated assembler code.  With
16097 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
16098 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
16099 assembler mnemonics defined for the POWER architecture.  Instructions
16100 defined in only one architecture have only one mnemonic; GCC uses that
16101 mnemonic irrespective of which of these options is specified.
16102
16103 GCC defaults to the mnemonics appropriate for the architecture in
16104 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
16105 value of these option.  Unless you are building a cross-compiler, you
16106 should normally not specify either @option{-mnew-mnemonics} or
16107 @option{-mold-mnemonics}, but should instead accept the default.
16108
16109 @item -mcpu=@var{cpu_type}
16110 @opindex mcpu
16111 Set architecture type, register usage, choice of mnemonics, and
16112 instruction scheduling parameters for machine type @var{cpu_type}.
16113 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
16114 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
16115 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
16116 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
16117 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
16118 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
16119 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
16120 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
16121 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
16122 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
16123 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
16124
16125 @option{-mcpu=common} selects a completely generic processor.  Code
16126 generated under this option will run on any POWER or PowerPC processor.
16127 GCC will use only the instructions in the common subset of both
16128 architectures, and will not use the MQ register.  GCC assumes a generic
16129 processor model for scheduling purposes.
16130
16131 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
16132 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
16133 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
16134 types, with an appropriate, generic processor model assumed for
16135 scheduling purposes.
16136
16137 The other options specify a specific processor.  Code generated under
16138 those options will run best on that processor, and may not run at all on
16139 others.
16140
16141 The @option{-mcpu} options automatically enable or disable the
16142 following options:
16143
16144 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
16145 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
16146 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
16147 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
16148
16149 The particular options set for any particular CPU will vary between
16150 compiler versions, depending on what setting seems to produce optimal
16151 code for that CPU; it doesn't necessarily reflect the actual hardware's
16152 capabilities.  If you wish to set an individual option to a particular
16153 value, you may specify it after the @option{-mcpu} option, like
16154 @samp{-mcpu=970 -mno-altivec}.
16155
16156 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
16157 not enabled or disabled by the @option{-mcpu} option at present because
16158 AIX does not have full support for these options.  You may still
16159 enable or disable them individually if you're sure it'll work in your
16160 environment.
16161
16162 @item -mtune=@var{cpu_type}
16163 @opindex mtune
16164 Set the instruction scheduling parameters for machine type
16165 @var{cpu_type}, but do not set the architecture type, register usage, or
16166 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
16167 values for @var{cpu_type} are used for @option{-mtune} as for
16168 @option{-mcpu}.  If both are specified, the code generated will use the
16169 architecture, registers, and mnemonics set by @option{-mcpu}, but the
16170 scheduling parameters set by @option{-mtune}.
16171
16172 @item -mcmodel=small
16173 @opindex mcmodel=small
16174 Generate PowerPC64 code for the small model: The TOC is limited to
16175 64k.
16176
16177 @item -mcmodel=medium
16178 @opindex mcmodel=medium
16179 Generate PowerPC64 code for the medium model: The TOC and other static
16180 data may be up to a total of 4G in size.
16181
16182 @item -mcmodel=large
16183 @opindex mcmodel=large
16184 Generate PowerPC64 code for the large model: The TOC may be up to 4G
16185 in size.  Other data and code is only limited by the 64-bit address
16186 space.
16187
16188 @item -maltivec
16189 @itemx -mno-altivec
16190 @opindex maltivec
16191 @opindex mno-altivec
16192 Generate code that uses (does not use) AltiVec instructions, and also
16193 enable the use of built-in functions that allow more direct access to
16194 the AltiVec instruction set.  You may also need to set
16195 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
16196 enhancements.
16197
16198 @item -mvrsave
16199 @itemx -mno-vrsave
16200 @opindex mvrsave
16201 @opindex mno-vrsave
16202 Generate VRSAVE instructions when generating AltiVec code.
16203
16204 @item -mgen-cell-microcode
16205 @opindex mgen-cell-microcode
16206 Generate Cell microcode instructions
16207
16208 @item -mwarn-cell-microcode
16209 @opindex mwarn-cell-microcode
16210 Warning when a Cell microcode instruction is going to emitted.  An example
16211 of a Cell microcode instruction is a variable shift.
16212
16213 @item -msecure-plt
16214 @opindex msecure-plt
16215 Generate code that allows ld and ld.so to build executables and shared
16216 libraries with non-exec .plt and .got sections.  This is a PowerPC
16217 32-bit SYSV ABI option.
16218
16219 @item -mbss-plt
16220 @opindex mbss-plt
16221 Generate code that uses a BSS .plt section that ld.so fills in, and
16222 requires .plt and .got sections that are both writable and executable.
16223 This is a PowerPC 32-bit SYSV ABI option.
16224
16225 @item -misel
16226 @itemx -mno-isel
16227 @opindex misel
16228 @opindex mno-isel
16229 This switch enables or disables the generation of ISEL instructions.
16230
16231 @item -misel=@var{yes/no}
16232 This switch has been deprecated.  Use @option{-misel} and
16233 @option{-mno-isel} instead.
16234
16235 @item -mspe
16236 @itemx -mno-spe
16237 @opindex mspe
16238 @opindex mno-spe
16239 This switch enables or disables the generation of SPE simd
16240 instructions.
16241
16242 @item -mpaired
16243 @itemx -mno-paired
16244 @opindex mpaired
16245 @opindex mno-paired
16246 This switch enables or disables the generation of PAIRED simd
16247 instructions.
16248
16249 @item -mspe=@var{yes/no}
16250 This option has been deprecated.  Use @option{-mspe} and
16251 @option{-mno-spe} instead.
16252
16253 @item -mvsx
16254 @itemx -mno-vsx
16255 @opindex mvsx
16256 @opindex mno-vsx
16257 Generate code that uses (does not use) vector/scalar (VSX)
16258 instructions, and also enable the use of built-in functions that allow
16259 more direct access to the VSX instruction set.
16260
16261 @item -mfloat-gprs=@var{yes/single/double/no}
16262 @itemx -mfloat-gprs
16263 @opindex mfloat-gprs
16264 This switch enables or disables the generation of floating point
16265 operations on the general purpose registers for architectures that
16266 support it.
16267
16268 The argument @var{yes} or @var{single} enables the use of
16269 single-precision floating point operations.
16270
16271 The argument @var{double} enables the use of single and
16272 double-precision floating point operations.
16273
16274 The argument @var{no} disables floating point operations on the
16275 general purpose registers.
16276
16277 This option is currently only available on the MPC854x.
16278
16279 @item -m32
16280 @itemx -m64
16281 @opindex m32
16282 @opindex m64
16283 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
16284 targets (including GNU/Linux).  The 32-bit environment sets int, long
16285 and pointer to 32 bits and generates code that runs on any PowerPC
16286 variant.  The 64-bit environment sets int to 32 bits and long and
16287 pointer to 64 bits, and generates code for PowerPC64, as for
16288 @option{-mpowerpc64}.
16289
16290 @item -mfull-toc
16291 @itemx -mno-fp-in-toc
16292 @itemx -mno-sum-in-toc
16293 @itemx -mminimal-toc
16294 @opindex mfull-toc
16295 @opindex mno-fp-in-toc
16296 @opindex mno-sum-in-toc
16297 @opindex mminimal-toc
16298 Modify generation of the TOC (Table Of Contents), which is created for
16299 every executable file.  The @option{-mfull-toc} option is selected by
16300 default.  In that case, GCC will allocate at least one TOC entry for
16301 each unique non-automatic variable reference in your program.  GCC
16302 will also place floating-point constants in the TOC@.  However, only
16303 16,384 entries are available in the TOC@.
16304
16305 If you receive a linker error message that saying you have overflowed
16306 the available TOC space, you can reduce the amount of TOC space used
16307 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
16308 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
16309 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
16310 generate code to calculate the sum of an address and a constant at
16311 run-time instead of putting that sum into the TOC@.  You may specify one
16312 or both of these options.  Each causes GCC to produce very slightly
16313 slower and larger code at the expense of conserving TOC space.
16314
16315 If you still run out of space in the TOC even when you specify both of
16316 these options, specify @option{-mminimal-toc} instead.  This option causes
16317 GCC to make only one TOC entry for every file.  When you specify this
16318 option, GCC will produce code that is slower and larger but which
16319 uses extremely little TOC space.  You may wish to use this option
16320 only on files that contain less frequently executed code.
16321
16322 @item -maix64
16323 @itemx -maix32
16324 @opindex maix64
16325 @opindex maix32
16326 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
16327 @code{long} type, and the infrastructure needed to support them.
16328 Specifying @option{-maix64} implies @option{-mpowerpc64} and
16329 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
16330 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
16331
16332 @item -mxl-compat
16333 @itemx -mno-xl-compat
16334 @opindex mxl-compat
16335 @opindex mno-xl-compat
16336 Produce code that conforms more closely to IBM XL compiler semantics
16337 when using AIX-compatible ABI@.  Pass floating-point arguments to
16338 prototyped functions beyond the register save area (RSA) on the stack
16339 in addition to argument FPRs.  Do not assume that most significant
16340 double in 128-bit long double value is properly rounded when comparing
16341 values and converting to double.  Use XL symbol names for long double
16342 support routines.
16343
16344 The AIX calling convention was extended but not initially documented to
16345 handle an obscure K&R C case of calling a function that takes the
16346 address of its arguments with fewer arguments than declared.  IBM XL
16347 compilers access floating point arguments which do not fit in the
16348 RSA from the stack when a subroutine is compiled without
16349 optimization.  Because always storing floating-point arguments on the
16350 stack is inefficient and rarely needed, this option is not enabled by
16351 default and only is necessary when calling subroutines compiled by IBM
16352 XL compilers without optimization.
16353
16354 @item -mpe
16355 @opindex mpe
16356 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
16357 application written to use message passing with special startup code to
16358 enable the application to run.  The system must have PE installed in the
16359 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
16360 must be overridden with the @option{-specs=} option to specify the
16361 appropriate directory location.  The Parallel Environment does not
16362 support threads, so the @option{-mpe} option and the @option{-pthread}
16363 option are incompatible.
16364
16365 @item -malign-natural
16366 @itemx -malign-power
16367 @opindex malign-natural
16368 @opindex malign-power
16369 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
16370 @option{-malign-natural} overrides the ABI-defined alignment of larger
16371 types, such as floating-point doubles, on their natural size-based boundary.
16372 The option @option{-malign-power} instructs GCC to follow the ABI-specified
16373 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
16374
16375 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
16376 is not supported.
16377
16378 @item -msoft-float
16379 @itemx -mhard-float
16380 @opindex msoft-float
16381 @opindex mhard-float
16382 Generate code that does not use (uses) the floating-point register set.
16383 Software floating point emulation is provided if you use the
16384 @option{-msoft-float} option, and pass the option to GCC when linking.
16385
16386 @item -msingle-float
16387 @itemx -mdouble-float
16388 @opindex msingle-float
16389 @opindex mdouble-float
16390 Generate code for single or double-precision floating point operations.
16391 @option{-mdouble-float} implies @option{-msingle-float}.
16392
16393 @item -msimple-fpu
16394 @opindex msimple-fpu
16395 Do not generate sqrt and div instructions for hardware floating point unit.
16396
16397 @item -mfpu
16398 @opindex mfpu
16399 Specify type of floating point unit.  Valid values are @var{sp_lite}
16400 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
16401 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
16402 and @var{dp_full} (equivalent to -mdouble-float).
16403
16404 @item -mxilinx-fpu
16405 @opindex mxilinx-fpu
16406 Perform optimizations for floating point unit on Xilinx PPC 405/440.
16407
16408 @item -mmultiple
16409 @itemx -mno-multiple
16410 @opindex mmultiple
16411 @opindex mno-multiple
16412 Generate code that uses (does not use) the load multiple word
16413 instructions and the store multiple word instructions.  These
16414 instructions are generated by default on POWER systems, and not
16415 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
16416 endian PowerPC systems, since those instructions do not work when the
16417 processor is in little endian mode.  The exceptions are PPC740 and
16418 PPC750 which permit the instructions usage in little endian mode.
16419
16420 @item -mstring
16421 @itemx -mno-string
16422 @opindex mstring
16423 @opindex mno-string
16424 Generate code that uses (does not use) the load string instructions
16425 and the store string word instructions to save multiple registers and
16426 do small block moves.  These instructions are generated by default on
16427 POWER systems, and not generated on PowerPC systems.  Do not use
16428 @option{-mstring} on little endian PowerPC systems, since those
16429 instructions do not work when the processor is in little endian mode.
16430 The exceptions are PPC740 and PPC750 which permit the instructions
16431 usage in little endian mode.
16432
16433 @item -mupdate
16434 @itemx -mno-update
16435 @opindex mupdate
16436 @opindex mno-update
16437 Generate code that uses (does not use) the load or store instructions
16438 that update the base register to the address of the calculated memory
16439 location.  These instructions are generated by default.  If you use
16440 @option{-mno-update}, there is a small window between the time that the
16441 stack pointer is updated and the address of the previous frame is
16442 stored, which means code that walks the stack frame across interrupts or
16443 signals may get corrupted data.
16444
16445 @item -mavoid-indexed-addresses
16446 @itemx -mno-avoid-indexed-addresses
16447 @opindex mavoid-indexed-addresses
16448 @opindex mno-avoid-indexed-addresses
16449 Generate code that tries to avoid (not avoid) the use of indexed load
16450 or store instructions. These instructions can incur a performance
16451 penalty on Power6 processors in certain situations, such as when
16452 stepping through large arrays that cross a 16M boundary.  This option
16453 is enabled by default when targetting Power6 and disabled otherwise.
16454
16455 @item -mfused-madd
16456 @itemx -mno-fused-madd
16457 @opindex mfused-madd
16458 @opindex mno-fused-madd
16459 Generate code that uses (does not use) the floating point multiply and
16460 accumulate instructions.  These instructions are generated by default
16461 if hardware floating point is used.  The machine dependent
16462 @option{-mfused-madd} option is now mapped to the machine independent
16463 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
16464 mapped to @option{-ffp-contract=off}.
16465
16466 @item -mmulhw
16467 @itemx -mno-mulhw
16468 @opindex mmulhw
16469 @opindex mno-mulhw
16470 Generate code that uses (does not use) the half-word multiply and
16471 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
16472 These instructions are generated by default when targetting those
16473 processors.
16474
16475 @item -mdlmzb
16476 @itemx -mno-dlmzb
16477 @opindex mdlmzb
16478 @opindex mno-dlmzb
16479 Generate code that uses (does not use) the string-search @samp{dlmzb}
16480 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
16481 generated by default when targetting those processors.
16482
16483 @item -mno-bit-align
16484 @itemx -mbit-align
16485 @opindex mno-bit-align
16486 @opindex mbit-align
16487 On System V.4 and embedded PowerPC systems do not (do) force structures
16488 and unions that contain bit-fields to be aligned to the base type of the
16489 bit-field.
16490
16491 For example, by default a structure containing nothing but 8
16492 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
16493 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
16494 the structure would be aligned to a 1 byte boundary and be one byte in
16495 size.
16496
16497 @item -mno-strict-align
16498 @itemx -mstrict-align
16499 @opindex mno-strict-align
16500 @opindex mstrict-align
16501 On System V.4 and embedded PowerPC systems do not (do) assume that
16502 unaligned memory references will be handled by the system.
16503
16504 @item -mrelocatable
16505 @itemx -mno-relocatable
16506 @opindex mrelocatable
16507 @opindex mno-relocatable
16508 Generate code that allows (does not allow) a static executable to be
16509 relocated to a different address at runtime.  A simple embedded
16510 PowerPC system loader should relocate the entire contents of
16511 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
16512 a table of 32-bit addresses generated by this option.  For this to
16513 work, all objects linked together must be compiled with
16514 @option{-mrelocatable} or @option{-mrelocatable-lib}.
16515 @option{-mrelocatable} code aligns the stack to an 8 byte boundary.
16516
16517 @item -mrelocatable-lib
16518 @itemx -mno-relocatable-lib
16519 @opindex mrelocatable-lib
16520 @opindex mno-relocatable-lib
16521 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
16522 @code{.fixup} section to allow static executables to be relocated at
16523 runtime, but @option{-mrelocatable-lib} does not use the smaller stack
16524 alignment of @option{-mrelocatable}.  Objects compiled with
16525 @option{-mrelocatable-lib} may be linked with objects compiled with
16526 any combination of the @option{-mrelocatable} options.
16527
16528 @item -mno-toc
16529 @itemx -mtoc
16530 @opindex mno-toc
16531 @opindex mtoc
16532 On System V.4 and embedded PowerPC systems do not (do) assume that
16533 register 2 contains a pointer to a global area pointing to the addresses
16534 used in the program.
16535
16536 @item -mlittle
16537 @itemx -mlittle-endian
16538 @opindex mlittle
16539 @opindex mlittle-endian
16540 On System V.4 and embedded PowerPC systems compile code for the
16541 processor in little endian mode.  The @option{-mlittle-endian} option is
16542 the same as @option{-mlittle}.
16543
16544 @item -mbig
16545 @itemx -mbig-endian
16546 @opindex mbig
16547 @opindex mbig-endian
16548 On System V.4 and embedded PowerPC systems compile code for the
16549 processor in big endian mode.  The @option{-mbig-endian} option is
16550 the same as @option{-mbig}.
16551
16552 @item -mdynamic-no-pic
16553 @opindex mdynamic-no-pic
16554 On Darwin and Mac OS X systems, compile code so that it is not
16555 relocatable, but that its external references are relocatable.  The
16556 resulting code is suitable for applications, but not shared
16557 libraries.
16558
16559 @item -msingle-pic-base
16560 @opindex msingle-pic-base
16561 Treat the register used for PIC addressing as read-only, rather than
16562 loading it in the prologue for each function.  The run-time system is
16563 responsible for initializing this register with an appropriate value
16564 before execution begins.
16565
16566 @item -mprioritize-restricted-insns=@var{priority}
16567 @opindex mprioritize-restricted-insns
16568 This option controls the priority that is assigned to
16569 dispatch-slot restricted instructions during the second scheduling
16570 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
16571 @var{no/highest/second-highest} priority to dispatch slot restricted
16572 instructions.
16573
16574 @item -msched-costly-dep=@var{dependence_type}
16575 @opindex msched-costly-dep
16576 This option controls which dependences are considered costly
16577 by the target during instruction scheduling.  The argument
16578 @var{dependence_type} takes one of the following values:
16579 @var{no}: no dependence is costly,
16580 @var{all}: all dependences are costly,
16581 @var{true_store_to_load}: a true dependence from store to load is costly,
16582 @var{store_to_load}: any dependence from store to load is costly,
16583 @var{number}: any dependence which latency >= @var{number} is costly.
16584
16585 @item -minsert-sched-nops=@var{scheme}
16586 @opindex minsert-sched-nops
16587 This option controls which nop insertion scheme will be used during
16588 the second scheduling pass.  The argument @var{scheme} takes one of the
16589 following values:
16590 @var{no}: Don't insert nops.
16591 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
16592 according to the scheduler's grouping.
16593 @var{regroup_exact}: Insert nops to force costly dependent insns into
16594 separate groups.  Insert exactly as many nops as needed to force an insn
16595 to a new group, according to the estimated processor grouping.
16596 @var{number}: Insert nops to force costly dependent insns into
16597 separate groups.  Insert @var{number} nops to force an insn to a new group.
16598
16599 @item -mcall-sysv
16600 @opindex mcall-sysv
16601 On System V.4 and embedded PowerPC systems compile code using calling
16602 conventions that adheres to the March 1995 draft of the System V
16603 Application Binary Interface, PowerPC processor supplement.  This is the
16604 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
16605
16606 @item -mcall-sysv-eabi
16607 @itemx -mcall-eabi
16608 @opindex mcall-sysv-eabi
16609 @opindex mcall-eabi
16610 Specify both @option{-mcall-sysv} and @option{-meabi} options.
16611
16612 @item -mcall-sysv-noeabi
16613 @opindex mcall-sysv-noeabi
16614 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
16615
16616 @item -mcall-aixdesc
16617 @opindex m
16618 On System V.4 and embedded PowerPC systems compile code for the AIX
16619 operating system.
16620
16621 @item -mcall-linux
16622 @opindex mcall-linux
16623 On System V.4 and embedded PowerPC systems compile code for the
16624 Linux-based GNU system.
16625
16626 @item -mcall-freebsd
16627 @opindex mcall-freebsd
16628 On System V.4 and embedded PowerPC systems compile code for the
16629 FreeBSD operating system.
16630
16631 @item -mcall-netbsd
16632 @opindex mcall-netbsd
16633 On System V.4 and embedded PowerPC systems compile code for the
16634 NetBSD operating system.
16635
16636 @item -mcall-openbsd
16637 @opindex mcall-netbsd
16638 On System V.4 and embedded PowerPC systems compile code for the
16639 OpenBSD operating system.
16640
16641 @item -maix-struct-return
16642 @opindex maix-struct-return
16643 Return all structures in memory (as specified by the AIX ABI)@.
16644
16645 @item -msvr4-struct-return
16646 @opindex msvr4-struct-return
16647 Return structures smaller than 8 bytes in registers (as specified by the
16648 SVR4 ABI)@.
16649
16650 @item -mabi=@var{abi-type}
16651 @opindex mabi
16652 Extend the current ABI with a particular extension, or remove such extension.
16653 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
16654 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
16655
16656 @item -mabi=spe
16657 @opindex mabi=spe
16658 Extend the current ABI with SPE ABI extensions.  This does not change
16659 the default ABI, instead it adds the SPE ABI extensions to the current
16660 ABI@.
16661
16662 @item -mabi=no-spe
16663 @opindex mabi=no-spe
16664 Disable Booke SPE ABI extensions for the current ABI@.
16665
16666 @item -mabi=ibmlongdouble
16667 @opindex mabi=ibmlongdouble
16668 Change the current ABI to use IBM extended precision long double.
16669 This is a PowerPC 32-bit SYSV ABI option.
16670
16671 @item -mabi=ieeelongdouble
16672 @opindex mabi=ieeelongdouble
16673 Change the current ABI to use IEEE extended precision long double.
16674 This is a PowerPC 32-bit Linux ABI option.
16675
16676 @item -mprototype
16677 @itemx -mno-prototype
16678 @opindex mprototype
16679 @opindex mno-prototype
16680 On System V.4 and embedded PowerPC systems assume that all calls to
16681 variable argument functions are properly prototyped.  Otherwise, the
16682 compiler must insert an instruction before every non prototyped call to
16683 set or clear bit 6 of the condition code register (@var{CR}) to
16684 indicate whether floating point values were passed in the floating point
16685 registers in case the function takes a variable arguments.  With
16686 @option{-mprototype}, only calls to prototyped variable argument functions
16687 will set or clear the bit.
16688
16689 @item -msim
16690 @opindex msim
16691 On embedded PowerPC systems, assume that the startup module is called
16692 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
16693 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
16694 configurations.
16695
16696 @item -mmvme
16697 @opindex mmvme
16698 On embedded PowerPC systems, assume that the startup module is called
16699 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
16700 @file{libc.a}.
16701
16702 @item -mads
16703 @opindex mads
16704 On embedded PowerPC systems, assume that the startup module is called
16705 @file{crt0.o} and the standard C libraries are @file{libads.a} and
16706 @file{libc.a}.
16707
16708 @item -myellowknife
16709 @opindex myellowknife
16710 On embedded PowerPC systems, assume that the startup module is called
16711 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
16712 @file{libc.a}.
16713
16714 @item -mvxworks
16715 @opindex mvxworks
16716 On System V.4 and embedded PowerPC systems, specify that you are
16717 compiling for a VxWorks system.
16718
16719 @item -memb
16720 @opindex memb
16721 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
16722 header to indicate that @samp{eabi} extended relocations are used.
16723
16724 @item -meabi
16725 @itemx -mno-eabi
16726 @opindex meabi
16727 @opindex mno-eabi
16728 On System V.4 and embedded PowerPC systems do (do not) adhere to the
16729 Embedded Applications Binary Interface (eabi) which is a set of
16730 modifications to the System V.4 specifications.  Selecting @option{-meabi}
16731 means that the stack is aligned to an 8 byte boundary, a function
16732 @code{__eabi} is called to from @code{main} to set up the eabi
16733 environment, and the @option{-msdata} option can use both @code{r2} and
16734 @code{r13} to point to two separate small data areas.  Selecting
16735 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
16736 do not call an initialization function from @code{main}, and the
16737 @option{-msdata} option will only use @code{r13} to point to a single
16738 small data area.  The @option{-meabi} option is on by default if you
16739 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
16740
16741 @item -msdata=eabi
16742 @opindex msdata=eabi
16743 On System V.4 and embedded PowerPC systems, put small initialized
16744 @code{const} global and static data in the @samp{.sdata2} section, which
16745 is pointed to by register @code{r2}.  Put small initialized
16746 non-@code{const} global and static data in the @samp{.sdata} section,
16747 which is pointed to by register @code{r13}.  Put small uninitialized
16748 global and static data in the @samp{.sbss} section, which is adjacent to
16749 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
16750 incompatible with the @option{-mrelocatable} option.  The
16751 @option{-msdata=eabi} option also sets the @option{-memb} option.
16752
16753 @item -msdata=sysv
16754 @opindex msdata=sysv
16755 On System V.4 and embedded PowerPC systems, put small global and static
16756 data in the @samp{.sdata} section, which is pointed to by register
16757 @code{r13}.  Put small uninitialized global and static data in the
16758 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
16759 The @option{-msdata=sysv} option is incompatible with the
16760 @option{-mrelocatable} option.
16761
16762 @item -msdata=default
16763 @itemx -msdata
16764 @opindex msdata=default
16765 @opindex msdata
16766 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
16767 compile code the same as @option{-msdata=eabi}, otherwise compile code the
16768 same as @option{-msdata=sysv}.
16769
16770 @item -msdata=data
16771 @opindex msdata=data
16772 On System V.4 and embedded PowerPC systems, put small global
16773 data in the @samp{.sdata} section.  Put small uninitialized global
16774 data in the @samp{.sbss} section.  Do not use register @code{r13}
16775 to address small data however.  This is the default behavior unless
16776 other @option{-msdata} options are used.
16777
16778 @item -msdata=none
16779 @itemx -mno-sdata
16780 @opindex msdata=none
16781 @opindex mno-sdata
16782 On embedded PowerPC systems, put all initialized global and static data
16783 in the @samp{.data} section, and all uninitialized data in the
16784 @samp{.bss} section.
16785
16786 @item -mblock-move-inline-limit=@var{num}
16787 @opindex mblock-move-inline-limit
16788 Inline all block moves (such as calls to @code{memcpy} or structure
16789 copies) less than or equal to @var{num} bytes.  The minimum value for
16790 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
16791 targets.  The default value is target-specific.
16792
16793 @item -G @var{num}
16794 @opindex G
16795 @cindex smaller data references (PowerPC)
16796 @cindex .sdata/.sdata2 references (PowerPC)
16797 On embedded PowerPC systems, put global and static items less than or
16798 equal to @var{num} bytes into the small data or bss sections instead of
16799 the normal data or bss section.  By default, @var{num} is 8.  The
16800 @option{-G @var{num}} switch is also passed to the linker.
16801 All modules should be compiled with the same @option{-G @var{num}} value.
16802
16803 @item -mregnames
16804 @itemx -mno-regnames
16805 @opindex mregnames
16806 @opindex mno-regnames
16807 On System V.4 and embedded PowerPC systems do (do not) emit register
16808 names in the assembly language output using symbolic forms.
16809
16810 @item -mlongcall
16811 @itemx -mno-longcall
16812 @opindex mlongcall
16813 @opindex mno-longcall
16814 By default assume that all calls are far away so that a longer more
16815 expensive calling sequence is required.  This is required for calls
16816 further than 32 megabytes (33,554,432 bytes) from the current location.
16817 A short call will be generated if the compiler knows
16818 the call cannot be that far away.  This setting can be overridden by
16819 the @code{shortcall} function attribute, or by @code{#pragma
16820 longcall(0)}.
16821
16822 Some linkers are capable of detecting out-of-range calls and generating
16823 glue code on the fly.  On these systems, long calls are unnecessary and
16824 generate slower code.  As of this writing, the AIX linker can do this,
16825 as can the GNU linker for PowerPC/64.  It is planned to add this feature
16826 to the GNU linker for 32-bit PowerPC systems as well.
16827
16828 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
16829 callee, L42'', plus a ``branch island'' (glue code).  The two target
16830 addresses represent the callee and the ``branch island''.  The
16831 Darwin/PPC linker will prefer the first address and generate a ``bl
16832 callee'' if the PPC ``bl'' instruction will reach the callee directly;
16833 otherwise, the linker will generate ``bl L42'' to call the ``branch
16834 island''.  The ``branch island'' is appended to the body of the
16835 calling function; it computes the full 32-bit address of the callee
16836 and jumps to it.
16837
16838 On Mach-O (Darwin) systems, this option directs the compiler emit to
16839 the glue for every direct call, and the Darwin linker decides whether
16840 to use or discard it.
16841
16842 In the future, we may cause GCC to ignore all longcall specifications
16843 when the linker is known to generate glue.
16844
16845 @item -mtls-markers
16846 @itemx -mno-tls-markers
16847 @opindex mtls-markers
16848 @opindex mno-tls-markers
16849 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
16850 specifying the function argument.  The relocation allows ld to
16851 reliably associate function call with argument setup instructions for
16852 TLS optimization, which in turn allows gcc to better schedule the
16853 sequence.
16854
16855 @item -pthread
16856 @opindex pthread
16857 Adds support for multithreading with the @dfn{pthreads} library.
16858 This option sets flags for both the preprocessor and linker.
16859
16860 @item -mrecip
16861 @itemx -mno-recip
16862 @opindex mrecip
16863 This option will enable GCC to use the reciprocal estimate and
16864 reciprocal square root estimate instructions with additional
16865 Newton-Raphson steps to increase precision instead of doing a divide or
16866 square root and divide for floating point arguments.  You should use
16867 the @option{-ffast-math} option when using @option{-mrecip} (or at
16868 least @option{-funsafe-math-optimizations},
16869 @option{-finite-math-only}, @option{-freciprocal-math} and
16870 @option{-fno-trapping-math}).  Note that while the throughput of the
16871 sequence is generally higher than the throughput of the non-reciprocal
16872 instruction, the precision of the sequence can be decreased by up to 2
16873 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
16874 roots.
16875
16876 @item -mrecip=@var{opt}
16877 @opindex mrecip=opt
16878 This option allows to control which reciprocal estimate instructions
16879 may be used.  @var{opt} is a comma separated list of options, that may
16880 be preceded by a @code{!} to invert the option:
16881 @code{all}: enable all estimate instructions,
16882 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
16883 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
16884 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
16885 @code{divf}: enable the single precision reciprocal approximation instructions;
16886 @code{divd}: enable the double precision reciprocal approximation instructions;
16887 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
16888 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
16889 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
16890
16891 So for example, @option{-mrecip=all,!rsqrtd} would enable the
16892 all of the reciprocal estimate instructions, except for the
16893 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
16894 which handle the double precision reciprocal square root calculations.
16895
16896 @item -mrecip-precision
16897 @itemx -mno-recip-precision
16898 @opindex mrecip-precision
16899 Assume (do not assume) that the reciprocal estimate instructions
16900 provide higher precision estimates than is mandated by the powerpc
16901 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
16902 automatically selects @option{-mrecip-precision}.  The double
16903 precision square root estimate instructions are not generated by
16904 default on low precision machines, since they do not provide an
16905 estimate that converges after three steps.
16906
16907 @item -mveclibabi=@var{type}
16908 @opindex mveclibabi
16909 Specifies the ABI type to use for vectorizing intrinsics using an
16910 external library.  The only type supported at present is @code{mass},
16911 which specifies to use IBM's Mathematical Acceleration Subsystem
16912 (MASS) libraries for vectorizing intrinsics using external libraries.
16913 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
16914 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
16915 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
16916 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
16917 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
16918 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
16919 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
16920 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
16921 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
16922 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
16923 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
16924 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
16925 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
16926 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
16927 for power7.  Both @option{-ftree-vectorize} and
16928 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
16929 libraries will have to be specified at link time.
16930
16931 @item -mfriz
16932 @itemx -mno-friz
16933 @opindex mfriz
16934 Generate (do not generate) the @code{friz} instruction when the
16935 @option{-funsafe-math-optimizations} option is used to optimize
16936 rounding a floating point value to 64-bit integer and back to floating
16937 point.  The @code{friz} instruction does not return the same value if
16938 the floating point number is too large to fit in an integer.
16939
16940 @item -mpointers-to-nested-functions
16941 @itemx -mno-pointers-to-nested-functions
16942 @opindex mpointers-to-nested-functions
16943 Generate (do not generate) code to load up the static chain register
16944 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
16945 systems where a function pointer points to a 3 word descriptor giving
16946 the function address, TOC value to be loaded in register @var{r2}, and
16947 static chain value to be loaded in register @var{r11}.  The
16948 @option{-mpointers-to-nested-functions} is on by default.  You will
16949 not be able to call through pointers to nested functions or pointers
16950 to functions compiled in other languages that use the static chain if
16951 you use the @option{-mno-pointers-to-nested-functions}.
16952
16953 @item -msave-toc-indirect
16954 @itemx -mno-save-toc-indirect
16955 @opindex msave-toc-indirect
16956 Generate (do not generate) code to save the TOC value in the reserved
16957 stack location in the function prologue if the function calls through
16958 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
16959 saved in the prologue, it is saved just before the call through the
16960 pointer.  The @option{-mno-save-toc-indirect} option is the default.
16961 @end table
16962
16963 @node RX Options
16964 @subsection RX Options
16965 @cindex RX Options
16966
16967 These command line options are defined for RX targets:
16968
16969 @table @gcctabopt
16970 @item -m64bit-doubles
16971 @itemx -m32bit-doubles
16972 @opindex m64bit-doubles
16973 @opindex m32bit-doubles
16974 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
16975 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
16976 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
16977 works on 32-bit values, which is why the default is
16978 @option{-m32bit-doubles}.
16979
16980 @item -fpu
16981 @itemx -nofpu
16982 @opindex fpu
16983 @opindex nofpu
16984 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
16985 floating point hardware.  The default is enabled for the @var{RX600}
16986 series and disabled for the @var{RX200} series.
16987
16988 Floating point instructions will only be generated for 32-bit floating
16989 point values however, so if the @option{-m64bit-doubles} option is in
16990 use then the FPU hardware will not be used for doubles.
16991
16992 @emph{Note} If the @option{-fpu} option is enabled then
16993 @option{-funsafe-math-optimizations} is also enabled automatically.
16994 This is because the RX FPU instructions are themselves unsafe.
16995
16996 @item -mcpu=@var{name}
16997 @opindex -mcpu
16998 Selects the type of RX CPU to be targeted.  Currently three types are
16999 supported, the generic @var{RX600} and @var{RX200} series hardware and
17000 the specific @var{RX610} CPU.  The default is @var{RX600}.
17001
17002 The only difference between @var{RX600} and @var{RX610} is that the
17003 @var{RX610} does not support the @code{MVTIPL} instruction.
17004
17005 The @var{RX200} series does not have a hardware floating point unit
17006 and so @option{-nofpu} is enabled by default when this type is
17007 selected.
17008
17009 @item -mbig-endian-data
17010 @itemx -mlittle-endian-data
17011 @opindex mbig-endian-data
17012 @opindex mlittle-endian-data
17013 Store data (but not code) in the big-endian format.  The default is
17014 @option{-mlittle-endian-data}, i.e.@: to store data in the little endian
17015 format.
17016
17017 @item -msmall-data-limit=@var{N}
17018 @opindex msmall-data-limit
17019 Specifies the maximum size in bytes of global and static variables
17020 which can be placed into the small data area.  Using the small data
17021 area can lead to smaller and faster code, but the size of area is
17022 limited and it is up to the programmer to ensure that the area does
17023 not overflow.  Also when the small data area is used one of the RX's
17024 registers (usually @code{r13}) is reserved for use pointing to this
17025 area, so it is no longer available for use by the compiler.  This
17026 could result in slower and/or larger code if variables which once
17027 could have been held in the reserved register are now pushed onto the
17028 stack.
17029
17030 Note, common variables (variables which have not been initialised) and
17031 constants are not placed into the small data area as they are assigned
17032 to other sections in the output executable.
17033
17034 The default value is zero, which disables this feature.  Note, this
17035 feature is not enabled by default with higher optimization levels
17036 (@option{-O2} etc) because of the potentially detrimental effects of
17037 reserving a register.  It is up to the programmer to experiment and
17038 discover whether this feature is of benefit to their program.  See the
17039 description of the @option{-mpid} option for a description of how the
17040 actual register to hold the small data area pointer is chosen.
17041
17042 @item -msim
17043 @itemx -mno-sim
17044 @opindex msim
17045 @opindex mno-sim
17046 Use the simulator runtime.  The default is to use the libgloss board
17047 specific runtime.
17048
17049 @item -mas100-syntax
17050 @itemx -mno-as100-syntax
17051 @opindex mas100-syntax
17052 @opindex mno-as100-syntax
17053 When generating assembler output use a syntax that is compatible with
17054 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
17055 assembler but it has some restrictions so generating it is not the
17056 default option.
17057
17058 @item -mmax-constant-size=@var{N}
17059 @opindex mmax-constant-size
17060 Specifies the maximum size, in bytes, of a constant that can be used as
17061 an operand in a RX instruction.  Although the RX instruction set does
17062 allow constants of up to 4 bytes in length to be used in instructions,
17063 a longer value equates to a longer instruction.  Thus in some
17064 circumstances it can be beneficial to restrict the size of constants
17065 that are used in instructions.  Constants that are too big are instead
17066 placed into a constant pool and referenced via register indirection.
17067
17068 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
17069 or 4 means that constants of any size are allowed.
17070
17071 @item -mrelax
17072 @opindex mrelax
17073 Enable linker relaxation.  Linker relaxation is a process whereby the
17074 linker will attempt to reduce the size of a program by finding shorter
17075 versions of various instructions.  Disabled by default.
17076
17077 @item -mint-register=@var{N}
17078 @opindex mint-register
17079 Specify the number of registers to reserve for fast interrupt handler
17080 functions.  The value @var{N} can be between 0 and 4.  A value of 1
17081 means that register @code{r13} will be reserved for the exclusive use
17082 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
17083 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
17084 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
17085 A value of 0, the default, does not reserve any registers.
17086
17087 @item -msave-acc-in-interrupts
17088 @opindex msave-acc-in-interrupts
17089 Specifies that interrupt handler functions should preserve the
17090 accumulator register.  This is only necessary if normal code might use
17091 the accumulator register, for example because it performs 64-bit
17092 multiplications.  The default is to ignore the accumulator as this
17093 makes the interrupt handlers faster.
17094
17095 @item -mpid
17096 @itemx -mno-pid
17097 @opindex mpid
17098 @opindex mno-pid
17099 Enables the generation of position independent data.  When enabled any
17100 access to constant data will done via an offset from a base address
17101 held in a register.  This allows the location of constant data to be
17102 determined at run-time without requiring the executable to be
17103 relocated, which is a benefit to embedded applications with tight
17104 memory constraints.  Data that can be modified is not affected by this
17105 option.
17106
17107 Note, using this feature reserves a register, usually @code{r13}, for
17108 the constant data base address.  This can result in slower and/or
17109 larger code, especially in complicated functions.
17110
17111 The actual register chosen to hold the constant data base address
17112 depends upon whether the @option{-msmall-data-limit} and/or the
17113 @option{-mint-register} command line options are enabled.  Starting
17114 with register @code{r13} and proceeding downwards, registers are
17115 allocated first to satisfy the requirements of @option{-mint-register},
17116 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
17117 is possible for the small data area register to be @code{r8} if both
17118 @option{-mint-register=4} and @option{-mpid} are specified on the
17119 command line.
17120
17121 By default this feature is not enabled.  The default can be restored
17122 via the @option{-mno-pid} command line option.
17123
17124 @end table
17125
17126 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
17127 has special significance to the RX port when used with the
17128 @code{interrupt} function attribute.  This attribute indicates a
17129 function intended to process fast interrupts.  GCC will will ensure
17130 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
17131 and/or @code{r13} and only provided that the normal use of the
17132 corresponding registers have been restricted via the
17133 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
17134 options.
17135
17136 @node S/390 and zSeries Options
17137 @subsection S/390 and zSeries Options
17138 @cindex S/390 and zSeries Options
17139
17140 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
17141
17142 @table @gcctabopt
17143 @item -mhard-float
17144 @itemx -msoft-float
17145 @opindex mhard-float
17146 @opindex msoft-float
17147 Use (do not use) the hardware floating-point instructions and registers
17148 for floating-point operations.  When @option{-msoft-float} is specified,
17149 functions in @file{libgcc.a} will be used to perform floating-point
17150 operations.  When @option{-mhard-float} is specified, the compiler
17151 generates IEEE floating-point instructions.  This is the default.
17152
17153 @item -mhard-dfp
17154 @itemx -mno-hard-dfp
17155 @opindex mhard-dfp
17156 @opindex mno-hard-dfp
17157 Use (do not use) the hardware decimal-floating-point instructions for
17158 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
17159 specified, functions in @file{libgcc.a} will be used to perform
17160 decimal-floating-point operations.  When @option{-mhard-dfp} is
17161 specified, the compiler generates decimal-floating-point hardware
17162 instructions.  This is the default for @option{-march=z9-ec} or higher.
17163
17164 @item -mlong-double-64
17165 @itemx -mlong-double-128
17166 @opindex mlong-double-64
17167 @opindex mlong-double-128
17168 These switches control the size of @code{long double} type. A size
17169 of 64bit makes the @code{long double} type equivalent to the @code{double}
17170 type. This is the default.
17171
17172 @item -mbackchain
17173 @itemx -mno-backchain
17174 @opindex mbackchain
17175 @opindex mno-backchain
17176 Store (do not store) the address of the caller's frame as backchain pointer
17177 into the callee's stack frame.
17178 A backchain may be needed to allow debugging using tools that do not understand
17179 DWARF-2 call frame information.
17180 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
17181 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
17182 the backchain is placed into the topmost word of the 96/160 byte register
17183 save area.
17184
17185 In general, code compiled with @option{-mbackchain} is call-compatible with
17186 code compiled with @option{-mmo-backchain}; however, use of the backchain
17187 for debugging purposes usually requires that the whole binary is built with
17188 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
17189 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17190 to build a linux kernel use @option{-msoft-float}.
17191
17192 The default is to not maintain the backchain.
17193
17194 @item -mpacked-stack
17195 @itemx -mno-packed-stack
17196 @opindex mpacked-stack
17197 @opindex mno-packed-stack
17198 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
17199 specified, the compiler uses the all fields of the 96/160 byte register save
17200 area only for their default purpose; unused fields still take up stack space.
17201 When @option{-mpacked-stack} is specified, register save slots are densely
17202 packed at the top of the register save area; unused space is reused for other
17203 purposes, allowing for more efficient use of the available stack space.
17204 However, when @option{-mbackchain} is also in effect, the topmost word of
17205 the save area is always used to store the backchain, and the return address
17206 register is always saved two words below the backchain.
17207
17208 As long as the stack frame backchain is not used, code generated with
17209 @option{-mpacked-stack} is call-compatible with code generated with
17210 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
17211 S/390 or zSeries generated code that uses the stack frame backchain at run
17212 time, not just for debugging purposes.  Such code is not call-compatible
17213 with code compiled with @option{-mpacked-stack}.  Also, note that the
17214 combination of @option{-mbackchain},
17215 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17216 to build a linux kernel use @option{-msoft-float}.
17217
17218 The default is to not use the packed stack layout.
17219
17220 @item -msmall-exec
17221 @itemx -mno-small-exec
17222 @opindex msmall-exec
17223 @opindex mno-small-exec
17224 Generate (or do not generate) code using the @code{bras} instruction
17225 to do subroutine calls.
17226 This only works reliably if the total executable size does not
17227 exceed 64k.  The default is to use the @code{basr} instruction instead,
17228 which does not have this limitation.
17229
17230 @item -m64
17231 @itemx -m31
17232 @opindex m64
17233 @opindex m31
17234 When @option{-m31} is specified, generate code compliant to the
17235 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
17236 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
17237 particular to generate 64-bit instructions.  For the @samp{s390}
17238 targets, the default is @option{-m31}, while the @samp{s390x}
17239 targets default to @option{-m64}.
17240
17241 @item -mzarch
17242 @itemx -mesa
17243 @opindex mzarch
17244 @opindex mesa
17245 When @option{-mzarch} is specified, generate code using the
17246 instructions available on z/Architecture.
17247 When @option{-mesa} is specified, generate code using the
17248 instructions available on ESA/390.  Note that @option{-mesa} is
17249 not possible with @option{-m64}.
17250 When generating code compliant to the GNU/Linux for S/390 ABI,
17251 the default is @option{-mesa}.  When generating code compliant
17252 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
17253
17254 @item -mmvcle
17255 @itemx -mno-mvcle
17256 @opindex mmvcle
17257 @opindex mno-mvcle
17258 Generate (or do not generate) code using the @code{mvcle} instruction
17259 to perform block moves.  When @option{-mno-mvcle} is specified,
17260 use a @code{mvc} loop instead.  This is the default unless optimizing for
17261 size.
17262
17263 @item -mdebug
17264 @itemx -mno-debug
17265 @opindex mdebug
17266 @opindex mno-debug
17267 Print (or do not print) additional debug information when compiling.
17268 The default is to not print debug information.
17269
17270 @item -march=@var{cpu-type}
17271 @opindex march
17272 Generate code that will run on @var{cpu-type}, which is the name of a system
17273 representing a certain processor type.  Possible values for
17274 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
17275 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
17276 When generating code using the instructions available on z/Architecture,
17277 the default is @option{-march=z900}.  Otherwise, the default is
17278 @option{-march=g5}.
17279
17280 @item -mtune=@var{cpu-type}
17281 @opindex mtune
17282 Tune to @var{cpu-type} everything applicable about the generated code,
17283 except for the ABI and the set of available instructions.
17284 The list of @var{cpu-type} values is the same as for @option{-march}.
17285 The default is the value used for @option{-march}.
17286
17287 @item -mtpf-trace
17288 @itemx -mno-tpf-trace
17289 @opindex mtpf-trace
17290 @opindex mno-tpf-trace
17291 Generate code that adds (does not add) in TPF OS specific branches to trace
17292 routines in the operating system.  This option is off by default, even
17293 when compiling for the TPF OS@.
17294
17295 @item -mfused-madd
17296 @itemx -mno-fused-madd
17297 @opindex mfused-madd
17298 @opindex mno-fused-madd
17299 Generate code that uses (does not use) the floating point multiply and
17300 accumulate instructions.  These instructions are generated by default if
17301 hardware floating point is used.
17302
17303 @item -mwarn-framesize=@var{framesize}
17304 @opindex mwarn-framesize
17305 Emit a warning if the current function exceeds the given frame size.  Because
17306 this is a compile time check it doesn't need to be a real problem when the program
17307 runs.  It is intended to identify functions which most probably cause
17308 a stack overflow.  It is useful to be used in an environment with limited stack
17309 size e.g.@: the linux kernel.
17310
17311 @item -mwarn-dynamicstack
17312 @opindex mwarn-dynamicstack
17313 Emit a warning if the function calls alloca or uses dynamically
17314 sized arrays.  This is generally a bad idea with a limited stack size.
17315
17316 @item -mstack-guard=@var{stack-guard}
17317 @itemx -mstack-size=@var{stack-size}
17318 @opindex mstack-guard
17319 @opindex mstack-size
17320 If these options are provided the s390 back end emits additional instructions in
17321 the function prologue which trigger a trap if the stack size is @var{stack-guard}
17322 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
17323 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
17324 the frame size of the compiled function is chosen.
17325 These options are intended to be used to help debugging stack overflow problems.
17326 The additionally emitted code causes only little overhead and hence can also be
17327 used in production like systems without greater performance degradation.  The given
17328 values have to be exact powers of 2 and @var{stack-size} has to be greater than
17329 @var{stack-guard} without exceeding 64k.
17330 In order to be efficient the extra code makes the assumption that the stack starts
17331 at an address aligned to the value given by @var{stack-size}.
17332 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
17333 @end table
17334
17335 @node Score Options
17336 @subsection Score Options
17337 @cindex Score Options
17338
17339 These options are defined for Score implementations:
17340
17341 @table @gcctabopt
17342 @item -meb
17343 @opindex meb
17344 Compile code for big endian mode.  This is the default.
17345
17346 @item -mel
17347 @opindex mel
17348 Compile code for little endian mode.
17349
17350 @item -mnhwloop
17351 @opindex mnhwloop
17352 Disable generate bcnz instruction.
17353
17354 @item -muls
17355 @opindex muls
17356 Enable generate unaligned load and store instruction.
17357
17358 @item -mmac
17359 @opindex mmac
17360 Enable the use of multiply-accumulate instructions. Disabled by default.
17361
17362 @item -mscore5
17363 @opindex mscore5
17364 Specify the SCORE5 as the target architecture.
17365
17366 @item -mscore5u
17367 @opindex mscore5u
17368 Specify the SCORE5U of the target architecture.
17369
17370 @item -mscore7
17371 @opindex mscore7
17372 Specify the SCORE7 as the target architecture. This is the default.
17373
17374 @item -mscore7d
17375 @opindex mscore7d
17376 Specify the SCORE7D as the target architecture.
17377 @end table
17378
17379 @node SH Options
17380 @subsection SH Options
17381
17382 These @samp{-m} options are defined for the SH implementations:
17383
17384 @table @gcctabopt
17385 @item -m1
17386 @opindex m1
17387 Generate code for the SH1.
17388
17389 @item -m2
17390 @opindex m2
17391 Generate code for the SH2.
17392
17393 @item -m2e
17394 Generate code for the SH2e.
17395
17396 @item -m2a-nofpu
17397 @opindex m2a-nofpu
17398 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
17399 that the floating-point unit is not used.
17400
17401 @item -m2a-single-only
17402 @opindex m2a-single-only
17403 Generate code for the SH2a-FPU, in such a way that no double-precision
17404 floating point operations are used.
17405
17406 @item -m2a-single
17407 @opindex m2a-single
17408 Generate code for the SH2a-FPU assuming the floating-point unit is in
17409 single-precision mode by default.
17410
17411 @item -m2a
17412 @opindex m2a
17413 Generate code for the SH2a-FPU assuming the floating-point unit is in
17414 double-precision mode by default.
17415
17416 @item -m3
17417 @opindex m3
17418 Generate code for the SH3.
17419
17420 @item -m3e
17421 @opindex m3e
17422 Generate code for the SH3e.
17423
17424 @item -m4-nofpu
17425 @opindex m4-nofpu
17426 Generate code for the SH4 without a floating-point unit.
17427
17428 @item -m4-single-only
17429 @opindex m4-single-only
17430 Generate code for the SH4 with a floating-point unit that only
17431 supports single-precision arithmetic.
17432
17433 @item -m4-single
17434 @opindex m4-single
17435 Generate code for the SH4 assuming the floating-point unit is in
17436 single-precision mode by default.
17437
17438 @item -m4
17439 @opindex m4
17440 Generate code for the SH4.
17441
17442 @item -m4a-nofpu
17443 @opindex m4a-nofpu
17444 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
17445 floating-point unit is not used.
17446
17447 @item -m4a-single-only
17448 @opindex m4a-single-only
17449 Generate code for the SH4a, in such a way that no double-precision
17450 floating point operations are used.
17451
17452 @item -m4a-single
17453 @opindex m4a-single
17454 Generate code for the SH4a assuming the floating-point unit is in
17455 single-precision mode by default.
17456
17457 @item -m4a
17458 @opindex m4a
17459 Generate code for the SH4a.
17460
17461 @item -m4al
17462 @opindex m4al
17463 Same as @option{-m4a-nofpu}, except that it implicitly passes
17464 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
17465 instructions at the moment.
17466
17467 @item -mb
17468 @opindex mb
17469 Compile code for the processor in big endian mode.
17470
17471 @item -ml
17472 @opindex ml
17473 Compile code for the processor in little endian mode.
17474
17475 @item -mdalign
17476 @opindex mdalign
17477 Align doubles at 64-bit boundaries.  Note that this changes the calling
17478 conventions, and thus some functions from the standard C library will
17479 not work unless you recompile it first with @option{-mdalign}.
17480
17481 @item -mrelax
17482 @opindex mrelax
17483 Shorten some address references at link time, when possible; uses the
17484 linker option @option{-relax}.
17485
17486 @item -mbigtable
17487 @opindex mbigtable
17488 Use 32-bit offsets in @code{switch} tables.  The default is to use
17489 16-bit offsets.
17490
17491 @item -mbitops
17492 @opindex mbitops
17493 Enable the use of bit manipulation instructions on SH2A.
17494
17495 @item -mfmovd
17496 @opindex mfmovd
17497 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
17498 alignment constraints.
17499
17500 @item -mhitachi
17501 @opindex mhitachi
17502 Comply with the calling conventions defined by Renesas.
17503
17504 @item -mrenesas
17505 @opindex mhitachi
17506 Comply with the calling conventions defined by Renesas.
17507
17508 @item -mno-renesas
17509 @opindex mhitachi
17510 Comply with the calling conventions defined for GCC before the Renesas
17511 conventions were available.  This option is the default for all
17512 targets of the SH toolchain.
17513
17514 @item -mnomacsave
17515 @opindex mnomacsave
17516 Mark the @code{MAC} register as call-clobbered, even if
17517 @option{-mhitachi} is given.
17518
17519 @item -mieee
17520 @opindex mieee
17521 Increase IEEE-compliance of floating-point code.
17522 At the moment, this is equivalent to @option{-fno-finite-math-only}.
17523 When generating 16 bit SH opcodes, getting IEEE-conforming results for
17524 comparisons of NANs / infinities incurs extra overhead in every
17525 floating point comparison, therefore the default is set to
17526 @option{-ffinite-math-only}.
17527
17528 @item -minline-ic_invalidate
17529 @opindex minline-ic_invalidate
17530 Inline code to invalidate instruction cache entries after setting up
17531 nested function trampolines.
17532 This option has no effect if -musermode is in effect and the selected
17533 code generation option (e.g. -m4) does not allow the use of the icbi
17534 instruction.
17535 If the selected code generation option does not allow the use of the icbi
17536 instruction, and -musermode is not in effect, the inlined code will
17537 manipulate the instruction cache address array directly with an associative
17538 write.  This not only requires privileged mode, but it will also
17539 fail if the cache line had been mapped via the TLB and has become unmapped.
17540
17541 @item -misize
17542 @opindex misize
17543 Dump instruction size and location in the assembly code.
17544
17545 @item -mpadstruct
17546 @opindex mpadstruct
17547 This option is deprecated.  It pads structures to multiple of 4 bytes,
17548 which is incompatible with the SH ABI@.
17549
17550 @item -mspace
17551 @opindex mspace
17552 Optimize for space instead of speed.  Implied by @option{-Os}.
17553
17554 @item -mprefergot
17555 @opindex mprefergot
17556 When generating position-independent code, emit function calls using
17557 the Global Offset Table instead of the Procedure Linkage Table.
17558
17559 @item -musermode
17560 @opindex musermode
17561 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
17562 if the inlined code would not work in user mode.
17563 This is the default when the target is @code{sh-*-linux*}.
17564
17565 @item -multcost=@var{number}
17566 @opindex multcost=@var{number}
17567 Set the cost to assume for a multiply insn.
17568
17569 @item -mdiv=@var{strategy}
17570 @opindex mdiv=@var{strategy}
17571 Set the division strategy to use for SHmedia code.  @var{strategy} must be
17572 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
17573 inv:call2, inv:fp .
17574 "fp" performs the operation in floating point.  This has a very high latency,
17575 but needs only a few instructions, so it might be a good choice if
17576 your code has enough easily exploitable ILP to allow the compiler to
17577 schedule the floating point instructions together with other instructions.
17578 Division by zero causes a floating point exception.
17579 "inv" uses integer operations to calculate the inverse of the divisor,
17580 and then multiplies the dividend with the inverse.  This strategy allows
17581 cse and hoisting of the inverse calculation.  Division by zero calculates
17582 an unspecified result, but does not trap.
17583 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
17584 have been found, or if the entire operation has been hoisted to the same
17585 place, the last stages of the inverse calculation are intertwined with the
17586 final multiply to reduce the overall latency, at the expense of using a few
17587 more instructions, and thus offering fewer scheduling opportunities with
17588 other code.
17589 "call" calls a library function that usually implements the inv:minlat
17590 strategy.
17591 This gives high code density for m5-*media-nofpu compilations.
17592 "call2" uses a different entry point of the same library function, where it
17593 assumes that a pointer to a lookup table has already been set up, which
17594 exposes the pointer load to cse / code hoisting optimizations.
17595 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
17596 code generation, but if the code stays unoptimized, revert to the "call",
17597 "call2", or "fp" strategies, respectively.  Note that the
17598 potentially-trapping side effect of division by zero is carried by a
17599 separate instruction, so it is possible that all the integer instructions
17600 are hoisted out, but the marker for the side effect stays where it is.
17601 A recombination to fp operations or a call is not possible in that case.
17602 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
17603 that the inverse calculation was nor separated from the multiply, they speed
17604 up division where the dividend fits into 20 bits (plus sign where applicable),
17605 by inserting a test to skip a number of operations in this case; this test
17606 slows down the case of larger dividends.  inv20u assumes the case of a such
17607 a small dividend to be unlikely, and inv20l assumes it to be likely.
17608
17609 @item -maccumulate-outgoing-args
17610 @opindex maccumulate-outgoing-args
17611 Reserve space once for outgoing arguments in the function prologue rather
17612 than around each call.  Generally beneficial for performance and size.  Also
17613 needed for unwinding to avoid changing the stack frame around conditional code.
17614
17615 @item -mdivsi3_libfunc=@var{name}
17616 @opindex mdivsi3_libfunc=@var{name}
17617 Set the name of the library function used for 32 bit signed division to
17618 @var{name}.  This only affect the name used in the call and inv:call
17619 division strategies, and the compiler will still expect the same
17620 sets of input/output/clobbered registers as if this option was not present.
17621
17622 @item -mfixed-range=@var{register-range}
17623 @opindex mfixed-range
17624 Generate code treating the given register range as fixed registers.
17625 A fixed register is one that the register allocator can not use.  This is
17626 useful when compiling kernel code.  A register range is specified as
17627 two registers separated by a dash.  Multiple register ranges can be
17628 specified separated by a comma.
17629
17630 @item -madjust-unroll
17631 @opindex madjust-unroll
17632 Throttle unrolling to avoid thrashing target registers.
17633 This option only has an effect if the gcc code base supports the
17634 TARGET_ADJUST_UNROLL_MAX target hook.
17635
17636 @item -mindexed-addressing
17637 @opindex mindexed-addressing
17638 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
17639 This is only safe if the hardware and/or OS implement 32 bit wrap-around
17640 semantics for the indexed addressing mode.  The architecture allows the
17641 implementation of processors with 64 bit MMU, which the OS could use to
17642 get 32 bit addressing, but since no current hardware implementation supports
17643 this or any other way to make the indexed addressing mode safe to use in
17644 the 32 bit ABI, the default is -mno-indexed-addressing.
17645
17646 @item -mgettrcost=@var{number}
17647 @opindex mgettrcost=@var{number}
17648 Set the cost assumed for the gettr instruction to @var{number}.
17649 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
17650
17651 @item -mpt-fixed
17652 @opindex mpt-fixed
17653 Assume pt* instructions won't trap.  This will generally generate better
17654 scheduled code, but is unsafe on current hardware.  The current architecture
17655 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
17656 This has the unintentional effect of making it unsafe to schedule ptabs /
17657 ptrel before a branch, or hoist it out of a loop.  For example,
17658 __do_global_ctors, a part of libgcc that runs constructors at program
17659 startup, calls functions in a list which is delimited by @minus{}1.  With the
17660 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
17661 That means that all the constructors will be run a bit quicker, but when
17662 the loop comes to the end of the list, the program crashes because ptabs
17663 loads @minus{}1 into a target register.  Since this option is unsafe for any
17664 hardware implementing the current architecture specification, the default
17665 is -mno-pt-fixed.  Unless the user specifies a specific cost with
17666 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
17667 this deters register allocation using target registers for storing
17668 ordinary integers.
17669
17670 @item -minvalid-symbols
17671 @opindex minvalid-symbols
17672 Assume symbols might be invalid.  Ordinary function symbols generated by
17673 the compiler will always be valid to load with movi/shori/ptabs or
17674 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
17675 to generate symbols that will cause ptabs / ptrel to trap.
17676 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
17677 It will then prevent cross-basic-block cse, hoisting and most scheduling
17678 of symbol loads.  The default is @option{-mno-invalid-symbols}.
17679 @end table
17680
17681 @node Solaris 2 Options
17682 @subsection Solaris 2 Options
17683 @cindex Solaris 2 options
17684
17685 These @samp{-m} options are supported on Solaris 2:
17686
17687 @table @gcctabopt
17688 @item -mimpure-text
17689 @opindex mimpure-text
17690 @option{-mimpure-text}, used in addition to @option{-shared}, tells
17691 the compiler to not pass @option{-z text} to the linker when linking a
17692 shared object.  Using this option, you can link position-dependent
17693 code into a shared object.
17694
17695 @option{-mimpure-text} suppresses the ``relocations remain against
17696 allocatable but non-writable sections'' linker error message.
17697 However, the necessary relocations will trigger copy-on-write, and the
17698 shared object is not actually shared across processes.  Instead of
17699 using @option{-mimpure-text}, you should compile all source code with
17700 @option{-fpic} or @option{-fPIC}.
17701
17702 @end table
17703
17704 These switches are supported in addition to the above on Solaris 2:
17705
17706 @table @gcctabopt
17707 @item -pthreads
17708 @opindex pthreads
17709 Add support for multithreading using the POSIX threads library.  This
17710 option sets flags for both the preprocessor and linker.  This option does
17711 not affect the thread safety of object code produced  by the compiler or
17712 that of libraries supplied with it.
17713
17714 @item -pthread
17715 @opindex pthread
17716 This is a synonym for @option{-pthreads}.
17717 @end table
17718
17719 @node SPARC Options
17720 @subsection SPARC Options
17721 @cindex SPARC options
17722
17723 These @samp{-m} options are supported on the SPARC:
17724
17725 @table @gcctabopt
17726 @item -mno-app-regs
17727 @itemx -mapp-regs
17728 @opindex mno-app-regs
17729 @opindex mapp-regs
17730 Specify @option{-mapp-regs} to generate output using the global registers
17731 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
17732 is the default.
17733
17734 To be fully SVR4 ABI compliant at the cost of some performance loss,
17735 specify @option{-mno-app-regs}.  You should compile libraries and system
17736 software with this option.
17737
17738 @item -mflat
17739 @itemx -mno-flat
17740 @opindex mflat
17741 @opindex mno-flat
17742 With @option{-mflat}, the compiler does not generate save/restore instructions
17743 and uses a ``flat'' or single register window model.  This model is compatible
17744 with the regular register window model.  The local registers and the input
17745 registers (0--5) are still treated as ``call-saved'' registers and will be
17746 saved on the stack as needed.
17747
17748 With @option{-mno-flat} (the default), the compiler generates save/restore
17749 instructions (except for leaf functions).  This is the normal operating mode.
17750
17751 @item -mfpu
17752 @itemx -mhard-float
17753 @opindex mfpu
17754 @opindex mhard-float
17755 Generate output containing floating point instructions.  This is the
17756 default.
17757
17758 @item -mno-fpu
17759 @itemx -msoft-float
17760 @opindex mno-fpu
17761 @opindex msoft-float
17762 Generate output containing library calls for floating point.
17763 @strong{Warning:} the requisite libraries are not available for all SPARC
17764 targets.  Normally the facilities of the machine's usual C compiler are
17765 used, but this cannot be done directly in cross-compilation.  You must make
17766 your own arrangements to provide suitable library functions for
17767 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
17768 @samp{sparclite-*-*} do provide software floating point support.
17769
17770 @option{-msoft-float} changes the calling convention in the output file;
17771 therefore, it is only useful if you compile @emph{all} of a program with
17772 this option.  In particular, you need to compile @file{libgcc.a}, the
17773 library that comes with GCC, with @option{-msoft-float} in order for
17774 this to work.
17775
17776 @item -mhard-quad-float
17777 @opindex mhard-quad-float
17778 Generate output containing quad-word (long double) floating point
17779 instructions.
17780
17781 @item -msoft-quad-float
17782 @opindex msoft-quad-float
17783 Generate output containing library calls for quad-word (long double)
17784 floating point instructions.  The functions called are those specified
17785 in the SPARC ABI@.  This is the default.
17786
17787 As of this writing, there are no SPARC implementations that have hardware
17788 support for the quad-word floating point instructions.  They all invoke
17789 a trap handler for one of these instructions, and then the trap handler
17790 emulates the effect of the instruction.  Because of the trap handler overhead,
17791 this is much slower than calling the ABI library routines.  Thus the
17792 @option{-msoft-quad-float} option is the default.
17793
17794 @item -mno-unaligned-doubles
17795 @itemx -munaligned-doubles
17796 @opindex mno-unaligned-doubles
17797 @opindex munaligned-doubles
17798 Assume that doubles have 8 byte alignment.  This is the default.
17799
17800 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
17801 alignment only if they are contained in another type, or if they have an
17802 absolute address.  Otherwise, it assumes they have 4 byte alignment.
17803 Specifying this option avoids some rare compatibility problems with code
17804 generated by other compilers.  It is not the default because it results
17805 in a performance loss, especially for floating point code.
17806
17807 @item -mno-faster-structs
17808 @itemx -mfaster-structs
17809 @opindex mno-faster-structs
17810 @opindex mfaster-structs
17811 With @option{-mfaster-structs}, the compiler assumes that structures
17812 should have 8 byte alignment.  This enables the use of pairs of
17813 @code{ldd} and @code{std} instructions for copies in structure
17814 assignment, in place of twice as many @code{ld} and @code{st} pairs.
17815 However, the use of this changed alignment directly violates the SPARC
17816 ABI@.  Thus, it's intended only for use on targets where the developer
17817 acknowledges that their resulting code will not be directly in line with
17818 the rules of the ABI@.
17819
17820 @item -mcpu=@var{cpu_type}
17821 @opindex mcpu
17822 Set the instruction set, register set, and instruction scheduling parameters
17823 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
17824 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
17825 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
17826 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
17827 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
17828 and @samp{niagara4}.
17829
17830 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
17831 which selects the best architecture option for the host processor.
17832 @option{-mcpu=native} has no effect if GCC does not recognize
17833 the processor.
17834
17835 Default instruction scheduling parameters are used for values that select
17836 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
17837 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
17838
17839 Here is a list of each supported architecture and their supported
17840 implementations.
17841
17842 @table @asis
17843 @item v7
17844 cypress
17845
17846 @item v8
17847 supersparc, hypersparc, leon
17848
17849 @item sparclite
17850 f930, f934, sparclite86x
17851
17852 @item sparclet
17853 tsc701
17854
17855 @item v9
17856 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
17857 @end table
17858
17859 By default (unless configured otherwise), GCC generates code for the V7
17860 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
17861 additionally optimizes it for the Cypress CY7C602 chip, as used in the
17862 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
17863 SPARCStation 1, 2, IPX etc.
17864
17865 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
17866 architecture.  The only difference from V7 code is that the compiler emits
17867 the integer multiply and integer divide instructions which exist in SPARC-V8
17868 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
17869 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
17870 2000 series.
17871
17872 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
17873 the SPARC architecture.  This adds the integer multiply, integer divide step
17874 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
17875 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
17876 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
17877 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
17878 MB86934 chip, which is the more recent SPARClite with FPU@.
17879
17880 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
17881 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
17882 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
17883 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
17884 optimizes it for the TEMIC SPARClet chip.
17885
17886 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
17887 architecture.  This adds 64-bit integer and floating-point move instructions,
17888 3 additional floating-point condition code registers and conditional move
17889 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
17890 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
17891 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
17892 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
17893 @option{-mcpu=niagara}, the compiler additionally optimizes it for
17894 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
17895 additionally optimizes it for Sun UltraSPARC T2 chips. With
17896 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
17897 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
17898 additionally optimizes it for Sun UltraSPARC T4 chips.
17899
17900 @item -mtune=@var{cpu_type}
17901 @opindex mtune
17902 Set the instruction scheduling parameters for machine type
17903 @var{cpu_type}, but do not set the instruction set or register set that the
17904 option @option{-mcpu=@var{cpu_type}} would.
17905
17906 The same values for @option{-mcpu=@var{cpu_type}} can be used for
17907 @option{-mtune=@var{cpu_type}}, but the only useful values are those
17908 that select a particular CPU implementation.  Those are @samp{cypress},
17909 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
17910 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
17911 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
17912 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
17913
17914 @item -mv8plus
17915 @itemx -mno-v8plus
17916 @opindex mv8plus
17917 @opindex mno-v8plus
17918 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
17919 difference from the V8 ABI is that the global and out registers are
17920 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
17921 mode for all SPARC-V9 processors.
17922
17923 @item -mvis
17924 @itemx -mno-vis
17925 @opindex mvis
17926 @opindex mno-vis
17927 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
17928 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
17929
17930 @item -mvis2
17931 @itemx -mno-vis2
17932 @opindex mvis2
17933 @opindex mno-vis2
17934 With @option{-mvis2}, GCC generates code that takes advantage of
17935 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
17936 default is @option{-mvis2} when targetting a cpu that supports such
17937 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
17938 also sets @option{-mvis}.
17939
17940 @item -mvis3
17941 @itemx -mno-vis3
17942 @opindex mvis3
17943 @opindex mno-vis3
17944 With @option{-mvis3}, GCC generates code that takes advantage of
17945 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
17946 default is @option{-mvis3} when targetting a cpu that supports such
17947 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
17948 also sets @option{-mvis2} and @option{-mvis}.
17949
17950 @item -mpopc
17951 @itemx -mno-popc
17952 @opindex mpopc
17953 @opindex mno-popc
17954 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
17955 population count instruction.  The default is @option{-mpopc}
17956 when targetting a cpu that supports such instructions, such as Niagara-2 and
17957 later.
17958
17959 @item -mfmaf
17960 @itemx -mno-fmaf
17961 @opindex mfmaf
17962 @opindex mno-fmaf
17963 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
17964 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
17965 when targetting a cpu that supports such instructions, such as Niagara-3 and
17966 later.
17967
17968 @item -mfix-at697f
17969 @opindex mfix-at697f
17970 Enable the documented workaround for the single erratum of the Atmel AT697F
17971 processor (which corresponds to erratum #13 of the AT697E processor).
17972 @end table
17973
17974 These @samp{-m} options are supported in addition to the above
17975 on SPARC-V9 processors in 64-bit environments:
17976
17977 @table @gcctabopt
17978 @item -mlittle-endian
17979 @opindex mlittle-endian
17980 Generate code for a processor running in little-endian mode.  It is only
17981 available for a few configurations and most notably not on Solaris and Linux.
17982
17983 @item -m32
17984 @itemx -m64
17985 @opindex m32
17986 @opindex m64
17987 Generate code for a 32-bit or 64-bit environment.
17988 The 32-bit environment sets int, long and pointer to 32 bits.
17989 The 64-bit environment sets int to 32 bits and long and pointer
17990 to 64 bits.
17991
17992 @item -mcmodel=@var{which}
17993 @opindex mcmodel
17994 Set the code model to one of
17995
17996 @table @samp
17997 @item medlow
17998 The Medium/Low code model: 64-bit addresses, programs
17999 must be linked in the low 32 bits of memory.  Programs can be statically
18000 or dynamically linked.
18001
18002 @item medmid
18003 The Medium/Middle code model: 64-bit addresses, programs
18004 must be linked in the low 44 bits of memory, the text and data segments must
18005 be less than 2GB in size and the data segment must be located within 2GB of
18006 the text segment.
18007
18008 @item medany
18009 The Medium/Anywhere code model: 64-bit addresses, programs
18010 may be linked anywhere in memory, the text and data segments must be less
18011 than 2GB in size and the data segment must be located within 2GB of the
18012 text segment.
18013
18014 @item embmedany
18015 The Medium/Anywhere code model for embedded systems:
18016 64-bit addresses, the text and data segments must be less than 2GB in
18017 size, both starting anywhere in memory (determined at link time).  The
18018 global register %g4 points to the base of the data segment.  Programs
18019 are statically linked and PIC is not supported.
18020 @end table
18021
18022 @item -mmemory-model=@var{mem-model}
18023 @opindex mmemory-model
18024 Set the memory model in force on the processor to one of
18025
18026 @table @samp
18027 @item default
18028 The default memory model for the processor and operating system.
18029
18030 @item rmo
18031 Relaxed Memory Order
18032
18033 @item pso
18034 Partial Store Order
18035
18036 @item tso
18037 Total Store Order
18038
18039 @item sc
18040 Sequential Consistency
18041 @end table
18042
18043 These memory models are formally defined in Appendix D of the Sparc V9
18044 architecture manual, as set in the processor's @code{PSTATE.MM} field.
18045
18046 @item -mstack-bias
18047 @itemx -mno-stack-bias
18048 @opindex mstack-bias
18049 @opindex mno-stack-bias
18050 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
18051 frame pointer if present, are offset by @minus{}2047 which must be added back
18052 when making stack frame references.  This is the default in 64-bit mode.
18053 Otherwise, assume no such offset is present.
18054 @end table
18055
18056 @node SPU Options
18057 @subsection SPU Options
18058 @cindex SPU options
18059
18060 These @samp{-m} options are supported on the SPU:
18061
18062 @table @gcctabopt
18063 @item -mwarn-reloc
18064 @itemx -merror-reloc
18065 @opindex mwarn-reloc
18066 @opindex merror-reloc
18067
18068 The loader for SPU does not handle dynamic relocations.  By default, GCC
18069 will give an error when it generates code that requires a dynamic
18070 relocation.  @option{-mno-error-reloc} disables the error,
18071 @option{-mwarn-reloc} will generate a warning instead.
18072
18073 @item -msafe-dma
18074 @itemx -munsafe-dma
18075 @opindex msafe-dma
18076 @opindex munsafe-dma
18077
18078 Instructions which initiate or test completion of DMA must not be
18079 reordered with respect to loads and stores of the memory which is being
18080 accessed.  Users typically address this problem using the volatile
18081 keyword, but that can lead to inefficient code in places where the
18082 memory is known to not change.  Rather than mark the memory as volatile
18083 we treat the DMA instructions as potentially effecting all memory.  With
18084 @option{-munsafe-dma} users must use the volatile keyword to protect
18085 memory accesses.
18086
18087 @item -mbranch-hints
18088 @opindex mbranch-hints
18089
18090 By default, GCC will generate a branch hint instruction to avoid
18091 pipeline stalls for always taken or probably taken branches.  A hint
18092 will not be generated closer than 8 instructions away from its branch.
18093 There is little reason to disable them, except for debugging purposes,
18094 or to make an object a little bit smaller.
18095
18096 @item -msmall-mem
18097 @itemx -mlarge-mem
18098 @opindex msmall-mem
18099 @opindex mlarge-mem
18100
18101 By default, GCC generates code assuming that addresses are never larger
18102 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
18103 a full 32 bit address.
18104
18105 @item -mstdmain
18106 @opindex mstdmain
18107
18108 By default, GCC links against startup code that assumes the SPU-style
18109 main function interface (which has an unconventional parameter list).
18110 With @option{-mstdmain}, GCC will link your program against startup
18111 code that assumes a C99-style interface to @code{main}, including a
18112 local copy of @code{argv} strings.
18113
18114 @item -mfixed-range=@var{register-range}
18115 @opindex mfixed-range
18116 Generate code treating the given register range as fixed registers.
18117 A fixed register is one that the register allocator can not use.  This is
18118 useful when compiling kernel code.  A register range is specified as
18119 two registers separated by a dash.  Multiple register ranges can be
18120 specified separated by a comma.
18121
18122 @item -mea32
18123 @itemx -mea64
18124 @opindex mea32
18125 @opindex mea64
18126 Compile code assuming that pointers to the PPU address space accessed
18127 via the @code{__ea} named address space qualifier are either 32 or 64
18128 bits wide.  The default is 32 bits.  As this is an ABI changing option,
18129 all object code in an executable must be compiled with the same setting.
18130
18131 @item -maddress-space-conversion
18132 @itemx -mno-address-space-conversion
18133 @opindex maddress-space-conversion
18134 @opindex mno-address-space-conversion
18135 Allow/disallow treating the @code{__ea} address space as superset
18136 of the generic address space.  This enables explicit type casts
18137 between @code{__ea} and generic pointer as well as implicit
18138 conversions of generic pointers to @code{__ea} pointers.  The
18139 default is to allow address space pointer conversions.
18140
18141 @item -mcache-size=@var{cache-size}
18142 @opindex mcache-size
18143 This option controls the version of libgcc that the compiler links to an
18144 executable and selects a software-managed cache for accessing variables
18145 in the @code{__ea} address space with a particular cache size.  Possible
18146 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
18147 and @samp{128}.  The default cache size is 64KB.
18148
18149 @item -matomic-updates
18150 @itemx -mno-atomic-updates
18151 @opindex matomic-updates
18152 @opindex mno-atomic-updates
18153 This option controls the version of libgcc that the compiler links to an
18154 executable and selects whether atomic updates to the software-managed
18155 cache of PPU-side variables are used.  If you use atomic updates, changes
18156 to a PPU variable from SPU code using the @code{__ea} named address space
18157 qualifier will not interfere with changes to other PPU variables residing
18158 in the same cache line from PPU code.  If you do not use atomic updates,
18159 such interference may occur; however, writing back cache lines will be
18160 more efficient.  The default behavior is to use atomic updates.
18161
18162 @item -mdual-nops
18163 @itemx -mdual-nops=@var{n}
18164 @opindex mdual-nops
18165 By default, GCC will insert nops to increase dual issue when it expects
18166 it to increase performance.  @var{n} can be a value from 0 to 10.  A
18167 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
18168 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
18169
18170 @item -mhint-max-nops=@var{n}
18171 @opindex mhint-max-nops
18172 Maximum number of nops to insert for a branch hint.  A branch hint must
18173 be at least 8 instructions away from the branch it is effecting.  GCC
18174 will insert up to @var{n} nops to enforce this, otherwise it will not
18175 generate the branch hint.
18176
18177 @item -mhint-max-distance=@var{n}
18178 @opindex mhint-max-distance
18179 The encoding of the branch hint instruction limits the hint to be within
18180 256 instructions of the branch it is effecting.  By default, GCC makes
18181 sure it is within 125.
18182
18183 @item -msafe-hints
18184 @opindex msafe-hints
18185 Work around a hardware bug which causes the SPU to stall indefinitely.
18186 By default, GCC will insert the @code{hbrp} instruction to make sure
18187 this stall won't happen.
18188
18189 @end table
18190
18191 @node System V Options
18192 @subsection Options for System V
18193
18194 These additional options are available on System V Release 4 for
18195 compatibility with other compilers on those systems:
18196
18197 @table @gcctabopt
18198 @item -G
18199 @opindex G
18200 Create a shared object.
18201 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
18202
18203 @item -Qy
18204 @opindex Qy
18205 Identify the versions of each tool used by the compiler, in a
18206 @code{.ident} assembler directive in the output.
18207
18208 @item -Qn
18209 @opindex Qn
18210 Refrain from adding @code{.ident} directives to the output file (this is
18211 the default).
18212
18213 @item -YP,@var{dirs}
18214 @opindex YP
18215 Search the directories @var{dirs}, and no others, for libraries
18216 specified with @option{-l}.
18217
18218 @item -Ym,@var{dir}
18219 @opindex Ym
18220 Look in the directory @var{dir} to find the M4 preprocessor.
18221 The assembler uses this option.
18222 @c This is supposed to go with a -Yd for predefined M4 macro files, but
18223 @c the generic assembler that comes with Solaris takes just -Ym.
18224 @end table
18225
18226 @node V850 Options
18227 @subsection V850 Options
18228 @cindex V850 Options
18229
18230 These @samp{-m} options are defined for V850 implementations:
18231
18232 @table @gcctabopt
18233 @item -mlong-calls
18234 @itemx -mno-long-calls
18235 @opindex mlong-calls
18236 @opindex mno-long-calls
18237 Treat all calls as being far away (near).  If calls are assumed to be
18238 far away, the compiler will always load the functions address up into a
18239 register, and call indirect through the pointer.
18240
18241 @item -mno-ep
18242 @itemx -mep
18243 @opindex mno-ep
18244 @opindex mep
18245 Do not optimize (do optimize) basic blocks that use the same index
18246 pointer 4 or more times to copy pointer into the @code{ep} register, and
18247 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
18248 option is on by default if you optimize.
18249
18250 @item -mno-prolog-function
18251 @itemx -mprolog-function
18252 @opindex mno-prolog-function
18253 @opindex mprolog-function
18254 Do not use (do use) external functions to save and restore registers
18255 at the prologue and epilogue of a function.  The external functions
18256 are slower, but use less code space if more than one function saves
18257 the same number of registers.  The @option{-mprolog-function} option
18258 is on by default if you optimize.
18259
18260 @item -mspace
18261 @opindex mspace
18262 Try to make the code as small as possible.  At present, this just turns
18263 on the @option{-mep} and @option{-mprolog-function} options.
18264
18265 @item -mtda=@var{n}
18266 @opindex mtda
18267 Put static or global variables whose size is @var{n} bytes or less into
18268 the tiny data area that register @code{ep} points to.  The tiny data
18269 area can hold up to 256 bytes in total (128 bytes for byte references).
18270
18271 @item -msda=@var{n}
18272 @opindex msda
18273 Put static or global variables whose size is @var{n} bytes or less into
18274 the small data area that register @code{gp} points to.  The small data
18275 area can hold up to 64 kilobytes.
18276
18277 @item -mzda=@var{n}
18278 @opindex mzda
18279 Put static or global variables whose size is @var{n} bytes or less into
18280 the first 32 kilobytes of memory.
18281
18282 @item -mv850
18283 @opindex mv850
18284 Specify that the target processor is the V850.
18285
18286 @item -mbig-switch
18287 @opindex mbig-switch
18288 Generate code suitable for big switch tables.  Use this option only if
18289 the assembler/linker complain about out of range branches within a switch
18290 table.
18291
18292 @item -mapp-regs
18293 @opindex mapp-regs
18294 This option will cause r2 and r5 to be used in the code generated by
18295 the compiler.  This setting is the default.
18296
18297 @item -mno-app-regs
18298 @opindex mno-app-regs
18299 This option will cause r2 and r5 to be treated as fixed registers.
18300
18301 @item -mv850e2v3
18302 @opindex mv850e2v3
18303 Specify that the target processor is the V850E2V3.  The preprocessor
18304 constants @samp{__v850e2v3__} will be defined if
18305 this option is used.
18306
18307 @item -mv850e2
18308 @opindex mv850e2
18309 Specify that the target processor is the V850E2.  The preprocessor
18310 constants @samp{__v850e2__} will be defined if this option is used.
18311
18312 @item -mv850e1
18313 @opindex mv850e1
18314 Specify that the target processor is the V850E1.  The preprocessor
18315 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
18316 this option is used.
18317
18318 @item -mv850es
18319 @opindex mv850es
18320 Specify that the target processor is the V850ES.  This is an alias for
18321 the @option{-mv850e1} option.
18322
18323 @item -mv850e
18324 @opindex mv850e
18325 Specify that the target processor is the V850E@.  The preprocessor
18326 constant @samp{__v850e__} will be defined if this option is used.
18327
18328 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
18329 nor @option{-mv850e2} nor @option{-mv850e2v3}
18330 are defined then a default target processor will be chosen and the
18331 relevant @samp{__v850*__} preprocessor constant will be defined.
18332
18333 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
18334 defined, regardless of which processor variant is the target.
18335
18336 @item -mdisable-callt
18337 @opindex mdisable-callt
18338 This option will suppress generation of the CALLT instruction for the
18339 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
18340 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
18341
18342 @end table
18343
18344 @node VAX Options
18345 @subsection VAX Options
18346 @cindex VAX options
18347
18348 These @samp{-m} options are defined for the VAX:
18349
18350 @table @gcctabopt
18351 @item -munix
18352 @opindex munix
18353 Do not output certain jump instructions (@code{aobleq} and so on)
18354 that the Unix assembler for the VAX cannot handle across long
18355 ranges.
18356
18357 @item -mgnu
18358 @opindex mgnu
18359 Do output those jump instructions, on the assumption that you
18360 will assemble with the GNU assembler.
18361
18362 @item -mg
18363 @opindex mg
18364 Output code for g-format floating point numbers instead of d-format.
18365 @end table
18366
18367 @node VxWorks Options
18368 @subsection VxWorks Options
18369 @cindex VxWorks Options
18370
18371 The options in this section are defined for all VxWorks targets.
18372 Options specific to the target hardware are listed with the other
18373 options for that target.
18374
18375 @table @gcctabopt
18376 @item -mrtp
18377 @opindex mrtp
18378 GCC can generate code for both VxWorks kernels and real time processes
18379 (RTPs).  This option switches from the former to the latter.  It also
18380 defines the preprocessor macro @code{__RTP__}.
18381
18382 @item -non-static
18383 @opindex non-static
18384 Link an RTP executable against shared libraries rather than static
18385 libraries.  The options @option{-static} and @option{-shared} can
18386 also be used for RTPs (@pxref{Link Options}); @option{-static}
18387 is the default.
18388
18389 @item -Bstatic
18390 @itemx -Bdynamic
18391 @opindex Bstatic
18392 @opindex Bdynamic
18393 These options are passed down to the linker.  They are defined for
18394 compatibility with Diab.
18395
18396 @item -Xbind-lazy
18397 @opindex Xbind-lazy
18398 Enable lazy binding of function calls.  This option is equivalent to
18399 @option{-Wl,-z,now} and is defined for compatibility with Diab.
18400
18401 @item -Xbind-now
18402 @opindex Xbind-now
18403 Disable lazy binding of function calls.  This option is the default and
18404 is defined for compatibility with Diab.
18405 @end table
18406
18407 @node x86-64 Options
18408 @subsection x86-64 Options
18409 @cindex x86-64 options
18410
18411 These are listed under @xref{i386 and x86-64 Options}.
18412
18413 @node Xstormy16 Options
18414 @subsection Xstormy16 Options
18415 @cindex Xstormy16 Options
18416
18417 These options are defined for Xstormy16:
18418
18419 @table @gcctabopt
18420 @item -msim
18421 @opindex msim
18422 Choose startup files and linker script suitable for the simulator.
18423 @end table
18424
18425 @node Xtensa Options
18426 @subsection Xtensa Options
18427 @cindex Xtensa Options
18428
18429 These options are supported for Xtensa targets:
18430
18431 @table @gcctabopt
18432 @item -mconst16
18433 @itemx -mno-const16
18434 @opindex mconst16
18435 @opindex mno-const16
18436 Enable or disable use of @code{CONST16} instructions for loading
18437 constant values.  The @code{CONST16} instruction is currently not a
18438 standard option from Tensilica.  When enabled, @code{CONST16}
18439 instructions are always used in place of the standard @code{L32R}
18440 instructions.  The use of @code{CONST16} is enabled by default only if
18441 the @code{L32R} instruction is not available.
18442
18443 @item -mfused-madd
18444 @itemx -mno-fused-madd
18445 @opindex mfused-madd
18446 @opindex mno-fused-madd
18447 Enable or disable use of fused multiply/add and multiply/subtract
18448 instructions in the floating-point option.  This has no effect if the
18449 floating-point option is not also enabled.  Disabling fused multiply/add
18450 and multiply/subtract instructions forces the compiler to use separate
18451 instructions for the multiply and add/subtract operations.  This may be
18452 desirable in some cases where strict IEEE 754-compliant results are
18453 required: the fused multiply add/subtract instructions do not round the
18454 intermediate result, thereby producing results with @emph{more} bits of
18455 precision than specified by the IEEE standard.  Disabling fused multiply
18456 add/subtract instructions also ensures that the program output is not
18457 sensitive to the compiler's ability to combine multiply and add/subtract
18458 operations.
18459
18460 @item -mserialize-volatile
18461 @itemx -mno-serialize-volatile
18462 @opindex mserialize-volatile
18463 @opindex mno-serialize-volatile
18464 When this option is enabled, GCC inserts @code{MEMW} instructions before
18465 @code{volatile} memory references to guarantee sequential consistency.
18466 The default is @option{-mserialize-volatile}.  Use
18467 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
18468
18469 @item -mforce-no-pic
18470 @opindex mforce-no-pic
18471 For targets, like GNU/Linux, where all user-mode Xtensa code must be
18472 position-independent code (PIC), this option disables PIC for compiling
18473 kernel code.
18474
18475 @item -mtext-section-literals
18476 @itemx -mno-text-section-literals
18477 @opindex mtext-section-literals
18478 @opindex mno-text-section-literals
18479 Control the treatment of literal pools.  The default is
18480 @option{-mno-text-section-literals}, which places literals in a separate
18481 section in the output file.  This allows the literal pool to be placed
18482 in a data RAM/ROM, and it also allows the linker to combine literal
18483 pools from separate object files to remove redundant literals and
18484 improve code size.  With @option{-mtext-section-literals}, the literals
18485 are interspersed in the text section in order to keep them as close as
18486 possible to their references.  This may be necessary for large assembly
18487 files.
18488
18489 @item -mtarget-align
18490 @itemx -mno-target-align
18491 @opindex mtarget-align
18492 @opindex mno-target-align
18493 When this option is enabled, GCC instructs the assembler to
18494 automatically align instructions to reduce branch penalties at the
18495 expense of some code density.  The assembler attempts to widen density
18496 instructions to align branch targets and the instructions following call
18497 instructions.  If there are not enough preceding safe density
18498 instructions to align a target, no widening will be performed.  The
18499 default is @option{-mtarget-align}.  These options do not affect the
18500 treatment of auto-aligned instructions like @code{LOOP}, which the
18501 assembler will always align, either by widening density instructions or
18502 by inserting no-op instructions.
18503
18504 @item -mlongcalls
18505 @itemx -mno-longcalls
18506 @opindex mlongcalls
18507 @opindex mno-longcalls
18508 When this option is enabled, GCC instructs the assembler to translate
18509 direct calls to indirect calls unless it can determine that the target
18510 of a direct call is in the range allowed by the call instruction.  This
18511 translation typically occurs for calls to functions in other source
18512 files.  Specifically, the assembler translates a direct @code{CALL}
18513 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
18514 The default is @option{-mno-longcalls}.  This option should be used in
18515 programs where the call target can potentially be out of range.  This
18516 option is implemented in the assembler, not the compiler, so the
18517 assembly code generated by GCC will still show direct call
18518 instructions---look at the disassembled object code to see the actual
18519 instructions.  Note that the assembler will use an indirect call for
18520 every cross-file call, not just those that really will be out of range.
18521 @end table
18522
18523 @node zSeries Options
18524 @subsection zSeries Options
18525 @cindex zSeries options
18526
18527 These are listed under @xref{S/390 and zSeries Options}.
18528
18529 @node Code Gen Options
18530 @section Options for Code Generation Conventions
18531 @cindex code generation conventions
18532 @cindex options, code generation
18533 @cindex run-time options
18534
18535 These machine-independent options control the interface conventions
18536 used in code generation.
18537
18538 Most of them have both positive and negative forms; the negative form
18539 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
18540 one of the forms is listed---the one which is not the default.  You
18541 can figure out the other form by either removing @samp{no-} or adding
18542 it.
18543
18544 @table @gcctabopt
18545 @item -fbounds-check
18546 @opindex fbounds-check
18547 For front-ends that support it, generate additional code to check that
18548 indices used to access arrays are within the declared range.  This is
18549 currently only supported by the Java and Fortran front-ends, where
18550 this option defaults to true and false respectively.
18551
18552 @item -ftrapv
18553 @opindex ftrapv
18554 This option generates traps for signed overflow on addition, subtraction,
18555 multiplication operations.
18556
18557 @item -fwrapv
18558 @opindex fwrapv
18559 This option instructs the compiler to assume that signed arithmetic
18560 overflow of addition, subtraction and multiplication wraps around
18561 using twos-complement representation.  This flag enables some optimizations
18562 and disables others.  This option is enabled by default for the Java
18563 front-end, as required by the Java language specification.
18564
18565 @item -fexceptions
18566 @opindex fexceptions
18567 Enable exception handling.  Generates extra code needed to propagate
18568 exceptions.  For some targets, this implies GCC will generate frame
18569 unwind information for all functions, which can produce significant data
18570 size overhead, although it does not affect execution.  If you do not
18571 specify this option, GCC will enable it by default for languages like
18572 C++ which normally require exception handling, and disable it for
18573 languages like C that do not normally require it.  However, you may need
18574 to enable this option when compiling C code that needs to interoperate
18575 properly with exception handlers written in C++.  You may also wish to
18576 disable this option if you are compiling older C++ programs that don't
18577 use exception handling.
18578
18579 @item -fnon-call-exceptions
18580 @opindex fnon-call-exceptions
18581 Generate code that allows trapping instructions to throw exceptions.
18582 Note that this requires platform-specific runtime support that does
18583 not exist everywhere.  Moreover, it only allows @emph{trapping}
18584 instructions to throw exceptions, i.e.@: memory references or floating
18585 point instructions.  It does not allow exceptions to be thrown from
18586 arbitrary signal handlers such as @code{SIGALRM}.
18587
18588 @item -funwind-tables
18589 @opindex funwind-tables
18590 Similar to @option{-fexceptions}, except that it will just generate any needed
18591 static data, but will not affect the generated code in any other way.
18592 You will normally not enable this option; instead, a language processor
18593 that needs this handling would enable it on your behalf.
18594
18595 @item -fasynchronous-unwind-tables
18596 @opindex fasynchronous-unwind-tables
18597 Generate unwind table in dwarf2 format, if supported by target machine.  The
18598 table is exact at each instruction boundary, so it can be used for stack
18599 unwinding from asynchronous events (such as debugger or garbage collector).
18600
18601 @item -fpcc-struct-return
18602 @opindex fpcc-struct-return
18603 Return ``short'' @code{struct} and @code{union} values in memory like
18604 longer ones, rather than in registers.  This convention is less
18605 efficient, but it has the advantage of allowing intercallability between
18606 GCC-compiled files and files compiled with other compilers, particularly
18607 the Portable C Compiler (pcc).
18608
18609 The precise convention for returning structures in memory depends
18610 on the target configuration macros.
18611
18612 Short structures and unions are those whose size and alignment match
18613 that of some integer type.
18614
18615 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
18616 switch is not binary compatible with code compiled with the
18617 @option{-freg-struct-return} switch.
18618 Use it to conform to a non-default application binary interface.
18619
18620 @item -freg-struct-return
18621 @opindex freg-struct-return
18622 Return @code{struct} and @code{union} values in registers when possible.
18623 This is more efficient for small structures than
18624 @option{-fpcc-struct-return}.
18625
18626 If you specify neither @option{-fpcc-struct-return} nor
18627 @option{-freg-struct-return}, GCC defaults to whichever convention is
18628 standard for the target.  If there is no standard convention, GCC
18629 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
18630 the principal compiler.  In those cases, we can choose the standard, and
18631 we chose the more efficient register return alternative.
18632
18633 @strong{Warning:} code compiled with the @option{-freg-struct-return}
18634 switch is not binary compatible with code compiled with the
18635 @option{-fpcc-struct-return} switch.
18636 Use it to conform to a non-default application binary interface.
18637
18638 @item -fshort-enums
18639 @opindex fshort-enums
18640 Allocate to an @code{enum} type only as many bytes as it needs for the
18641 declared range of possible values.  Specifically, the @code{enum} type
18642 will be equivalent to the smallest integer type which has enough room.
18643
18644 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
18645 code that is not binary compatible with code generated without that switch.
18646 Use it to conform to a non-default application binary interface.
18647
18648 @item -fshort-double
18649 @opindex fshort-double
18650 Use the same size for @code{double} as for @code{float}.
18651
18652 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
18653 code that is not binary compatible with code generated without that switch.
18654 Use it to conform to a non-default application binary interface.
18655
18656 @item -fshort-wchar
18657 @opindex fshort-wchar
18658 Override the underlying type for @samp{wchar_t} to be @samp{short
18659 unsigned int} instead of the default for the target.  This option is
18660 useful for building programs to run under WINE@.
18661
18662 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
18663 code that is not binary compatible with code generated without that switch.
18664 Use it to conform to a non-default application binary interface.
18665
18666 @item -fno-common
18667 @opindex fno-common
18668 In C code, controls the placement of uninitialized global variables.
18669 Unix C compilers have traditionally permitted multiple definitions of
18670 such variables in different compilation units by placing the variables
18671 in a common block.
18672 This is the behavior specified by @option{-fcommon}, and is the default
18673 for GCC on most targets.
18674 On the other hand, this behavior is not required by ISO C, and on some
18675 targets may carry a speed or code size penalty on variable references.
18676 The @option{-fno-common} option specifies that the compiler should place
18677 uninitialized global variables in the data section of the object file,
18678 rather than generating them as common blocks.
18679 This has the effect that if the same variable is declared
18680 (without @code{extern}) in two different compilations,
18681 you will get a multiple-definition error when you link them.
18682 In this case, you must compile with @option{-fcommon} instead.
18683 Compiling with @option{-fno-common} is useful on targets for which
18684 it provides better performance, or if you wish to verify that the
18685 program will work on other systems which always treat uninitialized
18686 variable declarations this way.
18687
18688 @item -fno-ident
18689 @opindex fno-ident
18690 Ignore the @samp{#ident} directive.
18691
18692 @item -finhibit-size-directive
18693 @opindex finhibit-size-directive
18694 Don't output a @code{.size} assembler directive, or anything else that
18695 would cause trouble if the function is split in the middle, and the
18696 two halves are placed at locations far apart in memory.  This option is
18697 used when compiling @file{crtstuff.c}; you should not need to use it
18698 for anything else.
18699
18700 @item -fverbose-asm
18701 @opindex fverbose-asm
18702 Put extra commentary information in the generated assembly code to
18703 make it more readable.  This option is generally only of use to those
18704 who actually need to read the generated assembly code (perhaps while
18705 debugging the compiler itself).
18706
18707 @option{-fno-verbose-asm}, the default, causes the
18708 extra information to be omitted and is useful when comparing two assembler
18709 files.
18710
18711 @item -frecord-gcc-switches
18712 @opindex frecord-gcc-switches
18713 This switch causes the command line that was used to invoke the
18714 compiler to be recorded into the object file that is being created.
18715 This switch is only implemented on some targets and the exact format
18716 of the recording is target and binary file format dependent, but it
18717 usually takes the form of a section containing ASCII text.  This
18718 switch is related to the @option{-fverbose-asm} switch, but that
18719 switch only records information in the assembler output file as
18720 comments, so it never reaches the object file.
18721 See also @option{-grecord-gcc-switches} for another
18722 way of storing compiler options into the object file.
18723
18724 @item -fpic
18725 @opindex fpic
18726 @cindex global offset table
18727 @cindex PIC
18728 Generate position-independent code (PIC) suitable for use in a shared
18729 library, if supported for the target machine.  Such code accesses all
18730 constant addresses through a global offset table (GOT)@.  The dynamic
18731 loader resolves the GOT entries when the program starts (the dynamic
18732 loader is not part of GCC; it is part of the operating system).  If
18733 the GOT size for the linked executable exceeds a machine-specific
18734 maximum size, you get an error message from the linker indicating that
18735 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
18736 instead.  (These maximums are 8k on the SPARC and 32k
18737 on the m68k and RS/6000.  The 386 has no such limit.)
18738
18739 Position-independent code requires special support, and therefore works
18740 only on certain machines.  For the 386, GCC supports PIC for System V
18741 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
18742 position-independent.
18743
18744 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
18745 are defined to 1.
18746
18747 @item -fPIC
18748 @opindex fPIC
18749 If supported for the target machine, emit position-independent code,
18750 suitable for dynamic linking and avoiding any limit on the size of the
18751 global offset table.  This option makes a difference on the m68k,
18752 PowerPC and SPARC@.
18753
18754 Position-independent code requires special support, and therefore works
18755 only on certain machines.
18756
18757 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
18758 are defined to 2.
18759
18760 @item -fpie
18761 @itemx -fPIE
18762 @opindex fpie
18763 @opindex fPIE
18764 These options are similar to @option{-fpic} and @option{-fPIC}, but
18765 generated position independent code can be only linked into executables.
18766 Usually these options are used when @option{-pie} GCC option will be
18767 used during linking.
18768
18769 @option{-fpie} and @option{-fPIE} both define the macros
18770 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
18771 for @option{-fpie} and 2 for @option{-fPIE}.
18772
18773 @item -fno-jump-tables
18774 @opindex fno-jump-tables
18775 Do not use jump tables for switch statements even where it would be
18776 more efficient than other code generation strategies.  This option is
18777 of use in conjunction with @option{-fpic} or @option{-fPIC} for
18778 building code which forms part of a dynamic linker and cannot
18779 reference the address of a jump table.  On some targets, jump tables
18780 do not require a GOT and this option is not needed.
18781
18782 @item -ffixed-@var{reg}
18783 @opindex ffixed
18784 Treat the register named @var{reg} as a fixed register; generated code
18785 should never refer to it (except perhaps as a stack pointer, frame
18786 pointer or in some other fixed role).
18787
18788 @var{reg} must be the name of a register.  The register names accepted
18789 are machine-specific and are defined in the @code{REGISTER_NAMES}
18790 macro in the machine description macro file.
18791
18792 This flag does not have a negative form, because it specifies a
18793 three-way choice.
18794
18795 @item -fcall-used-@var{reg}
18796 @opindex fcall-used
18797 Treat the register named @var{reg} as an allocable register that is
18798 clobbered by function calls.  It may be allocated for temporaries or
18799 variables that do not live across a call.  Functions compiled this way
18800 will not save and restore the register @var{reg}.
18801
18802 It is an error to used this flag with the frame pointer or stack pointer.
18803 Use of this flag for other registers that have fixed pervasive roles in
18804 the machine's execution model will produce disastrous results.
18805
18806 This flag does not have a negative form, because it specifies a
18807 three-way choice.
18808
18809 @item -fcall-saved-@var{reg}
18810 @opindex fcall-saved
18811 Treat the register named @var{reg} as an allocable register saved by
18812 functions.  It may be allocated even for temporaries or variables that
18813 live across a call.  Functions compiled this way will save and restore
18814 the register @var{reg} if they use it.
18815
18816 It is an error to used this flag with the frame pointer or stack pointer.
18817 Use of this flag for other registers that have fixed pervasive roles in
18818 the machine's execution model will produce disastrous results.
18819
18820 A different sort of disaster will result from the use of this flag for
18821 a register in which function values may be returned.
18822
18823 This flag does not have a negative form, because it specifies a
18824 three-way choice.
18825
18826 @item -fpack-struct[=@var{n}]
18827 @opindex fpack-struct
18828 Without a value specified, pack all structure members together without
18829 holes.  When a value is specified (which must be a small power of two), pack
18830 structure members according to this value, representing the maximum
18831 alignment (that is, objects with default alignment requirements larger than
18832 this will be output potentially unaligned at the next fitting location.
18833
18834 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
18835 code that is not binary compatible with code generated without that switch.
18836 Additionally, it makes the code suboptimal.
18837 Use it to conform to a non-default application binary interface.
18838
18839 @item -finstrument-functions
18840 @opindex finstrument-functions
18841 Generate instrumentation calls for entry and exit to functions.  Just
18842 after function entry and just before function exit, the following
18843 profiling functions will be called with the address of the current
18844 function and its call site.  (On some platforms,
18845 @code{__builtin_return_address} does not work beyond the current
18846 function, so the call site information may not be available to the
18847 profiling functions otherwise.)
18848
18849 @smallexample
18850 void __cyg_profile_func_enter (void *this_fn,
18851                                void *call_site);
18852 void __cyg_profile_func_exit  (void *this_fn,
18853                                void *call_site);
18854 @end smallexample
18855
18856 The first argument is the address of the start of the current function,
18857 which may be looked up exactly in the symbol table.
18858
18859 This instrumentation is also done for functions expanded inline in other
18860 functions.  The profiling calls will indicate where, conceptually, the
18861 inline function is entered and exited.  This means that addressable
18862 versions of such functions must be available.  If all your uses of a
18863 function are expanded inline, this may mean an additional expansion of
18864 code size.  If you use @samp{extern inline} in your C code, an
18865 addressable version of such functions must be provided.  (This is
18866 normally the case anyways, but if you get lucky and the optimizer always
18867 expands the functions inline, you might have gotten away without
18868 providing static copies.)
18869
18870 A function may be given the attribute @code{no_instrument_function}, in
18871 which case this instrumentation will not be done.  This can be used, for
18872 example, for the profiling functions listed above, high-priority
18873 interrupt routines, and any functions from which the profiling functions
18874 cannot safely be called (perhaps signal handlers, if the profiling
18875 routines generate output or allocate memory).
18876
18877 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
18878 @opindex finstrument-functions-exclude-file-list
18879
18880 Set the list of functions that are excluded from instrumentation (see
18881 the description of @code{-finstrument-functions}).  If the file that
18882 contains a function definition matches with one of @var{file}, then
18883 that function is not instrumented.  The match is done on substrings:
18884 if the @var{file} parameter is a substring of the file name, it is
18885 considered to be a match.
18886
18887 For example:
18888
18889 @smallexample
18890 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
18891 @end smallexample
18892
18893 @noindent
18894 will exclude any inline function defined in files whose pathnames
18895 contain @code{/bits/stl} or @code{include/sys}.
18896
18897 If, for some reason, you want to include letter @code{','} in one of
18898 @var{sym}, write @code{'\,'}. For example,
18899 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
18900 (note the single quote surrounding the option).
18901
18902 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
18903 @opindex finstrument-functions-exclude-function-list
18904
18905 This is similar to @code{-finstrument-functions-exclude-file-list},
18906 but this option sets the list of function names to be excluded from
18907 instrumentation.  The function name to be matched is its user-visible
18908 name, such as @code{vector<int> blah(const vector<int> &)}, not the
18909 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
18910 match is done on substrings: if the @var{sym} parameter is a substring
18911 of the function name, it is considered to be a match.  For C99 and C++
18912 extended identifiers, the function name must be given in UTF-8, not
18913 using universal character names.
18914
18915 @item -fstack-check
18916 @opindex fstack-check
18917 Generate code to verify that you do not go beyond the boundary of the
18918 stack.  You should specify this flag if you are running in an
18919 environment with multiple threads, but only rarely need to specify it in
18920 a single-threaded environment since stack overflow is automatically
18921 detected on nearly all systems if there is only one stack.
18922
18923 Note that this switch does not actually cause checking to be done; the
18924 operating system or the language runtime must do that.  The switch causes
18925 generation of code to ensure that they see the stack being extended.
18926
18927 You can additionally specify a string parameter: @code{no} means no
18928 checking, @code{generic} means force the use of old-style checking,
18929 @code{specific} means use the best checking method and is equivalent
18930 to bare @option{-fstack-check}.
18931
18932 Old-style checking is a generic mechanism that requires no specific
18933 target support in the compiler but comes with the following drawbacks:
18934
18935 @enumerate
18936 @item
18937 Modified allocation strategy for large objects: they will always be
18938 allocated dynamically if their size exceeds a fixed threshold.
18939
18940 @item
18941 Fixed limit on the size of the static frame of functions: when it is
18942 topped by a particular function, stack checking is not reliable and
18943 a warning is issued by the compiler.
18944
18945 @item
18946 Inefficiency: because of both the modified allocation strategy and the
18947 generic implementation, the performances of the code are hampered.
18948 @end enumerate
18949
18950 Note that old-style stack checking is also the fallback method for
18951 @code{specific} if no target support has been added in the compiler.
18952
18953 @item -fstack-limit-register=@var{reg}
18954 @itemx -fstack-limit-symbol=@var{sym}
18955 @itemx -fno-stack-limit
18956 @opindex fstack-limit-register
18957 @opindex fstack-limit-symbol
18958 @opindex fno-stack-limit
18959 Generate code to ensure that the stack does not grow beyond a certain value,
18960 either the value of a register or the address of a symbol.  If the stack
18961 would grow beyond the value, a signal is raised.  For most targets,
18962 the signal is raised before the stack overruns the boundary, so
18963 it is possible to catch the signal without taking special precautions.
18964
18965 For instance, if the stack starts at absolute address @samp{0x80000000}
18966 and grows downwards, you can use the flags
18967 @option{-fstack-limit-symbol=__stack_limit} and
18968 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
18969 of 128KB@.  Note that this may only work with the GNU linker.
18970
18971 @item -fsplit-stack
18972 @opindex fsplit-stack
18973 Generate code to automatically split the stack before it overflows.
18974 The resulting program has a discontiguous stack which can only
18975 overflow if the program is unable to allocate any more memory.  This
18976 is most useful when running threaded programs, as it is no longer
18977 necessary to calculate a good stack size to use for each thread.  This
18978 is currently only implemented for the i386 and x86_64 backends running
18979 GNU/Linux.
18980
18981 When code compiled with @option{-fsplit-stack} calls code compiled
18982 without @option{-fsplit-stack}, there may not be much stack space
18983 available for the latter code to run.  If compiling all code,
18984 including library code, with @option{-fsplit-stack} is not an option,
18985 then the linker can fix up these calls so that the code compiled
18986 without @option{-fsplit-stack} always has a large stack.  Support for
18987 this is implemented in the gold linker in GNU binutils release 2.21
18988 and later.
18989
18990 @item -fleading-underscore
18991 @opindex fleading-underscore
18992 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
18993 change the way C symbols are represented in the object file.  One use
18994 is to help link with legacy assembly code.
18995
18996 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
18997 generate code that is not binary compatible with code generated without that
18998 switch.  Use it to conform to a non-default application binary interface.
18999 Not all targets provide complete support for this switch.
19000
19001 @item -ftls-model=@var{model}
19002 @opindex ftls-model
19003 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
19004 The @var{model} argument should be one of @code{global-dynamic},
19005 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
19006
19007 The default without @option{-fpic} is @code{initial-exec}; with
19008 @option{-fpic} the default is @code{global-dynamic}.
19009
19010 @item -fvisibility=@var{default|internal|hidden|protected}
19011 @opindex fvisibility
19012 Set the default ELF image symbol visibility to the specified option---all
19013 symbols will be marked with this unless overridden within the code.
19014 Using this feature can very substantially improve linking and
19015 load times of shared object libraries, produce more optimized
19016 code, provide near-perfect API export and prevent symbol clashes.
19017 It is @strong{strongly} recommended that you use this in any shared objects
19018 you distribute.
19019
19020 Despite the nomenclature, @code{default} always means public; i.e.,
19021 available to be linked against from outside the shared object.
19022 @code{protected} and @code{internal} are pretty useless in real-world
19023 usage so the only other commonly used option will be @code{hidden}.
19024 The default if @option{-fvisibility} isn't specified is
19025 @code{default}, i.e., make every
19026 symbol public---this causes the same behavior as previous versions of
19027 GCC@.
19028
19029 A good explanation of the benefits offered by ensuring ELF
19030 symbols have the correct visibility is given by ``How To Write
19031 Shared Libraries'' by Ulrich Drepper (which can be found at
19032 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
19033 solution made possible by this option to marking things hidden when
19034 the default is public is to make the default hidden and mark things
19035 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
19036 and @code{__attribute__ ((visibility("default")))} instead of
19037 @code{__declspec(dllexport)} you get almost identical semantics with
19038 identical syntax.  This is a great boon to those working with
19039 cross-platform projects.
19040
19041 For those adding visibility support to existing code, you may find
19042 @samp{#pragma GCC visibility} of use.  This works by you enclosing
19043 the declarations you wish to set visibility for with (for example)
19044 @samp{#pragma GCC visibility push(hidden)} and
19045 @samp{#pragma GCC visibility pop}.
19046 Bear in mind that symbol visibility should be viewed @strong{as
19047 part of the API interface contract} and thus all new code should
19048 always specify visibility when it is not the default; i.e., declarations
19049 only for use within the local DSO should @strong{always} be marked explicitly
19050 as hidden as so to avoid PLT indirection overheads---making this
19051 abundantly clear also aids readability and self-documentation of the code.
19052 Note that due to ISO C++ specification requirements, operator new and
19053 operator delete must always be of default visibility.
19054
19055 Be aware that headers from outside your project, in particular system
19056 headers and headers from any other library you use, may not be
19057 expecting to be compiled with visibility other than the default.  You
19058 may need to explicitly say @samp{#pragma GCC visibility push(default)}
19059 before including any such headers.
19060
19061 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
19062 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
19063 no modifications.  However, this means that calls to @samp{extern}
19064 functions with no explicit visibility will use the PLT, so it is more
19065 effective to use @samp{__attribute ((visibility))} and/or
19066 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
19067 declarations should be treated as hidden.
19068
19069 Note that @samp{-fvisibility} does affect C++ vague linkage
19070 entities. This means that, for instance, an exception class that will
19071 be thrown between DSOs must be explicitly marked with default
19072 visibility so that the @samp{type_info} nodes will be unified between
19073 the DSOs.
19074
19075 An overview of these techniques, their benefits and how to use them
19076 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
19077
19078 @item -fstrict-volatile-bitfields
19079 @opindex fstrict-volatile-bitfields
19080 This option should be used if accesses to volatile bitfields (or other
19081 structure fields, although the compiler usually honors those types
19082 anyway) should use a single access of the width of the
19083 field's type, aligned to a natural alignment if possible.  For
19084 example, targets with memory-mapped peripheral registers might require
19085 all such accesses to be 16 bits wide; with this flag the user could
19086 declare all peripheral bitfields as ``unsigned short'' (assuming short
19087 is 16 bits on these targets) to force GCC to use 16 bit accesses
19088 instead of, perhaps, a more efficient 32 bit access.
19089
19090 If this option is disabled, the compiler will use the most efficient
19091 instruction.  In the previous example, that might be a 32-bit load
19092 instruction, even though that will access bytes that do not contain
19093 any portion of the bitfield, or memory-mapped registers unrelated to
19094 the one being updated.
19095
19096 If the target requires strict alignment, and honoring the field
19097 type would require violating this alignment, a warning is issued.
19098 If the field has @code{packed} attribute, the access is done without
19099 honoring the field type.  If the field doesn't have @code{packed}
19100 attribute, the access is done honoring the field type.  In both cases,
19101 GCC assumes that the user knows something about the target hardware
19102 that it is unaware of.
19103
19104 The default value of this option is determined by the application binary
19105 interface for the target processor.
19106
19107 @end table
19108
19109 @c man end
19110
19111 @node Environment Variables
19112 @section Environment Variables Affecting GCC
19113 @cindex environment variables
19114
19115 @c man begin ENVIRONMENT
19116 This section describes several environment variables that affect how GCC
19117 operates.  Some of them work by specifying directories or prefixes to use
19118 when searching for various kinds of files.  Some are used to specify other
19119 aspects of the compilation environment.
19120
19121 Note that you can also specify places to search using options such as
19122 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
19123 take precedence over places specified using environment variables, which
19124 in turn take precedence over those specified by the configuration of GCC@.
19125 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
19126 GNU Compiler Collection (GCC) Internals}.
19127
19128 @table @env
19129 @item LANG
19130 @itemx LC_CTYPE
19131 @c @itemx LC_COLLATE
19132 @itemx LC_MESSAGES
19133 @c @itemx LC_MONETARY
19134 @c @itemx LC_NUMERIC
19135 @c @itemx LC_TIME
19136 @itemx LC_ALL
19137 @findex LANG
19138 @findex LC_CTYPE
19139 @c @findex LC_COLLATE
19140 @findex LC_MESSAGES
19141 @c @findex LC_MONETARY
19142 @c @findex LC_NUMERIC
19143 @c @findex LC_TIME
19144 @findex LC_ALL
19145 @cindex locale
19146 These environment variables control the way that GCC uses
19147 localization information that allow GCC to work with different
19148 national conventions.  GCC inspects the locale categories
19149 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
19150 so.  These locale categories can be set to any value supported by your
19151 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
19152 Kingdom encoded in UTF-8.
19153
19154 The @env{LC_CTYPE} environment variable specifies character
19155 classification.  GCC uses it to determine the character boundaries in
19156 a string; this is needed for some multibyte encodings that contain quote
19157 and escape characters that would otherwise be interpreted as a string
19158 end or escape.
19159
19160 The @env{LC_MESSAGES} environment variable specifies the language to
19161 use in diagnostic messages.
19162
19163 If the @env{LC_ALL} environment variable is set, it overrides the value
19164 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
19165 and @env{LC_MESSAGES} default to the value of the @env{LANG}
19166 environment variable.  If none of these variables are set, GCC
19167 defaults to traditional C English behavior.
19168
19169 @item TMPDIR
19170 @findex TMPDIR
19171 If @env{TMPDIR} is set, it specifies the directory to use for temporary
19172 files.  GCC uses temporary files to hold the output of one stage of
19173 compilation which is to be used as input to the next stage: for example,
19174 the output of the preprocessor, which is the input to the compiler
19175 proper.
19176
19177 @item GCC_COMPARE_DEBUG
19178 @findex GCC_COMPARE_DEBUG
19179 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
19180 @option{-fcompare-debug} to the compiler driver.  See the documentation
19181 of this option for more details.
19182
19183 @item GCC_EXEC_PREFIX
19184 @findex GCC_EXEC_PREFIX
19185 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
19186 names of the subprograms executed by the compiler.  No slash is added
19187 when this prefix is combined with the name of a subprogram, but you can
19188 specify a prefix that ends with a slash if you wish.
19189
19190 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
19191 an appropriate prefix to use based on the pathname it was invoked with.
19192
19193 If GCC cannot find the subprogram using the specified prefix, it
19194 tries looking in the usual places for the subprogram.
19195
19196 The default value of @env{GCC_EXEC_PREFIX} is
19197 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
19198 the installed compiler. In many cases @var{prefix} is the value
19199 of @code{prefix} when you ran the @file{configure} script.
19200
19201 Other prefixes specified with @option{-B} take precedence over this prefix.
19202
19203 This prefix is also used for finding files such as @file{crt0.o} that are
19204 used for linking.
19205
19206 In addition, the prefix is used in an unusual way in finding the
19207 directories to search for header files.  For each of the standard
19208 directories whose name normally begins with @samp{/usr/local/lib/gcc}
19209 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
19210 replacing that beginning with the specified prefix to produce an
19211 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
19212 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
19213 These alternate directories are searched first; the standard directories
19214 come next. If a standard directory begins with the configured
19215 @var{prefix} then the value of @var{prefix} is replaced by
19216 @env{GCC_EXEC_PREFIX} when looking for header files.
19217
19218 @item COMPILER_PATH
19219 @findex COMPILER_PATH
19220 The value of @env{COMPILER_PATH} is a colon-separated list of
19221 directories, much like @env{PATH}.  GCC tries the directories thus
19222 specified when searching for subprograms, if it can't find the
19223 subprograms using @env{GCC_EXEC_PREFIX}.
19224
19225 @item LIBRARY_PATH
19226 @findex LIBRARY_PATH
19227 The value of @env{LIBRARY_PATH} is a colon-separated list of
19228 directories, much like @env{PATH}.  When configured as a native compiler,
19229 GCC tries the directories thus specified when searching for special
19230 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
19231 using GCC also uses these directories when searching for ordinary
19232 libraries for the @option{-l} option (but directories specified with
19233 @option{-L} come first).
19234
19235 @item LANG
19236 @findex LANG
19237 @cindex locale definition
19238 This variable is used to pass locale information to the compiler.  One way in
19239 which this information is used is to determine the character set to be used
19240 when character literals, string literals and comments are parsed in C and C++.
19241 When the compiler is configured to allow multibyte characters,
19242 the following values for @env{LANG} are recognized:
19243
19244 @table @samp
19245 @item C-JIS
19246 Recognize JIS characters.
19247 @item C-SJIS
19248 Recognize SJIS characters.
19249 @item C-EUCJP
19250 Recognize EUCJP characters.
19251 @end table
19252
19253 If @env{LANG} is not defined, or if it has some other value, then the
19254 compiler will use mblen and mbtowc as defined by the default locale to
19255 recognize and translate multibyte characters.
19256 @end table
19257
19258 @noindent
19259 Some additional environments variables affect the behavior of the
19260 preprocessor.
19261
19262 @include cppenv.texi
19263
19264 @c man end
19265
19266 @node Precompiled Headers
19267 @section Using Precompiled Headers
19268 @cindex precompiled headers
19269 @cindex speed of compilation
19270
19271 Often large projects have many header files that are included in every
19272 source file.  The time the compiler takes to process these header files
19273 over and over again can account for nearly all of the time required to
19274 build the project.  To make builds faster, GCC allows users to
19275 `precompile' a header file; then, if builds can use the precompiled
19276 header file they will be much faster.
19277
19278 To create a precompiled header file, simply compile it as you would any
19279 other file, if necessary using the @option{-x} option to make the driver
19280 treat it as a C or C++ header file.  You will probably want to use a
19281 tool like @command{make} to keep the precompiled header up-to-date when
19282 the headers it contains change.
19283
19284 A precompiled header file will be searched for when @code{#include} is
19285 seen in the compilation.  As it searches for the included file
19286 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
19287 compiler looks for a precompiled header in each directory just before it
19288 looks for the include file in that directory.  The name searched for is
19289 the name specified in the @code{#include} with @samp{.gch} appended.  If
19290 the precompiled header file can't be used, it is ignored.
19291
19292 For instance, if you have @code{#include "all.h"}, and you have
19293 @file{all.h.gch} in the same directory as @file{all.h}, then the
19294 precompiled header file will be used if possible, and the original
19295 header will be used otherwise.
19296
19297 Alternatively, you might decide to put the precompiled header file in a
19298 directory and use @option{-I} to ensure that directory is searched
19299 before (or instead of) the directory containing the original header.
19300 Then, if you want to check that the precompiled header file is always
19301 used, you can put a file of the same name as the original header in this
19302 directory containing an @code{#error} command.
19303
19304 This also works with @option{-include}.  So yet another way to use
19305 precompiled headers, good for projects not designed with precompiled
19306 header files in mind, is to simply take most of the header files used by
19307 a project, include them from another header file, precompile that header
19308 file, and @option{-include} the precompiled header.  If the header files
19309 have guards against multiple inclusion, they will be skipped because
19310 they've already been included (in the precompiled header).
19311
19312 If you need to precompile the same header file for different
19313 languages, targets, or compiler options, you can instead make a
19314 @emph{directory} named like @file{all.h.gch}, and put each precompiled
19315 header in the directory, perhaps using @option{-o}.  It doesn't matter
19316 what you call the files in the directory, every precompiled header in
19317 the directory will be considered.  The first precompiled header
19318 encountered in the directory that is valid for this compilation will
19319 be used; they're searched in no particular order.
19320
19321 There are many other possibilities, limited only by your imagination,
19322 good sense, and the constraints of your build system.
19323
19324 A precompiled header file can be used only when these conditions apply:
19325
19326 @itemize
19327 @item
19328 Only one precompiled header can be used in a particular compilation.
19329
19330 @item
19331 A precompiled header can't be used once the first C token is seen.  You
19332 can have preprocessor directives before a precompiled header; you can
19333 even include a precompiled header from inside another header, so long as
19334 there are no C tokens before the @code{#include}.
19335
19336 @item
19337 The precompiled header file must be produced for the same language as
19338 the current compilation.  You can't use a C precompiled header for a C++
19339 compilation.
19340
19341 @item
19342 The precompiled header file must have been produced by the same compiler
19343 binary as the current compilation is using.
19344
19345 @item
19346 Any macros defined before the precompiled header is included must
19347 either be defined in the same way as when the precompiled header was
19348 generated, or must not affect the precompiled header, which usually
19349 means that they don't appear in the precompiled header at all.
19350
19351 The @option{-D} option is one way to define a macro before a
19352 precompiled header is included; using a @code{#define} can also do it.
19353 There are also some options that define macros implicitly, like
19354 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
19355 defined this way.
19356
19357 @item If debugging information is output when using the precompiled
19358 header, using @option{-g} or similar, the same kind of debugging information
19359 must have been output when building the precompiled header.  However,
19360 a precompiled header built using @option{-g} can be used in a compilation
19361 when no debugging information is being output.
19362
19363 @item The same @option{-m} options must generally be used when building
19364 and using the precompiled header.  @xref{Submodel Options},
19365 for any cases where this rule is relaxed.
19366
19367 @item Each of the following options must be the same when building and using
19368 the precompiled header:
19369
19370 @gccoptlist{-fexceptions}
19371
19372 @item
19373 Some other command-line options starting with @option{-f},
19374 @option{-p}, or @option{-O} must be defined in the same way as when
19375 the precompiled header was generated.  At present, it's not clear
19376 which options are safe to change and which are not; the safest choice
19377 is to use exactly the same options when generating and using the
19378 precompiled header.  The following are known to be safe:
19379
19380 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
19381 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
19382 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
19383 -pedantic-errors}
19384
19385 @end itemize
19386
19387 For all of these except the last, the compiler will automatically
19388 ignore the precompiled header if the conditions aren't met.  If you
19389 find an option combination that doesn't work and doesn't cause the
19390 precompiled header to be ignored, please consider filing a bug report,
19391 see @ref{Bugs}.
19392
19393 If you do use differing options when generating and using the
19394 precompiled header, the actual behavior will be a mixture of the
19395 behavior for the options.  For instance, if you use @option{-g} to
19396 generate the precompiled header but not when using it, you may or may
19397 not get debugging information for routines in the precompiled header.